jt3d.es.js 5.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916
  1. var __defProp = Object.defineProperty;
  2. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  3. var __publicField = (obj, key, value) => {
  4. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  5. return value;
  6. };
  7. import { getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, ref, readonly, watch, openBlock, createElementBlock, createElementVNode, warn, computed as computed$1, watchEffect, onBeforeUnmount, inject, isRef, shallowRef, onBeforeMount, provide, defineComponent, renderSlot, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, withDirectives, createCommentVNode, Fragment, normalizeClass, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle, vShow, Transition, reactive, onUpdated, cloneVNode, Text as Text$1, Comment as Comment$1, Teleport, onDeactivated, vModelRadio, createTextVNode, toRefs, toHandlers, withKeys, renderList, h, createSlots, toRaw as toRaw$1, triggerRef, resolveComponent, resolveDirective, vModelText, defineCustomElement } from "vue";
  8. const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  9. class Util {
  10. static uuid(prefix = "D") {
  11. let uuid = [];
  12. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  13. uuid[14] = "4";
  14. let r2;
  15. for (let i2 = 0; i2 < 36; i2++) {
  16. if (!uuid[i2]) {
  17. r2 = 0 | Math.random() * 16;
  18. uuid[i2] = CHARS[i2 == 19 ? r2 & 3 | 8 : r2];
  19. }
  20. }
  21. return prefix + "-" + uuid.join("");
  22. }
  23. static merge(dest, ...sources) {
  24. let i2, j, len, src;
  25. for (j = 0, len = sources.length; j < len; j++) {
  26. src = sources[j];
  27. for (i2 in src) {
  28. dest[i2] = src[i2];
  29. }
  30. }
  31. return dest;
  32. }
  33. static trim(str) {
  34. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
  35. }
  36. static splitWords(str) {
  37. return this.trim(str).split(/\s+/);
  38. }
  39. static setOptions(obj, options2) {
  40. if (!obj.hasOwnProperty("options")) {
  41. obj.options = obj.options ? create(obj.options) : {};
  42. }
  43. for (var i2 in options2) {
  44. obj.options[i2] = options2[i2];
  45. }
  46. return obj.options;
  47. }
  48. static checkPosition(position2) {
  49. return position2 && position2.hasOwnProperty("_lng") && position2.hasOwnProperty("_lat") && position2.hasOwnProperty("_alt");
  50. }
  51. static checkPositions(positions) {
  52. return positions && (typeof positions === "string" || Array.isArray(positions));
  53. }
  54. static checkViewer(viewer2) {
  55. return viewer2 && viewer2.delegate && viewer2.canvas;
  56. }
  57. }
  58. class DomUtil {
  59. static get(id) {
  60. return typeof id === "string" ? document.getElementById(id) : id;
  61. }
  62. static getStyle(el, style) {
  63. var value = el.style[style] || el.currentStyle && el.currentStyle[style];
  64. if ((!value || value === "auto") && document.defaultView) {
  65. var css = document.defaultView.getComputedStyle(el, null);
  66. value = css ? css[style] : null;
  67. }
  68. return value === "auto" ? null : value;
  69. }
  70. static create(tagName, className, container) {
  71. var el = document.createElement(tagName);
  72. el.className = className || "";
  73. if (container) {
  74. container.appendChild(el);
  75. }
  76. return el;
  77. }
  78. static remove(el) {
  79. var parent = el.parentNode;
  80. if (parent) {
  81. parent.removeChild(el);
  82. }
  83. }
  84. static empty(el) {
  85. while (el.firstChild) {
  86. el.removeChild(el.firstChild);
  87. }
  88. }
  89. hasClass(el, name) {
  90. if (el.classList !== void 0) {
  91. return el.classList.contains(name);
  92. }
  93. var className = getClass(el);
  94. return className.length > 0 && new RegExp("(^|\\s)" + name + "(\\s|$)").test(className);
  95. }
  96. static addClass(el, name) {
  97. if (el.classList !== void 0) {
  98. let classes = Util.splitWords(name);
  99. for (let i2 = 0, len = classes.length; i2 < len; i2++) {
  100. el.classList.add(classes[i2]);
  101. }
  102. } else if (!this.hasClass(el, name)) {
  103. let className = this.getClass(el);
  104. this.setClass(el, (className ? className + " " : "") + name);
  105. }
  106. }
  107. static removeClass(el, name) {
  108. if (el.classList !== void 0) {
  109. el.classList.remove(name);
  110. } else {
  111. this.setClass(
  112. el,
  113. Util.trim(
  114. (" " + this.getClass(el) + " ").replace(" " + name + " ", " ")
  115. )
  116. );
  117. }
  118. }
  119. static setClass(el, name) {
  120. if (el.className.baseVal === void 0) {
  121. el.className = name;
  122. } else {
  123. el.className.baseVal = name;
  124. }
  125. }
  126. static getClass(el) {
  127. if (el.correspondingElement) {
  128. el = el.correspondingElement;
  129. }
  130. return el.className.baseVal === void 0 ? el.className : el.className.baseVal;
  131. }
  132. static createSvg(width2, height2, path, container) {
  133. let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg:svg");
  134. svg.setAttribute("class", "svg-path");
  135. svg.setAttribute("width", width2);
  136. svg.setAttribute("height", height2);
  137. svg.setAttribute("viewBox", `0 0 ${width2} ${height2}`);
  138. let pathEl = document.createElementNS("http://www.w3.org/2000/svg", "path");
  139. pathEl.setAttribute("d", path);
  140. svg.appendChild(pathEl);
  141. if (container) {
  142. container.appendChild(svg);
  143. }
  144. return svg;
  145. }
  146. }
  147. var StatusBar$1 = "";
  148. class StatusBar {
  149. constructor(viewer2) {
  150. if (!viewer2)
  151. throw new Error("viewer is required!");
  152. this._viewer = viewer2;
  153. this._show = false;
  154. this._handler;
  155. this._posX;
  156. this._posY;
  157. this._posZ;
  158. this._cameraHeight;
  159. this._pitch;
  160. this._heading;
  161. this._scale;
  162. this.initListener();
  163. }
  164. get params() {
  165. return {
  166. posX: this._posX,
  167. posY: this._posY,
  168. posZ: this._posZ,
  169. cameraHeight: this._cameraHeight,
  170. pitch: this._pitch,
  171. heading: this._heading,
  172. scale: this._scale
  173. };
  174. }
  175. get statusDom() {
  176. let innerHtml = `
  177. <span class="status-scale">
  178. \u6BD4\u4F8B\u5C3A\uFF1A
  179. <span class="scale-border">
  180. ${this._scale}
  181. </span>
  182. </span>
  183. <span class="status-position">
  184. <span id="status_spaceInfo">\u7A7A\u95F4\u4FE1\u606F</span>
  185. \u5237\u5E27\u7387\uFF1A<span id="status_ms"></span>|<span id="status_fps"></span>
  186. </span>
  187. `;
  188. return innerHtml;
  189. }
  190. get show() {
  191. return this._show;
  192. }
  193. set show(bool) {
  194. bool ? this.createStatusBar() : this.removeStatusBar();
  195. this._show = bool;
  196. }
  197. initListener() {
  198. const $this = this;
  199. const scene = this._viewer.scene;
  200. this._scaleListener = function() {
  201. let width2 = scene.canvas.clientWidth;
  202. let height2 = scene.canvas.clientHeight;
  203. let left = scene.camera.getPickRay(
  204. new Cesium.Cartesian2(width2 / 2 | 0, height2 - 1)
  205. );
  206. let right = scene.camera.getPickRay(
  207. new Cesium.Cartesian2(1 + width2 / 2 | 0, height2 - 1)
  208. );
  209. let globe = scene.globe;
  210. let leftPosition = globe.pick(left, scene);
  211. let rightPosition = globe.pick(right, scene);
  212. if (leftPosition && rightPosition) {
  213. let geodesic = new Cesium.EllipsoidGeodesic();
  214. let leftCartographic = globe.ellipsoid.cartesianToCartographic(leftPosition);
  215. let rightCartographic = globe.ellipsoid.cartesianToCartographic(rightPosition);
  216. geodesic.setEndPoints(leftCartographic, rightCartographic);
  217. let distance2 = geodesic.surfaceDistance;
  218. let curScaleNum = $this.closest(distance2 / 10);
  219. if (curScaleNum < 1) {
  220. $this._scale = curScaleNum * 1e3 + "m";
  221. } else {
  222. $this._scale = curScaleNum + "km";
  223. }
  224. }
  225. document.getElementsByClassName("scale-border")[0].innerText = $this._scale;
  226. if (document.getElementsByClassName("cesium-performanceDisplay-ms").length > 0) {
  227. document.getElementById("status_ms").innerText = document.getElementsByClassName("cesium-performanceDisplay-ms")[0].innerText;
  228. }
  229. if (document.getElementsByClassName("cesium-performanceDisplay-fps").length > 0) {
  230. document.getElementById("status_fps").innerText = document.getElementsByClassName("cesium-performanceDisplay-fps")[0].innerText;
  231. }
  232. };
  233. }
  234. createStatusBar() {
  235. const _delegate = this._viewer;
  236. this.initHandler(_delegate);
  237. this.initScale(_delegate, true);
  238. this._domContainer = DomUtil.create(
  239. "div",
  240. "lk-status-bar",
  241. document.getElementById(this._viewer._container.id)
  242. );
  243. this._domContainer.innerHTML = this.statusDom;
  244. }
  245. removeStatusBar() {
  246. this.initScale(this._viewer, false);
  247. if (this._handler) {
  248. this._handler.destroy();
  249. }
  250. if (this._domContainer) {
  251. DomUtil.remove(this._domContainer);
  252. }
  253. }
  254. initHandler(viewer2) {
  255. const $this = this;
  256. this._handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  257. const mouseOverHandler = function(movement) {
  258. let loc2 = $this._getScreenClickPositionAndHeight(movement.endPosition);
  259. if (!Cesium.defined(loc2))
  260. return;
  261. if (!loc2.lng)
  262. return;
  263. $this._posX = loc2.lng.toFixed(8);
  264. $this._posY = loc2.lat.toFixed(8);
  265. $this._posZ = loc2.height.toFixed(2);
  266. document.getElementById("status_spaceInfo").innerHTML = `
  267. <span>\u7ECF\u5EA6\uFF1A${$this._posX}</span>
  268. <span>\u7EAC\u5EA6\uFF1A${$this._posY}</span>
  269. <span>\u9AD8\u5EA6\uFF1A${$this._posZ}</span>
  270. `;
  271. };
  272. this._handler.setInputAction(
  273. mouseOverHandler,
  274. Cesium.ScreenSpaceEventType.MOUSE_MOVE
  275. );
  276. }
  277. initScale(viewer2, bool) {
  278. const scene = viewer2.scene;
  279. bool ? scene.postRender.addEventListener(this._scaleListener) : scene.postRender.removeEventListener(this._scaleListener);
  280. }
  281. closest(num) {
  282. const scaleList = [
  283. 1e-3,
  284. 2e-3,
  285. 3e-3,
  286. 5e-3,
  287. 0.01,
  288. 0.015,
  289. 0.02,
  290. 0.025,
  291. 0.03,
  292. 0.035,
  293. 0.04,
  294. 0.045,
  295. 0.05,
  296. 0.06,
  297. 0.07,
  298. 0.08,
  299. 0.09,
  300. 0.1,
  301. 0.12,
  302. 0.15,
  303. 0.2,
  304. 0.25,
  305. 0.3,
  306. 0.5,
  307. 1,
  308. 2,
  309. 3,
  310. 5,
  311. 10,
  312. 15,
  313. 20,
  314. 25,
  315. 30,
  316. 35,
  317. 40,
  318. 45,
  319. 50,
  320. 60,
  321. 70,
  322. 80,
  323. 90,
  324. 100,
  325. 120,
  326. 150,
  327. 200,
  328. 250,
  329. 300,
  330. 500,
  331. 1e3,
  332. 2e3,
  333. 5e3,
  334. 1e4,
  335. 1e5,
  336. 5e5,
  337. 1e6
  338. ];
  339. let ret = scaleList[0];
  340. let distance2 = Math.abs(ret - num);
  341. for (let i2 = 1; i2 < scaleList.length; i2++) {
  342. let newDistance = Math.abs(scaleList[i2] - num);
  343. if (newDistance < distance2) {
  344. distance2 = newDistance;
  345. ret = scaleList[i2];
  346. }
  347. }
  348. return ret;
  349. }
  350. _getScreenClickPositionAndHeight(screenPoint) {
  351. var lng = void 0, lat = void 0, height2 = void 0;
  352. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  353. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  354. if (position2) {
  355. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  356. cartographic = Cesium.Cartographic.fromCartesian(position2);
  357. var feature2 = this._viewer.scene.pick(screenPoint);
  358. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  359. lng = this._arcToDegree(cartographic.longitude);
  360. lat = this._arcToDegree(cartographic.latitude);
  361. height2 = cartographic.height;
  362. } else {
  363. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  364. if (Cesium.defined(cartesian)) {
  365. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  366. if (Cesium.defined(cartographic)) {
  367. lng = this._arcToDegree(cartographic.longitude);
  368. lat = this._arcToDegree(cartographic.latitude);
  369. height2 = cartographic.height;
  370. }
  371. }
  372. }
  373. }
  374. return {
  375. lng,
  376. lat,
  377. height: height2
  378. };
  379. }
  380. _arcToDegree(arc) {
  381. return arc / Math.PI * 180;
  382. }
  383. }
  384. var base = "";
  385. class jtMap3d {
  386. constructor(options2) {
  387. if (!Cesium.defined(options2) || !Cesium.defined(options2.container)) {
  388. throw new Cesium.DeveloperError("options.container is required.");
  389. }
  390. Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNzM5YjQ3MC03YmMxLTRmMjAtOTk4Yi0yNDMyMDZlOTQzYTYiLCJpZCI6NTU5MjAsImlhdCI6MTYyNDI0NTM5NX0.diydVWFzw5C5rQlHaFYkdDJoSorcdex81KpWcntyICo";
  391. this._viewer = this._initMap(options2);
  392. this._imageryLayers = this._viewer.imageryLayers;
  393. this._primitives = this._viewer.scene.primitives;
  394. this._entities = this._viewer.entities;
  395. this._dataSources = this._viewer.dataSources;
  396. this._defaultSkyBox = this._viewer.scene.skyBox;
  397. this.statusBar = new StatusBar(this._viewer);
  398. console.log(Cesium.buildModuleUrl.getCesiumBaseUrl());
  399. }
  400. _initMap(options2) {
  401. let viewer2 = new Cesium.Viewer(options2.container, {
  402. animation: true,
  403. timeline: true,
  404. shadows: false,
  405. shouldAnimate: true,
  406. baseLayerPicker: false,
  407. navigationHelpButton: false,
  408. homeButton: false,
  409. fullscreenButton: false,
  410. sceneModePicker: false,
  411. scene3DOnly: true,
  412. infoBox: false,
  413. clampToGround: true,
  414. geocoder: false,
  415. selectionIndicator: false,
  416. contextOptions: {
  417. webgl: {
  418. alpha: true,
  419. depth: true,
  420. stencil: true,
  421. antialias: true,
  422. premultipliedAlpha: true,
  423. preserveDrawingBuffer: true,
  424. failIfMajorPerformanceCaveat: true
  425. }
  426. }
  427. });
  428. viewer2._cesiumWidget._creditContainer.style.display = "none";
  429. viewer2.scene.globe.show = true;
  430. viewer2.scene.globe.depthTestAgainstTerrain = true;
  431. viewer2.scene.globe.enableLighting = false;
  432. viewer2.scene.requestRenderMode = false;
  433. viewer2.scene.debugShowFramesPerSecond = true;
  434. viewer2.scene.skyAtmosphere.show = false;
  435. viewer2.scene.skyBox.show = true;
  436. viewer2.scene.sun.show = true;
  437. viewer2.scene.moon.show = false;
  438. viewer2.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  439. viewer2.animation.viewModel.dateFormatter = localeDateTimeFormatter;
  440. viewer2.animation.viewModel.timeFormatter = localeTimeFormatter;
  441. viewer2.timeline.makeLabel = localeDateTimeFormatter;
  442. function localeDateTimeFormatter(datetime, viewModel, ignoredate) {
  443. var julianDT = new Cesium.JulianDate();
  444. Cesium.JulianDate.addHours(datetime, 8, julianDT);
  445. var gregorianDT = Cesium.JulianDate.toGregorianDate(julianDT);
  446. var objDT;
  447. if (ignoredate) {
  448. objDT = "";
  449. } else {
  450. objDT = new Date(gregorianDT.year, gregorianDT.month - 1, gregorianDT.day);
  451. objDT = gregorianDT.year + "-" + objDT.toLocaleString("zh-cn", {
  452. month: "short"
  453. }).split("\u6708").join("-") + gregorianDT.day + " ";
  454. if (viewModel || gregorianDT.hour + gregorianDT.minute === 0) {
  455. return objDT;
  456. }
  457. }
  458. let hour, minute, second;
  459. if (gregorianDT.hour < 10) {
  460. hour = `0${gregorianDT.hour}`;
  461. } else {
  462. hour = gregorianDT.hour;
  463. }
  464. if (gregorianDT.minute < 10) {
  465. minute = `0${gregorianDT.minute}`;
  466. } else {
  467. minute = gregorianDT.minute;
  468. }
  469. if (gregorianDT.second < 10) {
  470. second = `0${gregorianDT.second}`;
  471. } else {
  472. second = gregorianDT.second;
  473. }
  474. return objDT + hour + ":" + minute + ":" + second;
  475. }
  476. function localeTimeFormatter(time, viewModel) {
  477. return localeDateTimeFormatter(time, viewModel, true);
  478. }
  479. return viewer2;
  480. }
  481. _setView(options2) {
  482. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  483. throw new Cesium.DeveloperError("longitude and latitude are required.");
  484. }
  485. Cesium.Check.typeOf.number("longitude", options2.longitude);
  486. Cesium.Check.typeOf.number("latitude", options2.latitude);
  487. this._viewer.camera.setView({
  488. destination: Cesium.Cartesian3.fromDegrees(
  489. options2.longitude,
  490. options2.latitude,
  491. options2.height
  492. ),
  493. orientation: {
  494. heading: Cesium.Math.toRadians(Cesium.defaultValue(options2.heading, 0)),
  495. pitch: Cesium.Math.toRadians(Cesium.defaultValue(options2.pitch, -90)),
  496. roll: options2.roll
  497. }
  498. });
  499. }
  500. _getChinaPostion() {
  501. return Cesium.Cartesian3.fromDegrees(116.435314, 40.960521, 1e7);
  502. }
  503. }
  504. Object.assign(jtMap3d.prototype, {
  505. flytoChina() {
  506. this._viewer.camera.flyTo({
  507. destination: this._getChinaPostion(),
  508. duration: 3
  509. });
  510. },
  511. setViewChina: function() {
  512. this._setView({
  513. longitude: 103.84,
  514. latitude: 31.15,
  515. height: 24e6,
  516. heading: 0,
  517. pitch: -90,
  518. roll: 0
  519. });
  520. },
  521. fullMap: function(options2) {
  522. return new Promise((resolve2, reject2) => {
  523. let _self = this;
  524. this._entities.removeById("fullMapRectangle");
  525. options2.isRemove = Cesium.defaultValue(options2.isRemove, true);
  526. options2.duration = Cesium.defaultValue(options2.duration, 3);
  527. options2.heading = Cesium.defaultValue(options2.heading, 0);
  528. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  529. options2.range = Cesium.defaultValue(options2.range, 0);
  530. var rectangle = Cesium.Rectangle.fromDegrees(
  531. options2.west,
  532. options2.south,
  533. options2.east,
  534. options2.north
  535. );
  536. var fullMapEntity = this._entities.add({
  537. id: "fullMapRectangle",
  538. name: "fullMapRectangle",
  539. rectangle: {
  540. coordinates: rectangle,
  541. material: Cesium.Color.GREEN.withAlpha(0),
  542. height: 10,
  543. outline: false
  544. }
  545. });
  546. var flyPromise = this._viewer.flyTo(fullMapEntity, {
  547. duration: options2.duration,
  548. offset: {
  549. heading: Cesium.Math.toRadians(options2.heading),
  550. pitch: Cesium.Math.toRadians(options2.pitch),
  551. range: options2.range
  552. }
  553. });
  554. flyPromise.then(function(flyPromise2) {
  555. if (flyPromise2) {
  556. if (options2.isRemove) {
  557. fullMapEntity && (_self._entities.remove(fullMapEntity), fullMapEntity = null);
  558. }
  559. resolve2(true);
  560. }
  561. }).catch(function(error) {
  562. console.log(error);
  563. });
  564. });
  565. },
  566. setMapNorth() {
  567. let viewer2 = this._viewer;
  568. let pitch = Cesium.Math.toDegrees(viewer2.camera.pitch).toFixed(0);
  569. var center2 = viewer2.camera.pickEllipsoid(new Cesium.Cartesian2(viewer2.canvas.clientWidth / 2, viewer2.canvas.clientHeight / 2));
  570. var curPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(center2);
  571. let centerX = curPosition.longitude * 180 / Math.PI;
  572. let centerY = curPosition.latitude * 180 / Math.PI;
  573. let cameraPointX = viewer2.camera.positionCartographic.longitude * 180 / Math.PI;
  574. let cameraPointY = viewer2.camera.positionCartographic.latitude * 180 / Math.PI;
  575. let cameraPointZ = viewer2.camera.positionCartographic.height.toFixed(0);
  576. var satrt = Cesium.Cartographic.fromDegrees(cameraPointX, cameraPointY, cameraPointZ);
  577. var end = Cesium.Cartographic.fromDegrees(centerX, centerY, 0);
  578. var geodesic = new Cesium.EllipsoidGeodesic();
  579. geodesic.setEndPoints(satrt, end);
  580. var distance2 = geodesic.surfaceDistance;
  581. let range3 = Math.sqrt(Math.pow(distance2, 2) + Math.pow(cameraPointZ - 0, 2));
  582. if (this.centerEntity) {
  583. viewer2.entities.remove(this.centerEntity);
  584. }
  585. this.centerEntity = viewer2.entities.add({
  586. position: Cesium.Cartesian3.fromDegrees(centerX, centerY, 0),
  587. point: {
  588. color: Cesium.Color.RED,
  589. pixelSize: 1
  590. }
  591. });
  592. let offset = new Cesium.HeadingPitchRange(Cesium.Math.toRadians(0), Cesium.Math.toRadians(pitch), range3);
  593. viewer2.zoomTo(this.centerEntity, offset);
  594. },
  595. setMapSpinByPoint(points2, options2) {
  596. let viewer2 = this._viewer;
  597. if (!Cesium.defined(points2)) {
  598. throw new Cesium.DeveloperError("points is required.");
  599. }
  600. options2 = options2 || {};
  601. options2.speed = Cesium.defaultValue(options2.speed, 30);
  602. var position2 = points2;
  603. if (points2 instanceof Cesium.Cartesian3) {
  604. position2 = points2;
  605. } else {
  606. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  607. }
  608. var entity = viewer2.entities.add(
  609. new Cesium.Entity({
  610. point: new Cesium.PointGraphics({
  611. color: new Cesium.Color(1, 1, 0),
  612. pixelSize: 6,
  613. outlineColor: new Cesium.Color(0, 1, 1)
  614. }),
  615. position: position2
  616. })
  617. );
  618. var angle = 360 / options2.speed;
  619. var initialHeading = viewer2.camera.heading;
  620. var pitch = viewer2.camera.pitch;
  621. if (options2.pitch) {
  622. pitch = Cesium.Math.toRadians(options2.pitch);
  623. }
  624. var distance2 = viewer2.camera.positionCartographic.height;
  625. if (options2.height) {
  626. distance2 = options2.height;
  627. }
  628. var startTime = Cesium.JulianDate.fromDate(new Date());
  629. viewer2.clock.startTime = startTime.clone();
  630. viewer2.clock.currentTime = startTime.clone();
  631. viewer2.clock.clockRange = Cesium.ClockRange.CLAMPED;
  632. viewer2.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;
  633. var Exection = function TimeExecution() {
  634. var delTime = Cesium.JulianDate.secondsDifference(viewer2.clock.currentTime, viewer2.clock.startTime);
  635. var heading = Cesium.Math.toRadians(delTime * angle) + initialHeading;
  636. viewer2.scene.camera.setView({
  637. destination: position2,
  638. orientation: {
  639. heading,
  640. pitch
  641. }
  642. });
  643. viewer2.scene.camera.moveBackward(distance2);
  644. if (Cesium.JulianDate.compare(viewer2.clock.currentTime, viewer2.clock.stopTime) >= 0) {
  645. viewer2.clock.onTick.removeEventListener(Exection);
  646. }
  647. var handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  648. handler.setInputAction(function(click) {
  649. viewer2.clock.onTick.removeEventListener(Exection);
  650. viewer2.entities.remove(entity);
  651. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  652. };
  653. viewer2.clock.onTick.addEventListener(Exection);
  654. }
  655. });
  656. const BD_FACTOR = 3.141592653589793 * 3e3 / 180;
  657. const PI = 3.141592653589793;
  658. const RADIUS = 6378245;
  659. const EE = 0.006693421622965943;
  660. class CoordTransform {
  661. static BD09ToGCJ02(lng, lat) {
  662. let x = +lng - 65e-4;
  663. let y = +lat - 6e-3;
  664. let z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * BD_FACTOR);
  665. let theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * BD_FACTOR);
  666. let gg_lng = z * Math.cos(theta);
  667. let gg_lat = z * Math.sin(theta);
  668. return [gg_lng, gg_lat];
  669. }
  670. static GCJ02ToBD09(lng, lat) {
  671. lat = +lat;
  672. lng = +lng;
  673. let z = Math.sqrt(lng * lng + lat * lat) + 2e-5 * Math.sin(lat * BD_FACTOR);
  674. let theta = Math.atan2(lat, lng) + 3e-6 * Math.cos(lng * BD_FACTOR);
  675. let bd_lng = z * Math.cos(theta) + 65e-4;
  676. let bd_lat = z * Math.sin(theta) + 6e-3;
  677. return [bd_lng, bd_lat];
  678. }
  679. static WGS84ToGCJ02(lng, lat) {
  680. lat = +lat;
  681. lng = +lng;
  682. if (this.out_of_china(lng, lat)) {
  683. return [lng, lat];
  684. } else {
  685. let d2 = this.delta(lng, lat);
  686. return [lng + d2[0], lat + d2[1]];
  687. }
  688. }
  689. static GCJ02ToWGS84(lng, lat) {
  690. lat = +lat;
  691. lng = +lng;
  692. if (this.out_of_china(lng, lat)) {
  693. return [lng, lat];
  694. } else {
  695. let d2 = this.delta(lng, lat);
  696. let mgLng = lng + d2[0];
  697. let mgLat = lat + d2[1];
  698. return [lng * 2 - mgLng, lat * 2 - mgLat];
  699. }
  700. }
  701. static delta(lng, lat) {
  702. let dLng = this.transformLng(lng - 105, lat - 35);
  703. let dLat = this.transformLat(lng - 105, lat - 35);
  704. const radLat = lat / 180 * PI;
  705. let magic = Math.sin(radLat);
  706. magic = 1 - EE * magic * magic;
  707. const sqrtMagic = Math.sqrt(magic);
  708. dLng = dLng * 180 / (RADIUS / sqrtMagic * Math.cos(radLat) * PI);
  709. dLat = dLat * 180 / (RADIUS * (1 - EE) / (magic * sqrtMagic) * PI);
  710. return [dLng, dLat];
  711. }
  712. static transformLng(lng, lat) {
  713. lat = +lat;
  714. lng = +lng;
  715. let ret = 300 + lng + 2 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
  716. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  717. ret += (20 * Math.sin(lng * PI) + 40 * Math.sin(lng / 3 * PI)) * 2 / 3;
  718. ret += (150 * Math.sin(lng / 12 * PI) + 300 * Math.sin(lng / 30 * PI)) * 2 / 3;
  719. return ret;
  720. }
  721. static transformLat(lng, lat) {
  722. lat = +lat;
  723. lng = +lng;
  724. let ret = -100 + 2 * lng + 3 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
  725. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  726. ret += (20 * Math.sin(lat * PI) + 40 * Math.sin(lat / 3 * PI)) * 2 / 3;
  727. ret += (160 * Math.sin(lat / 12 * PI) + 320 * Math.sin(lat * PI / 30)) * 2 / 3;
  728. return ret;
  729. }
  730. static out_of_china(lng, lat) {
  731. lat = +lat;
  732. lng = +lng;
  733. return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
  734. }
  735. static getCatesian3FromPX(viewer2, px) {
  736. let picks = viewer2.scene.drillPick(px);
  737. let cartesian = null;
  738. let isOn3dtiles = false, isOnTerrain = false;
  739. for (let i2 in picks) {
  740. let pick = picks[i2];
  741. if (pick && pick.primitive instanceof Cesium.Cesium3DTileFeature || pick && pick.primitive instanceof Cesium.Cesium3DTileset || pick && pick.primitive instanceof Cesium.Model) {
  742. isOn3dtiles = true;
  743. }
  744. if (isOn3dtiles) {
  745. viewer2.scene.pick(px);
  746. cartesian = viewer2.scene.pickPosition(px);
  747. if (cartesian) {
  748. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  749. if (cartographic.height < 0)
  750. cartographic.height = 0;
  751. let lon = Cesium.Math.toDegrees(cartographic.longitude), lat = Cesium.Math.toDegrees(cartographic.latitude), height2 = cartographic.height;
  752. cartesian = this.transformWGS84ToCartesian({
  753. lng: lon,
  754. lat,
  755. alt: height2
  756. });
  757. }
  758. }
  759. }
  760. let boolTerrain = viewer2.terrainProvider instanceof Cesium.EllipsoidTerrainProvider;
  761. if (!isOn3dtiles && !boolTerrain) {
  762. let ray = viewer2.scene.camera.getPickRay(px);
  763. if (!ray)
  764. return null;
  765. cartesian = viewer2.scene.globe.pick(ray, viewer2.scene);
  766. isOnTerrain = true;
  767. }
  768. if (!isOn3dtiles && !isOnTerrain && boolTerrain) {
  769. cartesian = viewer2.scene.camera.pickEllipsoid(
  770. px,
  771. viewer2.scene.globe.ellipsoid
  772. );
  773. }
  774. if (cartesian) {
  775. let position2 = this.transformCartesianToWGS84(cartesian);
  776. if (position2.alt < 0) {
  777. cartesian = this.transformWGS84ToCartesian(position2, 0.1);
  778. }
  779. return cartesian;
  780. }
  781. return false;
  782. }
  783. static transformWGS84ToCartesian(position2, alt) {
  784. return position2 ? Cesium.Cartesian3.fromDegrees(
  785. position2.lng || position2.lon,
  786. position2.lat,
  787. position2.alt = alt || position2.alt,
  788. Cesium.Ellipsoid.WGS84
  789. ) : Cesium.Cartesian3.ZERO;
  790. }
  791. static transformCartesianToWGS84(cartesian) {
  792. let ellipsoid = Cesium.Ellipsoid.WGS84;
  793. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  794. return {
  795. lng: Cesium.Math.toDegrees(cartographic.longitude),
  796. lat: Cesium.Math.toDegrees(cartographic.latitude),
  797. alt: cartographic.height
  798. };
  799. }
  800. static Cartesian3ListToWGS84(cartesianList) {
  801. let ellipsoid = Cesium.Ellipsoid.WGS84;
  802. let result = [];
  803. for (let index2 = 0; index2 < cartesianList.length; index2++) {
  804. const cartesian = cartesianList[index2];
  805. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  806. result.push({
  807. lng: Cesium.Math.toDegrees(cartographic.longitude),
  808. lat: Cesium.Math.toDegrees(cartographic.latitude),
  809. alt: cartographic.height
  810. });
  811. }
  812. return result;
  813. }
  814. static Degrees2DMS(value) {
  815. let degrees = Math.floor(value);
  816. let rem = (value - degrees) * 60;
  817. let minutes = Math.floor(rem);
  818. let _second = (rem - minutes) * 60;
  819. let seconds = Math.round(_second);
  820. var _radians = Cesium.Math.toRadians(value);
  821. var _degrees = Cesium.Math.toDegrees(value);
  822. console.log(_radians);
  823. console.log(_degrees);
  824. let DMS = {
  825. degrees,
  826. minutes,
  827. seconds
  828. };
  829. return DMS;
  830. }
  831. static DMS2Degrees(DMS) {
  832. let _double = parseFloat(DMS.degrees) + parseFloat(DMS.minutes) / 60 + parseFloat(DMS.seconds) / 3600;
  833. return parseFloat(_double).toFixed(6);
  834. }
  835. static _cartesian3ToGeo(position2) {
  836. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  837. return {
  838. longitude: Cesium.Math.toDegrees(g.longitude),
  839. latitude: Cesium.Math.toDegrees(g.latitude),
  840. height: g.height
  841. };
  842. }
  843. static _arcToDegree(arc) {
  844. return arc / Math.PI * 180;
  845. }
  846. static _getScreenClickPositionAndHeight(viewer2, screenPoint) {
  847. this._viewer = viewer2;
  848. var lng = void 0, lat = void 0, height2 = void 0;
  849. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  850. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  851. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  852. var feature2 = this._viewer.scene.pick(screenPoint);
  853. if (feature2 == void 0) {
  854. lng = this._arcToDegree(cartographic.longitude);
  855. lat = this._arcToDegree(cartographic.latitude);
  856. height2 = cartographic.height;
  857. } else {
  858. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  859. if (Cesium.defined(cartesian)) {
  860. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  861. lng = this._arcToDegree(cartographic.longitude);
  862. lat = this._arcToDegree(cartographic.latitude);
  863. height2 = cartographic.height;
  864. }
  865. }
  866. return {
  867. lng,
  868. lat,
  869. height: height2
  870. };
  871. }
  872. static _transfromFromScreenPoint(viewer2, screenPosition) {
  873. let location = this._getScreenClickPositionAndHeight(viewer2, screenPosition);
  874. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  875. return {
  876. gLocation: location,
  877. sLocation: cartesian
  878. };
  879. }
  880. }
  881. class PolylineDirectionMaterialProperty {
  882. constructor(options2) {
  883. this.defaultColor = new Cesium.Color(255 / 255, 0, 0, 0);
  884. options2 = options2 || {};
  885. options2.isImageAlpha = Cesium.defaultValue(options2.isImageAlpha, true);
  886. options2.imgUrl = Cesium.defaultValue(options2.imgUrl, "jt3dSDK/imgs/polylinematerial/spriteline1.png");
  887. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  888. options2.count = Cesium.defaultValue(options2.count, 1);
  889. options2.direction = Cesium.defaultValue(options2.direction, "horizontal");
  890. options2.order = Cesium.defaultValue(options2.order, "-");
  891. if (options2.isImageAlpha) {
  892. options2.color = this.defaultColor;
  893. } else {
  894. if (options2.color instanceof Array) {
  895. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  896. } else if (typeof options2.color === "string") {
  897. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  898. } else {
  899. options2.color = this.defaultColor;
  900. }
  901. }
  902. this._definitionChanged = new Cesium.Event();
  903. this._color = void 0;
  904. this._image = void 0;
  905. this.color = options2.color;
  906. this.image = options2.imgUrl;
  907. this._isImageAlpha = options2.isImageAlpha;
  908. this._duration = options2.duration;
  909. this._count = options2.count;
  910. this._direction = options2.direction;
  911. this._order = options2.order;
  912. this._time = performance.now();
  913. this.addMaterial();
  914. }
  915. addMaterial() {
  916. Cesium.Material.PolylineTrailType = "PolylineTrail";
  917. Cesium.Material.Polylineimage = "images/colors.png";
  918. if (this._direction === "vertical") {
  919. if (this._isImageAlpha) {
  920. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb* 1.5 ;\n return material;\n }";
  921. } else {
  922. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  923. }
  924. } else if (this._direction === "horizontal") {
  925. if (this._isImageAlpha) {
  926. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb * 1.5 ;\n return material;\n }";
  927. } else {
  928. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  929. }
  930. }
  931. Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailType, {
  932. fabric: {
  933. type: Cesium.Material.PolylineTrailType,
  934. uniforms: {
  935. color: new Cesium.Color(1, 0, 0, 0.5),
  936. image: Cesium.Material.Polylineimage,
  937. time: 0,
  938. repeat: new Cesium.Cartesian2(5, 1),
  939. order: "-"
  940. },
  941. source: Cesium.Material.PolylineTrailSource
  942. },
  943. translucent: function(material) {
  944. return true;
  945. }
  946. });
  947. }
  948. }
  949. PolylineDirectionMaterialProperty.prototype.getType = function(time) {
  950. return "PolylineTrail";
  951. };
  952. PolylineDirectionMaterialProperty.prototype.getValue = function(time, result) {
  953. if (!Cesium.defined(result)) {
  954. result = {};
  955. }
  956. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, this.defaultColor, result.color);
  957. result.image = Cesium.Property.getValueOrUndefined(this._image, time);
  958. result.time = (performance.now() - this._time) % this._duration / this._duration;
  959. result.repeat = new Cesium.Cartesian2(this._count, 1);
  960. result.order = this._order;
  961. return result;
  962. };
  963. PolylineDirectionMaterialProperty.prototype.equals = function(other) {
  964. return this === other || other instanceof PolylineDirectionMaterialProperty && Cesium.Property.equals(this._color, other._color);
  965. };
  966. Object.defineProperties(PolylineDirectionMaterialProperty.prototype, {
  967. isConstant: {
  968. get: function() {
  969. return false;
  970. }
  971. },
  972. definitionChanged: {
  973. get: function() {
  974. return this._definitionChanged;
  975. }
  976. },
  977. color: Cesium.createPropertyDescriptor("color"),
  978. image: Cesium.createPropertyDescriptor("image")
  979. });
  980. class WallMaterialProperty$1 {
  981. constructor(viewer2, options2) {
  982. this._viewer = viewer2;
  983. options2 = options2 || {};
  984. this._definitionChanged = new Cesium.Event();
  985. this._color = void 0;
  986. this.color = options2.color || Cesium.Color.BLUE;
  987. this.duration = options2.duration || 1e3;
  988. this.count = options2.duration || 1;
  989. this.direction = options2.duration || "vertical";
  990. this.order = options2.duration || "-";
  991. this.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  992. this._time = new Date().getTime();
  993. this._materialTypeName = "WallMaterial" + this._guid();
  994. this._param = {
  995. color: this.color._value.toCssColorString(),
  996. image: this.trailImage,
  997. duration: this.duration,
  998. count: this.count,
  999. direction: this.direction,
  1000. order: this.order
  1001. };
  1002. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  1003. fabric: {
  1004. type: this._materialTypeName,
  1005. uniforms: {
  1006. time: -20,
  1007. color: new Cesium.Color(1, 0, 0, 0.5),
  1008. image: options2.trailImage
  1009. },
  1010. source: this._getDirectionWallShader(options2.param)
  1011. },
  1012. translucent: function(material) {
  1013. return true;
  1014. }
  1015. });
  1016. }
  1017. _guid() {
  1018. function S4() {
  1019. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1020. }
  1021. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1022. }
  1023. getType(time) {
  1024. return this._materialTypeName;
  1025. }
  1026. getValue(time, result) {
  1027. if (!Cesium.defined(result)) {
  1028. result = {};
  1029. }
  1030. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  1031. result.image = this.trailImage;
  1032. if (this.duration) {
  1033. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  1034. }
  1035. this._viewer.scene.requestRender();
  1036. return result;
  1037. }
  1038. equals(other) {
  1039. return this === other || other instanceof WallMaterialProperty$1 && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  1040. }
  1041. _getDirectionWallShader(options2) {
  1042. let op = Cesium.defaultValue(options2, {});
  1043. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  1044. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  1045. let order = op.order === "+" ? "+" : "-";
  1046. this._param.count = count;
  1047. this._param.direction = direction;
  1048. this._param.order = order;
  1049. let materail = "";
  1050. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  1051. if (direction === "vertical") {
  1052. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  1053. } else if (direction === "horizontal") {
  1054. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  1055. }
  1056. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  1057. return materail;
  1058. }
  1059. }
  1060. Object.defineProperties(WallMaterialProperty$1.prototype, {
  1061. isConstant: {
  1062. get: function() {
  1063. return false;
  1064. }
  1065. },
  1066. definitionChanged: {
  1067. get: function() {
  1068. return this._definitionChanged;
  1069. }
  1070. },
  1071. color: Cesium.createPropertyDescriptor("color")
  1072. });
  1073. var tooltip = "";
  1074. function setSessionid$1(num) {
  1075. let len = num || 32;
  1076. let chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
  1077. let maxPos = chars.length;
  1078. let pwd = "";
  1079. for (let i2 = 0; i2 < len; i2++) {
  1080. pwd += chars.charAt(Math.floor(Math.random() * maxPos));
  1081. }
  1082. return pwd;
  1083. }
  1084. function guid() {
  1085. function S4() {
  1086. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1087. }
  1088. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1089. }
  1090. function getGuid(removeMinus) {
  1091. let d2 = new Date().getTime();
  1092. let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
  1093. const r2 = (d2 + Math.random() * 16) % 16 | 0;
  1094. d2 = Math.floor(d2 / 16);
  1095. return (c === "x" ? r2 : r2 & 3 | 8).toString(16);
  1096. });
  1097. if (removeMinus) {
  1098. uuid = uuid.replace(/-/g, "");
  1099. }
  1100. return uuid;
  1101. }
  1102. function getHeigthByLngLat(viewer2, options2) {
  1103. if (!viewer2)
  1104. throw new Cesium.DeveloperError("no viewer object!");
  1105. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  1106. throw new Cesium.DeveloperError("longitude and latitude are required.");
  1107. }
  1108. options2.level = Cesium.defaultValue(options2.level, 11);
  1109. let positions = Cesium.Cartographic.fromDegrees(options2.longitude, options2.latitude);
  1110. let terrainProvider = viewer2.terrainProvider;
  1111. return new Promise((resolve2, reject2) => {
  1112. new Cesium.sampleTerrain(terrainProvider, options2.level, [positions]).then(function(updatedPositions) {
  1113. if (updatedPositions) {
  1114. resolve2(updatedPositions[0].height);
  1115. }
  1116. });
  1117. });
  1118. }
  1119. function getHeigthByPoints(viewer2, options2) {
  1120. if (!viewer2)
  1121. throw new Cesium.DeveloperError("no viewer object!");
  1122. if (!Cesium.defined(options2)) {
  1123. throw new Cesium.DeveloperError("options is required.");
  1124. }
  1125. options2.level = Cesium.defaultValue(options2.level, 11);
  1126. let positions = [];
  1127. let points2 = options2.points;
  1128. for (let i2 = 0; i2 < points2.length; i2++) {
  1129. let pointX = points2[i2][0];
  1130. let pointY = points2[i2][1];
  1131. positions.push(
  1132. Cesium.Cartographic.fromDegrees(pointX, pointY)
  1133. );
  1134. }
  1135. let terrainProvider = viewer2.terrainProvider;
  1136. return new Promise((resolve2, reject2) => {
  1137. new Cesium.sampleTerrain(terrainProvider, options2.level, positions).then(function(updatedPositions) {
  1138. if (updatedPositions) {
  1139. resolve2(updatedPositions);
  1140. }
  1141. });
  1142. });
  1143. }
  1144. function getHeigthByPointsMostDetailed(viewer2, points2) {
  1145. if (!viewer2)
  1146. throw new Cesium.DeveloperError("no viewer object!");
  1147. if (!Cesium.defined(points2)) {
  1148. throw new Cesium.DeveloperError("points is required.");
  1149. }
  1150. let positions = [];
  1151. for (let i2 = 0; i2 < points2.length; i2++) {
  1152. let pointX = points2[i2][0];
  1153. let pointY = points2[i2][1];
  1154. positions.push(Cesium.Cartographic.fromDegrees(pointX, pointY));
  1155. }
  1156. let terrainProvider = viewer2.terrainProvider;
  1157. return new Promise((resolve2, reject2) => {
  1158. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1159. promise.then(function(updatedPositions) {
  1160. resolve2(updatedPositions);
  1161. });
  1162. });
  1163. }
  1164. function getHeigthByPointMostDetailed(viewer2, points2) {
  1165. if (!viewer2)
  1166. throw new Cesium.DeveloperError("no viewer object!");
  1167. if (!Cesium.defined(points2)) {
  1168. throw new Cesium.DeveloperError("points is required.");
  1169. }
  1170. let positions = Cesium.Cartographic.fromDegrees(points2[0], points2[1]);
  1171. let terrainProvider = viewer2.terrainProvider;
  1172. return new Promise((resolve2, reject2) => {
  1173. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1174. promise.then(function(updatedPositions) {
  1175. resolve2(updatedPositions);
  1176. });
  1177. });
  1178. }
  1179. function createTooltip(frameDiv) {
  1180. var tooltip2 = function(frameDiv2) {
  1181. var div = document.createElement("DIV");
  1182. div.className = "twipsy right";
  1183. var arrow = document.createElement("DIV");
  1184. arrow.className = "twipsy-arrow";
  1185. div.appendChild(arrow);
  1186. var title = document.createElement("DIV");
  1187. title.className = "twipsy-inner";
  1188. div.appendChild(title);
  1189. this._div = div;
  1190. this._title = title;
  1191. frameDiv2.appendChild(div);
  1192. };
  1193. tooltip2.prototype.setVisible = function(visible) {
  1194. this._div.style.display = visible ? "block" : "none";
  1195. };
  1196. tooltip2.prototype.showAt = function(position2, message) {
  1197. if (position2 && message) {
  1198. this.setVisible(true);
  1199. this._title.innerHTML = message;
  1200. this._div.style.left = position2.x + 10 + "px";
  1201. this._div.style.top = position2.y - this._div.clientHeight / 2 + "px";
  1202. }
  1203. };
  1204. return new tooltip2(frameDiv);
  1205. }
  1206. var common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  1207. __proto__: null,
  1208. setSessionid: setSessionid$1,
  1209. guid,
  1210. getGuid,
  1211. getHeigthByLngLat,
  1212. getHeigthByPoints,
  1213. getHeigthByPointsMostDetailed,
  1214. getHeigthByPointMostDetailed,
  1215. createTooltip
  1216. }, Symbol.toStringTag, { value: "Module" }));
  1217. class PointObject {
  1218. constructor(viewer2) {
  1219. if (!viewer2)
  1220. throw new Cesium.DeveloperError("no viewer object!");
  1221. this._viewer = viewer2;
  1222. }
  1223. }
  1224. Object.assign(PointObject.prototype, {
  1225. addLabel(points2, options2) {
  1226. return new Promise((resolve2, reject2) => {
  1227. if (!Cesium.defined(points2)) {
  1228. throw new Cesium.DeveloperError("points is required.");
  1229. }
  1230. let position2;
  1231. if (points2 instanceof Cesium.Cartesian3) {
  1232. position2 = points2;
  1233. } else {
  1234. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1235. }
  1236. options2 = options2 || {};
  1237. options2.id = options2.id || setSessionid$1();
  1238. let label2 = options2.label || {};
  1239. label2.text = Cesium.defaultValue(label2.text, "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0");
  1240. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  1241. if (label2.fillColor instanceof Cesium.Color) {
  1242. label2.fillColor = label2.fillColor;
  1243. } else if (label2.fillColor instanceof Array) {
  1244. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  1245. } else if (typeof label2.fillColor === "string") {
  1246. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  1247. } else {
  1248. label2.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1249. }
  1250. if (label2.outlineColor instanceof Cesium.Color) {
  1251. label2.outlineColor = label2.outlineColor;
  1252. } else if (label2.outlineColor instanceof Array) {
  1253. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  1254. } else if (typeof label2.outlineColor === "string") {
  1255. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  1256. } else {
  1257. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1258. }
  1259. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  1260. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  1261. if (label2.backgroundColor instanceof Cesium.Color) {
  1262. label2.backgroundColor = label2.backgroundColor;
  1263. } else if (label2.backgroundColor instanceof Array) {
  1264. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  1265. } else if (typeof label2.backgroundColor === "string") {
  1266. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  1267. } else {
  1268. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1269. }
  1270. if (label2.backgroundPadding) {
  1271. label2.backgroundPadding = new Cesium.Cartesian2(label2.backgroundPadding, label2.backgroundPadding);
  1272. }
  1273. let entity = new Cesium.Entity({
  1274. position: position2,
  1275. label: {
  1276. text: label2.text,
  1277. font: label2.font,
  1278. fillColor: label2.fillColor,
  1279. outlineColor: label2.outlineColor,
  1280. outlineWidth: label2.outlineWidth,
  1281. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1282. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1283. showBackground: label2.showBackground,
  1284. backgroundColor: label2.backgroundColor,
  1285. backgroundPadding: label2.backgroundPadding,
  1286. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1287. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1288. clampToGround: true
  1289. }
  1290. });
  1291. if (label2.pixelOffset) {
  1292. label2.pixelOffset.x = Cesium.defaultValue(label2.pixelOffset.x, 0);
  1293. label2.pixelOffset.y = Cesium.defaultValue(label2.pixelOffset.y, 0);
  1294. entity.label.pixelOffset = new Cesium.Cartesian2(label2.pixelOffset.x, label2.pixelOffset.y);
  1295. }
  1296. if (label2.scaleByDistance) {
  1297. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  1298. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  1299. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  1300. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  1301. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  1302. }
  1303. resolve2(entity);
  1304. });
  1305. },
  1306. addPoint(points2, options2) {
  1307. return new Promise((resolve2, reject2) => {
  1308. if (!Cesium.defined(points2)) {
  1309. throw new Cesium.DeveloperError("points is required.");
  1310. }
  1311. let position2;
  1312. if (points2 instanceof Cesium.Cartesian3) {
  1313. position2 = points2;
  1314. } else {
  1315. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1316. }
  1317. options2 = options2 || {};
  1318. options2.id = options2.id || setSessionid$1();
  1319. let point2 = options2.point || {};
  1320. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1321. if (point2.color instanceof Cesium.Color) {
  1322. point2.color = point2.color;
  1323. } else if (point2.color instanceof Array) {
  1324. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1325. } else if (typeof point2.color === "string") {
  1326. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1327. } else {
  1328. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1329. }
  1330. if (point2.outlineColor instanceof Cesium.Color) {
  1331. point2.outlineColor = point2.outlineColor;
  1332. } else if (point2.outlineColor instanceof Array) {
  1333. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1334. } else if (typeof point2.outlineColor === "string") {
  1335. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1336. } else {
  1337. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1338. }
  1339. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1340. let entity = new Cesium.Entity({
  1341. position: position2,
  1342. point: {
  1343. pixelSize: point2.pixelSize,
  1344. color: point2.color,
  1345. outlineColor: point2.outlineColor,
  1346. outlineWidth: point2.outlineWidth,
  1347. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1348. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1349. clampToGround: true
  1350. }
  1351. });
  1352. if (options2.label) {
  1353. let label2 = options2.label || {};
  1354. label2.text = Cesium.defaultValue(label2.text, "");
  1355. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  1356. if (label2.fillColor instanceof Cesium.Color) {
  1357. label2.fillColor = label2.outlineColor;
  1358. } else if (label2.fillColor instanceof Array) {
  1359. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  1360. } else if (typeof label2.fillColor === "string") {
  1361. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  1362. } else {
  1363. label2.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1364. }
  1365. if (label2.outlineColor instanceof Cesium.Color) {
  1366. label2.outlineColor = label2.outlineColor;
  1367. } else if (label2.outlineColor instanceof Array) {
  1368. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  1369. } else if (typeof label2.outlineColor === "string") {
  1370. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  1371. } else {
  1372. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1373. }
  1374. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  1375. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  1376. if (label2.backgroundColor instanceof Cesium.Color) {
  1377. label2.backgroundColor = label2.backgroundColor;
  1378. } else if (label2.backgroundColor instanceof Array) {
  1379. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  1380. } else if (typeof label2.backgroundColor === "string") {
  1381. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  1382. } else {
  1383. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1384. }
  1385. if (label2.backgroundPadding) {
  1386. label2.backgroundPadding = new Cesium.Cartesian2(label2.backgroundPadding, label2.backgroundPadding);
  1387. }
  1388. entity.label = {
  1389. text: label2.text,
  1390. font: label2.font,
  1391. fillColor: label2.fillColor,
  1392. outlineColor: label2.outlineColor,
  1393. outlineWidth: label2.outlineWidth,
  1394. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1395. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1396. showBackground: label2.showBackground,
  1397. backgroundColor: label2.backgroundColor,
  1398. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1399. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1400. clampToGround: true
  1401. };
  1402. if (label2.pixelOffset) {
  1403. label2.pixelOffset.x = Cesium.defaultValue(label2.pixelOffset.x, 0);
  1404. label2.pixelOffset.y = Cesium.defaultValue(label2.pixelOffset.y, 0);
  1405. entity.label.pixelOffset = new Cesium.Cartesian2(label2.pixelOffset.x, label2.pixelOffset.y);
  1406. }
  1407. if (label2.scaleByDistance) {
  1408. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  1409. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  1410. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  1411. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  1412. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  1413. }
  1414. }
  1415. resolve2(entity);
  1416. });
  1417. },
  1418. addBillboard(points2, options2) {
  1419. return new Promise((resolve2, reject2) => {
  1420. if (!Cesium.defined(points2)) {
  1421. throw new Cesium.DeveloperError("points is required.");
  1422. }
  1423. let position2;
  1424. if (points2 instanceof Cesium.Cartesian3) {
  1425. position2 = points2;
  1426. } else {
  1427. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1428. }
  1429. options2 = options2 || {};
  1430. options2.id = options2.id || setSessionid$1();
  1431. let billboard = options2.billboard || {};
  1432. billboard.image = billboard.imgUrl || "jt3dSDK/imgs/point/point3.png";
  1433. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1434. let entity = new Cesium.Entity({
  1435. name: "add billboard",
  1436. position: position2,
  1437. billboard: {
  1438. image: billboard.image,
  1439. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1440. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1441. scale: billboard.scale,
  1442. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1443. }
  1444. });
  1445. if (options2.properties) {
  1446. entity.properties = options2.properties;
  1447. }
  1448. if (billboard.pixelOffset) {
  1449. billboard.pixelOffset.x = Cesium.defaultValue(billboard.pixelOffset.x, 0);
  1450. billboard.pixelOffset.y = Cesium.defaultValue(billboard.pixelOffset.y, 0);
  1451. entity.billboard.pixelOffset = new Cesium.Cartesian2(billboard.pixelOffset.x, billboard.pixelOffset.y);
  1452. }
  1453. if (billboard.scaleByDistance) {
  1454. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  1455. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  1456. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  1457. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  1458. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  1459. }
  1460. if (options2.label) {
  1461. let label2 = options2.label || {};
  1462. label2.text = Cesium.defaultValue(label2.text, "");
  1463. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  1464. if (label2.fillColor instanceof Cesium.Color) {
  1465. label2.fillColor = label2.fillColor;
  1466. } else if (label2.fillColor instanceof Array) {
  1467. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  1468. } else if (typeof label2.fillColor === "string") {
  1469. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  1470. } else {
  1471. label2.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1472. }
  1473. if (label2.outlineColor instanceof Cesium.Color) {
  1474. label2.outlineColor = label2.outlineColor;
  1475. } else if (label2.outlineColor instanceof Array) {
  1476. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  1477. } else if (typeof label2.outlineColor === "string") {
  1478. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  1479. } else {
  1480. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1481. }
  1482. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  1483. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  1484. if (label2.backgroundColor instanceof Cesium.Color) {
  1485. label2.backgroundColor = label2.backgroundColor;
  1486. } else if (label2.backgroundColor instanceof Array) {
  1487. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  1488. } else if (typeof label2.backgroundColor === "string") {
  1489. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  1490. } else {
  1491. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1492. }
  1493. if (label2.backgroundPadding) {
  1494. label2.backgroundPadding = new Cesium.Cartesian2(label2.backgroundPadding, label2.backgroundPadding);
  1495. }
  1496. entity.label = {
  1497. text: label2.text,
  1498. font: label2.font,
  1499. fillColor: label2.fillColor,
  1500. outlineColor: label2.outlineColor,
  1501. outlineWidth: label2.outlineWidth,
  1502. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1503. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1504. showBackground: label2.showBackground,
  1505. backgroundColor: label2.backgroundColor,
  1506. backgroundPadding: label2.backgroundPadding,
  1507. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1508. };
  1509. if (label2.pixelOffset) {
  1510. label2.pixelOffset.x = Cesium.defaultValue(label2.pixelOffset.x, 0);
  1511. label2.pixelOffset.y = Cesium.defaultValue(label2.pixelOffset.y, 0);
  1512. entity.label.pixelOffset = new Cesium.Cartesian2(label2.pixelOffset.x, label2.pixelOffset.y);
  1513. }
  1514. if (label2.scaleByDistance) {
  1515. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  1516. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  1517. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  1518. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  1519. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  1520. }
  1521. }
  1522. resolve2(entity);
  1523. });
  1524. },
  1525. addModel: function(points2, options2) {
  1526. this._viewer;
  1527. return new Promise((resolve2, reject2) => {
  1528. if (!Cesium.defined(points2)) {
  1529. throw new Cesium.DeveloperError("points is required.");
  1530. }
  1531. let position2;
  1532. if (points2 instanceof Cesium.Cartesian3) {
  1533. position2 = points2;
  1534. } else {
  1535. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1536. }
  1537. options2 = options2 || {};
  1538. options2.id = options2.id || setSessionid$1();
  1539. let model = options2.model || {};
  1540. model.alpha = Cesium.defaultValue(model.alpha, 1);
  1541. model.heading = Cesium.defaultValue(model.heading, 0);
  1542. model.pitch = Cesium.defaultValue(model.pitch, 0);
  1543. model.roll = Cesium.defaultValue(model.roll, 0);
  1544. var heading = Cesium.Math.toRadians(model.heading);
  1545. var pitch = model.pitch;
  1546. var roll = model.roll;
  1547. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1548. let entity = new Cesium.Entity({
  1549. position: position2,
  1550. model: {
  1551. uri: model.url,
  1552. incrementallyLoadTextures: true,
  1553. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1554. colorBlendAmount: 0.1,
  1555. color: Cesium.Color.WHITE.withAlpha(model.alpha),
  1556. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1557. runAnimations: true,
  1558. show: true,
  1559. debugWireframe: false,
  1560. debugShowBoundingVolume: false,
  1561. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1562. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1563. clampToGround: true
  1564. }
  1565. });
  1566. if (model.minimumPixelSize) {
  1567. entity.model.minimumPixelSize = model.minimumPixelSize;
  1568. }
  1569. if (model.maximumScale) {
  1570. entity.model.maximumScale = model.maximumScale;
  1571. }
  1572. if (options2.silhouetteColor) {
  1573. if (model.silhouetteColor instanceof Cesium.Color) {
  1574. model.silhouetteColor = model.silhouetteColor;
  1575. } else if (model.silhouetteColor instanceof Array) {
  1576. model.silhouetteColor = new Cesium.Color(model.silhouetteColor[0] / 255, model.silhouetteColor[1] / 255, model.silhouetteColor[2] / 255, model.silhouetteColor[3]);
  1577. } else if (typeof model.silhouetteColor === "string") {
  1578. model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  1579. } else {
  1580. model.silhouetteColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1581. }
  1582. }
  1583. model.silhouetteSize = Cesium.defaultValue(model.silhouetteSize, 1);
  1584. resolve2(entity);
  1585. });
  1586. },
  1587. generatePoint(points2, options2) {
  1588. return new Promise((resolve2, reject2) => {
  1589. let _self = this;
  1590. if (!Cesium.defined(points2)) {
  1591. throw new Cesium.DeveloperError("points is required.");
  1592. }
  1593. options2 = options2 || {};
  1594. options2.id = options2.id || setSessionid$1();
  1595. let point2 = options2.point || {};
  1596. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1597. if (point2.color instanceof Cesium.Color) {
  1598. point2.color = point2.color;
  1599. } else if (point2.color instanceof Array) {
  1600. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1601. } else if (typeof point2.color === "string") {
  1602. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1603. } else {
  1604. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1605. }
  1606. if (point2.outlineColor instanceof Cesium.Color) {
  1607. point2.outlineColor = point2.outlineColor;
  1608. } else if (point2.outlineColor instanceof Array) {
  1609. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1610. } else if (typeof point2.outlineColor === "string") {
  1611. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1612. } else {
  1613. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1614. }
  1615. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1616. let terrainAltitude = getHeigthByPointsMostDetailed(_self._viewer, [points2]);
  1617. terrainAltitude.then(function(updatedPositions) {
  1618. let position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], updatedPositions[0].height);
  1619. let entity = new Cesium.Entity({
  1620. id: options2.id,
  1621. position: position2,
  1622. point: {
  1623. pixelSize: point2.pixelSize,
  1624. color: point2.color,
  1625. outlineColor: point2.outlineColor,
  1626. outlineWidth: point2.outlineWidth,
  1627. heightReference: Cesium.HeightReference.NONE,
  1628. disableDepthTestDistance: updatedPositions[0].height,
  1629. clampToGround: true
  1630. }
  1631. });
  1632. if (options2.label) {
  1633. let label2 = options2.label || {};
  1634. label2.text = Cesium.defaultValue(label2.text, "");
  1635. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  1636. if (label2.fillColor instanceof Cesium.Color) {
  1637. label2.fillColor = label2.fillColor;
  1638. } else if (label2.fillColor instanceof Array) {
  1639. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  1640. } else if (typeof label2.fillColor === "string") {
  1641. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  1642. } else {
  1643. label2.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1644. }
  1645. if (label2.outlineColor instanceof Cesium.Color) {
  1646. label2.outlineColor = label2.outlineColor;
  1647. } else if (label2.outlineColor instanceof Array) {
  1648. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  1649. } else if (typeof label2.outlineColor === "string") {
  1650. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  1651. } else {
  1652. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1653. }
  1654. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  1655. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  1656. if (label2.backgroundColor instanceof Cesium.Color) {
  1657. label2.backgroundColor = label2.backgroundColor;
  1658. } else if (label2.backgroundColor instanceof Array) {
  1659. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  1660. } else if (typeof label2.backgroundColor === "string") {
  1661. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  1662. } else {
  1663. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1664. }
  1665. label2.scale = Cesium.defaultValue(label2.scale, 1);
  1666. entity.label = {
  1667. text: label2.text,
  1668. font: label2.font,
  1669. fillColor: label2.fillColor,
  1670. outlineColor: label2.outlineColor,
  1671. outlineWidth: label2.outlineWidth,
  1672. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1673. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1674. showBackground: label2.showBackground,
  1675. backgroundColor: label2.backgroundColor,
  1676. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1677. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1678. scale: label2.scale,
  1679. clampToGround: true
  1680. };
  1681. if (label2.pixelOffset) {
  1682. label2.pixelOffset.x = Cesium.defaultValue(label2.pixelOffset.x, 0);
  1683. label2.pixelOffset.y = Cesium.defaultValue(label2.pixelOffset.y, 0);
  1684. entity.label.pixelOffset = new Cesium.Cartesian2(label2.pixelOffset.x, label2.pixelOffset.y);
  1685. }
  1686. if (label2.scaleByDistance) {
  1687. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  1688. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  1689. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  1690. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  1691. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  1692. }
  1693. }
  1694. resolve2(entity);
  1695. });
  1696. });
  1697. },
  1698. addBillboardByGeoJson: function(geoJsonUrl, options2) {
  1699. return new Promise((resolve2, reject2) => {
  1700. let viewer2 = this._viewer;
  1701. if (!Cesium.defined(geoJsonUrl)) {
  1702. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1703. }
  1704. options2 = options2 || {};
  1705. options2.id = options2.id || setSessionid$1();
  1706. let billboard = options2.billboard || {};
  1707. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  1708. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1709. let label2 = options2.label || {};
  1710. label2.text = Cesium.defaultValue(label2.text, "");
  1711. label2.textField = Cesium.defaultValue(label2.textField, "");
  1712. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  1713. if (label2.fillColor instanceof Cesium.Color) {
  1714. label2.fillColor = label2.fillColor;
  1715. } else if (label2.fillColor instanceof Array) {
  1716. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  1717. } else if (typeof label2.fillColor === "string") {
  1718. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  1719. } else {
  1720. label2.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1721. }
  1722. if (label2.outlineColor instanceof Cesium.Color) {
  1723. label2.outlineColor = label2.outlineColor;
  1724. } else if (label2.outlineColor instanceof Array) {
  1725. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  1726. } else if (typeof label2.outlineColor === "string") {
  1727. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  1728. } else {
  1729. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1730. }
  1731. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  1732. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  1733. if (label2.backgroundColor instanceof Cesium.Color) {
  1734. label2.backgroundColor = label2.backgroundColor;
  1735. } else if (label2.backgroundColor instanceof Array) {
  1736. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  1737. } else if (typeof label2.backgroundColor === "string") {
  1738. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  1739. } else {
  1740. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1741. }
  1742. label2.scale = Cesium.defaultValue(label2.scale, 1);
  1743. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  1744. dataSource.load(geoJsonUrl, {
  1745. clampToGround: true
  1746. }).then(function(data) {
  1747. viewer2.dataSources.add(data);
  1748. const entities2 = data.entities.values;
  1749. entities2.forEach((entity) => {
  1750. entity.billboard = {
  1751. image: billboard.imgUrl,
  1752. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1753. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1754. scale: billboard.scale,
  1755. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1756. };
  1757. let labelText = label2.text;
  1758. if (entity.properties[label2.textField]) {
  1759. labelText = entity.properties[label2.textField]._value;
  1760. }
  1761. if (labelText === "") {
  1762. labelText = (i + 1).toString();
  1763. }
  1764. entity.label = {
  1765. text: labelText.toString(),
  1766. font: label2.font,
  1767. fillColor: label2.fillColor,
  1768. outlineColor: label2.outlineColor,
  1769. outlineWidth: label2.outlineWidth,
  1770. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1771. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1772. showBackground: label2.showBackground,
  1773. backgroundColor: label2.backgroundColor,
  1774. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1775. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1776. scale: label2.scale
  1777. };
  1778. if (label2.scaleByDistance) {
  1779. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  1780. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  1781. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  1782. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  1783. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  1784. }
  1785. });
  1786. });
  1787. });
  1788. },
  1789. addGltf: function(options2) {
  1790. let viewer2 = this._viewer;
  1791. return new Promise((resolve2, reject2) => {
  1792. if (!Cesium.defined(options2.points)) {
  1793. resolve2("options.points is required.");
  1794. throw new Cesium.DeveloperError("options.points is required.");
  1795. }
  1796. if (!Cesium.defined(options2.url)) {
  1797. resolve2("options.url is required.");
  1798. throw new Cesium.DeveloperError("options.url is required.");
  1799. }
  1800. options2.id = options2.id || setSessionid$1();
  1801. options2.heading = Cesium.defaultValue(options2.heading, 0);
  1802. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  1803. options2.roll = Cesium.defaultValue(options2.roll, 0);
  1804. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  1805. let position2 = void 0;
  1806. if (options2.points instanceof Cesium.Cartesian3) {
  1807. position2 = options2.points;
  1808. } else {
  1809. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1810. }
  1811. var heading = Cesium.Math.toRadians(options2.heading);
  1812. var pitch = options2.pitch;
  1813. var roll = options2.roll;
  1814. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1815. var modelGltf = viewer2.entities.add({
  1816. id: options2.id,
  1817. position: position2,
  1818. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  1819. model: {
  1820. uri: options2.url,
  1821. incrementallyLoadTextures: true,
  1822. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1823. colorBlendAmount: 0.1,
  1824. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  1825. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1826. runAnimations: true,
  1827. show: true,
  1828. debugWireframe: false,
  1829. debugShowBoundingVolume: false
  1830. }
  1831. });
  1832. if (options2.minimumPixelSize) {
  1833. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  1834. }
  1835. if (options2.maximumScale) {
  1836. modelGltf.model.maximumScale = options2.maximumScale;
  1837. }
  1838. if (options2.silhouetteColor) {
  1839. if (options2.silhouetteColor instanceof Cesium.Color) {
  1840. options2.silhouetteColor = label.silhouetteColor;
  1841. } else if (options2.silhouetteColor instanceof Array) {
  1842. options2.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  1843. } else if (typeof options2.silhouetteColor === "string") {
  1844. options2.silhouetteColor = new Cesium.Color.fromCssColorString(options2.silhouetteColor);
  1845. } else {
  1846. options2.silhouetteColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1847. }
  1848. }
  1849. window[options2.id] = modelGltf;
  1850. resolve2(options2.id);
  1851. });
  1852. },
  1853. addModelFromGltf(points2, options2) {
  1854. let viewer2 = this._viewer;
  1855. return new Promise((resolve2, reject2) => {
  1856. if (!Cesium.defined(options2.points)) {
  1857. resolve2("options.points is required.");
  1858. throw new Cesium.DeveloperError("options.points is required.");
  1859. }
  1860. if (!Cesium.defined(options2.url)) {
  1861. resolve2("options.url is required.");
  1862. throw new Cesium.DeveloperError("options.url is required.");
  1863. }
  1864. options2.id = options2.id || setSessionid$1();
  1865. options2.scale = Cesium.defaultValue(options2.scale, 1);
  1866. let position2 = void 0;
  1867. if (options2.points instanceof Cesium.Cartesian3) {
  1868. position2 = options2.points;
  1869. } else {
  1870. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1871. }
  1872. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  1873. let model = viewer2.scene.primitives.add(
  1874. Cesium.Model.fromGltf({
  1875. show: true,
  1876. url: options2.url,
  1877. modelMatrix,
  1878. lightColor: new Cesium.Cartesian3(10, 10, 10),
  1879. debugWireframe: false,
  1880. debugShowBoundingVolume: false
  1881. })
  1882. );
  1883. model.readyPromise.then(function() {
  1884. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  1885. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  1886. });
  1887. window[options2.id] = model;
  1888. resolve2(options2.id);
  1889. });
  1890. }
  1891. });
  1892. class PolylineObject {
  1893. constructor(viewer2) {
  1894. if (!viewer2)
  1895. throw new Cesium.DeveloperError("no viewer object!");
  1896. this._viewer = viewer2;
  1897. }
  1898. }
  1899. Object.assign(PolylineObject.prototype, {
  1900. addPolyline: function(points2, options2) {
  1901. this._viewer;
  1902. return new Promise((resolve2, reject2) => {
  1903. if (!Cesium.defined(points2)) {
  1904. throw new Cesium.DeveloperError("points is required.");
  1905. }
  1906. if (points2.length < 2) {
  1907. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1908. }
  1909. let positions;
  1910. if (points2[0] instanceof Cesium.Cartesian3) {
  1911. positions = points2;
  1912. } else {
  1913. positions = points2.map((point2) => {
  1914. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1915. });
  1916. }
  1917. options2 = options2 || {};
  1918. options2 = options2 || {};
  1919. options2.id = options2.id || setSessionid$1();
  1920. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1921. options2.width = Cesium.defaultValue(options2.width, 3);
  1922. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1923. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1924. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1925. let material = new PolylineDirectionMaterialProperty(options2);
  1926. let entity = new Cesium.Entity({
  1927. name: "line",
  1928. polyline: {
  1929. positions,
  1930. width: options2.width,
  1931. material,
  1932. distanceDisplayCondition
  1933. }
  1934. });
  1935. if (options2.clampToGround) {
  1936. entity.polyline.clampToGround = true;
  1937. }
  1938. resolve2(entity);
  1939. });
  1940. },
  1941. drawPolylineByGeoJson: function(geoJsonUrl, options2) {
  1942. return new Promise((resolve2, reject2) => {
  1943. let viewer2 = this._viewer;
  1944. if (!Cesium.defined(geoJsonUrl)) {
  1945. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1946. }
  1947. options2 = options2 || {};
  1948. options2.id = options2.id || setSessionid$1();
  1949. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1950. options2.width = Cesium.defaultValue(options2.width, 3);
  1951. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1952. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1953. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  1954. clampToGround: options2.clampToGround
  1955. });
  1956. promise.then((dataSource) => {
  1957. viewer2.dataSources.add(dataSource);
  1958. dataSource.name = options2.id;
  1959. let entities2 = dataSource.entities.values;
  1960. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1961. let material = new PolylineDirectionMaterialProperty(options2);
  1962. for (var i2 = 0; i2 < entities2.length; i2++) {
  1963. var entity = entities2[i2];
  1964. entity.polyline.distanceDisplayCondition = distanceDisplayCondition;
  1965. entity.polyline.material = material;
  1966. entity.polyline.width = options2.width;
  1967. if (options2.clampToGround) {
  1968. entity.polyline.clampToGround = true;
  1969. }
  1970. }
  1971. resolve2(entities2);
  1972. });
  1973. });
  1974. },
  1975. PolylineLinkPulseMaterialProperty: function(points2, options2) {
  1976. return new Promise((resolve2, reject2) => {
  1977. if (!Cesium.defined(points2)) {
  1978. throw new Cesium.DeveloperError("points is required.");
  1979. }
  1980. if (points2.length < 2) {
  1981. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1982. }
  1983. let positions = points2.map((point2) => {
  1984. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1985. });
  1986. options2 = options2 || {};
  1987. options2.id = options2.id || setSessionid$1();
  1988. options2.width = options2.width || 5;
  1989. let material = new PolylineDirectionMaterialProperty(options2);
  1990. let entity = this._viewer.entities.add({
  1991. id: options2.id,
  1992. name: "Pulse line",
  1993. polyline: {
  1994. positions,
  1995. width: options2.width,
  1996. material,
  1997. clampToGround: true
  1998. }
  1999. });
  2000. resolve2(entity);
  2001. });
  2002. },
  2003. PolylineArrowMaterialProperty: function(points2, options2) {
  2004. return new Promise((resolve2, reject2) => {
  2005. if (!Cesium.defined(points2)) {
  2006. throw new Cesium.DeveloperError("points is required.");
  2007. }
  2008. if (points2.length < 2) {
  2009. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2010. }
  2011. let positions = points2.map((point2) => {
  2012. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2013. });
  2014. options2 = options2 || {};
  2015. options2.id = options2.id || setSessionid$1();
  2016. options2.width = options2.width || 5;
  2017. let material = new PolylineDirectionMaterialProperty(options2);
  2018. let entity = this._viewer.entities.add({
  2019. id: options2.id,
  2020. name: "Pulse line",
  2021. polyline: {
  2022. positions,
  2023. width: options2.width,
  2024. material,
  2025. clampToGround: true
  2026. }
  2027. });
  2028. resolve2(entity);
  2029. });
  2030. },
  2031. drawGlowingLine(points2, options2) {
  2032. return new Promise((resolve2, reject2) => {
  2033. if (!Cesium.defined(points2)) {
  2034. throw new Cesium.DeveloperError("points is required.");
  2035. }
  2036. if (points2.length < 2) {
  2037. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2038. }
  2039. let positions = points2.map((point2) => {
  2040. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2041. });
  2042. options2 = options2 || {};
  2043. options2.id = options2.id || setSessionid$1();
  2044. if (options2.color) {
  2045. if (options2.color instanceof Array) {
  2046. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2047. } else if (typeof options2.color === "string") {
  2048. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2049. } else {
  2050. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2051. }
  2052. }
  2053. options2.width = options2.width || 5;
  2054. options2.glowPower = options2.glowPower || 0.25;
  2055. options2.taperPower = options2.taperPower || 1;
  2056. let entity = this._viewer.entities.add({
  2057. id: options2.id,
  2058. name: "Glowing blue line on the surface",
  2059. polyline: {
  2060. clampToGround: true,
  2061. positions,
  2062. width: options2.width,
  2063. followSurface: true,
  2064. material: new Cesium.PolylineGlowMaterialProperty({
  2065. color: options2.color,
  2066. glowPower: options2.glowPower,
  2067. taperPower: options2.taperPower
  2068. })
  2069. }
  2070. });
  2071. resolve2(entity);
  2072. });
  2073. },
  2074. drawSpecifyColorLine(points2, options2) {
  2075. return new Promise((resolve2, reject2) => {
  2076. if (!Cesium.defined(points2)) {
  2077. reject2("points is required.");
  2078. }
  2079. if (points2.length < 2) {
  2080. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2081. }
  2082. let positions = points2.map((point2) => {
  2083. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2084. });
  2085. options2 = options2 || {};
  2086. options2.id = options2.id || setSessionid$1();
  2087. if (options2.color) {
  2088. if (options2.color instanceof Array) {
  2089. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2090. } else if (typeof options2.color === "string") {
  2091. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2092. } else {
  2093. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2094. }
  2095. }
  2096. options2.width = options2.width || 5;
  2097. let entity = this._viewer.entities.add({
  2098. id: options2.id,
  2099. name: "Red line on the surface",
  2100. polyline: {
  2101. clampToGround: true,
  2102. positions,
  2103. width: options2.width,
  2104. material: options2.color
  2105. }
  2106. });
  2107. resolve2(entity);
  2108. });
  2109. },
  2110. drawSpecifyColorAndOutlineColorLine(points2, options2) {
  2111. return new Promise((resolve2, reject2) => {
  2112. if (!Cesium.defined(points2)) {
  2113. throw new Cesium.DeveloperError("points is required.");
  2114. }
  2115. if (points2.length < 2) {
  2116. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2117. }
  2118. let positions = points2.map((point2) => {
  2119. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2120. });
  2121. options2 = options2 || {};
  2122. options2.id = options2.id || setSessionid$1();
  2123. if (options2.color) {
  2124. if (options2.color instanceof Array) {
  2125. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2126. } else if (typeof options2.color === "string") {
  2127. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2128. } else {
  2129. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2130. }
  2131. }
  2132. options2.width = options2.width || 5;
  2133. if (options2.outlineColor) {
  2134. if (options2.outlineColor instanceof Array) {
  2135. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  2136. } else if (typeof options2.outlineColor === "string") {
  2137. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  2138. } else {
  2139. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2140. }
  2141. }
  2142. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  2143. let entity = this._viewer.entities.add({
  2144. id: options2.id,
  2145. name: "Orange line with black outline at height and following the surface",
  2146. polyline: {
  2147. clampToGround: true,
  2148. positions,
  2149. width: options2.width,
  2150. material: new Cesium.PolylineOutlineMaterialProperty({
  2151. color: options2.color,
  2152. outlineWidth: options2.outlineWidth,
  2153. outlineColor: options2.outlineColor
  2154. })
  2155. }
  2156. });
  2157. resolve2(entity);
  2158. });
  2159. },
  2160. drawSpecifyColorArrowStaticStateLine(points2, options2) {
  2161. return new Promise((resolve2, reject2) => {
  2162. if (!Cesium.defined(points2)) {
  2163. throw new Cesium.DeveloperError("points is required.");
  2164. }
  2165. if (points2.length < 2) {
  2166. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2167. }
  2168. let positions = points2.map((point2) => {
  2169. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2170. });
  2171. options2 = options2 || {};
  2172. options2.id = options2.id || setSessionid$1();
  2173. if (options2.color) {
  2174. if (options2.color instanceof Array) {
  2175. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2176. } else if (typeof options2.color === "string") {
  2177. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2178. } else {
  2179. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2180. }
  2181. }
  2182. options2.width = options2.width || 5;
  2183. let entity = this._viewer.entities.add({
  2184. id: options2.id,
  2185. name: "Purple straight arrow at height",
  2186. polyline: {
  2187. clampToGround: true,
  2188. positions,
  2189. width: options2.width,
  2190. followSurface: false,
  2191. material: new Cesium.PolylineArrowMaterialProperty(options2.color)
  2192. }
  2193. });
  2194. resolve2(entity);
  2195. });
  2196. },
  2197. drawDashedLine(points2, options2) {
  2198. return new Promise((resolve2, reject2) => {
  2199. if (!Cesium.defined(points2)) {
  2200. throw new Cesium.DeveloperError("points is required.");
  2201. }
  2202. if (points2.length < 2) {
  2203. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2204. }
  2205. let positions = points2.map((point2) => {
  2206. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2207. });
  2208. options2 = options2 || {};
  2209. options2.id = options2.id || setSessionid$1();
  2210. if (options2.color) {
  2211. if (options2.color instanceof Array) {
  2212. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2213. } else if (typeof options2.color === "string") {
  2214. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2215. } else {
  2216. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2217. }
  2218. }
  2219. options2.width = options2.width || 5;
  2220. if (options2.gapColor) {
  2221. if (options2.gapColor instanceof Array) {
  2222. options2.gapColor = new Cesium.Color(options2.gapColor[0] / 255, options2.gapColor[1] / 255, options2.gapColor[2] / 255, options2.gapColor[3]);
  2223. } else if (typeof options2.gapColor === "string") {
  2224. options2.gapColor = new Cesium.Color.fromCssColorString(options2.gapColor);
  2225. } else {
  2226. options2.gapColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2227. }
  2228. }
  2229. options2.dashLength = options2.dashLength || 16;
  2230. options2.dashPattern = options2.dashPattern || 255;
  2231. let entity = this._viewer.entities.add({
  2232. id: options2.id,
  2233. name: "CYAN dashed line",
  2234. polyline: {
  2235. clampToGround: true,
  2236. positions,
  2237. width: options2.width,
  2238. material: new Cesium.PolylineDashMaterialProperty({
  2239. color: options2.color,
  2240. gapColor: options2.gapColor,
  2241. dashLength: options2.dashLength,
  2242. dashPattern: options2.dashPattern
  2243. })
  2244. }
  2245. });
  2246. resolve2(entity);
  2247. });
  2248. }
  2249. });
  2250. function DynamicWallMaterialProperty(options2) {
  2251. this._definitionChanged = new Cesium.Event();
  2252. this._color = void 0;
  2253. this._colorSubscription = void 0;
  2254. this.color = options2.color || Color.BLUE;
  2255. this.duration = options2.duration || 1e3;
  2256. this.trailImage = options2.trailImage;
  2257. this._time = new Date().getTime();
  2258. }
  2259. function _getDirectionWallShader(options2) {
  2260. if (options2 && options2.get) {
  2261. var materail = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;";
  2262. if (options2.direction == "vertical") {
  2263. materail += "vec4 colorImage = texture2D(image, vec2(fract(st.s), fract(float(" + options2.count + ")*st.t" + options2.order + " time)));\n ";
  2264. } else {
  2265. materail += "vec4 colorImage = texture2D(image, vec2(fract(float(" + options2.count + ")*st.s " + options2.order + " time), fract(st.t)));\n ";
  2266. }
  2267. materail += "vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n return material;\n }";
  2268. return materail;
  2269. }
  2270. }
  2271. Object.defineProperties(DynamicWallMaterialProperty.prototype, {
  2272. isConstant: {
  2273. get: function() {
  2274. return false;
  2275. }
  2276. },
  2277. definitionChanged: {
  2278. get: function() {
  2279. return this._definitionChanged;
  2280. }
  2281. },
  2282. color: Cesium.createPropertyDescriptor("color")
  2283. });
  2284. var MaterialType = "wallType" + parseInt(Math.random() * 1e3);
  2285. DynamicWallMaterialProperty.prototype.getType = function(time) {
  2286. return MaterialType;
  2287. };
  2288. DynamicWallMaterialProperty.prototype.getValue = function(time, result) {
  2289. if (!Cesium.defined(result)) {
  2290. result = {};
  2291. }
  2292. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
  2293. result.image = this.trailImage;
  2294. if (this.duration) {
  2295. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  2296. }
  2297. viewer.scene.requestRender();
  2298. return result;
  2299. };
  2300. DynamicWallMaterialProperty.prototype.equals = function(other) {
  2301. return this === other || other instanceof DynamicWallMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2302. };
  2303. Cesium.Material._materialCache.addMaterial(MaterialType, {
  2304. fabric: {
  2305. type: MaterialType,
  2306. uniforms: {
  2307. color: new Cesium.Color(1, 0, 0, 0.5),
  2308. image: Cesium.Material.DefaultImageId,
  2309. time: -20
  2310. },
  2311. source: _getDirectionWallShader({
  2312. get: true,
  2313. count: 3,
  2314. direction: "vertical",
  2315. order: "-"
  2316. })
  2317. },
  2318. translucent: function(material) {
  2319. return true;
  2320. }
  2321. });
  2322. Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
  2323. class WallDiffuseMaterialProperty {
  2324. constructor(options2) {
  2325. this._definitionChanged = new Cesium.Event();
  2326. this._color = void 0;
  2327. this.color = options2.color;
  2328. }
  2329. get isConstant() {
  2330. return false;
  2331. }
  2332. get definitionChanged() {
  2333. return this._definitionChanged;
  2334. }
  2335. getType(time) {
  2336. return Cesium.Material.WallDiffuseMaterialType;
  2337. }
  2338. getValue(time, result) {
  2339. if (!Cesium.defined(result)) {
  2340. result = {};
  2341. }
  2342. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  2343. return result;
  2344. }
  2345. equals(other) {
  2346. return this === other || other instanceof WallDiffuseMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2347. }
  2348. }
  2349. Object.defineProperties(WallDiffuseMaterialProperty.prototype, {
  2350. color: Cesium.createPropertyDescriptor("color")
  2351. });
  2352. Cesium.WallDiffuseMaterialProperty = WallDiffuseMaterialProperty;
  2353. Cesium.Material.WallDiffuseMaterialProperty = "WallDiffuseMaterialProperty";
  2354. Cesium.Material.WallDiffuseMaterialType = "WallDiffuseMaterialType";
  2355. Cesium.Material.WallDiffuseMaterialSource = `
  2356. uniform vec4 color;
  2357. czm_material czm_getMaterial(czm_materialInput materialInput){
  2358. czm_material material = czm_getDefaultMaterial(materialInput);
  2359. vec2 st = materialInput.st;
  2360. material.diffuse = color.rgb * 2.0;
  2361. material.alpha = color.a * (1.0 - fract(st.t)) * 0.8;
  2362. return material;
  2363. }
  2364. `;
  2365. Cesium.Material._materialCache.addMaterial(Cesium.Material.WallDiffuseMaterialType, {
  2366. fabric: {
  2367. type: Cesium.Material.WallDiffuseMaterialType,
  2368. uniforms: {
  2369. color: new Cesium.Color(1, 0, 0, 1)
  2370. },
  2371. source: Cesium.Material.WallDiffuseMaterialSource
  2372. },
  2373. translucent: function(material) {
  2374. return true;
  2375. }
  2376. });
  2377. class WallObject {
  2378. constructor(viewer2) {
  2379. if (!viewer2)
  2380. throw new Cesium.DeveloperError("no viewer object!");
  2381. this._viewer = viewer2;
  2382. }
  2383. }
  2384. Object.assign(WallObject.prototype, {
  2385. drawWallByGeoJson: function(geoJsonUrl, options2) {
  2386. return new Promise((resolve2, reject2) => {
  2387. let _self = this;
  2388. let viewer2 = this._viewer;
  2389. if (!Cesium.defined(geoJsonUrl)) {
  2390. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  2391. }
  2392. options2 = options2 || {};
  2393. options2.id = options2.id || setSessionid$1();
  2394. fetch(geoJsonUrl).then((res) => {
  2395. return res.json();
  2396. }).then((res) => {
  2397. let wall = new Cesium.CustomDataSource(options2.id);
  2398. viewer2.dataSources.add(wall);
  2399. for (var i2 = 0; i2 < res.features.length; i2++) {
  2400. if (res.features[i2].geometry) {
  2401. if (res.features[i2].geometry.type === "MultiLineString") {
  2402. let coordinatesList = res.features[i2].geometry.coordinates;
  2403. for (var j = 0; j < coordinatesList.length; j++) {
  2404. let coordinates = coordinatesList[j];
  2405. let positions = coordinates.map((point2) => {
  2406. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2407. });
  2408. _self.addWall(positions, options2).then((entity) => {
  2409. wall.entities.add(entity);
  2410. });
  2411. }
  2412. } else {
  2413. let coordinates = res.features[i2].geometry.coordinates;
  2414. let positions = coordinates.map((point2) => {
  2415. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2416. });
  2417. _self.addWall(positions, options2).then((entity) => {
  2418. wall.entities.add(entity);
  2419. });
  2420. }
  2421. }
  2422. }
  2423. resolve2(options2.id);
  2424. });
  2425. });
  2426. },
  2427. addWall(points2, options2) {
  2428. return new Promise((resolve2, reject2) => {
  2429. if (!Cesium.defined(points2)) {
  2430. throw new Cesium.DeveloperError("points is required.");
  2431. }
  2432. if (points2.length < 2) {
  2433. reject2("\u5899\u4F53\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2434. }
  2435. let positions;
  2436. if (points2[0] instanceof Cesium.Cartesian3) {
  2437. positions = points2;
  2438. } else {
  2439. positions = points2.map((point2) => {
  2440. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2441. });
  2442. }
  2443. options2 = options2 || {};
  2444. options2.id = options2.id || setSessionid$1();
  2445. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  2446. options2.minimunHeights = options2.minimunHeights !== void 0 && typeof options2.minimunHeights === "number" ? options2.minimunHeights : 0;
  2447. options2.maximumHeights = options2.maximumHeights !== void 0 && typeof options2.maximumHeights === "number" ? options2.maximumHeights : 1e3;
  2448. if (options2.color) {
  2449. if (options2.color instanceof Cesium.Color) {
  2450. options2.color = options2.color;
  2451. } else if (options2.color instanceof Array) {
  2452. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2453. } else if (typeof options2.color === "string") {
  2454. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2455. } else {
  2456. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2457. }
  2458. }
  2459. options2.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  2460. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  2461. options2.count = Cesium.defaultValue(options2.count, 1);
  2462. options2.direction = Cesium.defaultValue(options2.direction, "vertical");
  2463. options2.order = Cesium.defaultValue(options2.order, "-");
  2464. let entity = new Cesium.Entity({
  2465. name: "\u7ACB\u4F53\u5899\u6548\u679C",
  2466. wall: {
  2467. positions,
  2468. maximumHeights: new Array(positions.length).fill(options2.maximumHeights),
  2469. minimunHeights: new Array(positions.length).fill(options2.minimunHeights),
  2470. material: new WallMaterialProperty$1(viewer, {
  2471. trailImage: options2.trailImage,
  2472. color: options2.color,
  2473. duration: options2.duration,
  2474. param: {
  2475. count: options2.count,
  2476. direction: options2.direction,
  2477. order: options2.order
  2478. }
  2479. })
  2480. }
  2481. });
  2482. resolve2(entity);
  2483. });
  2484. }
  2485. });
  2486. class LoadMapData {
  2487. constructor(viewer2) {
  2488. if (!viewer2)
  2489. throw new Cesium.DeveloperError("no viewer object!");
  2490. this._viewer = viewer2;
  2491. this._pointObject = new PointObject(viewer2);
  2492. this._polylineObject = new PolylineObject(viewer2);
  2493. this._wallObject = new WallObject(viewer2);
  2494. }
  2495. _addImageryProvider(id, provider) {
  2496. window[id] = this._viewer.imageryLayers.addImageryProvider(provider);
  2497. }
  2498. _removeImageryProvider(serviceId) {
  2499. this._viewer.imageryLayers.remove(window[serviceId]);
  2500. window[serviceId] = null;
  2501. }
  2502. _addTerrainProvider(provider) {
  2503. this._viewer.terrainProvider = provider;
  2504. }
  2505. _setEllipsoidTerrain() {
  2506. this._viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider({});
  2507. }
  2508. _addScenePrimitives(scenePrimitives) {
  2509. this._viewer.scene.primitives.add(scenePrimitives);
  2510. }
  2511. _removeScenePrimitives(serviceId) {
  2512. this._viewer.scene.primitives.remove(window[serviceId]);
  2513. window[serviceId] = null;
  2514. }
  2515. _guid() {
  2516. function S4() {
  2517. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  2518. }
  2519. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  2520. }
  2521. _transformProjection(provider) {
  2522. let webMercatorTilingScheme = provider.tilingScheme;
  2523. let projection = webMercatorTilingScheme._projection;
  2524. projection.x_project = projection.project;
  2525. projection.project = function(cartographic) {
  2526. let point2;
  2527. return point2 = CoordTransform.WGS84ToGCJ02(
  2528. Cesium.Math.toDegrees(cartographic.longitude),
  2529. Cesium.Math.toDegrees(cartographic.latitude)
  2530. ), projection.x_project(
  2531. new Cesium.Cartographic(
  2532. Cesium.Math.toRadians(point2[0]),
  2533. Cesium.Math.toRadians(point2[1])
  2534. )
  2535. );
  2536. };
  2537. projection.x_unproject = projection.unproject;
  2538. projection.unproject = function(cartesian) {
  2539. let point2, cartographic = projection.x_unproject(cartesian);
  2540. return point2 = CoordTransform.GCJ02ToWGS84(
  2541. Cesium.Math.toDegrees(cartographic.longitude),
  2542. Cesium.Math.toDegrees(cartographic.latitude)
  2543. ), new Cesium.Cartographic(
  2544. Cesium.Math.toRadians(point2[0]),
  2545. Cesium.Math.toRadians(point2[1])
  2546. );
  2547. };
  2548. return provider;
  2549. }
  2550. }
  2551. Object.assign(LoadMapData.prototype, {
  2552. addTerrain(options2) {
  2553. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2554. throw new Cesium.DeveloperError("options.url is required.");
  2555. }
  2556. let _ConstructorOptions = {
  2557. url: options2.url
  2558. };
  2559. if (options2.requestVertexNormals) {
  2560. _ConstructorOptions.requestVertexNormals = options2.requestVertexNormals;
  2561. } else {
  2562. _ConstructorOptions.requestVertexNormals = false;
  2563. }
  2564. if (options2.requestWaterMask) {
  2565. _ConstructorOptions.requestWaterMask = options2.requestWaterMask;
  2566. } else {
  2567. _ConstructorOptions.requestWaterMask = false;
  2568. }
  2569. var terrainProvider = new Cesium.CesiumTerrainProvider(_ConstructorOptions);
  2570. this._addTerrainProvider(terrainProvider);
  2571. this.setTerrainExaggeration(options2);
  2572. },
  2573. addMapboxLayer(options2, callSuccess) {
  2574. if (!Cesium.defined(options2) || !Cesium.defined(options2.styleId)) {
  2575. throw new Cesium.DeveloperError("options.styleId is required.");
  2576. }
  2577. if (!Cesium.defined(options2.accessToken)) {
  2578. throw new Cesium.DeveloperError("options.accessToken is required.");
  2579. }
  2580. options2.id = options2.id || this._guid();
  2581. var imageryProvider = new Cesium.MapboxStyleImageryProvider({
  2582. url: options2.url,
  2583. username: options2.username,
  2584. styleId: options2.styleId,
  2585. accessToken: options2.accessToken,
  2586. scaleFactor: options2.scaleFactor
  2587. });
  2588. this._addImageryProvider(options2.id, imageryProvider);
  2589. this.setLayersStyle({
  2590. serviceId: options2.id,
  2591. alpha: options2.alpha
  2592. });
  2593. if (callSuccess)
  2594. callSuccess(options2.id);
  2595. },
  2596. addUrlTemplateImagery: function(options2, callSuccess) {
  2597. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2598. throw new Cesium.DeveloperError("options.url is required.");
  2599. }
  2600. options2.id = options2.id || this._guid();
  2601. options2.CRS = options2.CRS || "";
  2602. let _ConstructorOptions = {
  2603. url: options2.url
  2604. };
  2605. if (options2.minimumLevel) {
  2606. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2607. }
  2608. if (options2.maximumLevel) {
  2609. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2610. } else {
  2611. _ConstructorOptions.maximumLevel = 18;
  2612. }
  2613. var imageryProvider = new Cesium.UrlTemplateImageryProvider(_ConstructorOptions);
  2614. if (options2.CRS.toUpperCase() === "WGS84") {
  2615. imageryProvider.readyPromise.then(() => {
  2616. this._transformProjection(imageryProvider);
  2617. });
  2618. }
  2619. this._addImageryProvider(options2.id, imageryProvider);
  2620. this.setLayersStyle({
  2621. serviceId: options2.id,
  2622. alpha: options2.alpha
  2623. });
  2624. if (callSuccess)
  2625. callSuccess(options2.id);
  2626. },
  2627. addTileMapServiceImagery: function(options2, callSuccess) {
  2628. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2629. throw new Cesium.DeveloperError("options.url is required.");
  2630. }
  2631. options2.id = options2.id || this._guid();
  2632. let _ConstructorOptions = {
  2633. url: options2.url
  2634. };
  2635. if (options2.minimumLevel) {
  2636. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2637. }
  2638. if (options2.maximumLevel) {
  2639. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2640. } else {
  2641. _ConstructorOptions.maximumLevel = 18;
  2642. }
  2643. var imageryProvider = new Cesium.TileMapServiceImageryProvider(_ConstructorOptions);
  2644. this._addImageryProvider(options2.id, imageryProvider);
  2645. this.setLayersStyle({
  2646. serviceId: options2.id,
  2647. alpha: options2.alpha
  2648. });
  2649. if (callSuccess)
  2650. callSuccess(options2.id);
  2651. },
  2652. addWebMapTileService: function(options2, callSuccess) {
  2653. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2654. throw new Cesium.DeveloperError("options.url is required.");
  2655. }
  2656. if (!Cesium.defined(options2.layers)) {
  2657. throw new Cesium.DeveloperError("options.layers is required.");
  2658. }
  2659. if (!Cesium.defined(options2.style)) {
  2660. throw new Cesium.DeveloperError("options.style is required.");
  2661. }
  2662. if (!Cesium.defined(options2.tileMatrixSetID)) {
  2663. throw new Cesium.DeveloperError("options.tileMatrixSetID is required.");
  2664. }
  2665. options2.id = options2.id || this._guid();
  2666. let _ConstructorOptions = {
  2667. url: options2.url,
  2668. layer: options2.layers,
  2669. style: options2.style,
  2670. tileMatrixSetID: options2.tileMatrixSetID,
  2671. format: Cesium.defaultValue(options2.format, "image/png")
  2672. };
  2673. if (options2.tileMatrixLabels) {
  2674. _ConstructorOptions.tileMatrixLabels = options2.tileMatrixLabels;
  2675. }
  2676. if (options2.minimumLevel) {
  2677. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2678. }
  2679. if (options2.maximumLevel) {
  2680. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2681. } else {
  2682. _ConstructorOptions.maximumLevel = 18;
  2683. }
  2684. let imageryProvider = new Cesium.WebMapTileServiceImageryProvider(_ConstructorOptions);
  2685. this._addImageryProvider(options2.id, imageryProvider);
  2686. this.setLayersStyle({
  2687. serviceId: options2.id,
  2688. alpha: options2.alpha
  2689. });
  2690. if (callSuccess)
  2691. callSuccess(options2.id);
  2692. },
  2693. addWebMapService: function(options2, callSuccess) {
  2694. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2695. throw new Cesium.DeveloperError("options.url is required.");
  2696. }
  2697. if (!Cesium.defined(options2.layers)) {
  2698. throw new Cesium.DeveloperError("options.layers is required.");
  2699. }
  2700. options2.id = options2.id || this._guid();
  2701. let _ConstructorOptions = {
  2702. url: options2.url,
  2703. layers: options2.layers
  2704. };
  2705. if (options2.parameters) {
  2706. _ConstructorOptions.parameters = options2.parameters;
  2707. } else {
  2708. _ConstructorOptions.parameters = {
  2709. service: "WMS",
  2710. transparent: true,
  2711. request: "GetMap",
  2712. format: "image/png"
  2713. };
  2714. }
  2715. if (options2.minimumLevel) {
  2716. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2717. }
  2718. if (options2.maximumLevel) {
  2719. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2720. } else {
  2721. _ConstructorOptions.maximumLevel = 18;
  2722. }
  2723. let imageryProvider = new Cesium.WebMapServiceImageryProvider(_ConstructorOptions);
  2724. this._addImageryProvider(options2.id, imageryProvider);
  2725. this.setLayersStyle({
  2726. serviceId: options2.id,
  2727. alpha: options2.alpha
  2728. });
  2729. if (callSuccess)
  2730. callSuccess(options2.id);
  2731. },
  2732. addArcGisMapServer: function(options2, callSuccess) {
  2733. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2734. throw new Cesium.DeveloperError("options.url is required.");
  2735. }
  2736. options2.id = options2.id || this._guid();
  2737. let _ConstructorOptions = {
  2738. url: options2.url
  2739. };
  2740. if (options2.layers) {
  2741. _ConstructorOptions.layers = options2.layers;
  2742. }
  2743. let imageryProvider = new Cesium.ArcGisMapServerImageryProvider(_ConstructorOptions);
  2744. this._addImageryProvider(options2.id, imageryProvider);
  2745. this.setLayersStyle({
  2746. serviceId: options2.id,
  2747. alpha: options2.alpha
  2748. });
  2749. if (callSuccess)
  2750. callSuccess(options2.id);
  2751. },
  2752. addCesium3DTileset: function(options2, callSuccess) {
  2753. let _self = this;
  2754. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2755. throw new Cesium.DeveloperError("options.url is required.");
  2756. }
  2757. options2.id = options2.id || this._guid();
  2758. let _ConstructorOptions = {
  2759. url: options2.url,
  2760. skipLevelOfDetail: true
  2761. };
  2762. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2763. tileSetModel.readyPromise.then((tileset) => {
  2764. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2765. window[options2.id] = tileset;
  2766. _self._addScenePrimitives(tileset);
  2767. _self.set3DTilePosition({
  2768. serviceId: options2.id,
  2769. height: options2.height
  2770. });
  2771. _self.set3DTileStyle({
  2772. serviceId: options2.id,
  2773. alpha: options2.alpha
  2774. });
  2775. if (callSuccess)
  2776. callSuccess(options2.id);
  2777. }).catch(function(error) {
  2778. console.log(error);
  2779. });
  2780. },
  2781. addCesium3DTilesetBm: function(options2, callSuccess) {
  2782. let _self = this;
  2783. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2784. throw new Cesium.DeveloperError("options.url is required.");
  2785. }
  2786. options2.id = options2.id || this._guid();
  2787. let _ConstructorOptions = {
  2788. url: options2.url,
  2789. skipLevelOfDetail: true
  2790. };
  2791. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2792. tileSetModel.readyPromise.then((tileset) => {
  2793. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2794. window[options2.id] = tileset;
  2795. _self._addScenePrimitives(tileset);
  2796. _self.set3DTileBMStyle({
  2797. serviceId: options2.id,
  2798. color: options2.color
  2799. });
  2800. if (callSuccess)
  2801. callSuccess(options2.id);
  2802. }).catch(function(error) {
  2803. console.log(error);
  2804. });
  2805. },
  2806. addPolygonImageMaterial: function(options2, callSuccess) {
  2807. if (!Cesium.defined(options2.points)) {
  2808. throw new Cesium.DeveloperError("options.points is required.");
  2809. }
  2810. if (options2.points.length < 3) {
  2811. reject("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  2812. }
  2813. let positions = [];
  2814. if (options2.points instanceof Cesium.Cartesian3) {
  2815. positions = options2.points;
  2816. } else {
  2817. positions = options2.points.map((point2) => {
  2818. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2819. });
  2820. }
  2821. options2.id = options2.id || this._guid();
  2822. options2.alpha = options2.alpha || 1;
  2823. this.classificationType = Cesium.ClassificationType.BOTH;
  2824. if (options2.classificationType === "Terrain") {
  2825. this.classificationType = Cesium.ClassificationType.TERRAIN;
  2826. } else if (options2.classificationType === "3DTiles") {
  2827. this.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
  2828. }
  2829. if (options2.url) {
  2830. if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(this._viewer.scene)) {
  2831. window.alert("Terrain Entity materials are not supported on this platform");
  2832. }
  2833. this.material = new Cesium.ImageMaterialProperty({
  2834. image: options2.url,
  2835. repeat: Cesium.Cartesian2(1, 1),
  2836. transparent: true,
  2837. color: Cesium.Color.WHITE.withAlpha(options2.alpha)
  2838. });
  2839. } else {
  2840. this.material = Cesium.Color.RED.withAlpha(options2.alpha);
  2841. }
  2842. window[options2.id] = this._viewer.entities.add({
  2843. id: options2.id,
  2844. polygon: {
  2845. hierarchy: positions,
  2846. material: this.material,
  2847. classificationType: this.classificationType
  2848. }
  2849. });
  2850. if (callSuccess)
  2851. callSuccess(options2.id);
  2852. },
  2853. addEntitiesGltf: function(options2, callSuccess) {
  2854. let viewer2 = this._viewer;
  2855. if (!Cesium.defined(options2.points)) {
  2856. resolve("options.points is required.");
  2857. throw new Cesium.DeveloperError("options.points is required.");
  2858. }
  2859. if (!Cesium.defined(options2.url)) {
  2860. resolve("options.url is required.");
  2861. throw new Cesium.DeveloperError("options.url is required.");
  2862. }
  2863. options2.id = options2.id || this._guid();
  2864. options2.heading = Cesium.defaultValue(options2.heading, 0);
  2865. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  2866. options2.roll = Cesium.defaultValue(options2.roll, 0);
  2867. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  2868. let position2 = void 0;
  2869. if (options2.points instanceof Cesium.Cartesian3) {
  2870. position2 = options2.points;
  2871. } else {
  2872. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2873. }
  2874. var heading = Cesium.Math.toRadians(options2.heading);
  2875. var pitch = options2.pitch;
  2876. var roll = options2.roll;
  2877. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  2878. var modelGltf = viewer2.entities.add({
  2879. id: options2.id,
  2880. position: position2,
  2881. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  2882. model: {
  2883. uri: options2.url,
  2884. incrementallyLoadTextures: true,
  2885. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  2886. colorBlendAmount: 0.1,
  2887. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  2888. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  2889. runAnimations: true,
  2890. show: true,
  2891. debugWireframe: false,
  2892. debugShowBoundingVolume: false
  2893. }
  2894. });
  2895. if (options2.minimumPixelSize) {
  2896. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  2897. }
  2898. if (options2.maximumScale) {
  2899. modelGltf.model.maximumScale = options2.maximumScale;
  2900. }
  2901. if (options2.silhouetteColor) {
  2902. modelGltf.model.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  2903. }
  2904. window[options2.id] = modelGltf;
  2905. if (callSuccess)
  2906. callSuccess(options2.id);
  2907. },
  2908. addScenePrimitivesGltf(options2, callSuccess) {
  2909. let viewer2 = this._viewer;
  2910. if (!Cesium.defined(options2.points)) {
  2911. resolve("options.points is required.");
  2912. throw new Cesium.DeveloperError("options.points is required.");
  2913. }
  2914. if (!Cesium.defined(options2.url)) {
  2915. resolve("options.url is required.");
  2916. throw new Cesium.DeveloperError("options.url is required.");
  2917. }
  2918. options2.id = options2.id || this._guid();
  2919. options2.scale = Cesium.defaultValue(options2.scale, 1);
  2920. let position2 = void 0;
  2921. if (options2.points instanceof Cesium.Cartesian3) {
  2922. position2 = options2.points;
  2923. } else {
  2924. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2925. }
  2926. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  2927. let model = viewer2.scene.primitives.add(
  2928. Cesium.Model.fromGltf({
  2929. show: true,
  2930. url: options2.url,
  2931. modelMatrix,
  2932. lightColor: new Cesium.Cartesian3(10, 10, 10),
  2933. scale: options2.scale,
  2934. debugWireframe: false,
  2935. debugShowBoundingVolume: false
  2936. })
  2937. );
  2938. model.readyPromise.then(function() {
  2939. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  2940. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  2941. });
  2942. window[options2.id] = model;
  2943. if (callSuccess)
  2944. callSuccess(options2.id);
  2945. },
  2946. addPolylineByGeoJson(options2, callSuccess) {
  2947. let _self = this;
  2948. this._viewer;
  2949. if (!Cesium.defined(options2.url)) {
  2950. resolve("options.url is required.");
  2951. throw new Cesium.DeveloperError("options.url is required.");
  2952. }
  2953. options2 = options2 || {};
  2954. options2.id = options2.id || this._guid();
  2955. let promise = Cesium.GeoJsonDataSource.load(options2.url, {
  2956. clampToGround: options2.clampToGround
  2957. });
  2958. promise.then((dataSource) => {
  2959. _self._viewer.dataSources.add(dataSource);
  2960. dataSource.name = options2.id;
  2961. let entities2 = dataSource.entities.values;
  2962. let material = new PolylineDirectionMaterialProperty(options2);
  2963. for (var i2 = 0; i2 < entities2.length; i2++) {
  2964. var entity = entities2[i2];
  2965. entity.polyline.material = material;
  2966. entity.polyline.width = options2.width;
  2967. if (options2.clampToGround) {
  2968. entity.polyline.clampToGround = true;
  2969. }
  2970. }
  2971. if (callSuccess)
  2972. callSuccess(options2.id);
  2973. });
  2974. },
  2975. addPolylineByJson(options2, callSuccess) {
  2976. let _self = this;
  2977. let viewer2 = this._viewer;
  2978. if (!Cesium.defined(options2.url)) {
  2979. resolve("options.url is required.");
  2980. throw new Cesium.DeveloperError("options.url is required.");
  2981. }
  2982. options2 = options2 || {};
  2983. options2.id = options2.id || this._guid();
  2984. fetch(options2.url).then((res) => {
  2985. return res.json();
  2986. }).then((res) => {
  2987. let dataSource = new Cesium.CustomDataSource(options2.id);
  2988. viewer2.dataSources.add(dataSource);
  2989. for (var i2 = 0; i2 < res.features.length; i2++) {
  2990. if (res.features[i2].geometry) {
  2991. if (res.features[i2].geometry.type === "MultiLineString") {
  2992. let coordinatesList = res.features[i2].geometry.coordinates;
  2993. for (var j = 0; j < coordinatesList.length; j++) {
  2994. let coordinates = coordinatesList[j];
  2995. let positions = coordinates.map((point2) => {
  2996. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2997. });
  2998. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  2999. dataSource.entities.add(entity);
  3000. });
  3001. }
  3002. } else {
  3003. let coordinates = res.features[i2].geometry.coordinates;
  3004. let positions = coordinates.map((point2) => {
  3005. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3006. });
  3007. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  3008. dataSource.entities.add(entity);
  3009. });
  3010. }
  3011. }
  3012. }
  3013. if (callSuccess)
  3014. callSuccess(options2.id);
  3015. });
  3016. },
  3017. addBillboardByGeoJson(options2, callSuccess) {
  3018. let viewer2 = this._viewer;
  3019. if (!Cesium.defined(options2.url)) {
  3020. resolve("options.url is required.");
  3021. throw new Cesium.DeveloperError("options.url is required.");
  3022. }
  3023. options2 = options2 || {};
  3024. options2.id = options2.id || this._guid();
  3025. let billboard = options2.billboard || {};
  3026. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  3027. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  3028. billboard.pixelOffset = Cesium.defaultValue(billboard.pixelOffset, 0);
  3029. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  3030. dataSource.load(options2.url, {
  3031. clampToGround: true
  3032. }).then(function(data) {
  3033. viewer2.dataSources.add(data);
  3034. const entities2 = data.entities.values;
  3035. entities2.forEach((entity) => {
  3036. entity.billboard = {
  3037. image: billboard.imgUrl,
  3038. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  3039. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  3040. scale: billboard.scale,
  3041. pixelOffset: new Cesium.Cartesian2(0, billboard.pixelOffset),
  3042. disableDepthTestDistance: Number.POSITIVE_INFINITY
  3043. };
  3044. if (billboard.scaleByDistance) {
  3045. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  3046. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  3047. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  3048. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  3049. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  3050. }
  3051. if (options2.label) {
  3052. let label2 = options2.label || {};
  3053. label2.text = Cesium.defaultValue(label2.text, "");
  3054. label2.textField = Cesium.defaultValue(label2.textField, "");
  3055. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  3056. if (label2.fillColor instanceof Array) {
  3057. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  3058. } else if (typeof options2.color === "string") {
  3059. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  3060. } else {
  3061. label2.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  3062. }
  3063. if (label2.outlineColor instanceof Array) {
  3064. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  3065. } else if (label2.outlineColor instanceof String) {
  3066. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  3067. } else {
  3068. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3069. }
  3070. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  3071. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  3072. if (label2.backgroundColor instanceof Array) {
  3073. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  3074. } else if (label2.backgroundColor instanceof String) {
  3075. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  3076. } else {
  3077. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3078. }
  3079. label2.pixelOffset = Cesium.defaultValue(label2.pixelOffset, 0);
  3080. label2.scale = Cesium.defaultValue(label2.scale, 1);
  3081. label2.near = Cesium.defaultValue(label2.near, 150);
  3082. label2.nearValue = Cesium.defaultValue(label2.nearValue, 1);
  3083. label2.far = Cesium.defaultValue(label2.far, 2400);
  3084. label2.farValue = Cesium.defaultValue(label2.farValue, 0);
  3085. let labelText = label2.text;
  3086. if (entity.properties[label2.textField]) {
  3087. labelText = entity.properties[label2.textField]._value;
  3088. }
  3089. if (labelText === "") {
  3090. labelText = (i + 1).toString();
  3091. }
  3092. entity.label = {
  3093. text: labelText.toString(),
  3094. font: label2.font,
  3095. fillColor: label2.fillColor,
  3096. outlineColor: label2.outlineColor,
  3097. outlineWidth: label2.outlineWidth,
  3098. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  3099. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  3100. showBackground: label2.showBackground,
  3101. backgroundColor: label2.backgroundColor,
  3102. backgroundPadding: new Cesium.Cartesian2(6, 6),
  3103. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  3104. pixelOffset: new Cesium.Cartesian2(0, label2.pixelOffset),
  3105. scale: label2.scale
  3106. };
  3107. if (label2.scaleByDistance) {
  3108. label2.scaleByDistance.near = Cesium.defaultValue(label2.scaleByDistance.near, 0);
  3109. label2.scaleByDistance.nearValue = Cesium.defaultValue(label2.scaleByDistance.nearValue, 0);
  3110. label2.scaleByDistance.far = Cesium.defaultValue(label2.scaleByDistance.far, 1);
  3111. label2.scaleByDistance.farValue = Cesium.defaultValue(label2.scaleByDistance.farValue, 0);
  3112. entity.label.scaleByDistance = new Cesium.NearFarScalar(label2.scaleByDistance.near, label2.scaleByDistance.nearValue, label2.scaleByDistance.far, label2.scaleByDistance.farValue);
  3113. }
  3114. }
  3115. });
  3116. if (callSuccess)
  3117. callSuccess(options2.id);
  3118. });
  3119. },
  3120. addBillboardByJson(options2, callSuccess) {
  3121. let _self = this;
  3122. let viewer2 = this._viewer;
  3123. if (!Cesium.defined(options2.url)) {
  3124. resolve("options.url is required.");
  3125. throw new Cesium.DeveloperError("options.url is required.");
  3126. }
  3127. options2 = options2 || {};
  3128. let id = options2.id || this._guid();
  3129. viewer2.terrainProvider;
  3130. fetch(options2.url).then((res) => {
  3131. return res.json();
  3132. }).then((res) => {
  3133. let dataSource = new Cesium.CustomDataSource(options2.id);
  3134. viewer2.dataSources.add(dataSource);
  3135. let promiseList = [];
  3136. for (var i2 = 0; i2 < res.features.length; i2++) {
  3137. let geometry2 = res.features[i2].geometry;
  3138. let properties = res.features[i2].properties;
  3139. if (geometry2) {
  3140. if (properties) {
  3141. options2.properties = properties;
  3142. if (options2.label) {
  3143. let label2 = options2.label || {};
  3144. if (properties[label2.textField]) {
  3145. options2.label.text = properties[label2.textField];
  3146. }
  3147. }
  3148. }
  3149. if (geometry2.type === "MultiPoint") {
  3150. let coordinatesList = geometry2.coordinates;
  3151. for (var j = 0; j < coordinatesList.length; j++) {
  3152. let coordinates = coordinatesList[j];
  3153. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3154. _self._pointObject.addBillboard(position2, options2).then((entity) => {
  3155. dataSource.entities.add(entity);
  3156. });
  3157. }
  3158. } else {
  3159. let coordinates = geometry2.coordinates;
  3160. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3161. let result = _self._pointObject.addBillboard(position2, options2);
  3162. promiseList.push(result);
  3163. }
  3164. }
  3165. }
  3166. Promise.all(promiseList).then((itemList) => {
  3167. console.log("itemList", itemList);
  3168. itemList.forEach((item, index2) => {
  3169. dataSource.entities.add(item);
  3170. });
  3171. if (callSuccess)
  3172. callSuccess(id);
  3173. });
  3174. });
  3175. },
  3176. addWallByJson(options2, callSuccess) {
  3177. let _self = this;
  3178. let viewer2 = this._viewer;
  3179. if (!Cesium.defined(options2.url)) {
  3180. resolve("options.url is required.");
  3181. throw new Cesium.DeveloperError("options.url is required.");
  3182. }
  3183. options2 = options2 || {};
  3184. options2.id = options2.id || setSessionid();
  3185. fetch(options2.url).then((res) => {
  3186. return res.json();
  3187. }).then((res) => {
  3188. let dataSource = new Cesium.CustomDataSource(options2.id);
  3189. viewer2.dataSources.add(dataSource);
  3190. for (var i2 = 0; i2 < res.features.length; i2++) {
  3191. if (res.features[i2].geometry) {
  3192. if (res.features[i2].geometry.type === "MultiLineString") {
  3193. let coordinatesList = res.features[i2].geometry.coordinates;
  3194. for (var j = 0; j < coordinatesList.length; j++) {
  3195. let coordinates = coordinatesList[j];
  3196. let positions = coordinates.map((point2) => {
  3197. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3198. });
  3199. _self._wallObject.addWall(positions, options2).then((entity) => {
  3200. dataSource.entities.add(entity);
  3201. });
  3202. }
  3203. } else {
  3204. let coordinates = res.features[i2].geometry.coordinates;
  3205. let positions = coordinates.map((point2) => {
  3206. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3207. });
  3208. _self._wallObject.addWall(positions, options2).then((entity) => {
  3209. dataSource.entities.add(entity);
  3210. });
  3211. }
  3212. }
  3213. }
  3214. if (callSuccess)
  3215. callSuccess(options2.id);
  3216. });
  3217. }
  3218. });
  3219. Object.assign(LoadMapData.prototype, {
  3220. set3DTileStyle(options2) {
  3221. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3222. throw new Cesium.DeveloperError("options.serviceId is required.");
  3223. }
  3224. if (Cesium.defined(options2.alpha)) {
  3225. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3226. }
  3227. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3228. let tileset = window[options2.serviceId];
  3229. tileset.style = new Cesium.Cesium3DTileStyle({
  3230. color: "color('rgba(255,255,255," + options2.alpha + ")')"
  3231. });
  3232. },
  3233. set3DTileBMStyle: function(options2) {
  3234. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3235. throw new Cesium.DeveloperError("options.serviceId is required.");
  3236. }
  3237. options2.color = options2.color ? "vec4(" + options2.color[0] + "/255, " + options2.color[1] + "/255, " + options2.color[2] + "/255, " + options2.color[3] + ")" : "vec4(0.0, 0.58, 0.86, 1.0)";
  3238. let tileset = window[options2.serviceId];
  3239. tileset.readyPromise.then((tileset2) => {
  3240. tileset2.boundingSphere.radius;
  3241. if (tileset2.boundingSphere.radius > 1e4) {
  3242. tileset2.boundingSphere.radius / 10;
  3243. }
  3244. tileset2.style = new Cesium.Cesium3DTileStyle({
  3245. color: options2.color
  3246. });
  3247. tileset2.tileVisible.addEventListener((tile) => {
  3248. let content = tile.content;
  3249. let featuresLength = content.featuresLength;
  3250. for (let i2 = 0; i2 < featuresLength; i2 += 2) {
  3251. const feature2 = content.getFeature(i2);
  3252. const model = feature2.content._model;
  3253. if (model && model._sourcePrograms && model._rendererResources) {
  3254. Object.keys(model._sourcePrograms).forEach((key) => {
  3255. const program = model._sourcePrograms[key];
  3256. const fragmentShader = model._rendererResources.sourceShaders[program.fragmentShader];
  3257. let vPosition = "";
  3258. if (fragmentShader.indexOf(" v_positionEC;") !== -1) {
  3259. vPosition = "v_positionEC";
  3260. } else if (fragmentShader.indexOf(" v_pos;") !== -1) {
  3261. vPosition = "v_pos";
  3262. }
  3263. const color2 = `vec4(${feature2.color.toString()})`;
  3264. model._rendererResources.sourceShaders[program.fragmentShader] = `
  3265. varying vec3 ${vPosition};
  3266. void main(void){
  3267. vec4 v_helsing_position = czm_inverseModelView * vec4(${vPosition},1);
  3268. float _baseHeight = -30.0;
  3269. float vtxf_height = v_helsing_position.z - _baseHeight;
  3270. float stc_pl = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;
  3271. float stc_sd = vtxf_height / 30.0 + sin(stc_pl) * 0.1;
  3272. gl_FragColor = ${color2};
  3273. gl_FragColor *= vec4(stc_sd, stc_sd, stc_sd, 1.0);
  3274. /* \u626B\u63CF\u7EBF */
  3275. float glowRange = 80.0;
  3276. float stc_a13 = fract(czm_frameNumber / 460.0);
  3277. float stc_h = clamp(v_helsing_position.z / glowRange, 0.0, 1.0);
  3278. stc_a13 = abs(stc_a13 - 0.5) * 1.0;
  3279. float stc_diff = step(0.003, abs(stc_h - stc_a13));
  3280. gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - stc_diff);
  3281. }
  3282. `;
  3283. });
  3284. model._shouldRegenerateShaders = true;
  3285. }
  3286. }
  3287. });
  3288. });
  3289. this._viewer.scene.requestRender();
  3290. },
  3291. set3DTilePosition: function(options2) {
  3292. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3293. throw new Cesium.DeveloperError("options.serviceId is required.");
  3294. }
  3295. options2.height = Cesium.defaultValue(options2.height, 0);
  3296. let boundingSphere = window[options2.serviceId].boundingSphere;
  3297. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  3298. let left = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, options2.height);
  3299. let right = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0);
  3300. let translation = Cesium.Cartesian3.subtract(left, right, new Cesium.Cartesian3());
  3301. window[options2.serviceId].modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  3302. this._viewer.scene.requestRender();
  3303. },
  3304. setLayersStyle(options2) {
  3305. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3306. throw new Cesium.DeveloperError("options.serviceId is required.");
  3307. }
  3308. let layer = window[options2.serviceId];
  3309. if (Cesium.defined(options2.alpha)) {
  3310. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3311. }
  3312. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3313. layer.alpha = options2.alpha;
  3314. if (Cesium.defined(options2.brightness)) {
  3315. Cesium.Check.typeOf.number("brightness", options2.brightness);
  3316. }
  3317. options2.brightness = Cesium.defaultValue(options2.brightness, 1);
  3318. layer.brightness = options2.brightness;
  3319. if (Cesium.defined(options2.contrast)) {
  3320. Cesium.Check.typeOf.number("contrast", options2.contrast);
  3321. }
  3322. options2.contrast = Cesium.defaultValue(options2.contrast, 1);
  3323. layer.contrast = options2.contrast;
  3324. if (Cesium.defined(options2.gamma)) {
  3325. Cesium.Check.typeOf.number("gamma", options2.gamma);
  3326. }
  3327. options2.gamma = Cesium.defaultValue(options2.gamma, 1);
  3328. layer.gamma = options2.gamma;
  3329. if (Cesium.defined(options2.hue)) {
  3330. Cesium.Check.typeOf.number("hue", options2.hue);
  3331. }
  3332. options2.hue = Cesium.defaultValue(options2.hue, 0);
  3333. layer.hue = options2.hue;
  3334. if (Cesium.defined(options2.saturation)) {
  3335. Cesium.Check.typeOf.number("saturation", options2.saturation);
  3336. }
  3337. options2.saturation = Cesium.defaultValue(options2.saturation, 1);
  3338. layer.saturation = options2.saturation;
  3339. },
  3340. setPolygonImageMaterial(options2) {
  3341. if (Cesium.defined(options2.alpha)) {
  3342. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3343. }
  3344. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3345. let entity = window[options2.serviceId];
  3346. entity.polygon.material.color._value.alpha = options2.alpha;
  3347. },
  3348. setModelStyle(options2) {
  3349. if (Cesium.defined(options2.alpha)) {
  3350. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3351. }
  3352. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3353. let entity = window[options2.serviceId];
  3354. if (entity.model) {
  3355. entity.model.color._value.alpha = options2.alpha;
  3356. } else {
  3357. entity.color._value.alpha = options2.alpha;
  3358. }
  3359. },
  3360. setTerrainExaggeration(options2) {
  3361. if (Cesium.defined(options2.terrainExaggeration)) {
  3362. Cesium.Check.typeOf.number("terrainExaggeration", options2.terrainExaggeration);
  3363. }
  3364. options2.terrainExaggeration = Cesium.defaultValue(options2.terrainExaggeration, 1);
  3365. this._viewer.scene.globe.terrainExaggeration = options2.terrainExaggeration;
  3366. }
  3367. });
  3368. Object.assign(LoadMapData.prototype, {
  3369. removeImageryProvider(options2) {
  3370. return new Promise((resolve2, reject2) => {
  3371. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3372. throw new Cesium.DeveloperError("options.serviceId is required.");
  3373. }
  3374. this._removeImageryProvider(options2.serviceId);
  3375. resolve2(true);
  3376. });
  3377. },
  3378. removeTerrain() {
  3379. return new Promise((resolve2, reject2) => {
  3380. this._setEllipsoidTerrain();
  3381. resolve2(true);
  3382. });
  3383. },
  3384. removeScenePrimitives(options2) {
  3385. return new Promise((resolve2, reject2) => {
  3386. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3387. throw new Cesium.DeveloperError("options.serviceId is required.");
  3388. }
  3389. this._removeScenePrimitives(options2.serviceId);
  3390. resolve2(true);
  3391. });
  3392. },
  3393. removeEntity(options2) {
  3394. return new Promise((resolve2, reject2) => {
  3395. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3396. throw new Cesium.DeveloperError("options.serviceId is required.");
  3397. }
  3398. this._viewer.entities.remove(window[options2.serviceId]);
  3399. window[options2.serviceId] = null;
  3400. resolve2(true);
  3401. });
  3402. },
  3403. removeDataSources(options2) {
  3404. let viewer2 = this._viewer;
  3405. return new Promise((resolve2, reject2) => {
  3406. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3407. throw new Cesium.DeveloperError("options.serviceId is required.");
  3408. }
  3409. let list = viewer2.dataSources.getByName(options2.serviceId);
  3410. list.forEach((res, index2) => {
  3411. viewer2.dataSources.remove(res);
  3412. if (index2 === list.length - 1) {
  3413. resolve2(true);
  3414. }
  3415. });
  3416. });
  3417. }
  3418. });
  3419. Date.prototype.Format = function(fmt) {
  3420. var o = {
  3421. "M+": this.getMonth() + 1,
  3422. "d+": this.getDate(),
  3423. "h+": this.getHours(),
  3424. "m+": this.getMinutes(),
  3425. "s+": this.getSeconds(),
  3426. "q+": Math.floor((this.getMonth() + 3) / 3),
  3427. "S": this.getMilliseconds()
  3428. };
  3429. if (/(y+)/.test(fmt))
  3430. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  3431. for (var k in o)
  3432. if (new RegExp("(" + k + ")").test(fmt))
  3433. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
  3434. return fmt;
  3435. };
  3436. class CrImageServerLayer {
  3437. constructor({
  3438. viewer: viewer2,
  3439. url,
  3440. opacity = 0.75,
  3441. show = true
  3442. } = {}) {
  3443. this._viewer = viewer2;
  3444. this._url = url;
  3445. this._opacity = opacity;
  3446. this._renderName = this._guid();
  3447. let dataSource = new Cesium.CustomDataSource(this._renderName);
  3448. this._viewer.dataSources.add(dataSource);
  3449. this._entities = dataSource.entities;
  3450. this._renderEntities = /* @__PURE__ */ new Map();
  3451. this._isUpdateTile = show;
  3452. this._isDebug = false;
  3453. this._init();
  3454. }
  3455. _init() {
  3456. let _self = this;
  3457. this._provider = new Cesium.ArcGisMapServerImageryProvider({
  3458. url: _self._url
  3459. });
  3460. this._provider.readyPromise.then(function(result) {
  3461. _self._rectangle = _self._provider.rectangle;
  3462. if (_self._isDebug)
  3463. _self._printDebug();
  3464. _self._viewer.scene.postRender.addEventListener(() => {
  3465. if (_self._isUpdateTile) {
  3466. _self._isUpdateTile = false;
  3467. _self._renderTiles();
  3468. }
  3469. });
  3470. });
  3471. }
  3472. _guid() {
  3473. function S4() {
  3474. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  3475. }
  3476. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  3477. }
  3478. _printDebug() {
  3479. this._provider.tilingScheme;
  3480. let tiling84 = new Cesium.GeographicTilingScheme();
  3481. this._drawDebugRectangle(this._rectangle, Cesium.Color.GREEN);
  3482. tiling84.tileXYToRectangle(1696, 312, 10);
  3483. }
  3484. _drawDebugRectangle(rectangle, color2) {
  3485. let positions = this._calculateRectangleOutlineCoordinates(rectangle);
  3486. let rectEntity = new Cesium.Entity({
  3487. name: this._renderName,
  3488. polyline: {
  3489. positions,
  3490. material: color2,
  3491. width: 10,
  3492. clampToGround: true
  3493. }
  3494. });
  3495. this._entities.add(rectEntity);
  3496. }
  3497. _console(...rest) {
  3498. if (this._isDebug)
  3499. console.log("===" + new Date().Format("yyyy-MM-dd HH:mm:ss") + ">>>", rest);
  3500. }
  3501. _renderTiles() {
  3502. let _self = this;
  3503. let tilesToRender = this._viewer.scene.globe._surface._tilesToRender;
  3504. if (tilesToRender === void 0 || tilesToRender.length === 0) {
  3505. this._isUpdateTile = true;
  3506. return;
  3507. } else {
  3508. new Promise((resolve2, reject2) => {
  3509. tilesToRender.sort(function(obj1, obj2) {
  3510. let level1 = parseInt(obj1.level);
  3511. let level2 = parseInt(obj2.level);
  3512. return level1 - level2;
  3513. });
  3514. resolve2(tilesToRender);
  3515. }).then((tiles) => {
  3516. _self._asyncProjectionTiles(tiles);
  3517. });
  3518. }
  3519. }
  3520. _createKey(x, y, level) {
  3521. let key = `${this._renderName}_${x}_${y}_${level}`;
  3522. return key;
  3523. }
  3524. _asyncProjectionTiles(tiles) {
  3525. let renderTiles = [];
  3526. for (let tile of tiles) {
  3527. let proTiles = this._projectionTile(tile);
  3528. for (let proTile of proTiles) {
  3529. let key = this._createKey(proTile.x, proTile.y, proTile.level);
  3530. let subTile = renderTiles.find((obj) => {
  3531. return obj.x === proTile.x && obj.y === proTile.y;
  3532. });
  3533. if (subTile === void 0) {
  3534. let isExists = false;
  3535. for (let eTile of renderTiles) {
  3536. if (Cesium.Rectangle.intersection(eTile.rectangle, proTile.rectangle)) {
  3537. eTile.childTiles.push(key);
  3538. isExists = true;
  3539. break;
  3540. }
  3541. }
  3542. if (!isExists) {
  3543. renderTiles.push({
  3544. key,
  3545. x: proTile.x,
  3546. y: proTile.y,
  3547. level: proTile.level,
  3548. rectangle: proTile.rectangle,
  3549. childTiles: []
  3550. });
  3551. }
  3552. }
  3553. }
  3554. }
  3555. let i2 = renderTiles.length;
  3556. let appendTiles = [];
  3557. while (i2--) {
  3558. let findTile = renderTiles[i2];
  3559. if (findTile.childTiles.length >= 1) {
  3560. let tiles2 = this._createFourTiles(findTile);
  3561. for (let tile of tiles2) {
  3562. appendTiles.push(tile);
  3563. }
  3564. renderTiles.splice(i2, 1);
  3565. }
  3566. }
  3567. for (let appendTile of appendTiles) {
  3568. renderTiles.push(appendTile);
  3569. }
  3570. renderTiles.sort(function(obj1, obj2) {
  3571. let level1 = parseInt(obj1.level);
  3572. let level2 = parseInt(obj2.level);
  3573. return level1 - level2;
  3574. });
  3575. this._renderTilesToViewer(renderTiles);
  3576. }
  3577. _createTileByRectangleAndLevel(rectangle, level) {
  3578. let center2 = Cesium.Rectangle.center(rectangle);
  3579. let nLevel = parseInt(level) + 1;
  3580. let query = this._provider.tilingScheme.positionToTileXY(center2, nLevel);
  3581. if (query === void 0)
  3582. return void 0;
  3583. return {
  3584. key: this._createKey(query.x, query.y, nLevel),
  3585. x: query.x,
  3586. y: query.y,
  3587. level: nLevel,
  3588. rectangle,
  3589. childTiles: []
  3590. };
  3591. }
  3592. _createFourTiles(tile) {
  3593. let rects = [];
  3594. let results = [];
  3595. let rectangle = tile.rectangle;
  3596. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0, 0.5, 0.5));
  3597. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0, 1, 0.5));
  3598. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0.5, 0.5, 1));
  3599. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0.5, 1, 1));
  3600. for (let rect of rects) {
  3601. if (Cesium.Rectangle.intersection(rect, this._rectangle)) {
  3602. let newTile = this._createTileByRectangleAndLevel(rect, tile.level);
  3603. if (newTile !== void 0)
  3604. results.push(newTile);
  3605. }
  3606. }
  3607. return results;
  3608. }
  3609. _renderTilesToViewer(tiles) {
  3610. let _self = this;
  3611. let deleteKeys = [];
  3612. for (let [key, tile] of this._renderEntities) {
  3613. let findTile = tiles.find((obj) => {
  3614. return obj.key === key;
  3615. });
  3616. if (findTile === void 0) {
  3617. deleteKeys.push(key);
  3618. }
  3619. }
  3620. for (let key of deleteKeys) {
  3621. this._renderEntities.delete(key);
  3622. this._entities.removeById(key);
  3623. }
  3624. for (let tile of tiles) {
  3625. if (!this._renderEntities.has(tile.key)) {
  3626. let entity = this._renderSimpleTileToViewer(tile);
  3627. this._renderEntities.set(tile.key, entity);
  3628. let workBlob = new Blob([`(${downloadWorker.toString()})()`]);
  3629. let worker = new Worker(URL.createObjectURL(workBlob));
  3630. worker.postMessage({
  3631. key: tile.key,
  3632. url: this._url,
  3633. x: tile.x,
  3634. y: tile.y,
  3635. level: tile.level
  3636. });
  3637. worker.onmessage = function(event2) {
  3638. _self._console(`render x:${event2.data.x} y:${event2.data.y} level:${event2.data.level}`);
  3639. let renderEntity = _self._entities.getById(event2.data.key);
  3640. if (renderEntity !== void 0) {
  3641. event2.data.key;
  3642. const canvas = _self._createCanvas(event2.data, event2.data.image, _self._isDebug);
  3643. renderEntity.rectangle.material = canvas;
  3644. }
  3645. worker.terminate();
  3646. };
  3647. }
  3648. }
  3649. this._isUpdateTile = true;
  3650. }
  3651. _renderSimpleTileToViewer(tile) {
  3652. const canvas = this._createCanvas(tile, void 0, this._isDebug);
  3653. let bjPositions = this._calculateRectangleOutlineCoordinates(tile.rectangle);
  3654. let tileEntity = new Cesium.Entity({
  3655. name: this._renderName,
  3656. id: tile.key,
  3657. rectangle: {
  3658. coordinates: tile.rectangle,
  3659. material: canvas
  3660. },
  3661. polyline: {
  3662. positions: bjPositions,
  3663. material: Cesium.Color.YELLOW.withAlpha(this._isDebug ? 1 : 0),
  3664. width: 1,
  3665. clampToGround: true
  3666. }
  3667. });
  3668. return this._entities.add(tileEntity);
  3669. }
  3670. _createCanvas(tile, image, islabel) {
  3671. let provider = this._provider;
  3672. const canvas = document.createElement("canvas");
  3673. canvas.width = provider.tileWidth;
  3674. canvas.height = provider.tileHeight;
  3675. const context = canvas.getContext("2d");
  3676. if (image !== void 0) {
  3677. context.globalAlpha = this._opacity;
  3678. context.drawImage(event.data.image, 0, 0, canvas.width, canvas.height);
  3679. }
  3680. if (islabel !== void 0 && islabel === true) {
  3681. context.globalAlpha = 1;
  3682. context.font = "20px Arial";
  3683. context.textAlign = "center";
  3684. context.fillStyle = "rgba(255,255,0)";
  3685. context.strokeStyle = "rgba(255,255,255,1)";
  3686. context.lineWidth = 2;
  3687. context.strokeText(`L: ${tile.level}`, 126, 86);
  3688. context.fillText(`L: ${tile.level}`, 126, 86);
  3689. context.strokeText(`X: ${tile.x}`, 126, 136);
  3690. context.fillText(`X: ${tile.x}`, 126, 136);
  3691. context.strokeText(`Y: ${tile.y}`, 126, 186);
  3692. context.fillText(`Y: ${tile.y}`, 126, 186);
  3693. }
  3694. return canvas;
  3695. }
  3696. _projectionTile(tile) {
  3697. let rectangle = tile._rectangle;
  3698. let imageryLevel = parseInt(tile.level);
  3699. let mercatorTilingScheme = this._provider.tilingScheme;
  3700. let res = [];
  3701. let interRectangle = Cesium.Rectangle.intersection(rectangle, this._rectangle);
  3702. if (interRectangle === void 0)
  3703. return res;
  3704. let northwestTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3705. Cesium.Rectangle.northwest(rectangle),
  3706. imageryLevel
  3707. );
  3708. let southeastTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3709. Cesium.Rectangle.southeast(rectangle),
  3710. imageryLevel
  3711. );
  3712. if (northwestTileCoordinates !== void 0 && southeastTileCoordinates !== void 0) {
  3713. for (let i2 = northwestTileCoordinates.x; i2 <= southeastTileCoordinates.x; i2++) {
  3714. for (let j = northwestTileCoordinates.y; j <= southeastTileCoordinates.y; j++) {
  3715. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(i2, j, imageryLevel);
  3716. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3717. res.push({
  3718. x: i2,
  3719. y: j,
  3720. level: imageryLevel,
  3721. rectangle: _webRectangle
  3722. });
  3723. }
  3724. }
  3725. }
  3726. } else if (northwestTileCoordinates !== void 0) {
  3727. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3728. northwestTileCoordinates.x,
  3729. northwestTileCoordinates.y,
  3730. imageryLevel
  3731. );
  3732. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3733. res.push({
  3734. x: northwestTileCoordinates.x,
  3735. y: northwestTileCoordinates.y,
  3736. level: imageryLevel,
  3737. rectangle: _webRectangle
  3738. });
  3739. }
  3740. } else if (southeastTileCoordinates !== void 0) {
  3741. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3742. southeastTileCoordinates.x,
  3743. southeastTileCoordinates.y,
  3744. imageryLevel
  3745. );
  3746. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3747. res.push({
  3748. x: southeastTileCoordinates.x,
  3749. y: southeastTileCoordinates.y,
  3750. level: imageryLevel,
  3751. rectangle: _webRectangle
  3752. });
  3753. }
  3754. }
  3755. return res;
  3756. }
  3757. _calculateRectangleOutlineCoordinates(rectangle) {
  3758. let south_east = Cesium.Rectangle.southeast(rectangle);
  3759. let se2 = Cesium.Cartographic.toCartesian(south_east);
  3760. let south_west = Cesium.Rectangle.southwest(rectangle);
  3761. let sw = Cesium.Cartographic.toCartesian(south_west);
  3762. let north_east = Cesium.Rectangle.northeast(rectangle);
  3763. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  3764. let north_west = Cesium.Rectangle.northwest(rectangle);
  3765. let nw = Cesium.Cartographic.toCartesian(north_west);
  3766. return [sw, se2, ne2, nw, sw];
  3767. }
  3768. _removeEntityByName(entityName) {
  3769. var entities2 = this._entities;
  3770. if (!entities2 || !entities2.values)
  3771. return;
  3772. var delEntitys = [];
  3773. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  3774. if (entities2.values[i2].name == entityName) {
  3775. delEntitys.push(entities2.values[i2]);
  3776. }
  3777. }
  3778. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  3779. entities2.remove(delEntitys[i2]);
  3780. }
  3781. }
  3782. }
  3783. Object.assign(CrImageServerLayer.prototype, {
  3784. hide: function() {
  3785. this._console("\u9690\u85CF");
  3786. this._isUpdateTile = false;
  3787. this._removeEntityByName(this._renderName);
  3788. this._renderEntities.clear();
  3789. },
  3790. show: function() {
  3791. this._console("\u663E\u793A");
  3792. this._isUpdateTile = true;
  3793. },
  3794. setOpacity: function(opacity) {
  3795. if (opacity === void 0 || typeof opacity !== "number")
  3796. return;
  3797. if (opacity >= 1)
  3798. this._opacity = 1;
  3799. if (opacity <= 0)
  3800. this._opacity = 0;
  3801. this._opacity = parseFloat(opacity);
  3802. }
  3803. });
  3804. function downloadWorker() {
  3805. onmessage = function(event2) {
  3806. let data = event2.data;
  3807. let url = data.url + "/tile/" + data.level + "/" + data.y + "/" + data.x;
  3808. let xhr = new XMLHttpRequest();
  3809. xhr.open("get", url, true);
  3810. xhr.responseType = "blob";
  3811. xhr.onload = function() {
  3812. if (this.status === 200) {
  3813. var blob = this.response;
  3814. var bmpPromise = createImageBitmap(blob, {
  3815. imageOrientation: "none",
  3816. premultiplyAlpha: "none",
  3817. colorSpaceConversion: "default"
  3818. });
  3819. bmpPromise.then(function(image) {
  3820. let outObj = {
  3821. key: data.key,
  3822. x: data.x,
  3823. y: data.y,
  3824. level: data.level,
  3825. image
  3826. };
  3827. postMessage(outObj);
  3828. });
  3829. } else {
  3830. console.log("===>>>", url + " Not found");
  3831. }
  3832. };
  3833. xhr.send();
  3834. };
  3835. }
  3836. class LocateUtil {
  3837. constructor(viewer2) {
  3838. if (!viewer2)
  3839. throw new Cesium.DeveloperError("no viewer object!");
  3840. this._viewer = viewer2;
  3841. this._locationEntity = null;
  3842. }
  3843. }
  3844. Object.assign(LocateUtil.prototype, {
  3845. flyToPoint: function(options2) {
  3846. return new Promise((resolve2, reject2) => {
  3847. if (!Cesium.defined(options2) || !Cesium.defined(options2.longitude) || !Cesium.defined(options2.latitude)) {
  3848. throw new Cesium.DeveloperError("options.longitude and options.latitude are required.");
  3849. }
  3850. options2.height = Cesium.defaultValue(options2.height, 0);
  3851. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3852. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3853. options2.range = Cesium.defaultValue(options2.range, 0);
  3854. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3855. var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(options2.longitude, options2.latitude, options2.height), 0);
  3856. this._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3857. duration: options2.duration,
  3858. complete: function() {
  3859. resolve2(true);
  3860. },
  3861. offset: {
  3862. heading: Cesium.Math.toRadians(options2.heading),
  3863. pitch: Cesium.Math.toRadians(options2.pitch),
  3864. range: options2.range
  3865. }
  3866. });
  3867. });
  3868. },
  3869. flyToEntityByPoints: function(points2, type2, options2) {
  3870. return new Promise((resolve2, reject2) => {
  3871. let _self = this;
  3872. options2 = options2 || {};
  3873. if (points2 === void 0 || points2.length === void 0) {
  3874. reject2("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  3875. return;
  3876. }
  3877. let pointsArray = points2.map((point2) => {
  3878. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3879. });
  3880. if (_self._locationEntity) {
  3881. _self._viewer.entities.remove(_self._locationEntity);
  3882. }
  3883. switch (type2) {
  3884. case "point":
  3885. _self._locationEntity = _self._viewer.entities.add({
  3886. position: pointsArray[0],
  3887. point: {
  3888. pixelSize: 1
  3889. }
  3890. });
  3891. break;
  3892. case "polyline":
  3893. if (pointsArray.length < 2) {
  3894. reject2("\u7EBF\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  3895. } else {
  3896. _self._locationEntity = _self._viewer.entities.add({
  3897. polyline: {
  3898. positions: pointsArray,
  3899. clampToGround: true,
  3900. material: new Cesium.Color(255, 0, 0, 0.5),
  3901. width: 1
  3902. }
  3903. });
  3904. }
  3905. break;
  3906. case "polygon":
  3907. if (pointsArray.length < 3) {
  3908. reject2("\u9762\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  3909. } else {
  3910. _self._locationEntity = _self._viewer.entities.add({
  3911. polygon: {
  3912. hierarchy: {
  3913. positions: pointsArray
  3914. },
  3915. material: new Cesium.Color(255, 0, 0, 0.5),
  3916. outline: true
  3917. }
  3918. });
  3919. }
  3920. break;
  3921. default:
  3922. reject2("\u5750\u6807\u5F02\u5E38\uFF01");
  3923. break;
  3924. }
  3925. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3926. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3927. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3928. options2.range = Cesium.defaultValue(options2.range, 0);
  3929. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3930. duration: options2.duration,
  3931. offset: {
  3932. heading: Cesium.Math.toRadians(options2.heading),
  3933. pitch: Cesium.Math.toRadians(options2.pitch),
  3934. range: options2.range
  3935. }
  3936. });
  3937. flyPromise.then(function(flag) {
  3938. if (flag) {
  3939. resolve2(_self._locationEntity);
  3940. }
  3941. });
  3942. });
  3943. },
  3944. flyToEntity: function(entity, options2) {
  3945. return new Promise((resolve2, reject2) => {
  3946. let _self = this;
  3947. options2 = options2 || {};
  3948. if (_self._locationEntity) {
  3949. _self._viewer.entities.remove(_self._locationEntity);
  3950. }
  3951. _self._locationEntity = entity;
  3952. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3953. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3954. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3955. options2.range = Cesium.defaultValue(options2.range, 0);
  3956. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3957. duration: options2.duration,
  3958. offset: {
  3959. heading: Cesium.Math.toRadians(options2.heading),
  3960. pitch: Cesium.Math.toRadians(options2.pitch),
  3961. range: options2.range
  3962. }
  3963. });
  3964. flyPromise.then(function(flag) {
  3965. if (flag) {
  3966. resolve2(_self._locationEntity);
  3967. }
  3968. });
  3969. });
  3970. },
  3971. zoomToTilesets(tileset, options2) {
  3972. return new Promise((resolve2, reject2) => {
  3973. let _self = this;
  3974. if (!Cesium.defined(tileset)) {
  3975. throw new Cesium.DeveloperError("tileset is required.");
  3976. }
  3977. options2 = options2 || {};
  3978. options2.heading = Cesium.defaultValue(options2.heading, 120);
  3979. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  3980. options2.range = Cesium.defaultValue(options2.range, 450);
  3981. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3982. let boundingSphere = tileset.boundingSphere;
  3983. _self._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3984. duration: options2.duration,
  3985. complete: function() {
  3986. resolve2(true);
  3987. },
  3988. offset: {
  3989. heading: Cesium.Math.toRadians(options2.heading),
  3990. pitch: Cesium.Math.toRadians(options2.pitch),
  3991. range: options2.range
  3992. }
  3993. });
  3994. });
  3995. },
  3996. flyToTileset(tileset, options2) {
  3997. return new Promise((resolve2, reject2) => {
  3998. let _self = this;
  3999. if (!Cesium.defined(tileset)) {
  4000. throw new Cesium.DeveloperError("tileset is required.");
  4001. }
  4002. options2 = options2 || {};
  4003. options2.heading = Cesium.defaultValue(options2.heading, 120);
  4004. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  4005. options2.range = Cesium.defaultValue(options2.range, 450);
  4006. options2.duration = Cesium.defaultValue(options2.duration, 3);
  4007. let flyPromise = _self._viewer.flyTo(tileset, {
  4008. duration: options2.duration,
  4009. offset: {
  4010. heading: Cesium.Math.toRadians(options2.heading),
  4011. pitch: Cesium.Math.toRadians(options2.pitch),
  4012. range: options2.range
  4013. }
  4014. });
  4015. flyPromise.then(function(flag) {
  4016. if (flag) {
  4017. resolve2(true);
  4018. }
  4019. });
  4020. });
  4021. }
  4022. });
  4023. const CreateRemindertip = function(arr, position2, show) {
  4024. let tooltip2 = document.getElementById("toolTip");
  4025. let style, _x, _y, _color;
  4026. if (arr && typeof arr === "object") {
  4027. style = arr;
  4028. }
  4029. if (style && style.origin) {
  4030. style.origin === "center" && (_x = 15, _y = -12);
  4031. style.origin === "top" && (_x = 15, _y = -44);
  4032. style.origin === "bottom" && (_x = 15, _y = 20);
  4033. } else {
  4034. _x = 15, _y = 20;
  4035. }
  4036. if (style && style.color) {
  4037. style.color === "white" && (_color = "background: rgba(255, 255, 255, 0.8);color: black;");
  4038. style.color === "black" && (_color = "background: rgba(0, 0, 0, 0.65);color: white;");
  4039. style.color === "yellow" && (_color = "color: black;background-color: #ffcc33;border: 1px solid white;");
  4040. } else {
  4041. _color = "background: rgba(0, 0, 0, 0.65);color: white;";
  4042. }
  4043. if (!tooltip2) {
  4044. const viewerDom = document.getElementsByClassName("cesium-viewer")[0];
  4045. let elementbottom = document.createElement("div");
  4046. viewerDom.append(elementbottom);
  4047. let html = '<div id="toolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;' + _color + '"></div>';
  4048. viewerDom.insertAdjacentHTML("beforeend", html);
  4049. tooltip2 = document.getElementById("toolTip");
  4050. }
  4051. if (show) {
  4052. tooltip2.innerHTML = arr;
  4053. tooltip2.style.left = position2.x + _x + "px";
  4054. tooltip2.style.top = position2.y + _y + "px";
  4055. tooltip2.style.display = "block";
  4056. } else {
  4057. tooltip2.style.display = "none";
  4058. }
  4059. return {
  4060. tooltip: tooltip2,
  4061. style,
  4062. showAt: function(position3, text) {
  4063. this.tooltip.innerHTML = text;
  4064. if (this.style && this.style.origin) {
  4065. this.style.origin === "center" && (_x = 15, _y = -this.tooltip.offsetHeight / 2);
  4066. this.style.origin === "top" && (_x = 15, _y = -this.tooltip.offsetHeight - 20);
  4067. this.style.origin === "bottom" && (_x = 15, _y = 20);
  4068. } else {
  4069. _x = 15, _y = -this.tooltip.offsetHeight / 2;
  4070. }
  4071. this.tooltip.style.left = position3.x + _x + "px";
  4072. this.tooltip.style.top = position3.y + _y + "px";
  4073. this.tooltip.style.display = "block";
  4074. },
  4075. show: function(show2) {
  4076. if (show2) {
  4077. this.tooltip.style.display = "block";
  4078. } else {
  4079. this.tooltip.style.display = "none";
  4080. }
  4081. }
  4082. };
  4083. };
  4084. class SightLine {
  4085. constructor(viewer2) {
  4086. if (!viewer2)
  4087. throw new Cesium.DeveloperError("no viewer object!");
  4088. this._viewer = viewer2;
  4089. this._resultObject = {
  4090. viewPoint: void 0,
  4091. targetPoints: [],
  4092. targetPoint: void 0,
  4093. objectExclude: [],
  4094. entities: []
  4095. };
  4096. }
  4097. _distance(point1, point2) {
  4098. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  4099. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  4100. let geodesic = new Cesium.EllipsoidGeodesic();
  4101. geodesic.setEndPoints(point1cartographic, point2cartographic);
  4102. let s = geodesic.surfaceDistance;
  4103. s = Math.sqrt(
  4104. Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2)
  4105. );
  4106. return s;
  4107. }
  4108. _checkAppOrWeb() {
  4109. if (window.navigator.userAgent.match(
  4110. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  4111. )) {
  4112. return SightLine.RuntimeEnvironment.App;
  4113. } else {
  4114. return SightLine.RuntimeEnvironment.Web;
  4115. }
  4116. }
  4117. _isRuntimeApp() {
  4118. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.App) {
  4119. return true;
  4120. }
  4121. return false;
  4122. }
  4123. _isRuntimeWeb() {
  4124. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.Web) {
  4125. return true;
  4126. }
  4127. return false;
  4128. }
  4129. _createOperationMainDom() {
  4130. let buttonDiv = document.createElement("div");
  4131. buttonDiv.id = "drawButtonDiv";
  4132. buttonDiv.style.width = "80px";
  4133. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  4134. buttonDiv.style.borderRadius = "5px";
  4135. buttonDiv.style.display = "flex";
  4136. buttonDiv.style.flexDirection = "column";
  4137. buttonDiv.style.padding = "8px";
  4138. buttonDiv.style.justifyContent = "center";
  4139. buttonDiv.style.position = "absolute";
  4140. buttonDiv.style.bottom = "150px";
  4141. buttonDiv.style.right = "10px";
  4142. let btnCompletion = document.createElement("button");
  4143. btnCompletion.id = "btnDrawComplete";
  4144. btnCompletion.style.height = "30px";
  4145. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  4146. btnCompletion.style.color = "rgb(255, 255, 255)";
  4147. btnCompletion.style.border = "0px solid red";
  4148. btnCompletion.style.borderRadius = "5px";
  4149. btnCompletion.innerHTML = "\u5B8C\u6210";
  4150. btnCompletion.style.fontSize = "13px";
  4151. btnCompletion.style.cursor = "pointer";
  4152. buttonDiv.appendChild(btnCompletion);
  4153. document.body.appendChild(buttonDiv);
  4154. }
  4155. _showTooltipMessage(message) {
  4156. let msgMainDom = document.getElementById("messageMainDom");
  4157. if (msgMainDom !== null && msgMainDom !== void 0) {
  4158. document.body.removeChild(msgMainDom);
  4159. }
  4160. msgMainDom = document.createElement("div");
  4161. msgMainDom.style.width = "30%";
  4162. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  4163. msgMainDom.style.height = "45px";
  4164. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  4165. msgMainDom.style.borderRadius = "8px";
  4166. msgMainDom.style.display = "flex";
  4167. msgMainDom.style.alignItems = "center";
  4168. msgMainDom.style.paddingLeft = "10px";
  4169. msgMainDom.style.color = "rgb(91, 188, 48)";
  4170. msgMainDom.style.fontSize = "14px";
  4171. msgMainDom.style.fontWeight = "600";
  4172. msgMainDom.style.position = "absolute";
  4173. msgMainDom.style.left = "35%";
  4174. msgMainDom.style.transition = "transform 1s";
  4175. msgMainDom.style.transform = "translateY(-90px)";
  4176. msgMainDom.style.top = "0px";
  4177. msgMainDom.style.zIndex = 1e3;
  4178. document.body.appendChild(msgMainDom);
  4179. let strHtml = "";
  4180. strHtml += "<div style='";
  4181. strHtml += "background-color: rgb(88, 185, 45);";
  4182. strHtml += "color: rgb(255, 255, 255);";
  4183. strHtml += "height: 24px;";
  4184. strHtml += "width: 24px;";
  4185. strHtml += "border-radius: 20px;";
  4186. strHtml += "display: flex;";
  4187. strHtml += "justify-content: center;";
  4188. strHtml += "align-items: center;";
  4189. strHtml += "font-size: 14px;";
  4190. strHtml += "margin-right: 18px;";
  4191. strHtml += "'>&#10003</div>";
  4192. strHtml += "<div>" + message + "</div>";
  4193. msgMainDom.innerHTML = strHtml;
  4194. msgMainDom.addEventListener("transitionend", function() {
  4195. setTimeout(function() {
  4196. document.body.removeChild(msgMainDom);
  4197. }, 1e3);
  4198. }, false);
  4199. setTimeout(function() {
  4200. msgMainDom.style.transform = "translateY(50px)";
  4201. }, 100);
  4202. }
  4203. }
  4204. Object.assign(SightLine.prototype, {
  4205. startSightLine() {
  4206. let _self = this;
  4207. _self.clearAll();
  4208. let toolTip = "\u5DE6\u952E\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4209. if (this._isRuntimeApp()) {
  4210. toolTip = "\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4211. _self._showTooltipMessage(toolTip);
  4212. }
  4213. _self.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  4214. _self.handler.setInputAction((event2) => {
  4215. let loc2 = CoordTransform._transfromFromScreenPoint(_self._viewer, event2.position);
  4216. toolTip = "\u5DE6\u952E\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u901A\u89C6\u5206\u6790";
  4217. if (this._isRuntimeApp()) {
  4218. toolTip = "\u518D\u6B21\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9";
  4219. _self._showTooltipMessage(toolTip);
  4220. }
  4221. if (!Cesium.defined(loc2.sLocation))
  4222. return;
  4223. let cartesian = loc2.sLocation;
  4224. if (!_self._resultObject.viewPoint) {
  4225. _self._resultObject.viewPoint = cartesian;
  4226. let pointEntity = _self._viewer.entities.add({
  4227. position: cartesian,
  4228. point: {
  4229. color: Cesium.Color.YELLOW,
  4230. pixelSize: 5
  4231. },
  4232. label: {
  4233. text: "\u89C2\u5BDF\u4F4D\u7F6E",
  4234. font: "12px sans-serif",
  4235. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4236. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4237. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4238. outlineWidth: 1,
  4239. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4240. pixelOffset: new Cesium.Cartesian2(0, -28),
  4241. showBackground: true,
  4242. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4243. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4244. }
  4245. });
  4246. _self._resultObject.objectExclude.push(pointEntity);
  4247. _self._resultObject.entities.push(pointEntity);
  4248. } else {
  4249. _self._resultObject.targetPoint = cartesian;
  4250. let pointEntity = _self._viewer.entities.add({
  4251. position: cartesian,
  4252. point: {
  4253. color: Cesium.Color.YELLOW,
  4254. pixelSize: 5
  4255. },
  4256. label: {
  4257. text: "\u76EE\u6807\u4F4D\u7F6E",
  4258. font: "12px sans-serif",
  4259. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4260. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4261. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4262. outlineWidth: 1,
  4263. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4264. pixelOffset: new Cesium.Cartesian2(0, -28),
  4265. showBackground: true,
  4266. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4267. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4268. }
  4269. });
  4270. _self._resultObject.objectExclude.push(pointEntity);
  4271. _self._resultObject.entities.push(pointEntity);
  4272. let direction = Cesium.Cartesian3.normalize(
  4273. Cesium.Cartesian3.subtract(
  4274. _self._resultObject.targetPoint,
  4275. _self._resultObject.viewPoint,
  4276. new Cesium.Cartesian3()
  4277. ),
  4278. new Cesium.Cartesian3()
  4279. );
  4280. let ray = new Cesium.Ray(_self._resultObject.viewPoint, direction);
  4281. let result = _self._viewer.scene.pickFromRay(ray, _self._resultObject.objectExclude);
  4282. if (result) {
  4283. let dis0 = _self._distance(
  4284. _self._resultObject.viewPoint,
  4285. _self._resultObject.targetPoint
  4286. );
  4287. let dis1 = _self._distance(
  4288. _self._resultObject.viewPoint,
  4289. result.position
  4290. );
  4291. let dis2 = _self._distance(
  4292. result.position,
  4293. _self._resultObject.targetPoint
  4294. );
  4295. console.log(dis0, dis1, dis2);
  4296. if (dis0 > dis1) {
  4297. let _poly0 = _self._viewer.entities.add({
  4298. polyline: {
  4299. positions: [_self._resultObject.viewPoint, result.position],
  4300. material: Cesium.Color.GREEN,
  4301. width: 3
  4302. }
  4303. });
  4304. _self._resultObject.entities.push(_poly0);
  4305. let _poly1 = _self._viewer.entities.add({
  4306. polyline: {
  4307. positions: [result.position, _self._resultObject.targetPoint],
  4308. material: Cesium.Color.RED,
  4309. width: 3
  4310. }
  4311. });
  4312. _self._resultObject.entities.push(_poly1);
  4313. _self._resultObject.targetPoints.push({
  4314. targetPoint: cartesian,
  4315. visual: false,
  4316. distance: [dis0, dis1, dis2]
  4317. });
  4318. } else {
  4319. let _poly2 = _self._viewer.entities.add({
  4320. polyline: {
  4321. positions: [
  4322. _self._resultObject.viewPoint,
  4323. _self._resultObject.targetPoint
  4324. ],
  4325. material: Cesium.Color.GREEN,
  4326. width: 3
  4327. }
  4328. });
  4329. _self._resultObject.entities.push(_poly2);
  4330. _self._resultObject.targetPoints.push({
  4331. targetPoint: cartesian,
  4332. visual: true,
  4333. distance: [dis0, dis1, dis2]
  4334. });
  4335. }
  4336. }
  4337. }
  4338. if (_self._resultObject.objectExclude.length === 2) {
  4339. if (this._isRuntimeApp()) {
  4340. _self._createOperationMainDom();
  4341. document.getElementById("btnDrawComplete").onclick = () => {
  4342. CreateRemindertip(toolTip, event2.endPosition, false);
  4343. _self.handler.destroy();
  4344. let buttonDiv = document.getElementById("drawButtonDiv");
  4345. if (buttonDiv) {
  4346. document.body.removeChild(buttonDiv);
  4347. }
  4348. };
  4349. }
  4350. }
  4351. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  4352. _self.handler.setInputAction(function(move) {
  4353. if (_self._isRuntimeApp())
  4354. return;
  4355. CreateRemindertip(toolTip, move.endPosition, true);
  4356. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  4357. _self.handler.setInputAction((event2) => {
  4358. CreateRemindertip(toolTip, event2.endPosition, false);
  4359. _self.handler.destroy();
  4360. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  4361. },
  4362. clearAll() {
  4363. this._resultObject.entities.forEach((element) => {
  4364. this._viewer.entities.remove(element);
  4365. });
  4366. this._resultObject = {
  4367. viewPoint: void 0,
  4368. targetPoints: [],
  4369. targetPoint: void 0,
  4370. objectExclude: [],
  4371. entities: []
  4372. };
  4373. if (this.handler) {
  4374. this.handler.destroy();
  4375. }
  4376. let buttonDiv = document.getElementById("drawButtonDiv");
  4377. if (buttonDiv) {
  4378. document.body.removeChild(buttonDiv);
  4379. }
  4380. }
  4381. });
  4382. SightLine.RuntimeEnvironment = Object.freeze({
  4383. App: "app",
  4384. Web: "web"
  4385. });
  4386. /*!
  4387. * author: [object Object]
  4388. * @sakitam-gis/kriging v0.1.0
  4389. * build-time: 2019-7-6 20:41
  4390. * LICENSE: MIT
  4391. * (c) 2019-2019 https://github.com/sakitam-gis/kriging.js
  4392. */
  4393. function max(source) {
  4394. return Math.max.apply(null, source);
  4395. }
  4396. function min(source) {
  4397. return Math.min.apply(null, source);
  4398. }
  4399. function rep(source, n) {
  4400. var array = [];
  4401. for (var i2 = 0; i2 < n; i2++) {
  4402. array.push(source);
  4403. }
  4404. return array;
  4405. }
  4406. function pip(source, x, y) {
  4407. var i2 = 0;
  4408. var j = source.length - 1;
  4409. var c = false;
  4410. var length = source.length;
  4411. for (; i2 < length; j = i2++) {
  4412. if (source[i2][1] > y !== source[j][1] > y && x < (source[j][0] - source[i2][0]) * (y - source[i2][1]) / (source[j][1] - source[i2][1]) + source[i2][0]) {
  4413. c = !c;
  4414. }
  4415. }
  4416. return c;
  4417. }
  4418. function matrixDiag(c, n) {
  4419. var i2 = 0;
  4420. var Z2 = rep(0, n * n);
  4421. for (; i2 < n; i2++) {
  4422. Z2[i2 * n + i2] = c;
  4423. }
  4424. return Z2;
  4425. }
  4426. function matrixTranspose(X2, n, m) {
  4427. var i2 = 0;
  4428. var j;
  4429. var Z2 = Array(m * n);
  4430. for (; i2 < n; i2++) {
  4431. j = 0;
  4432. for (; j < m; j++) {
  4433. Z2[j * n + i2] = X2[i2 * m + j];
  4434. }
  4435. }
  4436. return Z2;
  4437. }
  4438. function matrixAdd(X2, Y, n, m) {
  4439. var i2 = 0;
  4440. var j;
  4441. var Z2 = Array(n * m);
  4442. for (; i2 < n; i2++) {
  4443. j = 0;
  4444. for (; j < m; j++) {
  4445. Z2[i2 * m + j] = X2[i2 * m + j] + Y[i2 * m + j];
  4446. }
  4447. }
  4448. return Z2;
  4449. }
  4450. function matrixMultiply(X2, Y, n, m, p) {
  4451. var i2 = 0;
  4452. var j;
  4453. var k;
  4454. var Z2 = Array(n * p);
  4455. for (; i2 < n; i2++) {
  4456. j = 0;
  4457. for (; j < p; j++) {
  4458. Z2[i2 * p + j] = 0;
  4459. k = 0;
  4460. for (; k < m; k++) {
  4461. Z2[i2 * p + j] += X2[i2 * m + k] * Y[k * p + j];
  4462. }
  4463. }
  4464. }
  4465. return Z2;
  4466. }
  4467. function matrixChol(X2, n) {
  4468. var i2;
  4469. var j;
  4470. var k;
  4471. var p = Array(n);
  4472. for (i2 = 0; i2 < n; i2++)
  4473. p[i2] = X2[i2 * n + i2];
  4474. for (i2 = 0; i2 < n; i2++) {
  4475. for (j = 0; j < i2; j++)
  4476. p[i2] -= X2[i2 * n + j] * X2[i2 * n + j];
  4477. if (p[i2] <= 0)
  4478. return false;
  4479. p[i2] = Math.sqrt(p[i2]);
  4480. for (j = i2 + 1; j < n; j++) {
  4481. for (k = 0; k < i2; k++)
  4482. X2[j * n + i2] -= X2[j * n + k] * X2[i2 * n + k];
  4483. X2[j * n + i2] /= p[i2];
  4484. }
  4485. }
  4486. for (i2 = 0; i2 < n; i2++)
  4487. X2[i2 * n + i2] = p[i2];
  4488. return true;
  4489. }
  4490. function matrixChol2inv(X2, n) {
  4491. var i2;
  4492. var j;
  4493. var k;
  4494. var sum;
  4495. for (i2 = 0; i2 < n; i2++) {
  4496. X2[i2 * n + i2] = 1 / X2[i2 * n + i2];
  4497. for (j = i2 + 1; j < n; j++) {
  4498. sum = 0;
  4499. for (k = i2; k < j; k++)
  4500. sum -= X2[j * n + k] * X2[k * n + i2];
  4501. X2[j * n + i2] = sum / X2[j * n + j];
  4502. }
  4503. }
  4504. for (i2 = 0; i2 < n; i2++)
  4505. for (j = i2 + 1; j < n; j++)
  4506. X2[i2 * n + j] = 0;
  4507. for (i2 = 0; i2 < n; i2++) {
  4508. X2[i2 * n + i2] *= X2[i2 * n + i2];
  4509. for (k = i2 + 1; k < n; k++)
  4510. X2[i2 * n + i2] += X2[k * n + i2] * X2[k * n + i2];
  4511. for (j = i2 + 1; j < n; j++)
  4512. for (k = j; k < n; k++)
  4513. X2[i2 * n + j] += X2[k * n + i2] * X2[k * n + j];
  4514. }
  4515. for (i2 = 0; i2 < n; i2++)
  4516. for (j = 0; j < i2; j++)
  4517. X2[i2 * n + j] = X2[j * n + i2];
  4518. }
  4519. function matrixSolve(X2, n) {
  4520. var m = n;
  4521. var b = Array(n * n);
  4522. var indxc = Array(n);
  4523. var indxr = Array(n);
  4524. var ipiv = Array(n);
  4525. var i2;
  4526. var icol = 0;
  4527. var irow = 0;
  4528. var j;
  4529. var k;
  4530. var l;
  4531. var ll;
  4532. var big;
  4533. var dum;
  4534. var pivinv;
  4535. var temp;
  4536. for (i2 = 0; i2 < n; i2++) {
  4537. for (j = 0; j < n; j++) {
  4538. if (i2 === j)
  4539. b[i2 * n + j] = 1;
  4540. else
  4541. b[i2 * n + j] = 0;
  4542. }
  4543. }
  4544. for (j = 0; j < n; j++)
  4545. ipiv[j] = 0;
  4546. for (i2 = 0; i2 < n; i2++) {
  4547. big = 0;
  4548. for (j = 0; j < n; j++) {
  4549. if (ipiv[j] !== 1) {
  4550. for (k = 0; k < n; k++) {
  4551. if (ipiv[k] === 0) {
  4552. if (Math.abs(X2[j * n + k]) >= big) {
  4553. big = Math.abs(X2[j * n + k]);
  4554. irow = j;
  4555. icol = k;
  4556. }
  4557. }
  4558. }
  4559. }
  4560. }
  4561. ++ipiv[icol];
  4562. if (irow !== icol) {
  4563. for (l = 0; l < n; l++) {
  4564. temp = X2[irow * n + l];
  4565. X2[irow * n + l] = X2[icol * n + l];
  4566. X2[icol * n + l] = temp;
  4567. }
  4568. for (l = 0; l < m; l++) {
  4569. temp = b[irow * n + l];
  4570. b[irow * n + l] = b[icol * n + l];
  4571. b[icol * n + l] = temp;
  4572. }
  4573. }
  4574. indxr[i2] = irow;
  4575. indxc[i2] = icol;
  4576. if (X2[icol * n + icol] === 0)
  4577. return false;
  4578. pivinv = 1 / X2[icol * n + icol];
  4579. X2[icol * n + icol] = 1;
  4580. for (l = 0; l < n; l++)
  4581. X2[icol * n + l] *= pivinv;
  4582. for (l = 0; l < m; l++)
  4583. b[icol * n + l] *= pivinv;
  4584. for (ll = 0; ll < n; ll++) {
  4585. if (ll !== icol) {
  4586. dum = X2[ll * n + icol];
  4587. X2[ll * n + icol] = 0;
  4588. for (l = 0; l < n; l++)
  4589. X2[ll * n + l] -= X2[icol * n + l] * dum;
  4590. for (l = 0; l < m; l++)
  4591. b[ll * n + l] -= b[icol * n + l] * dum;
  4592. }
  4593. }
  4594. }
  4595. for (l = n - 1; l >= 0; l--) {
  4596. if (indxr[l] !== indxc[l]) {
  4597. for (k = 0; k < n; k++) {
  4598. temp = X2[k * n + indxr[l]];
  4599. X2[k * n + indxr[l]] = X2[k * n + indxc[l]];
  4600. X2[k * n + indxc[l]] = temp;
  4601. }
  4602. }
  4603. }
  4604. return true;
  4605. }
  4606. function variogramGaussian(h2, nugget, range3, sill, A) {
  4607. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * Math.pow(h2 / range3, 2)));
  4608. }
  4609. function variogramExponential(h2, nugget, range3, sill, A) {
  4610. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * (h2 / range3)));
  4611. }
  4612. function variogramSpherical(h2, nugget, range3, sill) {
  4613. if (h2 > range3)
  4614. return nugget + (sill - nugget) / range3;
  4615. return nugget + (sill - nugget) / range3 * (1.5 * (h2 / range3) - 0.5 * Math.pow(h2 / range3, 3));
  4616. }
  4617. function train(t2, x, y, model, sigma2, alpha) {
  4618. var variogram = {
  4619. t: t2,
  4620. x,
  4621. y,
  4622. nugget: 0,
  4623. range: 0,
  4624. sill: 0,
  4625. A: 1 / 3,
  4626. n: 0,
  4627. model: variogramExponential,
  4628. K: [],
  4629. M: []
  4630. };
  4631. switch (model) {
  4632. case "gaussian":
  4633. variogram.model = variogramGaussian;
  4634. break;
  4635. case "exponential":
  4636. variogram.model = variogramExponential;
  4637. break;
  4638. case "spherical":
  4639. variogram.model = variogramSpherical;
  4640. break;
  4641. default:
  4642. variogram.model = variogramExponential;
  4643. }
  4644. var i2;
  4645. var j;
  4646. var k;
  4647. var l;
  4648. var n = t2.length;
  4649. var distance2 = Array((n * n - n) / 2);
  4650. for (i2 = 0, k = 0; i2 < n; i2++) {
  4651. for (j = 0; j < i2; j++, k++) {
  4652. distance2[k] = Array(2);
  4653. distance2[k][0] = Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5);
  4654. distance2[k][1] = Math.abs(t2[i2] - t2[j]);
  4655. }
  4656. }
  4657. distance2.sort(function(a, b) {
  4658. return a[0] - b[0];
  4659. });
  4660. variogram.range = distance2[(n * n - n) / 2 - 1][0];
  4661. var lags = (n * n - n) / 2 > 30 ? 30 : (n * n - n) / 2;
  4662. var tolerance = variogram.range / lags;
  4663. var lag = rep(0, lags);
  4664. var semi = rep(0, lags);
  4665. if (lags < 30) {
  4666. for (l = 0; l < lags; l++) {
  4667. lag[l] = distance2[l][0];
  4668. semi[l] = distance2[l][1];
  4669. }
  4670. } else {
  4671. for (i2 = 0, j = 0, k = 0, l = 0; i2 < lags && j < (n * n - n) / 2; i2++, k = 0) {
  4672. while (distance2[j][0] <= (i2 + 1) * tolerance) {
  4673. lag[l] += distance2[j][0];
  4674. semi[l] += distance2[j][1];
  4675. j++;
  4676. k++;
  4677. if (j >= (n * n - n) / 2)
  4678. break;
  4679. }
  4680. if (k > 0) {
  4681. lag[l] /= k;
  4682. semi[l] /= k;
  4683. l++;
  4684. }
  4685. }
  4686. if (l < 2)
  4687. return variogram;
  4688. }
  4689. n = l;
  4690. variogram.range = lag[n - 1] - lag[0];
  4691. var X2 = rep(1, 2 * n);
  4692. var Y = Array(n);
  4693. var A = variogram.A;
  4694. for (i2 = 0; i2 < n; i2++) {
  4695. switch (model) {
  4696. case "gaussian":
  4697. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * Math.pow(lag[i2] / variogram.range, 2));
  4698. break;
  4699. case "exponential":
  4700. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * lag[i2] / variogram.range);
  4701. break;
  4702. case "spherical":
  4703. X2[i2 * 2 + 1] = 1.5 * (lag[i2] / variogram.range) - 0.5 * Math.pow(lag[i2] / variogram.range, 3);
  4704. break;
  4705. }
  4706. Y[i2] = semi[i2];
  4707. }
  4708. var Xt2 = matrixTranspose(X2, n, 2);
  4709. var Z2 = matrixMultiply(Xt2, X2, 2, n, 2);
  4710. Z2 = matrixAdd(Z2, matrixDiag(1 / alpha, 2), 2, 2);
  4711. var cloneZ = Z2.slice(0);
  4712. if (matrixChol(Z2, 2)) {
  4713. matrixChol2inv(Z2, 2);
  4714. } else {
  4715. matrixSolve(cloneZ, 2);
  4716. Z2 = cloneZ;
  4717. }
  4718. var W2 = matrixMultiply(matrixMultiply(Z2, Xt2, 2, 2, n), Y, 2, n, 1);
  4719. variogram.nugget = W2[0];
  4720. variogram.sill = W2[1] * variogram.range + variogram.nugget;
  4721. variogram.n = x.length;
  4722. n = x.length;
  4723. var K2 = Array(n * n);
  4724. for (i2 = 0; i2 < n; i2++) {
  4725. for (j = 0; j < i2; j++) {
  4726. K2[i2 * n + j] = variogram.model(Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4727. K2[j * n + i2] = K2[i2 * n + j];
  4728. }
  4729. K2[i2 * n + i2] = variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4730. }
  4731. var C2 = matrixAdd(K2, matrixDiag(sigma2, n), n, n);
  4732. var cloneC = C2.slice(0);
  4733. if (matrixChol(C2, n)) {
  4734. matrixChol2inv(C2, n);
  4735. } else {
  4736. matrixSolve(cloneC, n);
  4737. C2 = cloneC;
  4738. }
  4739. var K1 = C2.slice(0);
  4740. var M = matrixMultiply(C2, t2, n, n, 1);
  4741. variogram.K = K1;
  4742. variogram.M = M;
  4743. return variogram;
  4744. }
  4745. function predict(x, y, variogram) {
  4746. var i2;
  4747. var k = Array(variogram.n);
  4748. for (i2 = 0; i2 < variogram.n; i2++) {
  4749. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4750. }
  4751. return matrixMultiply(k, variogram.M, 1, variogram.n, 1)[0];
  4752. }
  4753. function variance(x, y, variogram) {
  4754. var i2;
  4755. var k = Array(variogram.n);
  4756. for (i2 = 0; i2 < variogram.n; i2++) {
  4757. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4758. }
  4759. var val = matrixMultiply(matrixMultiply(k, variogram.K, 1, variogram.n, variogram.n), k, 1, variogram.n, 1)[0];
  4760. return variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A) + val;
  4761. }
  4762. function grid(polygons2, variogram, width2) {
  4763. var i2;
  4764. var j;
  4765. var k;
  4766. var n = polygons2.length;
  4767. if (n === 0)
  4768. return;
  4769. var xlim = [polygons2[0][0][0], polygons2[0][0][0]];
  4770. var ylim = [polygons2[0][0][1], polygons2[0][0][1]];
  4771. for (i2 = 0; i2 < n; i2++) {
  4772. for (j = 0; j < polygons2[i2].length; j++) {
  4773. if (polygons2[i2][j][0] < xlim[0])
  4774. xlim[0] = polygons2[i2][j][0];
  4775. if (polygons2[i2][j][0] > xlim[1])
  4776. xlim[1] = polygons2[i2][j][0];
  4777. if (polygons2[i2][j][1] < ylim[0])
  4778. ylim[0] = polygons2[i2][j][1];
  4779. if (polygons2[i2][j][1] > ylim[1])
  4780. ylim[1] = polygons2[i2][j][1];
  4781. }
  4782. }
  4783. var xtarget;
  4784. var ytarget;
  4785. var a = Array(2);
  4786. var b = Array(2);
  4787. var lxlim = Array(2);
  4788. var lylim = Array(2);
  4789. var x = Math.ceil((xlim[1] - xlim[0]) / width2);
  4790. var y = Math.ceil((ylim[1] - ylim[0]) / width2);
  4791. var A = Array(x + 1);
  4792. for (i2 = 0; i2 <= x; i2++)
  4793. A[i2] = Array(y + 1);
  4794. for (i2 = 0; i2 < n; i2++) {
  4795. lxlim[0] = polygons2[i2][0][0];
  4796. lxlim[1] = lxlim[0];
  4797. lylim[0] = polygons2[i2][0][1];
  4798. lylim[1] = lylim[0];
  4799. for (j = 1; j < polygons2[i2].length; j++) {
  4800. if (polygons2[i2][j][0] < lxlim[0])
  4801. lxlim[0] = polygons2[i2][j][0];
  4802. if (polygons2[i2][j][0] > lxlim[1])
  4803. lxlim[1] = polygons2[i2][j][0];
  4804. if (polygons2[i2][j][1] < lylim[0])
  4805. lylim[0] = polygons2[i2][j][1];
  4806. if (polygons2[i2][j][1] > lylim[1])
  4807. lylim[1] = polygons2[i2][j][1];
  4808. }
  4809. a[0] = Math.floor((lxlim[0] - (lxlim[0] - xlim[0]) % width2 - xlim[0]) / width2);
  4810. a[1] = Math.ceil((lxlim[1] - (lxlim[1] - xlim[1]) % width2 - xlim[0]) / width2);
  4811. b[0] = Math.floor((lylim[0] - (lylim[0] - ylim[0]) % width2 - ylim[0]) / width2);
  4812. b[1] = Math.ceil((lylim[1] - (lylim[1] - ylim[1]) % width2 - ylim[0]) / width2);
  4813. for (j = a[0]; j <= a[1]; j++) {
  4814. for (k = b[0]; k <= b[1]; k++) {
  4815. xtarget = xlim[0] + j * width2;
  4816. ytarget = ylim[0] + k * width2;
  4817. if (pip(polygons2[i2], xtarget, ytarget)) {
  4818. A[j][k] = predict(xtarget, ytarget, variogram);
  4819. }
  4820. }
  4821. }
  4822. }
  4823. return {
  4824. xlim,
  4825. ylim,
  4826. width: width2,
  4827. data: A,
  4828. zlim: [min(variogram.t), max(variogram.t)]
  4829. };
  4830. }
  4831. function plot(canvas, grid2, xlim, ylim, colors) {
  4832. var ctx = canvas.getContext("2d");
  4833. var data = grid2.data, zlim = grid2.zlim, width2 = grid2.width;
  4834. if (ctx) {
  4835. ctx.clearRect(0, 0, canvas.width, canvas.height);
  4836. var range3 = [xlim[1] - xlim[0], ylim[1] - ylim[0], zlim[1] - zlim[0]];
  4837. var i2 = void 0;
  4838. var j = void 0;
  4839. var x = void 0;
  4840. var y = void 0;
  4841. var z = void 0;
  4842. var n = data.length;
  4843. var m = data[0].length;
  4844. var wx = Math.ceil(width2 * canvas.width / (xlim[1] - xlim[0]));
  4845. var wy = Math.ceil(width2 * canvas.height / (ylim[1] - ylim[0]));
  4846. for (i2 = 0; i2 < n; i2++) {
  4847. for (j = 0; j < m; j++) {
  4848. if (data[i2][j] === void 0)
  4849. continue;
  4850. x = canvas.width * (i2 * width2 + grid2.xlim[0] - xlim[0]) / range3[0];
  4851. y = canvas.height * (1 - (j * width2 + grid2.ylim[0] - ylim[0]) / range3[1]);
  4852. z = (data[i2][j] - zlim[0]) / range3[2];
  4853. if (z < 0)
  4854. z = 0;
  4855. if (z > 1)
  4856. z = 1;
  4857. ctx.fillStyle = colors[Math.floor((colors.length - 1) * z)];
  4858. ctx.fillRect(Math.round(x - wx / 2), Math.round(y - wy / 2), wx, wy);
  4859. }
  4860. }
  4861. }
  4862. }
  4863. var index = {
  4864. train,
  4865. predict,
  4866. variance,
  4867. grid,
  4868. plot,
  4869. max,
  4870. min,
  4871. pip,
  4872. rep,
  4873. matrixDiag,
  4874. matrixTranspose,
  4875. matrixAdd,
  4876. matrixMultiply,
  4877. matrixChol,
  4878. matrixChol2inv,
  4879. matrixSolve,
  4880. variogramGaussian,
  4881. variogramExponential,
  4882. variogramSpherical
  4883. };
  4884. var earthRadius = 63710088e-1;
  4885. var factors = {
  4886. centimeters: earthRadius * 100,
  4887. centimetres: earthRadius * 100,
  4888. degrees: earthRadius / 111325,
  4889. feet: earthRadius * 3.28084,
  4890. inches: earthRadius * 39.37,
  4891. kilometers: earthRadius / 1e3,
  4892. kilometres: earthRadius / 1e3,
  4893. meters: earthRadius,
  4894. metres: earthRadius,
  4895. miles: earthRadius / 1609.344,
  4896. millimeters: earthRadius * 1e3,
  4897. millimetres: earthRadius * 1e3,
  4898. nauticalmiles: earthRadius / 1852,
  4899. radians: 1,
  4900. yards: earthRadius * 1.0936
  4901. };
  4902. var unitsFactors = {
  4903. centimeters: 100,
  4904. centimetres: 100,
  4905. degrees: 1 / 111325,
  4906. feet: 3.28084,
  4907. inches: 39.37,
  4908. kilometers: 1 / 1e3,
  4909. kilometres: 1 / 1e3,
  4910. meters: 1,
  4911. metres: 1,
  4912. miles: 1 / 1609.344,
  4913. millimeters: 1e3,
  4914. millimetres: 1e3,
  4915. nauticalmiles: 1 / 1852,
  4916. radians: 1 / earthRadius,
  4917. yards: 1.0936133
  4918. };
  4919. var areaFactors = {
  4920. acres: 247105e-9,
  4921. centimeters: 1e4,
  4922. centimetres: 1e4,
  4923. feet: 10.763910417,
  4924. hectares: 1e-4,
  4925. inches: 1550.003100006,
  4926. kilometers: 1e-6,
  4927. kilometres: 1e-6,
  4928. meters: 1,
  4929. metres: 1,
  4930. miles: 386e-9,
  4931. millimeters: 1e6,
  4932. millimetres: 1e6,
  4933. yards: 1.195990046
  4934. };
  4935. function feature(geom, properties, options2) {
  4936. if (options2 === void 0) {
  4937. options2 = {};
  4938. }
  4939. var feat = { type: "Feature" };
  4940. if (options2.id === 0 || options2.id) {
  4941. feat.id = options2.id;
  4942. }
  4943. if (options2.bbox) {
  4944. feat.bbox = options2.bbox;
  4945. }
  4946. feat.properties = properties || {};
  4947. feat.geometry = geom;
  4948. return feat;
  4949. }
  4950. function geometry(type2, coordinates, _options) {
  4951. switch (type2) {
  4952. case "Point":
  4953. return point(coordinates).geometry;
  4954. case "LineString":
  4955. return lineString(coordinates).geometry;
  4956. case "Polygon":
  4957. return polygon(coordinates).geometry;
  4958. case "MultiPoint":
  4959. return multiPoint(coordinates).geometry;
  4960. case "MultiLineString":
  4961. return multiLineString(coordinates).geometry;
  4962. case "MultiPolygon":
  4963. return multiPolygon(coordinates).geometry;
  4964. default:
  4965. throw new Error(type2 + " is invalid");
  4966. }
  4967. }
  4968. function point(coordinates, properties, options2) {
  4969. if (options2 === void 0) {
  4970. options2 = {};
  4971. }
  4972. if (!coordinates) {
  4973. throw new Error("coordinates is required");
  4974. }
  4975. if (!Array.isArray(coordinates)) {
  4976. throw new Error("coordinates must be an Array");
  4977. }
  4978. if (coordinates.length < 2) {
  4979. throw new Error("coordinates must be at least 2 numbers long");
  4980. }
  4981. if (!isNumber$1(coordinates[0]) || !isNumber$1(coordinates[1])) {
  4982. throw new Error("coordinates must contain numbers");
  4983. }
  4984. var geom = {
  4985. type: "Point",
  4986. coordinates
  4987. };
  4988. return feature(geom, properties, options2);
  4989. }
  4990. function points(coordinates, properties, options2) {
  4991. if (options2 === void 0) {
  4992. options2 = {};
  4993. }
  4994. return featureCollection$1(coordinates.map(function(coords) {
  4995. return point(coords, properties);
  4996. }), options2);
  4997. }
  4998. function polygon(coordinates, properties, options2) {
  4999. if (options2 === void 0) {
  5000. options2 = {};
  5001. }
  5002. for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
  5003. var ring = coordinates_1[_i];
  5004. if (ring.length < 4) {
  5005. throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
  5006. }
  5007. for (var j = 0; j < ring[ring.length - 1].length; j++) {
  5008. if (ring[ring.length - 1][j] !== ring[0][j]) {
  5009. throw new Error("First and last Position are not equivalent.");
  5010. }
  5011. }
  5012. }
  5013. var geom = {
  5014. type: "Polygon",
  5015. coordinates
  5016. };
  5017. return feature(geom, properties, options2);
  5018. }
  5019. function polygons(coordinates, properties, options2) {
  5020. if (options2 === void 0) {
  5021. options2 = {};
  5022. }
  5023. return featureCollection$1(coordinates.map(function(coords) {
  5024. return polygon(coords, properties);
  5025. }), options2);
  5026. }
  5027. function lineString(coordinates, properties, options2) {
  5028. if (options2 === void 0) {
  5029. options2 = {};
  5030. }
  5031. if (coordinates.length < 2) {
  5032. throw new Error("coordinates must be an array of two or more positions");
  5033. }
  5034. var geom = {
  5035. type: "LineString",
  5036. coordinates
  5037. };
  5038. return feature(geom, properties, options2);
  5039. }
  5040. function lineStrings(coordinates, properties, options2) {
  5041. if (options2 === void 0) {
  5042. options2 = {};
  5043. }
  5044. return featureCollection$1(coordinates.map(function(coords) {
  5045. return lineString(coords, properties);
  5046. }), options2);
  5047. }
  5048. function featureCollection$1(features, options2) {
  5049. if (options2 === void 0) {
  5050. options2 = {};
  5051. }
  5052. var fc = { type: "FeatureCollection" };
  5053. if (options2.id) {
  5054. fc.id = options2.id;
  5055. }
  5056. if (options2.bbox) {
  5057. fc.bbox = options2.bbox;
  5058. }
  5059. fc.features = features;
  5060. return fc;
  5061. }
  5062. function multiLineString(coordinates, properties, options2) {
  5063. if (options2 === void 0) {
  5064. options2 = {};
  5065. }
  5066. var geom = {
  5067. type: "MultiLineString",
  5068. coordinates
  5069. };
  5070. return feature(geom, properties, options2);
  5071. }
  5072. function multiPoint(coordinates, properties, options2) {
  5073. if (options2 === void 0) {
  5074. options2 = {};
  5075. }
  5076. var geom = {
  5077. type: "MultiPoint",
  5078. coordinates
  5079. };
  5080. return feature(geom, properties, options2);
  5081. }
  5082. function multiPolygon(coordinates, properties, options2) {
  5083. if (options2 === void 0) {
  5084. options2 = {};
  5085. }
  5086. var geom = {
  5087. type: "MultiPolygon",
  5088. coordinates
  5089. };
  5090. return feature(geom, properties, options2);
  5091. }
  5092. function geometryCollection(geometries, properties, options2) {
  5093. if (options2 === void 0) {
  5094. options2 = {};
  5095. }
  5096. var geom = {
  5097. type: "GeometryCollection",
  5098. geometries
  5099. };
  5100. return feature(geom, properties, options2);
  5101. }
  5102. function round(num, precision) {
  5103. if (precision === void 0) {
  5104. precision = 0;
  5105. }
  5106. if (precision && !(precision >= 0)) {
  5107. throw new Error("precision must be a positive number");
  5108. }
  5109. var multiplier = Math.pow(10, precision || 0);
  5110. return Math.round(num * multiplier) / multiplier;
  5111. }
  5112. function radiansToLength(radians, units) {
  5113. if (units === void 0) {
  5114. units = "kilometers";
  5115. }
  5116. var factor = factors[units];
  5117. if (!factor) {
  5118. throw new Error(units + " units is invalid");
  5119. }
  5120. return radians * factor;
  5121. }
  5122. function lengthToRadians(distance2, units) {
  5123. if (units === void 0) {
  5124. units = "kilometers";
  5125. }
  5126. var factor = factors[units];
  5127. if (!factor) {
  5128. throw new Error(units + " units is invalid");
  5129. }
  5130. return distance2 / factor;
  5131. }
  5132. function lengthToDegrees(distance2, units) {
  5133. return radiansToDegrees(lengthToRadians(distance2, units));
  5134. }
  5135. function bearingToAzimuth(bearing2) {
  5136. var angle = bearing2 % 360;
  5137. if (angle < 0) {
  5138. angle += 360;
  5139. }
  5140. return angle;
  5141. }
  5142. function radiansToDegrees(radians) {
  5143. var degrees = radians % (2 * Math.PI);
  5144. return degrees * 180 / Math.PI;
  5145. }
  5146. function degreesToRadians(degrees) {
  5147. var radians = degrees % 360;
  5148. return radians * Math.PI / 180;
  5149. }
  5150. function convertLength(length, originalUnit, finalUnit) {
  5151. if (originalUnit === void 0) {
  5152. originalUnit = "kilometers";
  5153. }
  5154. if (finalUnit === void 0) {
  5155. finalUnit = "kilometers";
  5156. }
  5157. if (!(length >= 0)) {
  5158. throw new Error("length must be a positive number");
  5159. }
  5160. return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);
  5161. }
  5162. function convertArea(area, originalUnit, finalUnit) {
  5163. if (originalUnit === void 0) {
  5164. originalUnit = "meters";
  5165. }
  5166. if (finalUnit === void 0) {
  5167. finalUnit = "kilometers";
  5168. }
  5169. if (!(area >= 0)) {
  5170. throw new Error("area must be a positive number");
  5171. }
  5172. var startFactor = areaFactors[originalUnit];
  5173. if (!startFactor) {
  5174. throw new Error("invalid original units");
  5175. }
  5176. var finalFactor = areaFactors[finalUnit];
  5177. if (!finalFactor) {
  5178. throw new Error("invalid final units");
  5179. }
  5180. return area / startFactor * finalFactor;
  5181. }
  5182. function isNumber$1(num) {
  5183. return !isNaN(num) && num !== null && !Array.isArray(num);
  5184. }
  5185. function isObject$6(input) {
  5186. return !!input && input.constructor === Object;
  5187. }
  5188. function validateBBox(bbox2) {
  5189. if (!bbox2) {
  5190. throw new Error("bbox is required");
  5191. }
  5192. if (!Array.isArray(bbox2)) {
  5193. throw new Error("bbox must be an Array");
  5194. }
  5195. if (bbox2.length !== 4 && bbox2.length !== 6) {
  5196. throw new Error("bbox must be an Array of 4 or 6 numbers");
  5197. }
  5198. bbox2.forEach(function(num) {
  5199. if (!isNumber$1(num)) {
  5200. throw new Error("bbox must only contain numbers");
  5201. }
  5202. });
  5203. }
  5204. function validateId(id) {
  5205. if (!id) {
  5206. throw new Error("id is required");
  5207. }
  5208. if (["string", "number"].indexOf(typeof id) === -1) {
  5209. throw new Error("id must be a number or a string");
  5210. }
  5211. }
  5212. var es$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5213. __proto__: null,
  5214. earthRadius,
  5215. factors,
  5216. unitsFactors,
  5217. areaFactors,
  5218. feature,
  5219. geometry,
  5220. point,
  5221. points,
  5222. polygon,
  5223. polygons,
  5224. lineString,
  5225. lineStrings,
  5226. featureCollection: featureCollection$1,
  5227. multiLineString,
  5228. multiPoint,
  5229. multiPolygon,
  5230. geometryCollection,
  5231. round,
  5232. radiansToLength,
  5233. lengthToRadians,
  5234. lengthToDegrees,
  5235. bearingToAzimuth,
  5236. radiansToDegrees,
  5237. degreesToRadians,
  5238. convertLength,
  5239. convertArea,
  5240. isNumber: isNumber$1,
  5241. isObject: isObject$6,
  5242. validateBBox,
  5243. validateId
  5244. }, Symbol.toStringTag, { value: "Module" }));
  5245. function coordEach(geojson, callback2, excludeWrapCoord) {
  5246. if (geojson === null)
  5247. return;
  5248. var j, k, l, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5249. for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
  5250. geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
  5251. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5252. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5253. for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
  5254. var multiFeatureIndex = 0;
  5255. var geometryIndex = 0;
  5256. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
  5257. if (geometry2 === null)
  5258. continue;
  5259. coords = geometry2.coordinates;
  5260. var geomType = geometry2.type;
  5261. wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
  5262. switch (geomType) {
  5263. case null:
  5264. break;
  5265. case "Point":
  5266. if (callback2(
  5267. coords,
  5268. coordIndex,
  5269. featureIndex,
  5270. multiFeatureIndex,
  5271. geometryIndex
  5272. ) === false)
  5273. return false;
  5274. coordIndex++;
  5275. multiFeatureIndex++;
  5276. break;
  5277. case "LineString":
  5278. case "MultiPoint":
  5279. for (j = 0; j < coords.length; j++) {
  5280. if (callback2(
  5281. coords[j],
  5282. coordIndex,
  5283. featureIndex,
  5284. multiFeatureIndex,
  5285. geometryIndex
  5286. ) === false)
  5287. return false;
  5288. coordIndex++;
  5289. if (geomType === "MultiPoint")
  5290. multiFeatureIndex++;
  5291. }
  5292. if (geomType === "LineString")
  5293. multiFeatureIndex++;
  5294. break;
  5295. case "Polygon":
  5296. case "MultiLineString":
  5297. for (j = 0; j < coords.length; j++) {
  5298. for (k = 0; k < coords[j].length - wrapShrink; k++) {
  5299. if (callback2(
  5300. coords[j][k],
  5301. coordIndex,
  5302. featureIndex,
  5303. multiFeatureIndex,
  5304. geometryIndex
  5305. ) === false)
  5306. return false;
  5307. coordIndex++;
  5308. }
  5309. if (geomType === "MultiLineString")
  5310. multiFeatureIndex++;
  5311. if (geomType === "Polygon")
  5312. geometryIndex++;
  5313. }
  5314. if (geomType === "Polygon")
  5315. multiFeatureIndex++;
  5316. break;
  5317. case "MultiPolygon":
  5318. for (j = 0; j < coords.length; j++) {
  5319. geometryIndex = 0;
  5320. for (k = 0; k < coords[j].length; k++) {
  5321. for (l = 0; l < coords[j][k].length - wrapShrink; l++) {
  5322. if (callback2(
  5323. coords[j][k][l],
  5324. coordIndex,
  5325. featureIndex,
  5326. multiFeatureIndex,
  5327. geometryIndex
  5328. ) === false)
  5329. return false;
  5330. coordIndex++;
  5331. }
  5332. geometryIndex++;
  5333. }
  5334. multiFeatureIndex++;
  5335. }
  5336. break;
  5337. case "GeometryCollection":
  5338. for (j = 0; j < geometry2.geometries.length; j++)
  5339. if (coordEach(geometry2.geometries[j], callback2, excludeWrapCoord) === false)
  5340. return false;
  5341. break;
  5342. default:
  5343. throw new Error("Unknown Geometry Type");
  5344. }
  5345. }
  5346. }
  5347. }
  5348. function coordReduce(geojson, callback2, initialValue, excludeWrapCoord) {
  5349. var previousValue = initialValue;
  5350. coordEach(
  5351. geojson,
  5352. function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
  5353. if (coordIndex === 0 && initialValue === void 0)
  5354. previousValue = currentCoord;
  5355. else
  5356. previousValue = callback2(
  5357. previousValue,
  5358. currentCoord,
  5359. coordIndex,
  5360. featureIndex,
  5361. multiFeatureIndex,
  5362. geometryIndex
  5363. );
  5364. },
  5365. excludeWrapCoord
  5366. );
  5367. return previousValue;
  5368. }
  5369. function propEach(geojson, callback2) {
  5370. var i2;
  5371. switch (geojson.type) {
  5372. case "FeatureCollection":
  5373. for (i2 = 0; i2 < geojson.features.length; i2++) {
  5374. if (callback2(geojson.features[i2].properties, i2) === false)
  5375. break;
  5376. }
  5377. break;
  5378. case "Feature":
  5379. callback2(geojson.properties, 0);
  5380. break;
  5381. }
  5382. }
  5383. function propReduce(geojson, callback2, initialValue) {
  5384. var previousValue = initialValue;
  5385. propEach(geojson, function(currentProperties, featureIndex) {
  5386. if (featureIndex === 0 && initialValue === void 0)
  5387. previousValue = currentProperties;
  5388. else
  5389. previousValue = callback2(previousValue, currentProperties, featureIndex);
  5390. });
  5391. return previousValue;
  5392. }
  5393. function featureEach$1(geojson, callback2) {
  5394. if (geojson.type === "Feature") {
  5395. callback2(geojson, 0);
  5396. } else if (geojson.type === "FeatureCollection") {
  5397. for (var i2 = 0; i2 < geojson.features.length; i2++) {
  5398. if (callback2(geojson.features[i2], i2) === false)
  5399. break;
  5400. }
  5401. }
  5402. }
  5403. function featureReduce(geojson, callback2, initialValue) {
  5404. var previousValue = initialValue;
  5405. featureEach$1(geojson, function(currentFeature, featureIndex) {
  5406. if (featureIndex === 0 && initialValue === void 0)
  5407. previousValue = currentFeature;
  5408. else
  5409. previousValue = callback2(previousValue, currentFeature, featureIndex);
  5410. });
  5411. return previousValue;
  5412. }
  5413. function coordAll(geojson) {
  5414. var coords = [];
  5415. coordEach(geojson, function(coord) {
  5416. coords.push(coord);
  5417. });
  5418. return coords;
  5419. }
  5420. function geomEach(geojson, callback2) {
  5421. var i2, j, g, geometry2, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId, featureIndex = 0, isFeatureCollection = geojson.type === "FeatureCollection", isFeature = geojson.type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5422. for (i2 = 0; i2 < stop; i2++) {
  5423. geometryMaybeCollection = isFeatureCollection ? geojson.features[i2].geometry : isFeature ? geojson.geometry : geojson;
  5424. featureProperties = isFeatureCollection ? geojson.features[i2].properties : isFeature ? geojson.properties : {};
  5425. featureBBox = isFeatureCollection ? geojson.features[i2].bbox : isFeature ? geojson.bbox : void 0;
  5426. featureId = isFeatureCollection ? geojson.features[i2].id : isFeature ? geojson.id : void 0;
  5427. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5428. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5429. for (g = 0; g < stopG; g++) {
  5430. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[g] : geometryMaybeCollection;
  5431. if (geometry2 === null) {
  5432. if (callback2(
  5433. null,
  5434. featureIndex,
  5435. featureProperties,
  5436. featureBBox,
  5437. featureId
  5438. ) === false)
  5439. return false;
  5440. continue;
  5441. }
  5442. switch (geometry2.type) {
  5443. case "Point":
  5444. case "LineString":
  5445. case "MultiPoint":
  5446. case "Polygon":
  5447. case "MultiLineString":
  5448. case "MultiPolygon": {
  5449. if (callback2(
  5450. geometry2,
  5451. featureIndex,
  5452. featureProperties,
  5453. featureBBox,
  5454. featureId
  5455. ) === false)
  5456. return false;
  5457. break;
  5458. }
  5459. case "GeometryCollection": {
  5460. for (j = 0; j < geometry2.geometries.length; j++) {
  5461. if (callback2(
  5462. geometry2.geometries[j],
  5463. featureIndex,
  5464. featureProperties,
  5465. featureBBox,
  5466. featureId
  5467. ) === false)
  5468. return false;
  5469. }
  5470. break;
  5471. }
  5472. default:
  5473. throw new Error("Unknown Geometry Type");
  5474. }
  5475. }
  5476. featureIndex++;
  5477. }
  5478. }
  5479. function geomReduce(geojson, callback2, initialValue) {
  5480. var previousValue = initialValue;
  5481. geomEach(
  5482. geojson,
  5483. function(currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {
  5484. if (featureIndex === 0 && initialValue === void 0)
  5485. previousValue = currentGeometry;
  5486. else
  5487. previousValue = callback2(
  5488. previousValue,
  5489. currentGeometry,
  5490. featureIndex,
  5491. featureProperties,
  5492. featureBBox,
  5493. featureId
  5494. );
  5495. }
  5496. );
  5497. return previousValue;
  5498. }
  5499. function flattenEach(geojson, callback2) {
  5500. geomEach(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
  5501. var type2 = geometry2 === null ? null : geometry2.type;
  5502. switch (type2) {
  5503. case null:
  5504. case "Point":
  5505. case "LineString":
  5506. case "Polygon":
  5507. if (callback2(
  5508. feature(geometry2, properties, { bbox: bbox2, id }),
  5509. featureIndex,
  5510. 0
  5511. ) === false)
  5512. return false;
  5513. return;
  5514. }
  5515. var geomType;
  5516. switch (type2) {
  5517. case "MultiPoint":
  5518. geomType = "Point";
  5519. break;
  5520. case "MultiLineString":
  5521. geomType = "LineString";
  5522. break;
  5523. case "MultiPolygon":
  5524. geomType = "Polygon";
  5525. break;
  5526. }
  5527. for (var multiFeatureIndex = 0; multiFeatureIndex < geometry2.coordinates.length; multiFeatureIndex++) {
  5528. var coordinate = geometry2.coordinates[multiFeatureIndex];
  5529. var geom = {
  5530. type: geomType,
  5531. coordinates: coordinate
  5532. };
  5533. if (callback2(feature(geom, properties), featureIndex, multiFeatureIndex) === false)
  5534. return false;
  5535. }
  5536. });
  5537. }
  5538. function flattenReduce(geojson, callback2, initialValue) {
  5539. var previousValue = initialValue;
  5540. flattenEach(
  5541. geojson,
  5542. function(currentFeature, featureIndex, multiFeatureIndex) {
  5543. if (featureIndex === 0 && multiFeatureIndex === 0 && initialValue === void 0)
  5544. previousValue = currentFeature;
  5545. else
  5546. previousValue = callback2(
  5547. previousValue,
  5548. currentFeature,
  5549. featureIndex,
  5550. multiFeatureIndex
  5551. );
  5552. }
  5553. );
  5554. return previousValue;
  5555. }
  5556. function segmentEach(geojson, callback2) {
  5557. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5558. var segmentIndex = 0;
  5559. if (!feature2.geometry)
  5560. return;
  5561. var type2 = feature2.geometry.type;
  5562. if (type2 === "Point" || type2 === "MultiPoint")
  5563. return;
  5564. var previousCoords;
  5565. var previousFeatureIndex = 0;
  5566. var previousMultiIndex = 0;
  5567. var prevGeomIndex = 0;
  5568. if (coordEach(
  5569. feature2,
  5570. function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
  5571. if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
  5572. previousCoords = currentCoord;
  5573. previousFeatureIndex = featureIndex;
  5574. previousMultiIndex = multiPartIndexCoord;
  5575. prevGeomIndex = geometryIndex;
  5576. segmentIndex = 0;
  5577. return;
  5578. }
  5579. var currentSegment = lineString(
  5580. [previousCoords, currentCoord],
  5581. feature2.properties
  5582. );
  5583. if (callback2(
  5584. currentSegment,
  5585. featureIndex,
  5586. multiFeatureIndex,
  5587. geometryIndex,
  5588. segmentIndex
  5589. ) === false)
  5590. return false;
  5591. segmentIndex++;
  5592. previousCoords = currentCoord;
  5593. }
  5594. ) === false)
  5595. return false;
  5596. });
  5597. }
  5598. function segmentReduce(geojson, callback2, initialValue) {
  5599. var previousValue = initialValue;
  5600. var started = false;
  5601. segmentEach(
  5602. geojson,
  5603. function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {
  5604. if (started === false && initialValue === void 0)
  5605. previousValue = currentSegment;
  5606. else
  5607. previousValue = callback2(
  5608. previousValue,
  5609. currentSegment,
  5610. featureIndex,
  5611. multiFeatureIndex,
  5612. geometryIndex,
  5613. segmentIndex
  5614. );
  5615. started = true;
  5616. }
  5617. );
  5618. return previousValue;
  5619. }
  5620. function lineEach(geojson, callback2) {
  5621. if (!geojson)
  5622. throw new Error("geojson is required");
  5623. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5624. if (feature2.geometry === null)
  5625. return;
  5626. var type2 = feature2.geometry.type;
  5627. var coords = feature2.geometry.coordinates;
  5628. switch (type2) {
  5629. case "LineString":
  5630. if (callback2(feature2, featureIndex, multiFeatureIndex, 0, 0) === false)
  5631. return false;
  5632. break;
  5633. case "Polygon":
  5634. for (var geometryIndex = 0; geometryIndex < coords.length; geometryIndex++) {
  5635. if (callback2(
  5636. lineString(coords[geometryIndex], feature2.properties),
  5637. featureIndex,
  5638. multiFeatureIndex,
  5639. geometryIndex
  5640. ) === false)
  5641. return false;
  5642. }
  5643. break;
  5644. }
  5645. });
  5646. }
  5647. function lineReduce(geojson, callback2, initialValue) {
  5648. var previousValue = initialValue;
  5649. lineEach(
  5650. geojson,
  5651. function(currentLine, featureIndex, multiFeatureIndex, geometryIndex) {
  5652. if (featureIndex === 0 && initialValue === void 0)
  5653. previousValue = currentLine;
  5654. else
  5655. previousValue = callback2(
  5656. previousValue,
  5657. currentLine,
  5658. featureIndex,
  5659. multiFeatureIndex,
  5660. geometryIndex
  5661. );
  5662. }
  5663. );
  5664. return previousValue;
  5665. }
  5666. function findSegment(geojson, options2) {
  5667. options2 = options2 || {};
  5668. if (!isObject$6(options2))
  5669. throw new Error("options is invalid");
  5670. var featureIndex = options2.featureIndex || 0;
  5671. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5672. var geometryIndex = options2.geometryIndex || 0;
  5673. var segmentIndex = options2.segmentIndex || 0;
  5674. var properties = options2.properties;
  5675. var geometry2;
  5676. switch (geojson.type) {
  5677. case "FeatureCollection":
  5678. if (featureIndex < 0)
  5679. featureIndex = geojson.features.length + featureIndex;
  5680. properties = properties || geojson.features[featureIndex].properties;
  5681. geometry2 = geojson.features[featureIndex].geometry;
  5682. break;
  5683. case "Feature":
  5684. properties = properties || geojson.properties;
  5685. geometry2 = geojson.geometry;
  5686. break;
  5687. case "Point":
  5688. case "MultiPoint":
  5689. return null;
  5690. case "LineString":
  5691. case "Polygon":
  5692. case "MultiLineString":
  5693. case "MultiPolygon":
  5694. geometry2 = geojson;
  5695. break;
  5696. default:
  5697. throw new Error("geojson is invalid");
  5698. }
  5699. if (geometry2 === null)
  5700. return null;
  5701. var coords = geometry2.coordinates;
  5702. switch (geometry2.type) {
  5703. case "Point":
  5704. case "MultiPoint":
  5705. return null;
  5706. case "LineString":
  5707. if (segmentIndex < 0)
  5708. segmentIndex = coords.length + segmentIndex - 1;
  5709. return lineString(
  5710. [coords[segmentIndex], coords[segmentIndex + 1]],
  5711. properties,
  5712. options2
  5713. );
  5714. case "Polygon":
  5715. if (geometryIndex < 0)
  5716. geometryIndex = coords.length + geometryIndex;
  5717. if (segmentIndex < 0)
  5718. segmentIndex = coords[geometryIndex].length + segmentIndex - 1;
  5719. return lineString(
  5720. [
  5721. coords[geometryIndex][segmentIndex],
  5722. coords[geometryIndex][segmentIndex + 1]
  5723. ],
  5724. properties,
  5725. options2
  5726. );
  5727. case "MultiLineString":
  5728. if (multiFeatureIndex < 0)
  5729. multiFeatureIndex = coords.length + multiFeatureIndex;
  5730. if (segmentIndex < 0)
  5731. segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;
  5732. return lineString(
  5733. [
  5734. coords[multiFeatureIndex][segmentIndex],
  5735. coords[multiFeatureIndex][segmentIndex + 1]
  5736. ],
  5737. properties,
  5738. options2
  5739. );
  5740. case "MultiPolygon":
  5741. if (multiFeatureIndex < 0)
  5742. multiFeatureIndex = coords.length + multiFeatureIndex;
  5743. if (geometryIndex < 0)
  5744. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5745. if (segmentIndex < 0)
  5746. segmentIndex = coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;
  5747. return lineString(
  5748. [
  5749. coords[multiFeatureIndex][geometryIndex][segmentIndex],
  5750. coords[multiFeatureIndex][geometryIndex][segmentIndex + 1]
  5751. ],
  5752. properties,
  5753. options2
  5754. );
  5755. }
  5756. throw new Error("geojson is invalid");
  5757. }
  5758. function findPoint(geojson, options2) {
  5759. options2 = options2 || {};
  5760. if (!isObject$6(options2))
  5761. throw new Error("options is invalid");
  5762. var featureIndex = options2.featureIndex || 0;
  5763. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5764. var geometryIndex = options2.geometryIndex || 0;
  5765. var coordIndex = options2.coordIndex || 0;
  5766. var properties = options2.properties;
  5767. var geometry2;
  5768. switch (geojson.type) {
  5769. case "FeatureCollection":
  5770. if (featureIndex < 0)
  5771. featureIndex = geojson.features.length + featureIndex;
  5772. properties = properties || geojson.features[featureIndex].properties;
  5773. geometry2 = geojson.features[featureIndex].geometry;
  5774. break;
  5775. case "Feature":
  5776. properties = properties || geojson.properties;
  5777. geometry2 = geojson.geometry;
  5778. break;
  5779. case "Point":
  5780. case "MultiPoint":
  5781. return null;
  5782. case "LineString":
  5783. case "Polygon":
  5784. case "MultiLineString":
  5785. case "MultiPolygon":
  5786. geometry2 = geojson;
  5787. break;
  5788. default:
  5789. throw new Error("geojson is invalid");
  5790. }
  5791. if (geometry2 === null)
  5792. return null;
  5793. var coords = geometry2.coordinates;
  5794. switch (geometry2.type) {
  5795. case "Point":
  5796. return point(coords, properties, options2);
  5797. case "MultiPoint":
  5798. if (multiFeatureIndex < 0)
  5799. multiFeatureIndex = coords.length + multiFeatureIndex;
  5800. return point(coords[multiFeatureIndex], properties, options2);
  5801. case "LineString":
  5802. if (coordIndex < 0)
  5803. coordIndex = coords.length + coordIndex;
  5804. return point(coords[coordIndex], properties, options2);
  5805. case "Polygon":
  5806. if (geometryIndex < 0)
  5807. geometryIndex = coords.length + geometryIndex;
  5808. if (coordIndex < 0)
  5809. coordIndex = coords[geometryIndex].length + coordIndex;
  5810. return point(coords[geometryIndex][coordIndex], properties, options2);
  5811. case "MultiLineString":
  5812. if (multiFeatureIndex < 0)
  5813. multiFeatureIndex = coords.length + multiFeatureIndex;
  5814. if (coordIndex < 0)
  5815. coordIndex = coords[multiFeatureIndex].length + coordIndex;
  5816. return point(coords[multiFeatureIndex][coordIndex], properties, options2);
  5817. case "MultiPolygon":
  5818. if (multiFeatureIndex < 0)
  5819. multiFeatureIndex = coords.length + multiFeatureIndex;
  5820. if (geometryIndex < 0)
  5821. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5822. if (coordIndex < 0)
  5823. coordIndex = coords[multiFeatureIndex][geometryIndex].length - coordIndex;
  5824. return point(
  5825. coords[multiFeatureIndex][geometryIndex][coordIndex],
  5826. properties,
  5827. options2
  5828. );
  5829. }
  5830. throw new Error("geojson is invalid");
  5831. }
  5832. var es$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5833. __proto__: null,
  5834. coordAll,
  5835. coordEach,
  5836. coordReduce,
  5837. featureEach: featureEach$1,
  5838. featureReduce,
  5839. findPoint,
  5840. findSegment,
  5841. flattenEach,
  5842. flattenReduce,
  5843. geomEach,
  5844. geomReduce,
  5845. lineEach,
  5846. lineReduce,
  5847. propEach,
  5848. propReduce,
  5849. segmentEach,
  5850. segmentReduce
  5851. }, Symbol.toStringTag, { value: "Module" }));
  5852. function bbox$1(geojson) {
  5853. var result = [Infinity, Infinity, -Infinity, -Infinity];
  5854. coordEach(geojson, function(coord) {
  5855. if (result[0] > coord[0]) {
  5856. result[0] = coord[0];
  5857. }
  5858. if (result[1] > coord[1]) {
  5859. result[1] = coord[1];
  5860. }
  5861. if (result[2] < coord[0]) {
  5862. result[2] = coord[0];
  5863. }
  5864. if (result[3] < coord[1]) {
  5865. result[3] = coord[1];
  5866. }
  5867. });
  5868. return result;
  5869. }
  5870. bbox$1["default"] = bbox$1;
  5871. var es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5872. __proto__: null,
  5873. "default": bbox$1
  5874. }, Symbol.toStringTag, { value: "Module" }));
  5875. function getCoord(coord) {
  5876. if (!coord) {
  5877. throw new Error("coord is required");
  5878. }
  5879. if (!Array.isArray(coord)) {
  5880. if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
  5881. return coord.geometry.coordinates;
  5882. }
  5883. if (coord.type === "Point") {
  5884. return coord.coordinates;
  5885. }
  5886. }
  5887. if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
  5888. return coord;
  5889. }
  5890. throw new Error("coord must be GeoJSON Point or an Array of numbers");
  5891. }
  5892. function getCoords(coords) {
  5893. if (Array.isArray(coords)) {
  5894. return coords;
  5895. }
  5896. if (coords.type === "Feature") {
  5897. if (coords.geometry !== null) {
  5898. return coords.geometry.coordinates;
  5899. }
  5900. } else {
  5901. if (coords.coordinates) {
  5902. return coords.coordinates;
  5903. }
  5904. }
  5905. throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
  5906. }
  5907. function getGeom(geojson) {
  5908. if (geojson.type === "Feature") {
  5909. return geojson.geometry;
  5910. }
  5911. return geojson;
  5912. }
  5913. function getType(geojson, _name) {
  5914. if (geojson.type === "FeatureCollection") {
  5915. return "FeatureCollection";
  5916. }
  5917. if (geojson.type === "GeometryCollection") {
  5918. return "GeometryCollection";
  5919. }
  5920. if (geojson.type === "Feature" && geojson.geometry !== null) {
  5921. return geojson.geometry.type;
  5922. }
  5923. return geojson.type;
  5924. }
  5925. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  5926. function getDefaultExportFromCjs(x) {
  5927. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  5928. }
  5929. function getAugmentedNamespace(n) {
  5930. if (n.__esModule)
  5931. return n;
  5932. var a = Object.defineProperty({}, "__esModule", { value: true });
  5933. Object.keys(n).forEach(function(k) {
  5934. var d2 = Object.getOwnPropertyDescriptor(n, k);
  5935. Object.defineProperty(a, k, d2.get ? d2 : {
  5936. enumerable: true,
  5937. get: function() {
  5938. return n[k];
  5939. }
  5940. });
  5941. });
  5942. return a;
  5943. }
  5944. var concaveman$2 = { exports: {} };
  5945. var rbush_min$1 = { exports: {} };
  5946. (function(module2, exports2) {
  5947. !function(t2, i2) {
  5948. module2.exports = i2();
  5949. }(commonjsGlobal, function() {
  5950. function t2(t3, r3, e2, a2, h3) {
  5951. !function t4(n2, r4, e3, a3, h4) {
  5952. for (; a3 > e3; ) {
  5953. if (a3 - e3 > 600) {
  5954. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  5955. t4(n2, r4, m2, c2, h4);
  5956. }
  5957. var p2 = n2[r4], d3 = e3, x = a3;
  5958. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  5959. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  5960. d3++;
  5961. for (; h4(n2[x], p2) > 0; )
  5962. x--;
  5963. }
  5964. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  5965. }
  5966. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  5967. }
  5968. function i2(t3, i3, n2) {
  5969. var r3 = t3[i3];
  5970. t3[i3] = t3[n2], t3[n2] = r3;
  5971. }
  5972. function n(t3, i3) {
  5973. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  5974. }
  5975. var r2 = function(t3) {
  5976. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  5977. };
  5978. function e(t3, i3, n2) {
  5979. if (!n2)
  5980. return i3.indexOf(t3);
  5981. for (var r3 = 0; r3 < i3.length; r3++)
  5982. if (n2(t3, i3[r3]))
  5983. return r3;
  5984. return -1;
  5985. }
  5986. function a(t3, i3) {
  5987. h2(t3, 0, t3.children.length, i3, t3);
  5988. }
  5989. function h2(t3, i3, n2, r3, e2) {
  5990. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  5991. for (var a2 = i3; a2 < n2; a2++) {
  5992. var h3 = t3.children[a2];
  5993. o(e2, t3.leaf ? r3(h3) : h3);
  5994. }
  5995. return e2;
  5996. }
  5997. function o(t3, i3) {
  5998. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  5999. }
  6000. function s(t3, i3) {
  6001. return t3.minX - i3.minX;
  6002. }
  6003. function l(t3, i3) {
  6004. return t3.minY - i3.minY;
  6005. }
  6006. function f(t3) {
  6007. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  6008. }
  6009. function u(t3) {
  6010. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  6011. }
  6012. function m(t3, i3) {
  6013. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  6014. }
  6015. function c(t3, i3) {
  6016. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  6017. }
  6018. function p(t3) {
  6019. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  6020. }
  6021. function d2(i3, n2, r3, e2, a2) {
  6022. for (var h3 = [n2, r3]; h3.length; )
  6023. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  6024. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  6025. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  6026. }
  6027. }
  6028. return r2.prototype.all = function() {
  6029. return this._all(this.data, []);
  6030. }, r2.prototype.search = function(t3) {
  6031. var i3 = this.data, n2 = [];
  6032. if (!c(t3, i3))
  6033. return n2;
  6034. for (var r3 = this.toBBox, e2 = []; i3; ) {
  6035. for (var a2 = 0; a2 < i3.children.length; a2++) {
  6036. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  6037. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  6038. }
  6039. i3 = e2.pop();
  6040. }
  6041. return n2;
  6042. }, r2.prototype.collides = function(t3) {
  6043. var i3 = this.data;
  6044. if (!c(t3, i3))
  6045. return false;
  6046. for (var n2 = []; i3; ) {
  6047. for (var r3 = 0; r3 < i3.children.length; r3++) {
  6048. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  6049. if (c(t3, a2)) {
  6050. if (i3.leaf || m(t3, a2))
  6051. return true;
  6052. n2.push(e2);
  6053. }
  6054. }
  6055. i3 = n2.pop();
  6056. }
  6057. return false;
  6058. }, r2.prototype.load = function(t3) {
  6059. if (!t3 || !t3.length)
  6060. return this;
  6061. if (t3.length < this._minEntries) {
  6062. for (var i3 = 0; i3 < t3.length; i3++)
  6063. this.insert(t3[i3]);
  6064. return this;
  6065. }
  6066. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  6067. if (this.data.children.length)
  6068. if (this.data.height === n2.height)
  6069. this._splitRoot(this.data, n2);
  6070. else {
  6071. if (this.data.height < n2.height) {
  6072. var r3 = this.data;
  6073. this.data = n2, n2 = r3;
  6074. }
  6075. this._insert(n2, this.data.height - n2.height - 1, true);
  6076. }
  6077. else
  6078. this.data = n2;
  6079. return this;
  6080. }, r2.prototype.insert = function(t3) {
  6081. return t3 && this._insert(t3, this.data.height - 1), this;
  6082. }, r2.prototype.clear = function() {
  6083. return this.data = p([]), this;
  6084. }, r2.prototype.remove = function(t3, i3) {
  6085. if (!t3)
  6086. return this;
  6087. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  6088. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  6089. var f2 = e(t3, h3.children, i3);
  6090. if (-1 !== f2)
  6091. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  6092. }
  6093. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  6094. }
  6095. return this;
  6096. }, r2.prototype.toBBox = function(t3) {
  6097. return t3;
  6098. }, r2.prototype.compareMinX = function(t3, i3) {
  6099. return t3.minX - i3.minX;
  6100. }, r2.prototype.compareMinY = function(t3, i3) {
  6101. return t3.minY - i3.minY;
  6102. }, r2.prototype.toJSON = function() {
  6103. return this.data;
  6104. }, r2.prototype.fromJSON = function(t3) {
  6105. return this.data = t3, this;
  6106. }, r2.prototype._all = function(t3, i3) {
  6107. for (var n2 = []; t3; )
  6108. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  6109. return i3;
  6110. }, r2.prototype._build = function(t3, i3, n2, r3) {
  6111. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  6112. if (h3 <= o2)
  6113. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  6114. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  6115. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  6116. d2(t3, i3, n2, l2, this.compareMinX);
  6117. for (var f2 = i3; f2 <= n2; f2 += l2) {
  6118. var u2 = Math.min(f2 + l2 - 1, n2);
  6119. d2(t3, f2, u2, s2, this.compareMinY);
  6120. for (var m2 = f2; m2 <= u2; m2 += s2) {
  6121. var c2 = Math.min(m2 + s2 - 1, u2);
  6122. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  6123. }
  6124. }
  6125. return a(e2, this.toBBox), e2;
  6126. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  6127. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  6128. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  6129. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  6130. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  6131. }
  6132. i3 = h3 || i3.children[0];
  6133. }
  6134. var m2, c2;
  6135. return i3;
  6136. }, r2.prototype._insert = function(t3, i3, n2) {
  6137. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  6138. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  6139. this._split(e2, i3), i3--;
  6140. this._adjustParentBBoxes(r3, e2, i3);
  6141. }, r2.prototype._split = function(t3, i3) {
  6142. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  6143. this._chooseSplitAxis(n2, e2, r3);
  6144. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  6145. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  6146. }, r2.prototype._splitRoot = function(t3, i3) {
  6147. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  6148. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  6149. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  6150. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  6151. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  6152. }
  6153. return r3 || n2 - i3;
  6154. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  6155. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  6156. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  6157. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  6158. t3.children.sort(r3);
  6159. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  6160. var m2 = t3.children[f2];
  6161. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  6162. }
  6163. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  6164. var p2 = t3.children[c2];
  6165. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  6166. }
  6167. return l2;
  6168. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  6169. for (var r3 = n2; r3 >= 0; r3--)
  6170. o(i3[r3], t3);
  6171. }, r2.prototype._condense = function(t3) {
  6172. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  6173. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  6174. }, r2;
  6175. });
  6176. })(rbush_min$1);
  6177. class TinyQueue {
  6178. constructor(data = [], compare = defaultCompare) {
  6179. this.data = data;
  6180. this.length = this.data.length;
  6181. this.compare = compare;
  6182. if (this.length > 0) {
  6183. for (let i2 = (this.length >> 1) - 1; i2 >= 0; i2--)
  6184. this._down(i2);
  6185. }
  6186. }
  6187. push(item) {
  6188. this.data.push(item);
  6189. this.length++;
  6190. this._up(this.length - 1);
  6191. }
  6192. pop() {
  6193. if (this.length === 0)
  6194. return void 0;
  6195. const top = this.data[0];
  6196. const bottom = this.data.pop();
  6197. this.length--;
  6198. if (this.length > 0) {
  6199. this.data[0] = bottom;
  6200. this._down(0);
  6201. }
  6202. return top;
  6203. }
  6204. peek() {
  6205. return this.data[0];
  6206. }
  6207. _up(pos) {
  6208. const { data, compare } = this;
  6209. const item = data[pos];
  6210. while (pos > 0) {
  6211. const parent = pos - 1 >> 1;
  6212. const current = data[parent];
  6213. if (compare(item, current) >= 0)
  6214. break;
  6215. data[pos] = current;
  6216. pos = parent;
  6217. }
  6218. data[pos] = item;
  6219. }
  6220. _down(pos) {
  6221. const { data, compare } = this;
  6222. const halfLength = this.length >> 1;
  6223. const item = data[pos];
  6224. while (pos < halfLength) {
  6225. let left = (pos << 1) + 1;
  6226. let best = data[left];
  6227. const right = left + 1;
  6228. if (right < this.length && compare(data[right], best) < 0) {
  6229. left = right;
  6230. best = data[right];
  6231. }
  6232. if (compare(best, item) >= 0)
  6233. break;
  6234. data[pos] = best;
  6235. pos = left;
  6236. }
  6237. data[pos] = item;
  6238. }
  6239. }
  6240. function defaultCompare(a, b) {
  6241. return a < b ? -1 : a > b ? 1 : 0;
  6242. }
  6243. var tinyqueue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  6244. __proto__: null,
  6245. "default": TinyQueue
  6246. }, Symbol.toStringTag, { value: "Module" }));
  6247. var require$$1$2 = /* @__PURE__ */ getAugmentedNamespace(tinyqueue);
  6248. var pointInPolygon$1 = { exports: {} };
  6249. var flat = function pointInPolygonFlat(point2, vs, start2, end) {
  6250. var x = point2[0], y = point2[1];
  6251. var inside2 = false;
  6252. if (start2 === void 0)
  6253. start2 = 0;
  6254. if (end === void 0)
  6255. end = vs.length;
  6256. var len = (end - start2) / 2;
  6257. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6258. var xi = vs[start2 + i2 * 2 + 0], yi = vs[start2 + i2 * 2 + 1];
  6259. var xj = vs[start2 + j * 2 + 0], yj = vs[start2 + j * 2 + 1];
  6260. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6261. if (intersect)
  6262. inside2 = !inside2;
  6263. }
  6264. return inside2;
  6265. };
  6266. var nested = function pointInPolygonNested(point2, vs, start2, end) {
  6267. var x = point2[0], y = point2[1];
  6268. var inside2 = false;
  6269. if (start2 === void 0)
  6270. start2 = 0;
  6271. if (end === void 0)
  6272. end = vs.length;
  6273. var len = end - start2;
  6274. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6275. var xi = vs[i2 + start2][0], yi = vs[i2 + start2][1];
  6276. var xj = vs[j + start2][0], yj = vs[j + start2][1];
  6277. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6278. if (intersect)
  6279. inside2 = !inside2;
  6280. }
  6281. return inside2;
  6282. };
  6283. var pointInPolygonFlat2 = flat;
  6284. var pointInPolygonNested2 = nested;
  6285. pointInPolygon$1.exports = function pointInPolygon(point2, vs, start2, end) {
  6286. if (vs.length > 0 && Array.isArray(vs[0])) {
  6287. return pointInPolygonNested2(point2, vs, start2, end);
  6288. } else {
  6289. return pointInPolygonFlat2(point2, vs, start2, end);
  6290. }
  6291. };
  6292. pointInPolygon$1.exports.nested = pointInPolygonNested2;
  6293. pointInPolygon$1.exports.flat = pointInPolygonFlat2;
  6294. var orient2d_min = { exports: {} };
  6295. (function(module2, exports2) {
  6296. !function(t2, e) {
  6297. e(exports2);
  6298. }(commonjsGlobal, function(t2) {
  6299. const e = 134217729, n = 33306690738754706e-32;
  6300. function r2(t3, e2, n2, r3, o2) {
  6301. let f2, i3, u2, c2, s2 = e2[0], a2 = r3[0], d3 = 0, l2 = 0;
  6302. a2 > s2 == a2 > -s2 ? (f2 = s2, s2 = e2[++d3]) : (f2 = a2, a2 = r3[++l2]);
  6303. let p = 0;
  6304. if (d3 < t3 && l2 < n2)
  6305. for (a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = s2 + f2) - s2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = a2 + f2) - a2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2); d3 < t3 && l2 < n2; )
  6306. a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6307. for (; d3 < t3; )
  6308. u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6309. for (; l2 < n2; )
  6310. u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6311. return 0 === f2 && 0 !== p || (o2[p++] = f2), p;
  6312. }
  6313. function o(t3) {
  6314. return new Float64Array(t3);
  6315. }
  6316. const f = 33306690738754716e-32, i2 = 22204460492503146e-32, u = 11093356479670487e-47, c = o(4), s = o(8), a = o(12), d2 = o(16), l = o(4);
  6317. t2.orient2d = function(t3, o2, p, b, y, h2) {
  6318. const M = (o2 - h2) * (p - y), x = (t3 - y) * (b - h2), j = M - x;
  6319. if (0 === M || 0 === x || M > 0 != x > 0)
  6320. return j;
  6321. const m = Math.abs(M + x);
  6322. return Math.abs(j) >= f * m ? j : -function(t4, o3, f2, p2, b2, y2, h3) {
  6323. let M2, x2, j2, m2, _, v, w, A, F, O, P2, g, k, q2, z, B2, C2, D;
  6324. const E2 = t4 - b2, G2 = f2 - b2, H2 = o3 - y2, I2 = p2 - y2;
  6325. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = E2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = H2 * G2) - w * F - A * F - w * O))), c[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), c[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, c[2] = g - (D - _) + (P2 - _), c[3] = D;
  6326. let J2 = function(t5, e2) {
  6327. let n2 = e2[0];
  6328. for (let r3 = 1; r3 < t5; r3++)
  6329. n2 += e2[r3];
  6330. return n2;
  6331. }(4, c), K2 = i2 * h3;
  6332. if (J2 >= K2 || -J2 >= K2)
  6333. return J2;
  6334. if (M2 = t4 - (E2 + (_ = t4 - E2)) + (_ - b2), j2 = f2 - (G2 + (_ = f2 - G2)) + (_ - b2), x2 = o3 - (H2 + (_ = o3 - H2)) + (_ - y2), m2 = p2 - (I2 + (_ = p2 - I2)) + (_ - y2), 0 === M2 && 0 === x2 && 0 === j2 && 0 === m2)
  6335. return J2;
  6336. if (K2 = u * h3 + n * Math.abs(J2), (J2 += E2 * m2 + I2 * M2 - (H2 * j2 + G2 * x2)) >= K2 || -J2 >= K2)
  6337. return J2;
  6338. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = M2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = x2 * G2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6339. const L = r2(4, c, 4, l, s);
  6340. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = E2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = H2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6341. const N2 = r2(L, s, 4, l, a);
  6342. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = M2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = x2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6343. const Q2 = r2(N2, a, 4, l, d2);
  6344. return d2[Q2 - 1];
  6345. }(t3, o2, p, b, y, h2, m);
  6346. }, t2.orient2dfast = function(t3, e2, n2, r3, o2, f2) {
  6347. return (e2 - f2) * (n2 - o2) - (t3 - o2) * (r3 - f2);
  6348. }, Object.defineProperty(t2, "__esModule", { value: true });
  6349. });
  6350. })(orient2d_min, orient2d_min.exports);
  6351. var RBush = rbush_min$1.exports;
  6352. var Queue = require$$1$2;
  6353. var pointInPolygon2 = pointInPolygon$1.exports;
  6354. var orient = orient2d_min.exports.orient2d;
  6355. if (Queue.default) {
  6356. Queue = Queue.default;
  6357. }
  6358. concaveman$2.exports = concaveman;
  6359. concaveman$2.exports.default = concaveman;
  6360. function concaveman(points2, concavity, lengthThreshold) {
  6361. concavity = Math.max(0, concavity === void 0 ? 2 : concavity);
  6362. lengthThreshold = lengthThreshold || 0;
  6363. var hull = fastConvexHull(points2);
  6364. var tree = new RBush(16);
  6365. tree.toBBox = function(a2) {
  6366. return {
  6367. minX: a2[0],
  6368. minY: a2[1],
  6369. maxX: a2[0],
  6370. maxY: a2[1]
  6371. };
  6372. };
  6373. tree.compareMinX = function(a2, b2) {
  6374. return a2[0] - b2[0];
  6375. };
  6376. tree.compareMinY = function(a2, b2) {
  6377. return a2[1] - b2[1];
  6378. };
  6379. tree.load(points2);
  6380. var queue = [];
  6381. for (var i2 = 0, last; i2 < hull.length; i2++) {
  6382. var p = hull[i2];
  6383. tree.remove(p);
  6384. last = insertNode(p, last);
  6385. queue.push(last);
  6386. }
  6387. var segTree = new RBush(16);
  6388. for (i2 = 0; i2 < queue.length; i2++)
  6389. segTree.insert(updateBBox(queue[i2]));
  6390. var sqConcavity = concavity * concavity;
  6391. var sqLenThreshold = lengthThreshold * lengthThreshold;
  6392. while (queue.length) {
  6393. var node = queue.shift();
  6394. var a = node.p;
  6395. var b = node.next.p;
  6396. var sqLen = getSqDist(a, b);
  6397. if (sqLen < sqLenThreshold)
  6398. continue;
  6399. var maxSqLen = sqLen / sqConcavity;
  6400. p = findCandidate(tree, node.prev.p, a, b, node.next.next.p, maxSqLen, segTree);
  6401. if (p && Math.min(getSqDist(p, a), getSqDist(p, b)) <= maxSqLen) {
  6402. queue.push(node);
  6403. queue.push(insertNode(p, node));
  6404. tree.remove(p);
  6405. segTree.remove(node);
  6406. segTree.insert(updateBBox(node));
  6407. segTree.insert(updateBBox(node.next));
  6408. }
  6409. }
  6410. node = last;
  6411. var concave = [];
  6412. do {
  6413. concave.push(node.p);
  6414. node = node.next;
  6415. } while (node !== last);
  6416. concave.push(node.p);
  6417. return concave;
  6418. }
  6419. function findCandidate(tree, a, b, c, d2, maxDist, segTree) {
  6420. var queue = new Queue([], compareDist);
  6421. var node = tree.data;
  6422. while (node) {
  6423. for (var i2 = 0; i2 < node.children.length; i2++) {
  6424. var child = node.children[i2];
  6425. var dist = node.leaf ? sqSegDist(child, b, c) : sqSegBoxDist(b, c, child);
  6426. if (dist > maxDist)
  6427. continue;
  6428. queue.push({
  6429. node: child,
  6430. dist
  6431. });
  6432. }
  6433. while (queue.length && !queue.peek().node.children) {
  6434. var item = queue.pop();
  6435. var p = item.node;
  6436. var d0 = sqSegDist(p, a, b);
  6437. var d1 = sqSegDist(p, c, d2);
  6438. if (item.dist < d0 && item.dist < d1 && noIntersections(b, p, segTree) && noIntersections(c, p, segTree))
  6439. return p;
  6440. }
  6441. node = queue.pop();
  6442. if (node)
  6443. node = node.node;
  6444. }
  6445. return null;
  6446. }
  6447. function compareDist(a, b) {
  6448. return a.dist - b.dist;
  6449. }
  6450. function sqSegBoxDist(a, b, bbox2) {
  6451. if (inside(a, bbox2) || inside(b, bbox2))
  6452. return 0;
  6453. var d1 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.maxX, bbox2.minY);
  6454. if (d1 === 0)
  6455. return 0;
  6456. var d2 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.minX, bbox2.maxY);
  6457. if (d2 === 0)
  6458. return 0;
  6459. var d3 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.maxX, bbox2.minY, bbox2.maxX, bbox2.maxY);
  6460. if (d3 === 0)
  6461. return 0;
  6462. var d4 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.maxY, bbox2.maxX, bbox2.maxY);
  6463. if (d4 === 0)
  6464. return 0;
  6465. return Math.min(d1, d2, d3, d4);
  6466. }
  6467. function inside(a, bbox2) {
  6468. return a[0] >= bbox2.minX && a[0] <= bbox2.maxX && a[1] >= bbox2.minY && a[1] <= bbox2.maxY;
  6469. }
  6470. function noIntersections(a, b, segTree) {
  6471. var minX = Math.min(a[0], b[0]);
  6472. var minY = Math.min(a[1], b[1]);
  6473. var maxX = Math.max(a[0], b[0]);
  6474. var maxY = Math.max(a[1], b[1]);
  6475. var edges = segTree.search({ minX, minY, maxX, maxY });
  6476. for (var i2 = 0; i2 < edges.length; i2++) {
  6477. if (intersects$1(edges[i2].p, edges[i2].next.p, a, b))
  6478. return false;
  6479. }
  6480. return true;
  6481. }
  6482. function cross(p1, p2, p3) {
  6483. return orient(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
  6484. }
  6485. function intersects$1(p1, q1, p2, q2) {
  6486. return p1 !== q2 && q1 !== p2 && cross(p1, q1, p2) > 0 !== cross(p1, q1, q2) > 0 && cross(p2, q2, p1) > 0 !== cross(p2, q2, q1) > 0;
  6487. }
  6488. function updateBBox(node) {
  6489. var p1 = node.p;
  6490. var p2 = node.next.p;
  6491. node.minX = Math.min(p1[0], p2[0]);
  6492. node.minY = Math.min(p1[1], p2[1]);
  6493. node.maxX = Math.max(p1[0], p2[0]);
  6494. node.maxY = Math.max(p1[1], p2[1]);
  6495. return node;
  6496. }
  6497. function fastConvexHull(points2) {
  6498. var left = points2[0];
  6499. var top = points2[0];
  6500. var right = points2[0];
  6501. var bottom = points2[0];
  6502. for (var i2 = 0; i2 < points2.length; i2++) {
  6503. var p = points2[i2];
  6504. if (p[0] < left[0])
  6505. left = p;
  6506. if (p[0] > right[0])
  6507. right = p;
  6508. if (p[1] < top[1])
  6509. top = p;
  6510. if (p[1] > bottom[1])
  6511. bottom = p;
  6512. }
  6513. var cull = [left, top, right, bottom];
  6514. var filtered = cull.slice();
  6515. for (i2 = 0; i2 < points2.length; i2++) {
  6516. if (!pointInPolygon2(points2[i2], cull))
  6517. filtered.push(points2[i2]);
  6518. }
  6519. return convexHull(filtered);
  6520. }
  6521. function insertNode(p, prev) {
  6522. var node = {
  6523. p,
  6524. prev: null,
  6525. next: null,
  6526. minX: 0,
  6527. minY: 0,
  6528. maxX: 0,
  6529. maxY: 0
  6530. };
  6531. if (!prev) {
  6532. node.prev = node;
  6533. node.next = node;
  6534. } else {
  6535. node.next = prev.next;
  6536. node.prev = prev;
  6537. prev.next.prev = node;
  6538. prev.next = node;
  6539. }
  6540. return node;
  6541. }
  6542. function getSqDist(p1, p2) {
  6543. var dx = p1[0] - p2[0], dy = p1[1] - p2[1];
  6544. return dx * dx + dy * dy;
  6545. }
  6546. function sqSegDist(p, p1, p2) {
  6547. var x = p1[0], y = p1[1], dx = p2[0] - x, dy = p2[1] - y;
  6548. if (dx !== 0 || dy !== 0) {
  6549. var t2 = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
  6550. if (t2 > 1) {
  6551. x = p2[0];
  6552. y = p2[1];
  6553. } else if (t2 > 0) {
  6554. x += dx * t2;
  6555. y += dy * t2;
  6556. }
  6557. }
  6558. dx = p[0] - x;
  6559. dy = p[1] - y;
  6560. return dx * dx + dy * dy;
  6561. }
  6562. function sqSegSegDist(x0, y0, x1, y1, x2, y2, x3, y3) {
  6563. var ux = x1 - x0;
  6564. var uy = y1 - y0;
  6565. var vx = x3 - x2;
  6566. var vy = y3 - y2;
  6567. var wx = x0 - x2;
  6568. var wy = y0 - y2;
  6569. var a = ux * ux + uy * uy;
  6570. var b = ux * vx + uy * vy;
  6571. var c = vx * vx + vy * vy;
  6572. var d2 = ux * wx + uy * wy;
  6573. var e = vx * wx + vy * wy;
  6574. var D = a * c - b * b;
  6575. var sc, sN, tc, tN;
  6576. var sD = D;
  6577. var tD = D;
  6578. if (D === 0) {
  6579. sN = 0;
  6580. sD = 1;
  6581. tN = e;
  6582. tD = c;
  6583. } else {
  6584. sN = b * e - c * d2;
  6585. tN = a * e - b * d2;
  6586. if (sN < 0) {
  6587. sN = 0;
  6588. tN = e;
  6589. tD = c;
  6590. } else if (sN > sD) {
  6591. sN = sD;
  6592. tN = e + b;
  6593. tD = c;
  6594. }
  6595. }
  6596. if (tN < 0) {
  6597. tN = 0;
  6598. if (-d2 < 0)
  6599. sN = 0;
  6600. else if (-d2 > a)
  6601. sN = sD;
  6602. else {
  6603. sN = -d2;
  6604. sD = a;
  6605. }
  6606. } else if (tN > tD) {
  6607. tN = tD;
  6608. if (-d2 + b < 0)
  6609. sN = 0;
  6610. else if (-d2 + b > a)
  6611. sN = sD;
  6612. else {
  6613. sN = -d2 + b;
  6614. sD = a;
  6615. }
  6616. }
  6617. sc = sN === 0 ? 0 : sN / sD;
  6618. tc = tN === 0 ? 0 : tN / tD;
  6619. var cx = (1 - sc) * x0 + sc * x1;
  6620. var cy = (1 - sc) * y0 + sc * y1;
  6621. var cx2 = (1 - tc) * x2 + tc * x3;
  6622. var cy2 = (1 - tc) * y2 + tc * y3;
  6623. var dx = cx2 - cx;
  6624. var dy = cy2 - cy;
  6625. return dx * dx + dy * dy;
  6626. }
  6627. function compareByX(a, b) {
  6628. return a[0] === b[0] ? a[1] - b[1] : a[0] - b[0];
  6629. }
  6630. function convexHull(points2) {
  6631. points2.sort(compareByX);
  6632. var lower = [];
  6633. for (var i2 = 0; i2 < points2.length; i2++) {
  6634. while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points2[i2]) <= 0) {
  6635. lower.pop();
  6636. }
  6637. lower.push(points2[i2]);
  6638. }
  6639. var upper = [];
  6640. for (var ii = points2.length - 1; ii >= 0; ii--) {
  6641. while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points2[ii]) <= 0) {
  6642. upper.pop();
  6643. }
  6644. upper.push(points2[ii]);
  6645. }
  6646. upper.pop();
  6647. lower.pop();
  6648. return lower.concat(upper);
  6649. }
  6650. var concaveman$1 = concaveman$2.exports;
  6651. function convex(geojson, options2) {
  6652. if (options2 === void 0) {
  6653. options2 = {};
  6654. }
  6655. options2.concavity = options2.concavity || Infinity;
  6656. var points2 = [];
  6657. coordEach(geojson, function(coord) {
  6658. points2.push([coord[0], coord[1]]);
  6659. });
  6660. if (!points2.length) {
  6661. return null;
  6662. }
  6663. var convexHull2 = concaveman$1(points2, options2.concavity);
  6664. if (convexHull2.length > 3) {
  6665. return polygon([convexHull2]);
  6666. }
  6667. return null;
  6668. }
  6669. function booleanPointInPolygon(point2, polygon2, options2) {
  6670. if (options2 === void 0) {
  6671. options2 = {};
  6672. }
  6673. if (!point2) {
  6674. throw new Error("point is required");
  6675. }
  6676. if (!polygon2) {
  6677. throw new Error("polygon is required");
  6678. }
  6679. var pt2 = getCoord(point2);
  6680. var geom = getGeom(polygon2);
  6681. var type2 = geom.type;
  6682. var bbox2 = polygon2.bbox;
  6683. var polys = geom.coordinates;
  6684. if (bbox2 && inBBox(pt2, bbox2) === false) {
  6685. return false;
  6686. }
  6687. if (type2 === "Polygon") {
  6688. polys = [polys];
  6689. }
  6690. var insidePoly = false;
  6691. for (var i2 = 0; i2 < polys.length && !insidePoly; i2++) {
  6692. if (inRing(pt2, polys[i2][0], options2.ignoreBoundary)) {
  6693. var inHole = false;
  6694. var k = 1;
  6695. while (k < polys[i2].length && !inHole) {
  6696. if (inRing(pt2, polys[i2][k], !options2.ignoreBoundary)) {
  6697. inHole = true;
  6698. }
  6699. k++;
  6700. }
  6701. if (!inHole) {
  6702. insidePoly = true;
  6703. }
  6704. }
  6705. }
  6706. return insidePoly;
  6707. }
  6708. function inRing(pt2, ring, ignoreBoundary) {
  6709. var isInside = false;
  6710. if (ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1]) {
  6711. ring = ring.slice(0, ring.length - 1);
  6712. }
  6713. for (var i2 = 0, j = ring.length - 1; i2 < ring.length; j = i2++) {
  6714. var xi = ring[i2][0];
  6715. var yi = ring[i2][1];
  6716. var xj = ring[j][0];
  6717. var yj = ring[j][1];
  6718. var onBoundary = pt2[1] * (xi - xj) + yi * (xj - pt2[0]) + yj * (pt2[0] - xi) === 0 && (xi - pt2[0]) * (xj - pt2[0]) <= 0 && (yi - pt2[1]) * (yj - pt2[1]) <= 0;
  6719. if (onBoundary) {
  6720. return !ignoreBoundary;
  6721. }
  6722. var intersect = yi > pt2[1] !== yj > pt2[1] && pt2[0] < (xj - xi) * (pt2[1] - yi) / (yj - yi) + xi;
  6723. if (intersect) {
  6724. isInside = !isInside;
  6725. }
  6726. }
  6727. return isInside;
  6728. }
  6729. function inBBox(pt2, bbox2) {
  6730. return bbox2[0] <= pt2[0] && bbox2[1] <= pt2[1] && bbox2[2] >= pt2[0] && bbox2[3] >= pt2[1];
  6731. }
  6732. function distance(from3, to, options2) {
  6733. if (options2 === void 0) {
  6734. options2 = {};
  6735. }
  6736. var coordinates1 = getCoord(from3);
  6737. var coordinates2 = getCoord(to);
  6738. var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);
  6739. var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);
  6740. var lat1 = degreesToRadians(coordinates1[1]);
  6741. var lat2 = degreesToRadians(coordinates2[1]);
  6742. var a = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
  6743. return radiansToLength(2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), options2.units);
  6744. }
  6745. function bboxPolygon(bbox2, options2) {
  6746. if (options2 === void 0) {
  6747. options2 = {};
  6748. }
  6749. var west = Number(bbox2[0]);
  6750. var south = Number(bbox2[1]);
  6751. var east = Number(bbox2[2]);
  6752. var north = Number(bbox2[3]);
  6753. if (bbox2.length === 6) {
  6754. throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
  6755. }
  6756. var lowLeft = [west, south];
  6757. var topLeft = [west, north];
  6758. var topRight = [east, north];
  6759. var lowRight = [east, south];
  6760. return polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options2.properties, { bbox: bbox2, id: options2.id });
  6761. }
  6762. function destination(origin, distance2, bearing2, options2) {
  6763. if (options2 === void 0) {
  6764. options2 = {};
  6765. }
  6766. var coordinates1 = getCoord(origin);
  6767. var longitude1 = degreesToRadians(coordinates1[0]);
  6768. var latitude1 = degreesToRadians(coordinates1[1]);
  6769. var bearingRad = degreesToRadians(bearing2);
  6770. var radians = lengthToRadians(distance2, options2.units);
  6771. var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) + Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));
  6772. var longitude2 = longitude1 + Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));
  6773. var lng = radiansToDegrees(longitude2);
  6774. var lat = radiansToDegrees(latitude2);
  6775. return point([lng, lat], options2.properties);
  6776. }
  6777. function bearing(start2, end, options2) {
  6778. if (options2 === void 0) {
  6779. options2 = {};
  6780. }
  6781. if (options2.final === true) {
  6782. return calculateFinalBearing(start2, end);
  6783. }
  6784. var coordinates1 = getCoord(start2);
  6785. var coordinates2 = getCoord(end);
  6786. var lon1 = degreesToRadians(coordinates1[0]);
  6787. var lon2 = degreesToRadians(coordinates2[0]);
  6788. var lat1 = degreesToRadians(coordinates1[1]);
  6789. var lat2 = degreesToRadians(coordinates2[1]);
  6790. var a = Math.sin(lon2 - lon1) * Math.cos(lat2);
  6791. var b = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);
  6792. return radiansToDegrees(Math.atan2(a, b));
  6793. }
  6794. function calculateFinalBearing(start2, end) {
  6795. var bear = bearing(end, start2);
  6796. bear = (bear + 180) % 360;
  6797. return bear;
  6798. }
  6799. function midpoint(point1, point2) {
  6800. var dist = distance(point1, point2);
  6801. var heading = bearing(point1, point2);
  6802. var midpoint2 = destination(point1, dist / 2, heading);
  6803. return midpoint2;
  6804. }
  6805. function center(geojson, options2) {
  6806. if (options2 === void 0) {
  6807. options2 = {};
  6808. }
  6809. var ext = bbox$1(geojson);
  6810. var x = (ext[0] + ext[2]) / 2;
  6811. var y = (ext[1] + ext[3]) / 2;
  6812. return point([x, y], options2.properties, options2);
  6813. }
  6814. function centroid(geojson, options2) {
  6815. if (options2 === void 0) {
  6816. options2 = {};
  6817. }
  6818. var xSum = 0;
  6819. var ySum = 0;
  6820. var len = 0;
  6821. coordEach(geojson, function(coord) {
  6822. xSum += coord[0];
  6823. ySum += coord[1];
  6824. len++;
  6825. }, true);
  6826. return point([xSum / len, ySum / len], options2.properties);
  6827. }
  6828. function centerOfMass(geojson, options2) {
  6829. if (options2 === void 0) {
  6830. options2 = {};
  6831. }
  6832. switch (getType(geojson)) {
  6833. case "Point":
  6834. return point(getCoord(geojson), options2.properties);
  6835. case "Polygon":
  6836. var coords = [];
  6837. coordEach(geojson, function(coord) {
  6838. coords.push(coord);
  6839. });
  6840. var centre = centroid(geojson, { properties: options2.properties });
  6841. var translation = centre.geometry.coordinates;
  6842. var sx = 0;
  6843. var sy = 0;
  6844. var sArea = 0;
  6845. var i2, pi, pj, xi, xj, yi, yj, a;
  6846. var neutralizedPoints = coords.map(function(point2) {
  6847. return [point2[0] - translation[0], point2[1] - translation[1]];
  6848. });
  6849. for (i2 = 0; i2 < coords.length - 1; i2++) {
  6850. pi = neutralizedPoints[i2];
  6851. xi = pi[0];
  6852. yi = pi[1];
  6853. pj = neutralizedPoints[i2 + 1];
  6854. xj = pj[0];
  6855. yj = pj[1];
  6856. a = xi * yj - xj * yi;
  6857. sArea += a;
  6858. sx += (xi + xj) * a;
  6859. sy += (yi + yj) * a;
  6860. }
  6861. if (sArea === 0) {
  6862. return centre;
  6863. } else {
  6864. var area = sArea * 0.5;
  6865. var areaFactor = 1 / (6 * area);
  6866. return point([translation[0] + areaFactor * sx, translation[1] + areaFactor * sy], options2.properties);
  6867. }
  6868. default:
  6869. var hull = convex(geojson);
  6870. if (hull)
  6871. return centerOfMass(hull, { properties: options2.properties });
  6872. else
  6873. return centroid(geojson, { properties: options2.properties });
  6874. }
  6875. }
  6876. function lineSegment(geojson) {
  6877. if (!geojson) {
  6878. throw new Error("geojson is required");
  6879. }
  6880. var results = [];
  6881. flattenEach(geojson, function(feature2) {
  6882. lineSegmentFeature(feature2, results);
  6883. });
  6884. return featureCollection$1(results);
  6885. }
  6886. function lineSegmentFeature(geojson, results) {
  6887. var coords = [];
  6888. var geometry2 = geojson.geometry;
  6889. if (geometry2 !== null) {
  6890. switch (geometry2.type) {
  6891. case "Polygon":
  6892. coords = getCoords(geometry2);
  6893. break;
  6894. case "LineString":
  6895. coords = [getCoords(geometry2)];
  6896. }
  6897. coords.forEach(function(coord) {
  6898. var segments = createSegments(coord, geojson.properties);
  6899. segments.forEach(function(segment) {
  6900. segment.id = results.length;
  6901. results.push(segment);
  6902. });
  6903. });
  6904. }
  6905. }
  6906. function createSegments(coords, properties) {
  6907. var segments = [];
  6908. coords.reduce(function(previousCoords, currentCoords) {
  6909. var segment = lineString([previousCoords, currentCoords], properties);
  6910. segment.bbox = bbox(previousCoords, currentCoords);
  6911. segments.push(segment);
  6912. return currentCoords;
  6913. });
  6914. return segments;
  6915. }
  6916. function bbox(coords1, coords2) {
  6917. var x1 = coords1[0];
  6918. var y1 = coords1[1];
  6919. var x2 = coords2[0];
  6920. var y2 = coords2[1];
  6921. var west = x1 < x2 ? x1 : x2;
  6922. var south = y1 < y2 ? y1 : y2;
  6923. var east = x1 > x2 ? x1 : x2;
  6924. var north = y1 > y2 ? y1 : y2;
  6925. return [west, south, east, north];
  6926. }
  6927. var geojsonRbush$1 = { exports: {} };
  6928. var rbush_min = { exports: {} };
  6929. (function(module2, exports2) {
  6930. !function(t2, i2) {
  6931. module2.exports = i2();
  6932. }(commonjsGlobal, function() {
  6933. function t2(t3, r3, e2, a2, h3) {
  6934. !function t4(n2, r4, e3, a3, h4) {
  6935. for (; a3 > e3; ) {
  6936. if (a3 - e3 > 600) {
  6937. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  6938. t4(n2, r4, m2, c2, h4);
  6939. }
  6940. var p2 = n2[r4], d3 = e3, x = a3;
  6941. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  6942. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  6943. d3++;
  6944. for (; h4(n2[x], p2) > 0; )
  6945. x--;
  6946. }
  6947. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  6948. }
  6949. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  6950. }
  6951. function i2(t3, i3, n2) {
  6952. var r3 = t3[i3];
  6953. t3[i3] = t3[n2], t3[n2] = r3;
  6954. }
  6955. function n(t3, i3) {
  6956. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  6957. }
  6958. var r2 = function(t3) {
  6959. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  6960. };
  6961. function e(t3, i3, n2) {
  6962. if (!n2)
  6963. return i3.indexOf(t3);
  6964. for (var r3 = 0; r3 < i3.length; r3++)
  6965. if (n2(t3, i3[r3]))
  6966. return r3;
  6967. return -1;
  6968. }
  6969. function a(t3, i3) {
  6970. h2(t3, 0, t3.children.length, i3, t3);
  6971. }
  6972. function h2(t3, i3, n2, r3, e2) {
  6973. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  6974. for (var a2 = i3; a2 < n2; a2++) {
  6975. var h3 = t3.children[a2];
  6976. o(e2, t3.leaf ? r3(h3) : h3);
  6977. }
  6978. return e2;
  6979. }
  6980. function o(t3, i3) {
  6981. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  6982. }
  6983. function s(t3, i3) {
  6984. return t3.minX - i3.minX;
  6985. }
  6986. function l(t3, i3) {
  6987. return t3.minY - i3.minY;
  6988. }
  6989. function f(t3) {
  6990. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  6991. }
  6992. function u(t3) {
  6993. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  6994. }
  6995. function m(t3, i3) {
  6996. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  6997. }
  6998. function c(t3, i3) {
  6999. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  7000. }
  7001. function p(t3) {
  7002. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  7003. }
  7004. function d2(i3, n2, r3, e2, a2) {
  7005. for (var h3 = [n2, r3]; h3.length; )
  7006. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  7007. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  7008. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  7009. }
  7010. }
  7011. return r2.prototype.all = function() {
  7012. return this._all(this.data, []);
  7013. }, r2.prototype.search = function(t3) {
  7014. var i3 = this.data, n2 = [];
  7015. if (!c(t3, i3))
  7016. return n2;
  7017. for (var r3 = this.toBBox, e2 = []; i3; ) {
  7018. for (var a2 = 0; a2 < i3.children.length; a2++) {
  7019. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  7020. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  7021. }
  7022. i3 = e2.pop();
  7023. }
  7024. return n2;
  7025. }, r2.prototype.collides = function(t3) {
  7026. var i3 = this.data;
  7027. if (!c(t3, i3))
  7028. return false;
  7029. for (var n2 = []; i3; ) {
  7030. for (var r3 = 0; r3 < i3.children.length; r3++) {
  7031. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  7032. if (c(t3, a2)) {
  7033. if (i3.leaf || m(t3, a2))
  7034. return true;
  7035. n2.push(e2);
  7036. }
  7037. }
  7038. i3 = n2.pop();
  7039. }
  7040. return false;
  7041. }, r2.prototype.load = function(t3) {
  7042. if (!t3 || !t3.length)
  7043. return this;
  7044. if (t3.length < this._minEntries) {
  7045. for (var i3 = 0; i3 < t3.length; i3++)
  7046. this.insert(t3[i3]);
  7047. return this;
  7048. }
  7049. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  7050. if (this.data.children.length)
  7051. if (this.data.height === n2.height)
  7052. this._splitRoot(this.data, n2);
  7053. else {
  7054. if (this.data.height < n2.height) {
  7055. var r3 = this.data;
  7056. this.data = n2, n2 = r3;
  7057. }
  7058. this._insert(n2, this.data.height - n2.height - 1, true);
  7059. }
  7060. else
  7061. this.data = n2;
  7062. return this;
  7063. }, r2.prototype.insert = function(t3) {
  7064. return t3 && this._insert(t3, this.data.height - 1), this;
  7065. }, r2.prototype.clear = function() {
  7066. return this.data = p([]), this;
  7067. }, r2.prototype.remove = function(t3, i3) {
  7068. if (!t3)
  7069. return this;
  7070. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  7071. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  7072. var f2 = e(t3, h3.children, i3);
  7073. if (-1 !== f2)
  7074. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  7075. }
  7076. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  7077. }
  7078. return this;
  7079. }, r2.prototype.toBBox = function(t3) {
  7080. return t3;
  7081. }, r2.prototype.compareMinX = function(t3, i3) {
  7082. return t3.minX - i3.minX;
  7083. }, r2.prototype.compareMinY = function(t3, i3) {
  7084. return t3.minY - i3.minY;
  7085. }, r2.prototype.toJSON = function() {
  7086. return this.data;
  7087. }, r2.prototype.fromJSON = function(t3) {
  7088. return this.data = t3, this;
  7089. }, r2.prototype._all = function(t3, i3) {
  7090. for (var n2 = []; t3; )
  7091. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  7092. return i3;
  7093. }, r2.prototype._build = function(t3, i3, n2, r3) {
  7094. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  7095. if (h3 <= o2)
  7096. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  7097. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  7098. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  7099. d2(t3, i3, n2, l2, this.compareMinX);
  7100. for (var f2 = i3; f2 <= n2; f2 += l2) {
  7101. var u2 = Math.min(f2 + l2 - 1, n2);
  7102. d2(t3, f2, u2, s2, this.compareMinY);
  7103. for (var m2 = f2; m2 <= u2; m2 += s2) {
  7104. var c2 = Math.min(m2 + s2 - 1, u2);
  7105. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  7106. }
  7107. }
  7108. return a(e2, this.toBBox), e2;
  7109. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  7110. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  7111. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  7112. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  7113. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  7114. }
  7115. i3 = h3 || i3.children[0];
  7116. }
  7117. var m2, c2;
  7118. return i3;
  7119. }, r2.prototype._insert = function(t3, i3, n2) {
  7120. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  7121. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  7122. this._split(e2, i3), i3--;
  7123. this._adjustParentBBoxes(r3, e2, i3);
  7124. }, r2.prototype._split = function(t3, i3) {
  7125. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  7126. this._chooseSplitAxis(n2, e2, r3);
  7127. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  7128. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  7129. }, r2.prototype._splitRoot = function(t3, i3) {
  7130. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  7131. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  7132. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  7133. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  7134. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  7135. }
  7136. return r3 || n2 - i3;
  7137. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  7138. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  7139. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  7140. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  7141. t3.children.sort(r3);
  7142. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  7143. var m2 = t3.children[f2];
  7144. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  7145. }
  7146. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  7147. var p2 = t3.children[c2];
  7148. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  7149. }
  7150. return l2;
  7151. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  7152. for (var r3 = n2; r3 >= 0; r3--)
  7153. o(i3[r3], t3);
  7154. }, r2.prototype._condense = function(t3) {
  7155. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  7156. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  7157. }, r2;
  7158. });
  7159. })(rbush_min);
  7160. var require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(es$2);
  7161. var require$$2 = /* @__PURE__ */ getAugmentedNamespace(es$1);
  7162. var require$$3 = /* @__PURE__ */ getAugmentedNamespace(es);
  7163. var rbush = rbush_min.exports;
  7164. var helpers = require$$1$1;
  7165. var meta = require$$2;
  7166. var turfBBox = require$$3.default;
  7167. var featureEach = meta.featureEach;
  7168. meta.coordEach;
  7169. helpers.polygon;
  7170. var featureCollection = helpers.featureCollection;
  7171. function geojsonRbush(maxEntries) {
  7172. var tree = new rbush(maxEntries);
  7173. tree.insert = function(feature2) {
  7174. if (feature2.type !== "Feature")
  7175. throw new Error("invalid feature");
  7176. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7177. return rbush.prototype.insert.call(this, feature2);
  7178. };
  7179. tree.load = function(features) {
  7180. var load = [];
  7181. if (Array.isArray(features)) {
  7182. features.forEach(function(feature2) {
  7183. if (feature2.type !== "Feature")
  7184. throw new Error("invalid features");
  7185. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7186. load.push(feature2);
  7187. });
  7188. } else {
  7189. featureEach(features, function(feature2) {
  7190. if (feature2.type !== "Feature")
  7191. throw new Error("invalid features");
  7192. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7193. load.push(feature2);
  7194. });
  7195. }
  7196. return rbush.prototype.load.call(this, load);
  7197. };
  7198. tree.remove = function(feature2, equals) {
  7199. if (feature2.type !== "Feature")
  7200. throw new Error("invalid feature");
  7201. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7202. return rbush.prototype.remove.call(this, feature2, equals);
  7203. };
  7204. tree.clear = function() {
  7205. return rbush.prototype.clear.call(this);
  7206. };
  7207. tree.search = function(geojson) {
  7208. var features = rbush.prototype.search.call(this, this.toBBox(geojson));
  7209. return featureCollection(features);
  7210. };
  7211. tree.collides = function(geojson) {
  7212. return rbush.prototype.collides.call(this, this.toBBox(geojson));
  7213. };
  7214. tree.all = function() {
  7215. var features = rbush.prototype.all.call(this);
  7216. return featureCollection(features);
  7217. };
  7218. tree.toJSON = function() {
  7219. return rbush.prototype.toJSON.call(this);
  7220. };
  7221. tree.fromJSON = function(json) {
  7222. return rbush.prototype.fromJSON.call(this, json);
  7223. };
  7224. tree.toBBox = function(geojson) {
  7225. var bbox2;
  7226. if (geojson.bbox)
  7227. bbox2 = geojson.bbox;
  7228. else if (Array.isArray(geojson) && geojson.length === 4)
  7229. bbox2 = geojson;
  7230. else if (Array.isArray(geojson) && geojson.length === 6)
  7231. bbox2 = [geojson[0], geojson[1], geojson[3], geojson[4]];
  7232. else if (geojson.type === "Feature")
  7233. bbox2 = turfBBox(geojson);
  7234. else if (geojson.type === "FeatureCollection")
  7235. bbox2 = turfBBox(geojson);
  7236. else
  7237. throw new Error("invalid geojson");
  7238. return {
  7239. minX: bbox2[0],
  7240. minY: bbox2[1],
  7241. maxX: bbox2[2],
  7242. maxY: bbox2[3]
  7243. };
  7244. };
  7245. return tree;
  7246. }
  7247. geojsonRbush$1.exports = geojsonRbush;
  7248. geojsonRbush$1.exports.default = geojsonRbush;
  7249. var rbush$1 = geojsonRbush$1.exports;
  7250. function lineIntersect(line1, line2) {
  7251. var unique = {};
  7252. var results = [];
  7253. if (line1.type === "LineString") {
  7254. line1 = feature(line1);
  7255. }
  7256. if (line2.type === "LineString") {
  7257. line2 = feature(line2);
  7258. }
  7259. if (line1.type === "Feature" && line2.type === "Feature" && line1.geometry !== null && line2.geometry !== null && line1.geometry.type === "LineString" && line2.geometry.type === "LineString" && line1.geometry.coordinates.length === 2 && line2.geometry.coordinates.length === 2) {
  7260. var intersect = intersects(line1, line2);
  7261. if (intersect) {
  7262. results.push(intersect);
  7263. }
  7264. return featureCollection$1(results);
  7265. }
  7266. var tree = rbush$1();
  7267. tree.load(lineSegment(line2));
  7268. featureEach$1(lineSegment(line1), function(segment) {
  7269. featureEach$1(tree.search(segment), function(match) {
  7270. var intersect2 = intersects(segment, match);
  7271. if (intersect2) {
  7272. var key = getCoords(intersect2).join(",");
  7273. if (!unique[key]) {
  7274. unique[key] = true;
  7275. results.push(intersect2);
  7276. }
  7277. }
  7278. });
  7279. });
  7280. return featureCollection$1(results);
  7281. }
  7282. function intersects(line1, line2) {
  7283. var coords1 = getCoords(line1);
  7284. var coords2 = getCoords(line2);
  7285. if (coords1.length !== 2) {
  7286. throw new Error("<intersects> line1 must only contain 2 coordinates");
  7287. }
  7288. if (coords2.length !== 2) {
  7289. throw new Error("<intersects> line2 must only contain 2 coordinates");
  7290. }
  7291. var x1 = coords1[0][0];
  7292. var y1 = coords1[0][1];
  7293. var x2 = coords1[1][0];
  7294. var y2 = coords1[1][1];
  7295. var x3 = coords2[0][0];
  7296. var y3 = coords2[0][1];
  7297. var x4 = coords2[1][0];
  7298. var y4 = coords2[1][1];
  7299. var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  7300. var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
  7301. var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
  7302. if (denom === 0) {
  7303. if (numeA === 0 && numeB === 0) {
  7304. return null;
  7305. }
  7306. return null;
  7307. }
  7308. var uA = numeA / denom;
  7309. var uB = numeB / denom;
  7310. if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
  7311. var x = x1 + uA * (x2 - x1);
  7312. var y = y1 + uA * (y2 - y1);
  7313. return point([x, y]);
  7314. }
  7315. return null;
  7316. }
  7317. function booleanPointOnLine(pt2, line, options2) {
  7318. if (options2 === void 0) {
  7319. options2 = {};
  7320. }
  7321. var ptCoords = getCoord(pt2);
  7322. var lineCoords = getCoords(line);
  7323. for (var i2 = 0; i2 < lineCoords.length - 1; i2++) {
  7324. var ignoreBoundary = false;
  7325. if (options2.ignoreEndVertices) {
  7326. if (i2 === 0) {
  7327. ignoreBoundary = "start";
  7328. }
  7329. if (i2 === lineCoords.length - 2) {
  7330. ignoreBoundary = "end";
  7331. }
  7332. if (i2 === 0 && i2 + 1 === lineCoords.length - 1) {
  7333. ignoreBoundary = "both";
  7334. }
  7335. }
  7336. if (isPointOnLineSegment$1(lineCoords[i2], lineCoords[i2 + 1], ptCoords, ignoreBoundary, typeof options2.epsilon === "undefined" ? null : options2.epsilon)) {
  7337. return true;
  7338. }
  7339. }
  7340. return false;
  7341. }
  7342. function isPointOnLineSegment$1(lineSegmentStart, lineSegmentEnd, pt2, excludeBoundary, epsilon) {
  7343. var x = pt2[0];
  7344. var y = pt2[1];
  7345. var x1 = lineSegmentStart[0];
  7346. var y1 = lineSegmentStart[1];
  7347. var x2 = lineSegmentEnd[0];
  7348. var y2 = lineSegmentEnd[1];
  7349. var dxc = pt2[0] - x1;
  7350. var dyc = pt2[1] - y1;
  7351. var dxl = x2 - x1;
  7352. var dyl = y2 - y1;
  7353. var cross2 = dxc * dyl - dyc * dxl;
  7354. if (epsilon !== null) {
  7355. if (Math.abs(cross2) > epsilon) {
  7356. return false;
  7357. }
  7358. } else if (cross2 !== 0) {
  7359. return false;
  7360. }
  7361. if (!excludeBoundary) {
  7362. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7363. return dxl > 0 ? x1 <= x && x <= x2 : x2 <= x && x <= x1;
  7364. }
  7365. return dyl > 0 ? y1 <= y && y <= y2 : y2 <= y && y <= y1;
  7366. } else if (excludeBoundary === "start") {
  7367. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7368. return dxl > 0 ? x1 < x && x <= x2 : x2 <= x && x < x1;
  7369. }
  7370. return dyl > 0 ? y1 < y && y <= y2 : y2 <= y && y < y1;
  7371. } else if (excludeBoundary === "end") {
  7372. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7373. return dxl > 0 ? x1 <= x && x < x2 : x2 < x && x <= x1;
  7374. }
  7375. return dyl > 0 ? y1 <= y && y < y2 : y2 < y && y <= y1;
  7376. } else if (excludeBoundary === "both") {
  7377. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7378. return dxl > 0 ? x1 < x && x < x2 : x2 < x && x < x1;
  7379. }
  7380. return dyl > 0 ? y1 < y && y < y2 : y2 < y && y < y1;
  7381. }
  7382. return false;
  7383. }
  7384. function booleanWithin(feature1, feature2) {
  7385. var geom1 = getGeom(feature1);
  7386. var geom2 = getGeom(feature2);
  7387. var type1 = geom1.type;
  7388. var type2 = geom2.type;
  7389. switch (type1) {
  7390. case "Point":
  7391. switch (type2) {
  7392. case "MultiPoint":
  7393. return isPointInMultiPoint(geom1, geom2);
  7394. case "LineString":
  7395. return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });
  7396. case "Polygon":
  7397. case "MultiPolygon":
  7398. return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });
  7399. default:
  7400. throw new Error("feature2 " + type2 + " geometry not supported");
  7401. }
  7402. case "MultiPoint":
  7403. switch (type2) {
  7404. case "MultiPoint":
  7405. return isMultiPointInMultiPoint(geom1, geom2);
  7406. case "LineString":
  7407. return isMultiPointOnLine(geom1, geom2);
  7408. case "Polygon":
  7409. case "MultiPolygon":
  7410. return isMultiPointInPoly(geom1, geom2);
  7411. default:
  7412. throw new Error("feature2 " + type2 + " geometry not supported");
  7413. }
  7414. case "LineString":
  7415. switch (type2) {
  7416. case "LineString":
  7417. return isLineOnLine$1(geom1, geom2);
  7418. case "Polygon":
  7419. case "MultiPolygon":
  7420. return isLineInPoly$1(geom1, geom2);
  7421. default:
  7422. throw new Error("feature2 " + type2 + " geometry not supported");
  7423. }
  7424. case "Polygon":
  7425. switch (type2) {
  7426. case "Polygon":
  7427. case "MultiPolygon":
  7428. return isPolyInPoly$1(geom1, geom2);
  7429. default:
  7430. throw new Error("feature2 " + type2 + " geometry not supported");
  7431. }
  7432. default:
  7433. throw new Error("feature1 " + type1 + " geometry not supported");
  7434. }
  7435. }
  7436. function isPointInMultiPoint(point2, multiPoint2) {
  7437. var i2;
  7438. var output = false;
  7439. for (i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7440. if (compareCoords$1(multiPoint2.coordinates[i2], point2.coordinates)) {
  7441. output = true;
  7442. break;
  7443. }
  7444. }
  7445. return output;
  7446. }
  7447. function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
  7448. for (var i2 = 0; i2 < multiPoint1.coordinates.length; i2++) {
  7449. var anyMatch = false;
  7450. for (var i22 = 0; i22 < multiPoint2.coordinates.length; i22++) {
  7451. if (compareCoords$1(multiPoint1.coordinates[i2], multiPoint2.coordinates[i22])) {
  7452. anyMatch = true;
  7453. }
  7454. }
  7455. if (!anyMatch) {
  7456. return false;
  7457. }
  7458. }
  7459. return true;
  7460. }
  7461. function isMultiPointOnLine(multiPoint2, lineString2) {
  7462. var foundInsidePoint = false;
  7463. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7464. if (!booleanPointOnLine(multiPoint2.coordinates[i2], lineString2)) {
  7465. return false;
  7466. }
  7467. if (!foundInsidePoint) {
  7468. foundInsidePoint = booleanPointOnLine(multiPoint2.coordinates[i2], lineString2, { ignoreEndVertices: true });
  7469. }
  7470. }
  7471. return foundInsidePoint;
  7472. }
  7473. function isMultiPointInPoly(multiPoint2, polygon2) {
  7474. var output = true;
  7475. var isInside = false;
  7476. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7477. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2);
  7478. if (!isInside) {
  7479. output = false;
  7480. break;
  7481. }
  7482. {
  7483. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2, {
  7484. ignoreBoundary: true
  7485. });
  7486. }
  7487. }
  7488. return output && isInside;
  7489. }
  7490. function isLineOnLine$1(lineString1, lineString2) {
  7491. for (var i2 = 0; i2 < lineString1.coordinates.length; i2++) {
  7492. if (!booleanPointOnLine(lineString1.coordinates[i2], lineString2)) {
  7493. return false;
  7494. }
  7495. }
  7496. return true;
  7497. }
  7498. function isLineInPoly$1(linestring, polygon2) {
  7499. var polyBbox = bbox$1(polygon2);
  7500. var lineBbox = bbox$1(linestring);
  7501. if (!doBBoxOverlap(polyBbox, lineBbox)) {
  7502. return false;
  7503. }
  7504. var foundInsidePoint = false;
  7505. for (var i2 = 0; i2 < linestring.coordinates.length - 1; i2++) {
  7506. if (!booleanPointInPolygon(linestring.coordinates[i2], polygon2)) {
  7507. return false;
  7508. }
  7509. if (!foundInsidePoint) {
  7510. foundInsidePoint = booleanPointInPolygon(linestring.coordinates[i2], polygon2, { ignoreBoundary: true });
  7511. }
  7512. if (!foundInsidePoint) {
  7513. var midpoint2 = getMidpoint(linestring.coordinates[i2], linestring.coordinates[i2 + 1]);
  7514. foundInsidePoint = booleanPointInPolygon(midpoint2, polygon2, {
  7515. ignoreBoundary: true
  7516. });
  7517. }
  7518. }
  7519. return foundInsidePoint;
  7520. }
  7521. function isPolyInPoly$1(geometry1, geometry2) {
  7522. var poly1Bbox = bbox$1(geometry1);
  7523. var poly2Bbox = bbox$1(geometry2);
  7524. if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {
  7525. return false;
  7526. }
  7527. for (var i2 = 0; i2 < geometry1.coordinates[0].length; i2++) {
  7528. if (!booleanPointInPolygon(geometry1.coordinates[0][i2], geometry2)) {
  7529. return false;
  7530. }
  7531. }
  7532. return true;
  7533. }
  7534. function doBBoxOverlap(bbox1, bbox2) {
  7535. if (bbox1[0] > bbox2[0])
  7536. return false;
  7537. if (bbox1[2] < bbox2[2])
  7538. return false;
  7539. if (bbox1[1] > bbox2[1])
  7540. return false;
  7541. if (bbox1[3] < bbox2[3])
  7542. return false;
  7543. return true;
  7544. }
  7545. function compareCoords$1(pair1, pair2) {
  7546. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7547. }
  7548. function getMidpoint(pair1, pair2) {
  7549. return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
  7550. }
  7551. function pointGrid(bbox2, cellSide, options2) {
  7552. if (options2 === void 0) {
  7553. options2 = {};
  7554. }
  7555. if (options2.mask && !options2.units)
  7556. options2.units = "kilometers";
  7557. var results = [];
  7558. var west = bbox2[0];
  7559. var south = bbox2[1];
  7560. var east = bbox2[2];
  7561. var north = bbox2[3];
  7562. var xFraction = cellSide / distance([west, south], [east, south], options2);
  7563. var cellWidth = xFraction * (east - west);
  7564. var yFraction = cellSide / distance([west, south], [west, north], options2);
  7565. var cellHeight = yFraction * (north - south);
  7566. var bboxWidth = east - west;
  7567. var bboxHeight = north - south;
  7568. var columns = Math.floor(bboxWidth / cellWidth);
  7569. var rows = Math.floor(bboxHeight / cellHeight);
  7570. var deltaX = (bboxWidth - columns * cellWidth) / 2;
  7571. var deltaY = (bboxHeight - rows * cellHeight) / 2;
  7572. var currentX = west + deltaX;
  7573. while (currentX <= east) {
  7574. var currentY = south + deltaY;
  7575. while (currentY <= north) {
  7576. var cellPt = point([currentX, currentY], options2.properties);
  7577. if (options2.mask) {
  7578. if (booleanWithin(cellPt, options2.mask))
  7579. results.push(cellPt);
  7580. } else {
  7581. results.push(cellPt);
  7582. }
  7583. currentY += cellHeight;
  7584. }
  7585. currentX += cellWidth;
  7586. }
  7587. return featureCollection$1(results);
  7588. }
  7589. function polygonToLine(poly, options2) {
  7590. if (options2 === void 0) {
  7591. options2 = {};
  7592. }
  7593. var geom = getGeom(poly);
  7594. if (!options2.properties && poly.type === "Feature") {
  7595. options2.properties = poly.properties;
  7596. }
  7597. switch (geom.type) {
  7598. case "Polygon":
  7599. return polygonToLine$1(geom, options2);
  7600. case "MultiPolygon":
  7601. return multiPolygonToLine(geom, options2);
  7602. default:
  7603. throw new Error("invalid poly");
  7604. }
  7605. }
  7606. function polygonToLine$1(poly, options2) {
  7607. if (options2 === void 0) {
  7608. options2 = {};
  7609. }
  7610. var geom = getGeom(poly);
  7611. var coords = geom.coordinates;
  7612. var properties = options2.properties ? options2.properties : poly.type === "Feature" ? poly.properties : {};
  7613. return coordsToLine(coords, properties);
  7614. }
  7615. function multiPolygonToLine(multiPoly, options2) {
  7616. if (options2 === void 0) {
  7617. options2 = {};
  7618. }
  7619. var geom = getGeom(multiPoly);
  7620. var coords = geom.coordinates;
  7621. var properties = options2.properties ? options2.properties : multiPoly.type === "Feature" ? multiPoly.properties : {};
  7622. var lines = [];
  7623. coords.forEach(function(coord) {
  7624. lines.push(coordsToLine(coord, properties));
  7625. });
  7626. return featureCollection$1(lines);
  7627. }
  7628. function coordsToLine(coords, properties) {
  7629. if (coords.length > 1) {
  7630. return multiLineString(coords, properties);
  7631. }
  7632. return lineString(coords[0], properties);
  7633. }
  7634. function booleanClockwise(line) {
  7635. var ring = getCoords(line);
  7636. var sum = 0;
  7637. var i2 = 1;
  7638. var prev;
  7639. var cur;
  7640. while (i2 < ring.length) {
  7641. prev = cur || ring[0];
  7642. cur = ring[i2];
  7643. sum += (cur[0] - prev[0]) * (cur[1] + prev[1]);
  7644. i2++;
  7645. }
  7646. return sum > 0;
  7647. }
  7648. function booleanDisjoint(feature1, feature2) {
  7649. var bool = true;
  7650. flattenEach(feature1, function(flatten1) {
  7651. flattenEach(feature2, function(flatten22) {
  7652. if (bool === false) {
  7653. return false;
  7654. }
  7655. bool = disjoint(flatten1.geometry, flatten22.geometry);
  7656. });
  7657. });
  7658. return bool;
  7659. }
  7660. function disjoint(geom1, geom2) {
  7661. switch (geom1.type) {
  7662. case "Point":
  7663. switch (geom2.type) {
  7664. case "Point":
  7665. return !compareCoords(geom1.coordinates, geom2.coordinates);
  7666. case "LineString":
  7667. return !isPointOnLine(geom2, geom1);
  7668. case "Polygon":
  7669. return !booleanPointInPolygon(geom1, geom2);
  7670. }
  7671. break;
  7672. case "LineString":
  7673. switch (geom2.type) {
  7674. case "Point":
  7675. return !isPointOnLine(geom1, geom2);
  7676. case "LineString":
  7677. return !isLineOnLine(geom1, geom2);
  7678. case "Polygon":
  7679. return !isLineInPoly(geom2, geom1);
  7680. }
  7681. break;
  7682. case "Polygon":
  7683. switch (geom2.type) {
  7684. case "Point":
  7685. return !booleanPointInPolygon(geom2, geom1);
  7686. case "LineString":
  7687. return !isLineInPoly(geom1, geom2);
  7688. case "Polygon":
  7689. return !isPolyInPoly(geom2, geom1);
  7690. }
  7691. }
  7692. return false;
  7693. }
  7694. function isPointOnLine(lineString2, pt2) {
  7695. for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
  7696. if (isPointOnLineSegment(lineString2.coordinates[i2], lineString2.coordinates[i2 + 1], pt2.coordinates)) {
  7697. return true;
  7698. }
  7699. }
  7700. return false;
  7701. }
  7702. function isLineOnLine(lineString1, lineString2) {
  7703. var doLinesIntersect = lineIntersect(lineString1, lineString2);
  7704. if (doLinesIntersect.features.length > 0) {
  7705. return true;
  7706. }
  7707. return false;
  7708. }
  7709. function isLineInPoly(polygon2, lineString2) {
  7710. for (var _i = 0, _a2 = lineString2.coordinates; _i < _a2.length; _i++) {
  7711. var coord = _a2[_i];
  7712. if (booleanPointInPolygon(coord, polygon2)) {
  7713. return true;
  7714. }
  7715. }
  7716. var doLinesIntersect = lineIntersect(lineString2, polygonToLine(polygon2));
  7717. if (doLinesIntersect.features.length > 0) {
  7718. return true;
  7719. }
  7720. return false;
  7721. }
  7722. function isPolyInPoly(feature1, feature2) {
  7723. for (var _i = 0, _a2 = feature1.coordinates[0]; _i < _a2.length; _i++) {
  7724. var coord1 = _a2[_i];
  7725. if (booleanPointInPolygon(coord1, feature2)) {
  7726. return true;
  7727. }
  7728. }
  7729. for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {
  7730. var coord2 = _c[_b];
  7731. if (booleanPointInPolygon(coord2, feature1)) {
  7732. return true;
  7733. }
  7734. }
  7735. var doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
  7736. if (doLinesIntersect.features.length > 0) {
  7737. return true;
  7738. }
  7739. return false;
  7740. }
  7741. function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt2) {
  7742. var dxc = pt2[0] - lineSegmentStart[0];
  7743. var dyc = pt2[1] - lineSegmentStart[1];
  7744. var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
  7745. var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
  7746. var cross2 = dxc * dyl - dyc * dxl;
  7747. if (cross2 !== 0) {
  7748. return false;
  7749. }
  7750. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7751. if (dxl > 0) {
  7752. return lineSegmentStart[0] <= pt2[0] && pt2[0] <= lineSegmentEnd[0];
  7753. } else {
  7754. return lineSegmentEnd[0] <= pt2[0] && pt2[0] <= lineSegmentStart[0];
  7755. }
  7756. } else if (dyl > 0) {
  7757. return lineSegmentStart[1] <= pt2[1] && pt2[1] <= lineSegmentEnd[1];
  7758. } else {
  7759. return lineSegmentEnd[1] <= pt2[1] && pt2[1] <= lineSegmentStart[1];
  7760. }
  7761. }
  7762. function compareCoords(pair1, pair2) {
  7763. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7764. }
  7765. function booleanIntersects(feature1, feature2) {
  7766. var bool = false;
  7767. flattenEach(feature1, function(flatten1) {
  7768. flattenEach(feature2, function(flatten22) {
  7769. if (bool === true) {
  7770. return true;
  7771. }
  7772. bool = !booleanDisjoint(flatten1.geometry, flatten22.geometry);
  7773. });
  7774. });
  7775. return bool;
  7776. }
  7777. function rectangleGrid(bbox2, cellWidth, cellHeight, options2) {
  7778. if (options2 === void 0) {
  7779. options2 = {};
  7780. }
  7781. var results = [];
  7782. var west = bbox2[0];
  7783. var south = bbox2[1];
  7784. var east = bbox2[2];
  7785. var north = bbox2[3];
  7786. var xFraction = cellWidth / distance([west, south], [east, south], options2);
  7787. var cellWidthDeg = xFraction * (east - west);
  7788. var yFraction = cellHeight / distance([west, south], [west, north], options2);
  7789. var cellHeightDeg = yFraction * (north - south);
  7790. var bboxWidth = east - west;
  7791. var bboxHeight = north - south;
  7792. var columns = Math.floor(bboxWidth / cellWidthDeg);
  7793. var rows = Math.floor(bboxHeight / cellHeightDeg);
  7794. var deltaX = (bboxWidth - columns * cellWidthDeg) / 2;
  7795. var deltaY = (bboxHeight - rows * cellHeightDeg) / 2;
  7796. var currentX = west + deltaX;
  7797. for (var column = 0; column < columns; column++) {
  7798. var currentY = south + deltaY;
  7799. for (var row = 0; row < rows; row++) {
  7800. var cellPoly = polygon([
  7801. [
  7802. [currentX, currentY],
  7803. [currentX, currentY + cellHeightDeg],
  7804. [currentX + cellWidthDeg, currentY + cellHeightDeg],
  7805. [currentX + cellWidthDeg, currentY],
  7806. [currentX, currentY]
  7807. ]
  7808. ], options2.properties);
  7809. if (options2.mask) {
  7810. if (booleanIntersects(options2.mask, cellPoly)) {
  7811. results.push(cellPoly);
  7812. }
  7813. } else {
  7814. results.push(cellPoly);
  7815. }
  7816. currentY += cellHeightDeg;
  7817. }
  7818. currentX += cellWidthDeg;
  7819. }
  7820. return featureCollection$1(results);
  7821. }
  7822. function squareGrid(bbox2, cellSide, options2) {
  7823. if (options2 === void 0) {
  7824. options2 = {};
  7825. }
  7826. return rectangleGrid(bbox2, cellSide, cellSide, options2);
  7827. }
  7828. class ViewShed {
  7829. constructor(viewer2) {
  7830. if (!viewer2)
  7831. throw new Cesium.DeveloperError("no viewer object!");
  7832. this.viewer = viewer2;
  7833. this.handler = void 0;
  7834. this.lightCamera;
  7835. this.pyramid;
  7836. this.frustumPrimitive;
  7837. this.viewershedPolygon;
  7838. }
  7839. initHandler() {
  7840. if (this.handler) {
  7841. this.handler.destroy();
  7842. this.handler = void 0;
  7843. }
  7844. let canvas = document.getElementById("canvasMap");
  7845. if (canvas == null) {
  7846. canvas = document.createElement("canvas");
  7847. canvas.id = "canvasMap";
  7848. canvas.style.display = "none";
  7849. canvas.style.top = "0px";
  7850. canvas.style.position = "absolute";
  7851. document.body.append(canvas);
  7852. }
  7853. this.canvasEle = canvas;
  7854. }
  7855. ReturnDistance(pos0, pos1) {
  7856. let point1cartographic = Cesium.Cartographic.fromCartesian(pos0);
  7857. let point2cartographic = Cesium.Cartographic.fromCartesian(pos1);
  7858. let geodesic = new Cesium.EllipsoidGeodesic();
  7859. geodesic.setEndPoints(point1cartographic, point2cartographic);
  7860. let s = geodesic.surfaceDistance;
  7861. return s;
  7862. }
  7863. getHeight(x, y, objectsToExclude) {
  7864. let endCartographic = Cesium.Cartographic.fromDegrees(x, y);
  7865. let endHeight = this.viewer.scene.sampleHeight(
  7866. endCartographic,
  7867. objectsToExclude
  7868. );
  7869. return endHeight;
  7870. }
  7871. cartesian3ToDegree(Cartesian32) {
  7872. let _ellipsoid = this.viewer.scene.globe.ellipsoid;
  7873. let _cartographic = _ellipsoid.cartesianToCartographic(Cartesian32);
  7874. let _lat = Cesium.Math.toDegrees(_cartographic.latitude);
  7875. let _lng = Cesium.Math.toDegrees(_cartographic.longitude);
  7876. let _alt = _cartographic.height;
  7877. return [_lng, _lat, _alt];
  7878. }
  7879. getAngle(lng1, lat1, lng2, lat2) {
  7880. let dRotateAngle = Math.atan2(Math.abs(lng1 - lng2), Math.abs(lat1 - lat2));
  7881. if (lng2 >= lng1) {
  7882. dRotateAngle = lat2 < lat1 ? Math.PI - dRotateAngle : dRotateAngle;
  7883. } else {
  7884. dRotateAngle = lat2 >= lat1 ? 2 * Math.PI - dRotateAngle : Math.PI + dRotateAngle;
  7885. }
  7886. dRotateAngle = dRotateAngle * 180 / Math.PI;
  7887. return dRotateAngle;
  7888. }
  7889. getPitch(pointA, pointB) {
  7890. let transfrom = Cesium.Transforms.eastNorthUpToFixedFrame(pointA);
  7891. const vector = Cesium.Cartesian3.subtract(
  7892. pointB,
  7893. pointA,
  7894. new Cesium.Cartesian3()
  7895. );
  7896. let direction = Cesium.Matrix4.multiplyByPointAsVector(
  7897. Cesium.Matrix4.inverse(transfrom, transfrom),
  7898. vector,
  7899. vector
  7900. );
  7901. Cesium.Cartesian3.normalize(direction, direction);
  7902. return Cesium.Math.PI_OVER_TWO - Cesium.Math.acosClamped(direction.z);
  7903. }
  7904. updateViewShed() {
  7905. this.clear();
  7906. this.setLightCamera();
  7907. this.addVisualPyramid();
  7908. this.createFrustum();
  7909. }
  7910. clear() {
  7911. if (this.pyramid) {
  7912. this.viewer.entities.removeById(this.pyramid.id);
  7913. this.pyramid = void 0;
  7914. }
  7915. if (this.frustumPrimitive) {
  7916. this.viewer.scene.primitives.remove(this.frustumPrimitive);
  7917. this.frustumPrimitive = void 0;
  7918. }
  7919. if (this.debugModelMatrixPrimitive) {
  7920. this.viewer.scene.primitives.remove(this.debugModelMatrixPrimitive);
  7921. this.debugModelMatrixPrimitive = void 0;
  7922. }
  7923. }
  7924. addVisualPyramid() {
  7925. let options2 = this.ViewShedOptions;
  7926. let position2 = options2.viewPosition;
  7927. let visualRange = Number(options2.visualRange);
  7928. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  7929. this.debugModelMatrixPrimitive = this.viewer.scene.primitives.add(
  7930. new Cesium.DebugModelMatrixPrimitive({
  7931. modelMatrix: transform3,
  7932. length: 5
  7933. })
  7934. );
  7935. const halfClock = options2.horizontalViewAngle / 2;
  7936. const halfCone = options2.verticalViewAngle / 2;
  7937. const pitch = Cesium.Math.toDegrees(options2.pitch);
  7938. const ellipsoid = new Cesium.EllipsoidGraphics({
  7939. radii: new Cesium.Cartesian3(visualRange, visualRange, visualRange),
  7940. minimumClock: Cesium.Math.toRadians(90 - options2.direction - halfClock),
  7941. maximumClock: Cesium.Math.toRadians(90 - options2.direction + halfClock),
  7942. minimumCone: Cesium.Math.toRadians(90 - pitch - halfCone),
  7943. maximumCone: Cesium.Math.toRadians(90 - pitch + halfCone),
  7944. fill: false,
  7945. outline: true,
  7946. subdivisions: 256,
  7947. stackPartitions: 64,
  7948. slicePartitions: 64,
  7949. outlineColor: Cesium.Color.YELLOWGREEN.withAlpha(0.5)
  7950. });
  7951. const pyramidEntity = new Cesium.Entity({
  7952. position: position2,
  7953. ellipsoid
  7954. });
  7955. this.pyramid = this.viewer.entities.add(pyramidEntity);
  7956. }
  7957. setLightCamera() {
  7958. if (!this.lightCamera) {
  7959. this.lightCamera = new Cesium.Camera(this.viewer.scene);
  7960. }
  7961. let options2 = this.ViewShedOptions;
  7962. let visualRange = Number(options2.visualRange);
  7963. this.lightCamera.position = options2.viewPosition;
  7964. this.lightCamera.frustum.near = 0.1;
  7965. this.lightCamera.frustum.far = visualRange;
  7966. const hr = Cesium.Math.toRadians(options2.horizontalViewAngle);
  7967. const vr = Cesium.Math.toRadians(options2.verticalViewAngle);
  7968. this.lightCamera.frustum.aspectRatio = visualRange * Math.tan(hr / 2) * 2 / (visualRange * Math.tan(vr / 2) * 2);
  7969. this.lightCamera.frustum.fov = hr > vr ? hr : vr;
  7970. this.lightCamera.setView({
  7971. destination: options2.viewPosition,
  7972. orientation: {
  7973. heading: Cesium.Math.toRadians(options2.direction || 0),
  7974. pitch: options2.pitch || 0,
  7975. roll: 0
  7976. }
  7977. });
  7978. }
  7979. createFrustum() {
  7980. const scratchRight = new Cesium.Cartesian3();
  7981. const scratchRotation = new Cesium.Matrix3();
  7982. const scratchOrientation = new Cesium.Quaternion();
  7983. const direction = this.lightCamera.directionWC;
  7984. const up = this.lightCamera.upWC;
  7985. let right = this.lightCamera.rightWC;
  7986. right = Cesium.Cartesian3.negate(right, scratchRight);
  7987. let rotation = scratchRotation;
  7988. Cesium.Matrix3.setColumn(rotation, 0, right, rotation);
  7989. Cesium.Matrix3.setColumn(rotation, 1, up, rotation);
  7990. Cesium.Matrix3.setColumn(rotation, 2, direction, rotation);
  7991. let orientation = Cesium.Quaternion.fromRotationMatrix(
  7992. rotation,
  7993. scratchOrientation
  7994. );
  7995. let instanceOutline = new Cesium.GeometryInstance({
  7996. geometry: new Cesium.FrustumOutlineGeometry({
  7997. frustum: this.lightCamera.frustum,
  7998. origin: this.ViewShedOptions.viewPosition,
  7999. orientation
  8000. }),
  8001. id: "\u89C6\u690E\u4F53\u8F6E\u5ED3\u7EBF" + Math.random().toString(36).substr(2),
  8002. attributes: {
  8003. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  8004. new Cesium.Color(0, 1, 0, 1)
  8005. ),
  8006. show: new Cesium.ShowGeometryInstanceAttribute(true)
  8007. }
  8008. });
  8009. this.frustumPrimitive = this.viewer.scene.primitives.add(
  8010. new Cesium.Primitive({
  8011. geometryInstances: instanceOutline,
  8012. appearance: new Cesium.PerInstanceColorAppearance({
  8013. flat: true,
  8014. translucent: false,
  8015. closed: true
  8016. })
  8017. })
  8018. );
  8019. }
  8020. addViewershedPolygon(positionArr) {
  8021. let polygon2 = new Cesium.PolygonGeometry({
  8022. polygonHierarchy: new Cesium.PolygonHierarchy(
  8023. Cesium.Cartesian3.fromDegreesArray(positionArr)
  8024. ),
  8025. height: 0,
  8026. extrudedHeight: 0,
  8027. vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
  8028. stRotation: 0,
  8029. ellipsoid: Cesium.Ellipsoid.WGS84,
  8030. granularity: Cesium.Math.RADIANS_PER_DEGREE,
  8031. perPositionHeight: false,
  8032. closeTop: true,
  8033. closeBottom: true,
  8034. arcType: Cesium.ArcType.GEODESIC
  8035. });
  8036. let polygonInstance = new Cesium.GeometryInstance({
  8037. geometry: polygon2,
  8038. name: "ViewershedPolygon",
  8039. attributes: {
  8040. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  8041. Cesium.Color.BLUE.withAlpha(0.6)
  8042. ),
  8043. show: new Cesium.ShowGeometryInstanceAttribute(true)
  8044. }
  8045. });
  8046. this.viewershedPolygon = this.viewer.scene.primitives.add(
  8047. new Cesium.GroundPrimitive({
  8048. geometryInstances: polygonInstance,
  8049. appearance: new Cesium.EllipsoidSurfaceAppearance({
  8050. aboveGround: true,
  8051. material: new Cesium.Material({
  8052. fabric: {
  8053. type: "Image",
  8054. uniforms: {
  8055. image: this.returnImgae()
  8056. }
  8057. }
  8058. })
  8059. })
  8060. })
  8061. );
  8062. }
  8063. drawViewershed(precision) {
  8064. const pos = this.cartesian3ToDegree(this.ViewShedOptions.viewPosition);
  8065. const radius = this.ViewShedOptions.visualRange;
  8066. const direction = this.ViewShedOptions.direction;
  8067. let boundary = this.computeBoundaryOptions(pos, radius, direction);
  8068. const bbox2 = boundary.bbox;
  8069. let mask = polygon([boundary.boundaryPoints]);
  8070. const dis = this.ViewShedOptions.visualRange / (precision * 1e3);
  8071. let gridPoints = pointGrid(bbox2, dis, {
  8072. mask
  8073. });
  8074. console.log(this.ViewShedOptions.visualRange, precision, dis);
  8075. let pointsResult = this.createTargetPoints(gridPoints, dis, pos);
  8076. let variogram = index.train(
  8077. pointsResult.values,
  8078. pointsResult.lngs,
  8079. pointsResult.lats,
  8080. "exponential",
  8081. 0,
  8082. 100
  8083. );
  8084. let grid2 = index.grid([boundary.boundaryPoints], variogram, dis / 1e3);
  8085. const colors = [
  8086. "#ff000080",
  8087. "#ff000080",
  8088. "#ff000080",
  8089. "#ff000080",
  8090. "#ff000080",
  8091. "#ff000080",
  8092. "#00ff0080",
  8093. "#00ff0080",
  8094. "#00ff0080",
  8095. "#00ff0080",
  8096. "#00ff0080",
  8097. "#00ff0080"
  8098. ];
  8099. this.canvasEle.width = 3840;
  8100. this.canvasEle.height = 2160;
  8101. index.plot(
  8102. this.canvasEle,
  8103. grid2,
  8104. [bbox2[0], bbox2[2]],
  8105. [bbox2[1], bbox2[3]],
  8106. colors
  8107. );
  8108. this.addViewershedPolygon(boundary.positionArr);
  8109. }
  8110. computeBoundaryOptions(pos, radius, angle) {
  8111. let Ea = 6378137;
  8112. let Eb = 6356725;
  8113. const lng = pos[0], lat = pos[1];
  8114. const bbox2 = [lng, lat, lng, lat];
  8115. let positionArr = [];
  8116. let boundaryPoints = [];
  8117. positionArr.push(lng, lat);
  8118. boundaryPoints.push([lng, lat]);
  8119. let start2 = angle + 45 > 360 ? angle - 45 - 360 : angle - 45;
  8120. let end = start2 + 90;
  8121. for (let i2 = start2; i2 <= end; i2++) {
  8122. let dx = radius * Math.sin(i2 * Math.PI / 180);
  8123. let dy = radius * Math.cos(i2 * Math.PI / 180);
  8124. let ec = Eb + (Ea - Eb) * (90 - lat) / 90;
  8125. let ed = ec * Math.cos(lat * Math.PI / 180);
  8126. let BJD = lng + dx / ed * 180 / Math.PI;
  8127. let BWD = lat + dy / ec * 180 / Math.PI;
  8128. positionArr.push(BJD, BWD);
  8129. boundaryPoints.push([BJD, BWD]);
  8130. this.refreshBBox(bbox2, BJD, BWD);
  8131. }
  8132. boundaryPoints.push([lng, lat]);
  8133. return {
  8134. positionArr,
  8135. boundaryPoints,
  8136. bbox: bbox2
  8137. };
  8138. }
  8139. refreshBBox(result, x, y) {
  8140. result[0] = x < result[0] ? x : result[0];
  8141. result[1] = y < result[1] ? y : result[1];
  8142. result[2] = x > result[2] ? x : result[2];
  8143. result[3] = y > result[3] ? y : result[3];
  8144. }
  8145. createTargetPoints(gridPoints, step, sourcePos) {
  8146. let positionArr = [];
  8147. let objectsToExclude = [
  8148. this.frustumPrimitive,
  8149. this.pyramid,
  8150. this.debugModelMatrixPrimitive
  8151. ];
  8152. let values3 = [], lngs = [], lats = [];
  8153. let height2 = this.getHeight(sourcePos[0], sourcePos[1], objectsToExclude);
  8154. positionArr.push({
  8155. x: sourcePos[0],
  8156. y: sourcePos[1],
  8157. z: height2
  8158. });
  8159. let viewPoint = this.ViewShedOptions.viewPosition;
  8160. for (let index2 = 0; index2 < gridPoints.features.length; index2++) {
  8161. const feature2 = gridPoints.features[index2];
  8162. const coords = feature2.geometry.coordinates;
  8163. const x = coords[0], y = coords[1];
  8164. let h2 = this.getHeight(x, y, objectsToExclude);
  8165. let endPoint = Cesium.Cartesian3.fromDegrees(x, y, h2);
  8166. let direction = Cesium.Cartesian3.normalize(
  8167. Cesium.Cartesian3.subtract(
  8168. endPoint,
  8169. viewPoint,
  8170. new Cesium.Cartesian3()
  8171. ),
  8172. new Cesium.Cartesian3()
  8173. );
  8174. let ray = new Cesium.Ray(viewPoint, direction);
  8175. let result = this.viewer.scene.pickFromRay(ray, objectsToExclude);
  8176. if (result) {
  8177. let buffer = this.ReturnDistance(endPoint, result.position);
  8178. if (buffer > step) {
  8179. values3.push(0);
  8180. } else {
  8181. values3.push(1);
  8182. }
  8183. lngs.push(x);
  8184. lats.push(y);
  8185. }
  8186. }
  8187. return {
  8188. values: values3,
  8189. lngs,
  8190. lats
  8191. };
  8192. }
  8193. returnImgae() {
  8194. return this.canvasEle.toDataURL("image/png");
  8195. }
  8196. }
  8197. Object.assign(ViewShed.prototype, {
  8198. createViewshed: function(precision) {
  8199. let _self = this;
  8200. let scene = _self.viewer.scene;
  8201. _self.initHandler();
  8202. _self.clearAll();
  8203. let count = 0;
  8204. let toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u8D77\u70B9";
  8205. _self.handler = new Cesium.ScreenSpaceEventHandler(_self.viewer.canvas);
  8206. _self.handler.setInputAction((event2) => {
  8207. count++;
  8208. if (count === 1) {
  8209. toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u7EC8\u70B9";
  8210. let earthPosition = scene.pickPosition(event2.position);
  8211. let pos = _self.cartesian3ToDegree(earthPosition);
  8212. _self.handler.setInputAction(function(move) {
  8213. CreateRemindertip(toolTip, move.endPosition, true);
  8214. let newPosition = scene.pickPosition(move.endPosition);
  8215. if (Cesium.defined(newPosition)) {
  8216. let pos1 = _self.cartesian3ToDegree(newPosition);
  8217. let distance2 = Cesium.Cartesian3.distance(newPosition, earthPosition);
  8218. let angle = _self.getAngle(pos[0], pos[1], pos1[0], pos1[1]);
  8219. let pitch = _self.getPitch(earthPosition, newPosition);
  8220. _self.ViewShedOptions = {
  8221. viewPosition: earthPosition,
  8222. endPosition: newPosition,
  8223. direction: angle,
  8224. pitch,
  8225. horizontalViewAngle: 90,
  8226. verticalViewAngle: 60,
  8227. visibleAreaColor: Cesium.Color.GREEN,
  8228. invisibleAreaColor: Cesium.Color.RED,
  8229. visualRange: distance2
  8230. };
  8231. _self.updateViewShed();
  8232. }
  8233. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8234. }
  8235. if (count === 2) {
  8236. _self.initHandler();
  8237. _self.drawViewershed(precision);
  8238. CreateRemindertip(toolTip, event2.endPosition, false);
  8239. }
  8240. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  8241. _self.handler.setInputAction(function(move) {
  8242. CreateRemindertip(toolTip, move.endPosition, true);
  8243. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8244. },
  8245. clearAll: function() {
  8246. this.clear();
  8247. if (this.viewershedPolygon) {
  8248. this.viewer.scene.primitives.remove(this.viewershedPolygon);
  8249. this.viewershedPolygon = void 0;
  8250. }
  8251. }
  8252. });
  8253. class SunshineShadow {
  8254. constructor(viewer2) {
  8255. if (!viewer2)
  8256. throw new Cesium.DeveloperError("no viewer object!");
  8257. this._viewer = viewer2;
  8258. this._stopTime = null;
  8259. }
  8260. }
  8261. Object.assign(SunshineShadow.prototype, {
  8262. startSunShine(options2) {
  8263. options2 = options2 || {};
  8264. if (!Cesium.defined(options2.startTime)) {
  8265. options2.startTime = new Date().getTime();
  8266. }
  8267. if (!Cesium.defined(options2.stopTime)) {
  8268. options2.stopTime = new Date().getTime() + 1e3;
  8269. }
  8270. if (!Cesium.defined(options2.speed)) {
  8271. options2.speed = 1600;
  8272. }
  8273. if (this._stopTime) {
  8274. this._viewer.clock.shouldAnimate = true;
  8275. this._viewer.clock.currentTime = this._stopTime;
  8276. } else {
  8277. this._viewer.scene.globe.enableLighting = true;
  8278. this._viewer.shadows = true;
  8279. this._viewer.clock.startTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8280. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8281. this._viewer.clock.stopTime = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8282. console.log(this._viewer.clock.currentTime);
  8283. this._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  8284. this._viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER;
  8285. this._viewer.clock.multiplier = options2.speed;
  8286. this._viewer.clock.canAnimate = true;
  8287. this._viewer.clock.shouldAnimate = true;
  8288. }
  8289. },
  8290. stopSunShine() {
  8291. this._stopTime = this._viewer.clock.currentTime;
  8292. console.log(this._viewer.clock.currentTime);
  8293. this._viewer.clock.shouldAnimate = false;
  8294. },
  8295. removeSunShine() {
  8296. if (this._stopTime) {
  8297. this._viewer.clock.shouldAnimate = true;
  8298. this._viewer.clock.currentTime = this._stopTime;
  8299. console.log(this._viewer.clock.currentTime);
  8300. }
  8301. this._viewer.scene.globe.enableLighting = false;
  8302. this._viewer.shadows = false;
  8303. this._stopTime = null;
  8304. }
  8305. });
  8306. Object.assign(SunshineShadow.prototype, {
  8307. start(options2) {
  8308. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8309. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "block";
  8310. }
  8311. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8312. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "block";
  8313. }
  8314. this._viewer.shadows = true;
  8315. options2 = options2 || {};
  8316. if (!Cesium.defined(options2.startTime)) {
  8317. options2.startTime = new Date(new Date().toLocaleDateString()).getTime();
  8318. console.log("\u5F53\u5929\u51CC\u66680\u70B9", new Date(new Date().toLocaleDateString()));
  8319. }
  8320. if (!Cesium.defined(options2.stopTime)) {
  8321. options2.stopTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1e3 - 1;
  8322. console.log("\u5F53\u592923\u70B959\u520659\u79D2", new Date(new Date(new Date().toLocaleDateString()).getTime() + 4 * 60 * 60 * 1e3));
  8323. }
  8324. if (!Cesium.defined(options2.speed)) {
  8325. options2.speed = 1600;
  8326. }
  8327. let start2 = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8328. let stop = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8329. viewer.timeline.zoomTo(start2, stop);
  8330. let clock2 = viewer.clock;
  8331. clock2.shouldAnimate = false;
  8332. clock2.startTime = start2;
  8333. clock2.stopTime = stop;
  8334. clock2.currentTime = start2;
  8335. clock2.clockRange = Cesium.ClockRange.UNBOUNDED;
  8336. clock2.multiplier = options2.speed;
  8337. },
  8338. remove() {
  8339. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8340. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "none";
  8341. }
  8342. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8343. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "none";
  8344. }
  8345. this._viewer.shadows = false;
  8346. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(new Date().getTime()));
  8347. this._viewer.clock.shouldAnimate = false;
  8348. }
  8349. });
  8350. class Profile {
  8351. constructor(viewer2) {
  8352. if (!viewer2)
  8353. throw new Cesium.DeveloperError("no viewer object!");
  8354. this._viewer = viewer2;
  8355. this._profileEntities = [];
  8356. }
  8357. _interPoints(positions, objectsToExclude) {
  8358. let positionsCartographic = [];
  8359. let terrainSamplePositions = [];
  8360. for (let index2 = 0; index2 < positions.length; index2++) {
  8361. const element = positions[index2];
  8362. let ellipsoid = this._viewer.scene.globe.ellipsoid;
  8363. let cartographic = ellipsoid.cartesianToCartographic(element);
  8364. positionsCartographic.push(cartographic);
  8365. }
  8366. for (let i2 = 0; i2 < positionsCartographic.length; i2++) {
  8367. const m_Cartographic0 = positionsCartographic[i2];
  8368. const m_Cartographic1 = positionsCartographic[i2 + 1];
  8369. if (m_Cartographic1) {
  8370. let a = Math.abs(m_Cartographic0.longitude - m_Cartographic1.longitude) * 1e7;
  8371. let b = Math.abs(m_Cartographic0.latitude - m_Cartographic1.latitude) * 1e7;
  8372. if (a > b)
  8373. b = a;
  8374. let length = parseInt(b / 2);
  8375. if (length > 1e3)
  8376. length = 1e3;
  8377. if (length < 2)
  8378. length = 2;
  8379. for (let j = 0; j < length; j++) {
  8380. terrainSamplePositions.push(
  8381. new Cesium.Cartographic(
  8382. Cesium.Math.lerp(
  8383. m_Cartographic0.longitude,
  8384. m_Cartographic1.longitude,
  8385. j / (length - 1)
  8386. ),
  8387. Cesium.Math.lerp(
  8388. m_Cartographic0.latitude,
  8389. m_Cartographic1.latitude,
  8390. j / (length - 1)
  8391. )
  8392. )
  8393. );
  8394. }
  8395. terrainSamplePositions.pop();
  8396. } else {
  8397. terrainSamplePositions.push(m_Cartographic0);
  8398. }
  8399. }
  8400. let positions_Inter = [];
  8401. let distance2 = 0;
  8402. for (let n = 0; n < terrainSamplePositions.length; n++) {
  8403. let curCartographic = terrainSamplePositions[n];
  8404. let height2 = this._viewer.scene.sampleHeight(curCartographic, objectsToExclude);
  8405. const lon = curCartographic.longitude / Math.PI * 180;
  8406. const lat = curCartographic.latitude / Math.PI * 180;
  8407. let point2 = Cesium.Cartesian3.fromDegrees(lon, lat, height2);
  8408. let preCartographic = terrainSamplePositions[n - 1];
  8409. if (preCartographic) {
  8410. const lon1 = preCartographic.longitude / Math.PI * 180;
  8411. const lat1 = preCartographic.latitude / Math.PI * 180;
  8412. let point1 = Cesium.Cartesian3.fromDegrees(lon1, lat1, height2);
  8413. let curDis = Cesium.Cartesian3.distance(point1, point2);
  8414. distance2 += curDis;
  8415. }
  8416. positions_Inter.push({
  8417. position: {
  8418. lon,
  8419. lat,
  8420. height: height2
  8421. },
  8422. distance: distance2
  8423. });
  8424. }
  8425. return positions_Inter;
  8426. }
  8427. }
  8428. Object.assign(Profile.prototype, {
  8429. startProfileAnalysis(points2, entity) {
  8430. return new Promise((resolve2, reject2) => {
  8431. let _self = this;
  8432. let positions = points2.map((point2) => {
  8433. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8434. });
  8435. _self.removeProfileAnalysis();
  8436. entity.clampToGround = true;
  8437. console.log(positions);
  8438. let pointsList = _self._interPoints(positions, [entity]);
  8439. console.log(pointsList);
  8440. resolve2(pointsList);
  8441. });
  8442. },
  8443. removeProfileAnalysis() {
  8444. let _self = this;
  8445. if (_self._profileEntities && _self._profileEntities.length > 0) {
  8446. _self._profileEntities.forEach((element) => {
  8447. _self._viewer.entities.remove(element);
  8448. });
  8449. }
  8450. _self._profileEntities = [];
  8451. }
  8452. });
  8453. class CutFill {
  8454. constructor(viewer2) {
  8455. if (!viewer2)
  8456. throw new Cesium.DeveloperError("no viewer object!");
  8457. this._viewer = viewer2;
  8458. this.delEntitys = [];
  8459. this.maxHeigh = -1e6;
  8460. }
  8461. _VolumeAnalysis(options2) {
  8462. let _self = this;
  8463. let cutArea = 0, cutVolume = 0, fillArea = 0, fillVolume = 0;
  8464. const indices = options2.geom.indices;
  8465. const positions = options2.geom.attributes.position.values;
  8466. for (let index2 = 0; index2 < indices.length; index2 += 3) {
  8467. const pos0 = _self._returnPosition(positions, indices[index2]);
  8468. const pos1 = _self._returnPosition(positions, indices[index2 + 1]);
  8469. const pos2 = _self._returnPosition(positions, indices[index2 + 2]);
  8470. let _entities = _self._viewer.entities.add({
  8471. name: "\u4E09\u89D2\u9762",
  8472. polygon: {
  8473. hierarchy: [pos0.heightPos, pos1.heightPos, pos2.heightPos],
  8474. perPositionHeight: true,
  8475. material: Cesium.Color.fromRandom(),
  8476. extrudedHeight: options2.height,
  8477. outline: true,
  8478. outlineColor: Cesium.Color.BLACK
  8479. }
  8480. });
  8481. _self.delEntitys.push(_entities);
  8482. const area = _self._computeArea4Triangle(
  8483. pos0.noHeightPos,
  8484. pos1.noHeightPos,
  8485. pos2.noHeightPos
  8486. );
  8487. const height2 = (pos0.height + pos1.height + pos2.height) / 3;
  8488. if (height2 < options2.height) {
  8489. fillArea += area;
  8490. const volume = area * (options2.height - height2);
  8491. fillVolume += volume;
  8492. } else {
  8493. cutArea += area;
  8494. const volume = area * (height2 - options2.height);
  8495. cutVolume += volume;
  8496. }
  8497. }
  8498. let allArea = cutArea + fillArea;
  8499. allArea = allArea.toFixed(2);
  8500. cutArea = cutArea.toFixed(2);
  8501. cutVolume = cutVolume.toFixed(2);
  8502. fillArea = fillArea.toFixed(2);
  8503. fillVolume = fillVolume.toFixed(2);
  8504. let result = {
  8505. allArea,
  8506. cutArea,
  8507. cutVolume,
  8508. fillArea,
  8509. fillVolume
  8510. };
  8511. return result;
  8512. }
  8513. _computeArea4Triangle(pos1, pos2, pos3) {
  8514. let a = Cesium.Cartesian3.distance(pos1, pos2);
  8515. let b = Cesium.Cartesian3.distance(pos2, pos3);
  8516. let c = Cesium.Cartesian3.distance(pos3, pos1);
  8517. let S = (a + b + c) / 2;
  8518. return Math.sqrt(S * (S - a) * (S - b) * (S - c));
  8519. }
  8520. _returnPosition(positions, index2) {
  8521. let cartesian = new Cesium.Cartesian3(
  8522. positions[index2 * 3],
  8523. positions[index2 * 3 + 1],
  8524. positions[index2 * 3 + 2]
  8525. );
  8526. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  8527. let height2 = this._viewer.scene.sampleHeightSupported ? this._viewer.scene.sampleHeight(cartographic) : this._viewer.scene.globe.getHeight(cartographic);
  8528. if (height2 > this.maxHeigh) {
  8529. this.maxHeigh = height2;
  8530. }
  8531. return {
  8532. heightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height2),
  8533. noHeightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0),
  8534. height: height2
  8535. };
  8536. }
  8537. }
  8538. Object.assign(CutFill.prototype, {
  8539. createPolygonGeo(points2, options2) {
  8540. return new Promise((resolve2, reject2) => {
  8541. let _self = this;
  8542. options2 = options2 || {};
  8543. options2.precision = Cesium.defaultValue(options2.precision, 256);
  8544. options2.height = Cesium.defaultValue(options2.height, 10);
  8545. _self.remove();
  8546. let positions = [];
  8547. for (let i2 = 0; i2 < points2.length; i2++) {
  8548. if (points2[i2] instanceof Cesium.Cartesian3) {
  8549. positions.push(points2[i2]);
  8550. } else {
  8551. positions.push(Cesium.Cartesian3.fromDegrees(points2[i2][0], points2[i2][1], points2[i2][1] || 0));
  8552. }
  8553. }
  8554. let granularity = Math.PI / Math.pow(2, 11);
  8555. granularity = granularity / options2.precision;
  8556. let polygonGeometry = new Cesium.PolygonGeometry.fromPositions({
  8557. positions,
  8558. vertexFormat: Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,
  8559. granularity
  8560. });
  8561. options2.geom = new Cesium.PolygonGeometry.createGeometry(polygonGeometry);
  8562. let result = _self._VolumeAnalysis(options2);
  8563. _self._viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0.9);
  8564. _self._viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
  8565. _self._viewer.scene.globe.translucency.enabled = true;
  8566. resolve2(result);
  8567. });
  8568. },
  8569. remove() {
  8570. for (var i2 = 0; i2 < this.delEntitys.length; i2++) {
  8571. this._viewer.entities.remove(this.delEntitys[i2]);
  8572. }
  8573. this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
  8574. this._viewer.scene.globe.translucency.enabled = false;
  8575. }
  8576. });
  8577. class HeightLimit {
  8578. constructor(viewer2) {
  8579. if (!viewer2)
  8580. throw new Cesium.DeveloperError("no viewer object!");
  8581. this._viewer = viewer2;
  8582. this.targetY = 0;
  8583. }
  8584. _setPolygon(options2) {
  8585. let _self = this;
  8586. _self.HiePolygon = _self._viewer.entities.add({
  8587. polygon: {
  8588. hierarchy: new Cesium.PolygonHierarchy(_self.data),
  8589. material: _self._handleColor("#FFF8DC", options2.alpha),
  8590. height: new Cesium.CallbackProperty(_self._createPolygonUpdateFunction(), false),
  8591. perPositionHeight: false,
  8592. outline: true,
  8593. outlineColor: _self._handleColor("red", options2.alpha),
  8594. outlineWidth: 1
  8595. }
  8596. });
  8597. }
  8598. _createPolygonUpdateFunction() {
  8599. let _self = this;
  8600. return function() {
  8601. return _self.targetY;
  8602. };
  8603. }
  8604. _handleColor(color2, alpha) {
  8605. return Cesium.Color.fromCssColorString(color2).withAlpha(alpha || 1);
  8606. }
  8607. _getMinHeight(points2) {
  8608. let height2 = 0;
  8609. points2.map((point2) => {
  8610. let _height = point2[2] || 0;
  8611. height2 = _height;
  8612. if (_height < height2) {
  8613. height2 = _height;
  8614. }
  8615. });
  8616. return height2;
  8617. }
  8618. }
  8619. Object.assign(HeightLimit.prototype, {
  8620. addPrimitive(points2, options2) {
  8621. this.removePrimitive();
  8622. options2 = options2 || {};
  8623. options2.height = Cesium.defaultValue(options2.height, 50);
  8624. options2.baseHeight = Cesium.defaultValue(options2.baseHeight, 50);
  8625. options2.color = Cesium.defaultValue(options2.color, "red");
  8626. options2.alpha = Cesium.defaultValue(options2.alpha, 0.6);
  8627. let positions = points2.map((point2) => {
  8628. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8629. });
  8630. let _self = this;
  8631. _self.data = positions;
  8632. _self.baseHeight = options2.baseHeight;
  8633. _self.targetY = options2.baseHeight + options2.height;
  8634. let polygonInstance = new Cesium.GeometryInstance({
  8635. geometry: new Cesium.PolygonGeometry({
  8636. polygonHierarchy: new Cesium.PolygonHierarchy(_self.data),
  8637. height: _self.baseHeight,
  8638. extrudedHeight: _self.baseHeight + 3e3
  8639. }),
  8640. attributes: {
  8641. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  8642. Cesium.Color.fromCssColorString(options2.color).withAlpha(options2.alpha)
  8643. ),
  8644. show: new Cesium.ShowGeometryInstanceAttribute(true)
  8645. }
  8646. });
  8647. _self.limitHeightPrimitive = _self._viewer.scene.primitives.add(
  8648. new Cesium.ClassificationPrimitive({
  8649. geometryInstances: polygonInstance,
  8650. releaseGeometryInstances: false,
  8651. classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
  8652. })
  8653. );
  8654. _self._setPolygon(options2);
  8655. },
  8656. removePrimitive() {
  8657. if (this.HiePolygon) {
  8658. this._viewer.entities.remove(this.HiePolygon);
  8659. }
  8660. if (this.limitHeightPrimitive) {
  8661. this._viewer.scene.primitives.remove(this.limitHeightPrimitive);
  8662. }
  8663. },
  8664. changeHeight(height2) {
  8665. if (!this.limitHeightPrimitive)
  8666. return;
  8667. this.targetY = this.baseHeight + height2;
  8668. let cartographic = Cesium.Cartographic.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);
  8669. let surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight);
  8670. let offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight + height2);
  8671. let translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  8672. this.limitHeightPrimitive._primitive.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  8673. }
  8674. });
  8675. class Cutting {
  8676. constructor(viewer2) {
  8677. if (!viewer2)
  8678. throw new Cesium.DeveloperError("no viewer object!");
  8679. this._viewer = viewer2;
  8680. this._camera = this._viewer.camera;
  8681. this._scene = this._viewer.scene;
  8682. this.targetY = 0;
  8683. this._mouseHandler();
  8684. }
  8685. _mouseHandler() {
  8686. let _self = this;
  8687. let viewer2 = _self._viewer;
  8688. let scene = _self._scene;
  8689. let selectedPlane;
  8690. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8691. downHandler.setInputAction(function(movement) {
  8692. let pickedObject = scene.pick(movement.position);
  8693. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8694. selectedPlane = pickedObject.id.plane;
  8695. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8696. selectedPlane.outlineColor = Cesium.Color.RED;
  8697. scene.screenSpaceCameraController.enableInputs = false;
  8698. }
  8699. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8700. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8701. upHandler.setInputAction(function() {
  8702. if (Cesium.defined(selectedPlane)) {
  8703. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8704. selectedPlane.outlineColor = Cesium.Color.RED;
  8705. selectedPlane = void 0;
  8706. }
  8707. scene.screenSpaceCameraController.enableInputs = true;
  8708. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  8709. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8710. moveHandler.setInputAction(function(movement) {
  8711. if (Cesium.defined(selectedPlane)) {
  8712. let deltaY = movement.startPosition.y - movement.endPosition.y;
  8713. _self.targetY += deltaY;
  8714. }
  8715. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8716. }
  8717. _createPlaneUpdateFunction(plane) {
  8718. let _self = this;
  8719. return function() {
  8720. plane.distance = _self.targetY;
  8721. return plane;
  8722. };
  8723. }
  8724. _createPlane(p1, p2, inverseTransform) {
  8725. let _self = this;
  8726. let p1C3 = _self._getOriginCoordinateSystemPoint(p1, inverseTransform);
  8727. let p2C3 = _self._getOriginCoordinateSystemPoint(p2, inverseTransform);
  8728. let up = new Cesium.Cartesian3(0, 0, 10);
  8729. let right = Cesium.Cartesian3.subtract(p2C3, p1C3, new Cesium.Cartesian3());
  8730. let normal = Cesium.Cartesian3.cross(right, up, new Cesium.Cartesian3());
  8731. normal = Cesium.Cartesian3.normalize(normal, normal);
  8732. let planeTmp = Cesium.Plane.fromPointNormal(p1C3, normal);
  8733. return Cesium.ClippingPlane.fromPlane(planeTmp);
  8734. }
  8735. _getOriginCoordinateSystemPoint(point2, inverseTransform) {
  8736. let val = Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  8737. return Cesium.Matrix4.multiplyByPoint(
  8738. inverseTransform,
  8739. val,
  8740. new Cesium.Cartesian3(0, 0, 0)
  8741. );
  8742. }
  8743. _getInverseTransform(tileSet) {
  8744. let transform3;
  8745. const tmp = tileSet.root.transform;
  8746. if (tmp && tmp.equals(Cesium.Matrix4.IDENTITY) || !tmp) {
  8747. transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(tileSet.boundingSphere.center);
  8748. } else {
  8749. transform3 = Cesium.Matrix4.fromArray(tileSet.root.transform);
  8750. }
  8751. return Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8752. }
  8753. _isDirRes(polygon2, isClockwise) {
  8754. var lineStringList = [];
  8755. polygon2.forEach((p) => {
  8756. lineStringList.push([p.lng, p.lat]);
  8757. });
  8758. var clockwiseRing = lineString(lineStringList);
  8759. let isR = booleanClockwise(clockwiseRing);
  8760. var points2 = [];
  8761. if (isClockwise) {
  8762. if (!isR) {
  8763. points2 = polygon2;
  8764. } else {
  8765. var count = 0;
  8766. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8767. points2[count] = polygon2[ii];
  8768. count++;
  8769. }
  8770. }
  8771. } else {
  8772. if (isR) {
  8773. points2 = polygon2;
  8774. } else {
  8775. var count = 0;
  8776. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8777. points2[count] = polygon2[ii];
  8778. count++;
  8779. }
  8780. }
  8781. }
  8782. return points2;
  8783. }
  8784. }
  8785. Object.assign(Cutting.prototype, {
  8786. activate(tileset) {
  8787. let _self = this;
  8788. let viewer2 = _self._viewer;
  8789. let inverseTransform = _self._getInverseTransform(tileset);
  8790. const clippingPlanes1 = [];
  8791. clippingPlanes1.push(_self._createPlane([121.55814450142213, 37.39658788787028], [121.65814450142213, 37.49658788787028], inverseTransform));
  8792. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8793. planes: [
  8794. new Cesium.ClippingPlane(
  8795. new Cesium.Cartesian3(0, 1, 0),
  8796. -10
  8797. )
  8798. ],
  8799. edgeWidth: 1
  8800. });
  8801. _self.tileset = tileset;
  8802. tileset.clippingPlanes = clippingPlanes;
  8803. tileset.debugShowBoundingVolume = false;
  8804. return tileset.readyPromise.then(function() {
  8805. let boundingSphere = tileset.boundingSphere;
  8806. let radius = boundingSphere.radius;
  8807. viewer2.zoomTo(
  8808. tileset,
  8809. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 5)
  8810. );
  8811. if (!Cesium.Matrix4.equals(
  8812. tileset.root.transform,
  8813. Cesium.Matrix4.IDENTITY
  8814. )) {
  8815. const transformCenter = Cesium.Matrix4.getTranslation(tileset.root.transform, new Cesium.Cartesian3());
  8816. const transformCartographic = Cesium.Cartographic.fromCartesian(transformCenter);
  8817. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);
  8818. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  8819. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  8820. }
  8821. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8822. const plane = clippingPlanes.get(i2);
  8823. viewer2.entities.add({
  8824. position: boundingSphere.center,
  8825. plane: {
  8826. dimensions: new Cesium.Cartesian2(
  8827. radius / 10,
  8828. radius / 10
  8829. ),
  8830. material: Cesium.Color.WHITE.withAlpha(0.1),
  8831. plane: new Cesium.CallbackProperty(
  8832. _self._createPlaneUpdateFunction(plane),
  8833. false
  8834. ),
  8835. outline: true,
  8836. outlineColor: Cesium.Color.WHITE
  8837. }
  8838. });
  8839. }
  8840. return tileset;
  8841. });
  8842. },
  8843. addTiles(my3dtiles, pointsArray) {
  8844. let _self = this;
  8845. let viewer2 = _self._viewer;
  8846. let tileset = my3dtiles;
  8847. _self.polygon = pointsArray;
  8848. _self.tileset = tileset;
  8849. return tileset.readyPromise.then(function() {
  8850. let inverseTransform = _self._getInverseTransform(tileset);
  8851. _self.polygon = _self._isDirRes(_self.polygon, false);
  8852. const clippingPlanes1 = [];
  8853. for (let i2 = 0; i2 < _self.polygon.length; i2++) {
  8854. if (i2 === _self.polygon.length - 1) {
  8855. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[0], inverseTransform));
  8856. } else {
  8857. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform));
  8858. }
  8859. }
  8860. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8861. planes: clippingPlanes1,
  8862. edgeWidth: 1,
  8863. edgeColor: Cesium.Color.RED,
  8864. unionClippingRegions: false
  8865. });
  8866. _self.clippingPlanes = clippingPlanes;
  8867. tileset.clippingPlanes = clippingPlanes;
  8868. tileset.debugShowBoundingVolume = false;
  8869. let boundingSphere = tileset.boundingSphere;
  8870. let radius = boundingSphere.radius;
  8871. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8872. let plane = clippingPlanes.get(i2);
  8873. viewer2.entities.add({
  8874. position: boundingSphere.center,
  8875. plane: {
  8876. dimensions: new Cesium.Cartesian2(
  8877. radius / 10,
  8878. radius / 10
  8879. ),
  8880. material: Cesium.Color.RED.withAlpha(0.1),
  8881. plane: new Cesium.CallbackProperty(
  8882. _self._createPlaneUpdateFunction(plane),
  8883. false
  8884. ),
  8885. outline: true,
  8886. outlineColor: Cesium.Color.RED
  8887. }
  8888. });
  8889. }
  8890. return tileset;
  8891. });
  8892. },
  8893. addTiles2(my3dtiles, pointsArray) {
  8894. let _self = this;
  8895. _self._viewer;
  8896. let tileset = my3dtiles;
  8897. _self.polygon = pointsArray;
  8898. _self.tileset = tileset;
  8899. Cesium.Matrix4.fromArray(
  8900. [
  8901. 1,
  8902. 5551115123125783e-31,
  8903. 5898416033378595e-24,
  8904. 0,
  8905. -6106226635438361e-31,
  8906. 1,
  8907. -11355608731111744e-24,
  8908. 0,
  8909. -5898416061134171e-24,
  8910. 11355608731111744e-24,
  8911. 0.9999999999999999,
  8912. 0,
  8913. 9.912469893228263,
  8914. -19.08345020748675,
  8915. -14.613607150502503,
  8916. 1
  8917. ]
  8918. );
  8919. let transform3 = Cesium.Matrix4.fromArray(
  8920. [
  8921. -0.8874246461620654,
  8922. -0.46095281470464317,
  8923. 0,
  8924. 0,
  8925. 0.2602796082288922,
  8926. -0.5010893346724129,
  8927. 0.8253266045740758,
  8928. 0,
  8929. -0.3804366214290463,
  8930. 0.7324151700322881,
  8931. 0.5646556435405804,
  8932. 0,
  8933. -2429070591483741e-9,
  8934. 467643767731705e-8,
  8935. 3581165448379543e-9,
  8936. 1
  8937. ]
  8938. );
  8939. let inverseTransform = Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8940. let clippingPlanes1 = [];
  8941. for (let i2 = 0; i2 < _self.polygon.length - 1; i2++) {
  8942. let plane = _self.createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform);
  8943. clippingPlanes1.push(plane);
  8944. }
  8945. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8946. planes: clippingPlanes1,
  8947. edgeWidth: 1,
  8948. edgeColor: Cesium.Color.RED,
  8949. unionClippingRegions: false
  8950. });
  8951. _self.clippingPlanes = clippingPlanes;
  8952. return tileset.readyPromise.then(function() {
  8953. tileset.clippingPlanes = clippingPlanes;
  8954. tileset.debugShowBoundingVolume = false;
  8955. let boundingSphere = tileset.boundingSphere;
  8956. boundingSphere.radius;
  8957. return tileset;
  8958. });
  8959. },
  8960. toggleClipping() {
  8961. let _self = this;
  8962. _self.tileset = null;
  8963. }
  8964. });
  8965. class GeologyClipPlan {
  8966. constructor(viewer2) {
  8967. if (!viewer2)
  8968. throw new Cesium.DeveloperError("no viewer object!");
  8969. this._viewer = viewer2;
  8970. this._camera = this._viewer.camera;
  8971. this._scene = this._viewer.scene;
  8972. this.tileset = void 0;
  8973. this.targetY = 0;
  8974. this.planeEntities = [];
  8975. this._mouseHandler();
  8976. }
  8977. _mouseHandler() {
  8978. let _self = this;
  8979. let viewer2 = _self._viewer;
  8980. let scene = _self._scene;
  8981. let selectedPlane;
  8982. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8983. downHandler.setInputAction(function(movement) {
  8984. let pickedObject = scene.pick(movement.position);
  8985. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8986. selectedPlane = pickedObject.id.plane;
  8987. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8988. selectedPlane.outlineColor = Cesium.Color.RED;
  8989. scene.screenSpaceCameraController.enableInputs = false;
  8990. }
  8991. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8992. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8993. upHandler.setInputAction(function() {
  8994. if (Cesium.defined(selectedPlane)) {
  8995. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8996. selectedPlane.outlineColor = Cesium.Color.RED;
  8997. selectedPlane = void 0;
  8998. }
  8999. scene.screenSpaceCameraController.enableInputs = true;
  9000. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  9001. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  9002. moveHandler.setInputAction(function(movement) {
  9003. if (Cesium.defined(selectedPlane)) {
  9004. let deltaY = movement.startPosition.y - movement.endPosition.y;
  9005. _self.targetY += deltaY;
  9006. }
  9007. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  9008. }
  9009. _createPlaneUpdateFunction(plane) {
  9010. let _self = this;
  9011. return function() {
  9012. plane.distance = _self.targetY;
  9013. return plane;
  9014. };
  9015. }
  9016. }
  9017. Object.assign(GeologyClipPlan.prototype, {
  9018. activate(tileset, options2) {
  9019. let _self = this;
  9020. let viewer2 = _self._viewer;
  9021. let distance2 = 1e5;
  9022. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  9023. planes: [
  9024. new Cesium.ClippingPlane(
  9025. new Cesium.Cartesian3(0, 0, -1),
  9026. distance2
  9027. )
  9028. ],
  9029. edgeWidth: 1
  9030. });
  9031. _self.tileset = tileset;
  9032. tileset.clippingPlanes = clippingPlanes;
  9033. tileset.debugShowBoundingVolume = false;
  9034. return tileset.readyPromise.then(function() {
  9035. let boundingSphere = tileset.boundingSphere;
  9036. let radius = boundingSphere.radius;
  9037. if (!Cesium.Matrix4.equals(
  9038. tileset.root.transform,
  9039. Cesium.Matrix4.IDENTITY
  9040. )) {
  9041. const transformCenter = Cesium.Matrix4.getTranslation(
  9042. tileset.root.transform,
  9043. new Cesium.Cartesian3()
  9044. );
  9045. const transformCartographic = Cesium.Cartographic.fromCartesian(
  9046. transformCenter
  9047. );
  9048. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(
  9049. tileset.boundingSphere.center
  9050. );
  9051. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  9052. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  9053. }
  9054. viewer2.zoomTo(
  9055. tileset,
  9056. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 10)
  9057. );
  9058. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  9059. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  9060. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  9061. cartographic.height;
  9062. var Cartesian33 = Cesium.Cartesian3.fromDegrees(lng, lat, 105);
  9063. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  9064. let plane = clippingPlanes.get(i2);
  9065. let planeEntity = viewer2.entities.add({
  9066. position: Cartesian33,
  9067. plane: {
  9068. dimensions: new Cesium.Cartesian2(
  9069. radius / 10,
  9070. radius / 20
  9071. ),
  9072. material: Cesium.Color.RED.withAlpha(0.1),
  9073. plane: new Cesium.CallbackProperty(
  9074. _self._createPlaneUpdateFunction(plane),
  9075. false
  9076. ),
  9077. outline: true,
  9078. outlineColor: Cesium.Color.RED
  9079. }
  9080. });
  9081. _self.planeEntities.push(planeEntity);
  9082. }
  9083. return tileset;
  9084. });
  9085. },
  9086. toggleClipping() {
  9087. let _self = this;
  9088. for (let i2 = 0; i2 < _self.planeEntities.length; i2++) {
  9089. _self._viewer.entities.remove(_self.planeEntities[i2]);
  9090. }
  9091. _self.planeEntities = [];
  9092. _self.targetY = 0;
  9093. let boundingSphere = _self.tileset.boundingSphere;
  9094. _self._camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(Cesium.Math.toRadians(120), Cesium.Math.toRadians(-10), boundingSphere.radius * 2.5));
  9095. _self._camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  9096. },
  9097. reset() {
  9098. this.planeEntities = [];
  9099. this.targetY = 0;
  9100. }
  9101. });
  9102. let SpatialAnalysis = {
  9103. SightLine,
  9104. ViewShed,
  9105. SunshineShadow,
  9106. Profile,
  9107. CutFill,
  9108. HeightLimit,
  9109. Cutting,
  9110. GeologyClipPlan
  9111. };
  9112. class TerrainExcavation {
  9113. constructor(viewer2) {
  9114. if (!viewer2)
  9115. throw new Error("no viewer object!");
  9116. this.viewer = viewer2;
  9117. }
  9118. prepareWell(activePoints) {
  9119. let pointLength = activePoints.length;
  9120. let heightDiff = this.excavateMinHeight - this.height;
  9121. let no_height_top = [], bottom_pos = [], lerp_pos = [];
  9122. for (let l = 0; l < pointLength; l++) {
  9123. let u = l == pointLength - 1 ? 0 : l + 1;
  9124. let point0 = [
  9125. Cesium.Cartographic.fromCartesian(activePoints[l]).longitude,
  9126. Cesium.Cartographic.fromCartesian(activePoints[l]).latitude
  9127. ];
  9128. let point1 = [
  9129. Cesium.Cartographic.fromCartesian(activePoints[u]).longitude,
  9130. Cesium.Cartographic.fromCartesian(activePoints[u]).latitude
  9131. ];
  9132. if (0 == l) {
  9133. lerp_pos.push(new Cesium.Cartographic(point0[0], point0[1]));
  9134. bottom_pos.push(
  9135. Cesium.Cartesian3.fromRadians(point0[0], point0[1], heightDiff)
  9136. );
  9137. no_height_top.push(
  9138. Cesium.Cartesian3.fromRadians(point0[0], point0[1], 0)
  9139. );
  9140. }
  9141. for (let p = 1; p <= this.splitNum; p++) {
  9142. let m = Cesium.Math.lerp(point0[0], point1[0], p / this.splitNum);
  9143. let g = Cesium.Math.lerp(point0[1], point1[1], p / this.splitNum);
  9144. l == pointLength - 1 && p == this.splitNum || (lerp_pos.push(new Cesium.Cartographic(m, g)), bottom_pos.push(Cesium.Cartesian3.fromRadians(m, g, heightDiff)), no_height_top.push(Cesium.Cartesian3.fromRadians(m, g, 0)));
  9145. }
  9146. }
  9147. this.wellData = {
  9148. lerp_pos,
  9149. bottom_pos,
  9150. no_height_top
  9151. };
  9152. }
  9153. createWell(wallData) {
  9154. let $this = this;
  9155. if (this.viewer.terrainProvider._layers) {
  9156. this.createBottomSurface(wallData.bottom_pos);
  9157. let positions = Cesium.sampleTerrainMostDetailed(
  9158. this.viewer.terrainProvider,
  9159. wallData.lerp_pos
  9160. );
  9161. positions.then(function(pos) {
  9162. let positionList = [];
  9163. for (let index2 = 0; index2 < pos.length; index2++) {
  9164. const element = pos[index2];
  9165. let curPos = Cesium.Cartesian3.fromRadians(
  9166. element.longitude,
  9167. element.latitude,
  9168. element.height
  9169. );
  9170. positionList.push(curPos);
  9171. }
  9172. $this.createWellWall(wallData.bottom_pos, positionList);
  9173. });
  9174. } else {
  9175. this.createBottomSurface(wallData.bottom_pos);
  9176. this.createWellWall(wallData.bottom_pos, wallData.no_height_top);
  9177. }
  9178. }
  9179. ellipsoidToDegree(pos) {
  9180. let cartesian3 = new Cesium.Cartesian3(pos.x, pos.y, pos.z);
  9181. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian3);
  9182. return {
  9183. longitude: Cesium.Math.toDegrees(cartographic.longitude),
  9184. latitude: Cesium.Math.toDegrees(cartographic.latitude),
  9185. altitude: cartographic.height
  9186. };
  9187. }
  9188. createBottomSurface(points2) {
  9189. if (points2.length) {
  9190. let minHeight = this.getMinHeight(points2);
  9191. let positions = [];
  9192. for (let i2 = 0; i2 < points2.length; i2++) {
  9193. let curPoint = this.ellipsoidToDegree(points2[i2]);
  9194. positions.push(curPoint.longitude, curPoint.latitude, minHeight);
  9195. }
  9196. let polygon2 = new Cesium.PolygonGeometry({
  9197. polygonHierarchy: new Cesium.PolygonHierarchy(
  9198. Cesium.Cartesian3.fromDegreesArrayHeights(positions)
  9199. ),
  9200. perPositionHeight: true
  9201. });
  9202. let material = new Cesium.Material({
  9203. fabric: {
  9204. type: "Image",
  9205. uniforms: {
  9206. image: this.bottomImg
  9207. }
  9208. }
  9209. });
  9210. let appearance = new Cesium.MaterialAppearance({
  9211. translucent: false,
  9212. flat: true,
  9213. material
  9214. });
  9215. this.bottomSurface = new Cesium.Primitive({
  9216. geometryInstances: new Cesium.GeometryInstance({
  9217. geometry: Cesium.PolygonGeometry.createGeometry(polygon2)
  9218. }),
  9219. appearance,
  9220. asynchronous: false
  9221. });
  9222. this.viewer.scene.primitives.add(this.bottomSurface);
  9223. }
  9224. }
  9225. createWellWall(bottomPos, positionList) {
  9226. let minHeight = this.getMinHeight(bottomPos);
  9227. let maxHeights = [], minHeights = [];
  9228. for (let i2 = 0; i2 < positionList.length; i2++) {
  9229. maxHeights.push(this.ellipsoidToDegree(positionList[i2]).altitude);
  9230. minHeights.push(minHeight);
  9231. }
  9232. let wall = new Cesium.WallGeometry({
  9233. positions: positionList,
  9234. maximumHeights: maxHeights,
  9235. minimumHeights: minHeights
  9236. });
  9237. let geometry2 = Cesium.WallGeometry.createGeometry(wall);
  9238. let material = new Cesium.Material({
  9239. fabric: {
  9240. type: "Image",
  9241. uniforms: {
  9242. image: this.wallImg
  9243. }
  9244. }
  9245. });
  9246. let appearance = new Cesium.MaterialAppearance({
  9247. translucent: false,
  9248. flat: true,
  9249. material
  9250. });
  9251. this.wellWall = new Cesium.Primitive({
  9252. geometryInstances: new Cesium.GeometryInstance({
  9253. geometry: geometry2,
  9254. attributes: {
  9255. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9256. Cesium.Color.GREY
  9257. )
  9258. },
  9259. id: "PitWall"
  9260. }),
  9261. appearance,
  9262. asynchronous: false
  9263. });
  9264. this.viewer.scene.primitives.add(this.wellWall);
  9265. }
  9266. getMinHeight(points2) {
  9267. let minHeight = 5e6;
  9268. let minPoint = null;
  9269. for (let i2 = 0; i2 < points2.length; i2++) {
  9270. let height2 = points2[i2]["z"];
  9271. if (height2 < minHeight) {
  9272. minHeight = height2;
  9273. minPoint = this.ellipsoidToDegree(points2[i2]);
  9274. }
  9275. }
  9276. return minPoint.altitude;
  9277. }
  9278. switchExcavate(show) {
  9279. if (show) {
  9280. this.viewer.scene.globe.material = null;
  9281. this.wellWall.show = true;
  9282. this.bottomSurface.show = true;
  9283. } else {
  9284. this.viewer.scene.globe.material = null;
  9285. this.wellWall.show = false;
  9286. this.bottomSurface.show = false;
  9287. }
  9288. }
  9289. updateExcavateDepth(height2) {
  9290. this.viewer.scene.primitives.remove(this.bottomSurface);
  9291. this.viewer.scene.primitives.remove(this.wellWall);
  9292. console.log(this.wellData, this.excavateMinHeight);
  9293. let lerp_pos = this.wellData.lerp_pos;
  9294. let posList = [];
  9295. for (let n = 0; n < lerp_pos.length; n++) {
  9296. posList.push(
  9297. Cesium.Cartesian3.fromRadians(
  9298. lerp_pos[n].longitude,
  9299. lerp_pos[n].latitude,
  9300. this.excavateMinHeight - height2
  9301. )
  9302. );
  9303. }
  9304. this.wellData.bottom_pos = posList;
  9305. this.createWell(this.wellData);
  9306. }
  9307. }
  9308. Object.defineProperties(TerrainExcavation.prototype, {
  9309. show: {
  9310. get: function() {
  9311. return this._show;
  9312. },
  9313. set: function(e) {
  9314. this._show = e;
  9315. this.switchExcavate(e);
  9316. }
  9317. },
  9318. height: {
  9319. get: function() {
  9320. return this._height;
  9321. },
  9322. set: function(e) {
  9323. this._height = e;
  9324. this.updateExcavateDepth(e);
  9325. }
  9326. }
  9327. });
  9328. Object.assign(TerrainExcavation.prototype, {
  9329. add(activePoints, options2) {
  9330. options2 = options2 || {};
  9331. this._height = options2.excavateDepth || 10;
  9332. this.bottomImg = options2.bottomImg || "jt3dSDK/imgs/polygon/ground.png";
  9333. this.wallImg = options2.wallImg || "jt3dSDK/imgs/polygon/ground.png";
  9334. this.splitNum = Cesium.defaultValue(options2.splitNum, 50);
  9335. activePoints = activePoints.map((point2) => {
  9336. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9337. });
  9338. let viewer2 = this.viewer;
  9339. this.clear();
  9340. let clippingPlanesList = [];
  9341. let car3Difference = Cesium.Cartesian3.subtract(
  9342. activePoints[0],
  9343. activePoints[1],
  9344. new Cesium.Cartesian3()
  9345. );
  9346. let boolDiff = car3Difference.x > 0;
  9347. this.excavateMinHeight = 999999999;
  9348. for (let index2 = 0; index2 < activePoints.length; ++index2) {
  9349. let s = (index2 + 1) % activePoints.length;
  9350. let curMidPoint = Cesium.Cartesian3.midpoint(
  9351. activePoints[index2],
  9352. activePoints[s],
  9353. new Cesium.Cartesian3()
  9354. );
  9355. let cartographic = Cesium.Cartographic.fromCartesian(activePoints[index2]);
  9356. let curHeight = viewer2.scene.globe.getHeight(cartographic) || cartographic.height;
  9357. console.log(curHeight);
  9358. if (curHeight < this.excavateMinHeight) {
  9359. this.excavateMinHeight = curHeight;
  9360. }
  9361. let curMidPointNormal = Cesium.Cartesian3.normalize(
  9362. curMidPoint,
  9363. new Cesium.Cartesian3()
  9364. );
  9365. let curMidPointDifference = boolDiff ? Cesium.Cartesian3.subtract(
  9366. activePoints[index2],
  9367. curMidPoint,
  9368. new Cesium.Cartesian3()
  9369. ) : Cesium.Cartesian3.subtract(
  9370. activePoints[s],
  9371. curMidPoint,
  9372. new Cesium.Cartesian3()
  9373. );
  9374. curMidPointDifference = Cesium.Cartesian3.normalize(
  9375. curMidPointDifference,
  9376. curMidPointDifference
  9377. );
  9378. let curMidPointCross = Cesium.Cartesian3.cross(
  9379. curMidPointDifference,
  9380. curMidPointNormal,
  9381. new Cesium.Cartesian3()
  9382. );
  9383. curMidPointCross = Cesium.Cartesian3.normalize(
  9384. curMidPointCross,
  9385. curMidPointCross
  9386. );
  9387. let plane = new Cesium.Plane(curMidPointCross, 0);
  9388. let distance2 = Cesium.Plane.getPointDistance(plane, curMidPoint);
  9389. clippingPlanesList.push(
  9390. new Cesium.ClippingPlane(curMidPointCross, distance2)
  9391. );
  9392. }
  9393. this.viewer.scene.globe.clippingPlanes = new Cesium.ClippingPlaneCollection({
  9394. planes: clippingPlanesList,
  9395. edgeWidth: 1,
  9396. edgeColor: Cesium.Color.WHITE,
  9397. enabled: true
  9398. });
  9399. this.prepareWell(activePoints);
  9400. this.createWell(this.wellData);
  9401. },
  9402. clear() {
  9403. if (this.viewer.scene.globe.clippingPlanes) {
  9404. this.viewer.scene.globe.clippingPlanes.removeAll();
  9405. this.viewer.scene.primitives.remove(this.bottomSurface);
  9406. this.viewer.scene.primitives.remove(this.wellWall);
  9407. this.viewer.scene.render();
  9408. }
  9409. }
  9410. });
  9411. class SlopeAspect {
  9412. constructor(viewer2) {
  9413. if (!viewer2)
  9414. throw new Cesium.DeveloperError("no viewer object!");
  9415. this._viewer = viewer2;
  9416. this.result = [];
  9417. this.handler = void 0;
  9418. this.toolTip = "";
  9419. }
  9420. _openTip() {
  9421. let _self = this;
  9422. this.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  9423. this.handler.setInputAction(function(movement) {
  9424. let endPos = movement.endPosition;
  9425. var pick = _self._viewer.scene.pick(endPos);
  9426. if (pick && pick.id && pick.id.type === "SlopeAspect") {
  9427. _self.toolTip = pick.id.value.toFixed(2);
  9428. CreateRemindertip(_self.toolTip, endPos, true);
  9429. } else {
  9430. _self.toolTip = "";
  9431. CreateRemindertip(_self.toolTip, endPos, false);
  9432. }
  9433. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  9434. }
  9435. _createEllipse(gridSquare) {
  9436. let _self = this;
  9437. let boxResults = [];
  9438. for (let index2 = 0; index2 < gridSquare.features.length; index2++) {
  9439. const feature2 = gridSquare.features[index2];
  9440. const coordinates = feature2.geometry.coordinates[0];
  9441. const centerdegree = [
  9442. (coordinates[0][0] + coordinates[2][0]) / 2,
  9443. (coordinates[0][1] + coordinates[2][1]) / 2
  9444. ];
  9445. let centerCartographic = Cesium.Cartographic.fromDegrees(
  9446. centerdegree[0],
  9447. centerdegree[1]
  9448. );
  9449. boxResults.push(centerCartographic);
  9450. for (let i2 = 0; i2 < coordinates.length; i2++) {
  9451. const coord = coordinates[i2];
  9452. let cartographic = Cesium.Cartographic.fromDegrees(coord[0], coord[1]);
  9453. boxResults.push(cartographic);
  9454. const coord1 = coordinates[i2 + 1];
  9455. if (coord1) {
  9456. let newCoord = [(coord[0] + coord1[0]) / 2, (coord[1] + coord1[1]) / 2];
  9457. let newCartographic = Cesium.Cartographic.fromDegrees(newCoord[0], newCoord[1]);
  9458. boxResults.push(newCartographic);
  9459. }
  9460. }
  9461. }
  9462. Cesium.sampleTerrainMostDetailed(
  9463. _self._viewer.scene.terrainProvider,
  9464. boxResults
  9465. ).then((updatePositions) => {
  9466. let arrr = [];
  9467. let ellipseResults = updatePositions.reduce(function(pre, item, index2, updatePositions2) {
  9468. var begin = index2 * 10;
  9469. var end = begin + 10;
  9470. var res = updatePositions2.slice(begin, end);
  9471. if (res.length != 0) {
  9472. arrr[index2] = res;
  9473. }
  9474. return arrr;
  9475. }, []);
  9476. _self._calculateSlope(ellipseResults);
  9477. _self._openTip();
  9478. });
  9479. }
  9480. _createPolygonInsrance(points2, color2) {
  9481. let positions = [];
  9482. for (let index2 = 1; index2 < points2.length - 1; index2++) {
  9483. const element = points2[index2];
  9484. positions.push(Cesium.Cartographic.toCartesian(element));
  9485. }
  9486. let polygon2 = new Cesium.PolygonGeometry({
  9487. polygonHierarchy: new Cesium.PolygonHierarchy(positions)
  9488. });
  9489. let polygonInstance = new Cesium.GeometryInstance({
  9490. geometry: polygon2,
  9491. attributes: {
  9492. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9493. Cesium.Color.fromCssColorString(color2)
  9494. ),
  9495. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9496. }
  9497. });
  9498. return polygonInstance;
  9499. }
  9500. _createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope) {
  9501. let cartographic_0 = new Cesium.Cartographic(
  9502. (targetPoint.longitude + center2.longitude) / 2,
  9503. (targetPoint.latitude + center2.latitude) / 2,
  9504. (targetPoint.height + center2.height) / 2
  9505. );
  9506. let cartographic_1 = new Cesium.Cartographic(
  9507. (diagonalPoint.longitude + center2.longitude) / 2,
  9508. (diagonalPoint.latitude + center2.latitude) / 2,
  9509. (diagonalPoint.height + center2.height) / 2
  9510. );
  9511. let positions1 = heightDifference > 0 ? [
  9512. Cesium.Cartographic.toCartesian(cartographic_0),
  9513. Cesium.Cartographic.toCartesian(cartographic_1)
  9514. ] : [
  9515. Cesium.Cartographic.toCartesian(cartographic_1),
  9516. Cesium.Cartographic.toCartesian(cartographic_0)
  9517. ];
  9518. const instance = new Cesium.GeometryInstance({
  9519. id: {
  9520. type: "SlopeAspect",
  9521. value: curSlope
  9522. },
  9523. geometry: new Cesium.GroundPolylineGeometry({
  9524. positions: positions1,
  9525. width: this.arrowWidth
  9526. }),
  9527. attributes: {
  9528. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9529. Cesium.Color.BLUE.withAlpha(0.6)
  9530. ),
  9531. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9532. }
  9533. });
  9534. return instance;
  9535. }
  9536. _calculateSlope(ellipseResults) {
  9537. let _self = this;
  9538. let instances = [];
  9539. let polygonInstance = [];
  9540. for (let index2 = 0; index2 < ellipseResults.length; index2++) {
  9541. const ellipse = ellipseResults[index2];
  9542. const center2 = ellipse[0];
  9543. let heightDifference = 0;
  9544. let maxIndex = 0;
  9545. for (let i2 = 1; i2 < ellipse.length - 1; i2++) {
  9546. const point2 = ellipse[i2];
  9547. let curHD = point2.height - center2.height;
  9548. if (Math.abs(curHD) > heightDifference) {
  9549. heightDifference = curHD;
  9550. maxIndex = i2;
  9551. }
  9552. }
  9553. let pos0 = new Cesium.Cartographic(center2.longitude, center2.latitude, 0);
  9554. let pos1 = new Cesium.Cartographic(
  9555. ellipse[maxIndex].longitude,
  9556. ellipse[maxIndex].latitude,
  9557. 0
  9558. );
  9559. let distance2 = Cesium.Cartesian3.distance(
  9560. Cesium.Cartographic.toCartesian(pos0),
  9561. Cesium.Cartographic.toCartesian(pos1)
  9562. );
  9563. let curSlope = Math.abs(heightDifference / distance2);
  9564. let curColor = _self._calculateSlopeColor(curSlope, 0.4);
  9565. const curPolygonInstance = _self._createPolygonInsrance(ellipse, curColor);
  9566. polygonInstance.push(curPolygonInstance);
  9567. let diagonalPoint = maxIndex > 4 ? ellipse[maxIndex - 4] : ellipse[maxIndex + 4];
  9568. let targetPoint = ellipse[maxIndex];
  9569. const arrowInstance = _self._createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope);
  9570. instances.push(arrowInstance);
  9571. }
  9572. const mapPrimitive = _self._viewer.scene.primitives.add(
  9573. new Cesium.GroundPrimitive({
  9574. geometryInstances: polygonInstance,
  9575. appearance: new Cesium.PerInstanceColorAppearance({
  9576. translucent: true,
  9577. closed: false
  9578. })
  9579. })
  9580. );
  9581. const arrowPrimitive = _self._viewer.scene.primitives.add(
  9582. new Cesium.GroundPolylinePrimitive({
  9583. geometryInstances: instances,
  9584. appearance: new Cesium.PolylineMaterialAppearance({
  9585. material: new Cesium.Material({
  9586. fabric: {
  9587. type: "PolylineArrow",
  9588. uniforms: {
  9589. color: new Cesium.Color(1, 1, 0, 0.8)
  9590. }
  9591. }
  9592. })
  9593. })
  9594. })
  9595. );
  9596. _self.result.push(arrowPrimitive, mapPrimitive);
  9597. }
  9598. _calculateSlopeColor(value, alpha) {
  9599. if (value < 0.00872686779075879) {
  9600. return "rgba(85,182,43," + alpha + ")";
  9601. } else if (value < 0.03492076949174773) {
  9602. return "rgba(135,211,43," + alpha + ")";
  9603. } else if (value < 0.08748866352592401) {
  9604. return "rgba(204,244,44," + alpha + ")";
  9605. } else if (value < 0.2679491924311227) {
  9606. return "rgba(245,233,44," + alpha + ")";
  9607. } else if (value < 0.7002075382097097) {
  9608. return "rgba(255,138,43," + alpha + ")";
  9609. } else if (value < 1.4281480067421144) {
  9610. return "rgba(255,84,43," + alpha + ")";
  9611. } else {
  9612. return "rgba(255,32,43," + alpha + ")";
  9613. }
  9614. }
  9615. }
  9616. Object.assign(SlopeAspect.prototype, {
  9617. createNew4Distance(points2, polygon$1, options2) {
  9618. let _self = this;
  9619. options2 = options2 || {};
  9620. options2.distance = options2.distance || 0.1;
  9621. let width2 = options2.distance * 200 > 35 ? 35 : options2.distance * 200;
  9622. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9623. let positions = points2.map((point2) => {
  9624. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9625. });
  9626. _self.clearAll();
  9627. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9628. let boundary = [];
  9629. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9630. for (let index2 = 0; index2 < degrees.length; index2++) {
  9631. const element = degrees[index2];
  9632. const x = element.lng;
  9633. const y = element.lat;
  9634. boundary.push([x, y]);
  9635. minX = x < minX ? x : minX;
  9636. minY = y < minY ? y : minY;
  9637. maxX = x > maxX ? x : maxX;
  9638. maxY = y > maxY ? y : maxY;
  9639. }
  9640. boundary.push(boundary[0]);
  9641. let bbox2 = [minX, minY, maxX, maxY];
  9642. polygon([boundary]);
  9643. let gridSquare = squareGrid(bbox2, options2.distance, {});
  9644. _self._createEllipse(gridSquare);
  9645. },
  9646. createNew4Num(points2, polygon$1, options2) {
  9647. let _self = this;
  9648. options2 = options2 || {};
  9649. options2.num = Cesium.defaultValue(options2.num, 10);
  9650. let positions = points2.map((point2) => {
  9651. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9652. });
  9653. _self.clearAll();
  9654. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9655. let boundary = [];
  9656. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9657. for (let index2 = 0; index2 < degrees.length; index2++) {
  9658. const element = degrees[index2];
  9659. const x = element.lng;
  9660. const y = element.lat;
  9661. boundary.push([x, y]);
  9662. minX = x < minX ? x : minX;
  9663. minY = y < minY ? y : minY;
  9664. maxX = x > maxX ? x : maxX;
  9665. maxY = y > maxY ? y : maxY;
  9666. }
  9667. boundary.push(boundary[0]);
  9668. let bbox2 = [minX, minY, maxX, maxY];
  9669. let a = maxX - minX;
  9670. let b = maxY - minY;
  9671. b = b > a ? b : a;
  9672. const step = b / options2.num;
  9673. let width2 = step * 2e3 > 35 ? 35 : step * 2e3;
  9674. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9675. polygon([boundary]);
  9676. let gridSquare = squareGrid(bbox2, step, {
  9677. units: "degrees"
  9678. });
  9679. _self._createEllipse(gridSquare);
  9680. },
  9681. clearAll() {
  9682. this.result.forEach((element) => {
  9683. this._viewer.scene.primitives.remove(element);
  9684. });
  9685. this.result = [];
  9686. if (this.handler) {
  9687. this.handler.destroy();
  9688. this.handler = void 0;
  9689. }
  9690. }
  9691. });
  9692. let TerrainAnalysis = {
  9693. TerrainExcavation,
  9694. SlopeAspect
  9695. };
  9696. class Weather {
  9697. constructor(viewer2) {
  9698. if (!viewer2)
  9699. throw new Cesium.DeveloperError("no viewer object!");
  9700. this._viewer = viewer2;
  9701. }
  9702. _initRain() {
  9703. this.rainStage = new Cesium.PostProcessStage({
  9704. name: "jt_rain",
  9705. fragmentShader: this._rain(),
  9706. uniforms: {
  9707. tiltAngle: () => {
  9708. return this.tiltAngle;
  9709. },
  9710. rainSize: () => {
  9711. return this.rainSize;
  9712. },
  9713. rainSpeed: () => {
  9714. return this.rainSpeed;
  9715. }
  9716. }
  9717. });
  9718. this._viewer.scene.postProcessStages.add(this.rainStage);
  9719. }
  9720. _initSnow() {
  9721. this.snowStage = new Cesium.PostProcessStage({
  9722. name: "jt_snow",
  9723. fragmentShader: this._snow(),
  9724. uniforms: {
  9725. snowSize: () => {
  9726. return this.snowSize;
  9727. },
  9728. snowSpeed: () => {
  9729. return this.snowSpeed;
  9730. }
  9731. }
  9732. });
  9733. this._viewer.scene.postProcessStages.add(this.snowStage);
  9734. }
  9735. _initFog() {
  9736. this.fogStage = new Cesium.PostProcessStage({
  9737. name: "jt_fog",
  9738. fragmentShader: this._fog(),
  9739. uniforms: {
  9740. visibility: () => {
  9741. return this.visibility;
  9742. },
  9743. fogColor: () => {
  9744. return this.color;
  9745. }
  9746. }
  9747. });
  9748. this._viewer.scene.postProcessStages.add(this.fogStage);
  9749. }
  9750. _rain() {
  9751. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainSpeed;\n float hash(float x) {\n return fract(sin(x * 133.3) * 13.13);\n }\n void main(void) {\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n vec3 c = vec3(.6, .7, .8);\n float a = tiltAngle;\n float si = sin(a), co = cos(a);\n uv *= mat2(co, -si, si, co);\n uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\n float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\n float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\n c *= v * b;\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\n }\n ";
  9752. }
  9753. _snow() {
  9754. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSpeed;\n uniform float snowSize;\n float snow(vec2 uv,float scale)\n {\n float time=czm_frameNumber/snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution=czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c=0.;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor=mix(texture2D(colorTexture,v_textureCoordinates),vec4(finalColor,1),.5);\n }\n ";
  9755. }
  9756. _fog() {
  9757. return "uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates; \n void main(void) \n { \n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates); \n float depth = czm_readDepth(depthTexture, v_textureCoordinates); \n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates); \n float f = visibility * (depthcolor.r - 0.3) / 0.2; \n if (f < 0.0) f = 0.0; \n else if (f > 1.0) f = 1.0; \n gl_FragColor = mix(origcolor, fogColor, f); \n }\n";
  9758. }
  9759. _removeSnow() {
  9760. if (!this._viewer || !this.snowStage)
  9761. return;
  9762. this._viewer.scene.postProcessStages.remove(this.snowStage);
  9763. delete this.snowSize;
  9764. delete this.snowSpeed;
  9765. }
  9766. _removeRain() {
  9767. if (!this._viewer || !this.rainStage)
  9768. return;
  9769. this._viewer.scene.postProcessStages.remove(this.rainStage);
  9770. delete this.tiltAngle;
  9771. delete this.rainSize;
  9772. delete this.rainSpeed;
  9773. }
  9774. _removeFog() {
  9775. if (!this._viewer || !this.fogStage)
  9776. return;
  9777. this._viewer.scene.postProcessStages.remove(this.fogStage);
  9778. delete this.visibility;
  9779. delete this.color;
  9780. }
  9781. }
  9782. Object.assign(Weather.prototype, {
  9783. addRainEffect(options2) {
  9784. options2 = options2 || {};
  9785. this.tiltAngle = Cesium.defaultValue(options2.tiltAngle, -0.6);
  9786. this.rainSize = Cesium.defaultValue(options2.rainSize, 0.3);
  9787. this.rainSpeed = Cesium.defaultValue(options2.rainSpeed, 60);
  9788. this._initRain();
  9789. },
  9790. addSnowEffect(options2) {
  9791. options2 = options2 || {};
  9792. this.snowSize = Cesium.defaultValue(options2.snowSize, 0.02);
  9793. this.snowSpeed = Cesium.defaultValue(options2.snowSpeed, 60);
  9794. this._initSnow();
  9795. },
  9796. addFogEffect(options2) {
  9797. options2 = options2 || {};
  9798. this.visibility = Cesium.defaultValue(options2.visibility, 0.1);
  9799. this.color = Cesium.defaultValue(options2.color, new Cesium.Color(0.8, 0.8, 0.8, 0.5));
  9800. this._show = Cesium.defaultValue(options2.show, true);
  9801. this._initFog();
  9802. },
  9803. removeEffect() {
  9804. if (this.snowStage) {
  9805. this._removeSnow();
  9806. }
  9807. if (this.rainStage) {
  9808. this._removeRain();
  9809. }
  9810. if (this.fogStage) {
  9811. this._removeFog();
  9812. }
  9813. }
  9814. });
  9815. const BoxGeometry = Cesium.BoxGeometry;
  9816. const Cartesian3 = Cesium.Cartesian3;
  9817. const defaultValue = Cesium.defaultValue;
  9818. const defined = Cesium.defined;
  9819. const destroyObject = Cesium.destroyObject;
  9820. const DeveloperError$1 = Cesium.DeveloperError;
  9821. const GeometryPipeline = Cesium.GeometryPipeline;
  9822. const Matrix3 = Cesium.Matrix3;
  9823. const Matrix4 = Cesium.Matrix4;
  9824. const Transforms = Cesium.Transforms;
  9825. const VertexFormat = Cesium.VertexFormat;
  9826. const BufferUsage = Cesium.BufferUsage;
  9827. const CubeMap = Cesium.CubeMap;
  9828. const DrawCommand = Cesium.DrawCommand;
  9829. const loadCubeMap = Cesium.loadCubeMap;
  9830. const RenderState = Cesium.RenderState;
  9831. const VertexArray = Cesium.VertexArray;
  9832. const BlendingState = Cesium.BlendingState;
  9833. const SceneMode = Cesium.SceneMode;
  9834. const ShaderProgram = Cesium.ShaderProgram;
  9835. const ShaderSource = Cesium.ShaderSource;
  9836. const SkyBoxFS = "uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n ";
  9837. const SkyBoxVS = "attribute vec3 position;\n varying vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ";
  9838. if (!Cesium.defined(Cesium.Matrix4.getRotation)) {
  9839. Cesium.Matrix4.getRotation = Cesium.Matrix4.getMatrix3;
  9840. }
  9841. class SkyBoxOnGround {
  9842. constructor(options2) {
  9843. this.sources = options2.sources;
  9844. this._sources = void 0;
  9845. this.show = defaultValue(options2.show, true);
  9846. this._command = new DrawCommand({
  9847. modelMatrix: Matrix4.clone(Matrix4.IDENTITY),
  9848. owner: this
  9849. });
  9850. this._cubeMap = void 0;
  9851. this._attributeLocations = void 0;
  9852. this._useHdr = void 0;
  9853. }
  9854. }
  9855. const skyboxMatrix3 = new Matrix3();
  9856. SkyBoxOnGround.prototype.update = function(frameState, useHdr) {
  9857. const that = this;
  9858. if (!this.show) {
  9859. return void 0;
  9860. }
  9861. if (frameState.mode !== SceneMode.SCENE3D && frameState.mode !== SceneMode.MORPHING) {
  9862. return void 0;
  9863. }
  9864. if (!frameState.passes.render) {
  9865. return void 0;
  9866. }
  9867. const context = frameState.context;
  9868. if (this._sources !== this.sources) {
  9869. this._sources = this.sources;
  9870. const sources = this.sources;
  9871. if (!defined(sources.positiveX) || !defined(sources.negativeX) || !defined(sources.positiveY) || !defined(sources.negativeY) || !defined(sources.positiveZ) || !defined(sources.negativeZ)) {
  9872. throw new DeveloperError$1(
  9873. "this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  9874. );
  9875. }
  9876. if (typeof sources.positiveX !== typeof sources.negativeX || typeof sources.positiveX !== typeof sources.positiveY || typeof sources.positiveX !== typeof sources.negativeY || typeof sources.positiveX !== typeof sources.positiveZ || typeof sources.positiveX !== typeof sources.negativeZ) {
  9877. throw new DeveloperError$1(
  9878. "this.sources properties must all be the same type."
  9879. );
  9880. }
  9881. if (typeof sources.positiveX === "string") {
  9882. loadCubeMap(context, this._sources).then(function(cubeMap) {
  9883. that._cubeMap = that._cubeMap && that._cubeMap.destroy();
  9884. that._cubeMap = cubeMap;
  9885. });
  9886. } else {
  9887. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9888. this._cubeMap = new CubeMap({
  9889. context,
  9890. source: sources
  9891. });
  9892. }
  9893. }
  9894. const command = this._command;
  9895. command.modelMatrix = Transforms.eastNorthUpToFixedFrame(
  9896. frameState.camera._positionWC
  9897. );
  9898. if (!defined(command.vertexArray)) {
  9899. command.uniformMap = {
  9900. u_cubeMap: function() {
  9901. return that._cubeMap;
  9902. },
  9903. u_rotateMatrix: function() {
  9904. return Matrix4.getRotation(command.modelMatrix, skyboxMatrix3);
  9905. }
  9906. };
  9907. const geometry2 = BoxGeometry.createGeometry(
  9908. BoxGeometry.fromDimensions({
  9909. dimensions: new Cartesian3(2, 2, 2),
  9910. vertexFormat: VertexFormat.POSITION_ONLY
  9911. })
  9912. );
  9913. const attributeLocations = this._attributeLocations = GeometryPipeline.createAttributeLocations(
  9914. geometry2
  9915. );
  9916. command.vertexArray = VertexArray.fromGeometry({
  9917. context,
  9918. geometry: geometry2,
  9919. attributeLocations,
  9920. bufferUsage: BufferUsage._DRAW
  9921. });
  9922. command.renderState = RenderState.fromCache({
  9923. blending: BlendingState.ALPHA_BLEND
  9924. });
  9925. }
  9926. if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {
  9927. const fs = new ShaderSource({
  9928. defines: [useHdr ? "HDR" : ""],
  9929. sources: [SkyBoxFS]
  9930. });
  9931. command.shaderProgram = ShaderProgram.fromCache({
  9932. context,
  9933. vertexShaderSource: SkyBoxVS,
  9934. fragmentShaderSource: fs,
  9935. attributeLocations: this._attributeLocations
  9936. });
  9937. this._useHdr = useHdr;
  9938. }
  9939. if (!defined(this._cubeMap)) {
  9940. return void 0;
  9941. }
  9942. return command;
  9943. };
  9944. SkyBoxOnGround.prototype.isDestroyed = function() {
  9945. return false;
  9946. };
  9947. SkyBoxOnGround.prototype.destroy = function() {
  9948. const command = this._command;
  9949. command.vertexArray = command.vertexArray && command.vertexArray.destroy();
  9950. command.shaderProgram = command.shaderProgram && command.shaderProgram.destroy();
  9951. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9952. return destroyObject(this);
  9953. };
  9954. class SkyBox {
  9955. constructor(viewer2) {
  9956. if (!viewer2)
  9957. throw new Cesium.DeveloperError("no viewer object!");
  9958. this._viewer = viewer2;
  9959. this._farSkyBox = viewer2.scene.skyBox;
  9960. }
  9961. }
  9962. Object.assign(SkyBox.prototype, {
  9963. setGroundSkyBox(options2) {
  9964. options2 = options2 || {};
  9965. options2.height = options2.height || 2e5;
  9966. options2.type = options2.type || "\u84DD\u5929";
  9967. if (!options2.sources) {
  9968. switch (options2.type) {
  9969. case "\u665A\u971E":
  9970. options2.sources = {
  9971. positiveX: "jt3dSDK/imgs/skybox/01/px.png",
  9972. negativeX: "jt3dSDK/imgs/skybox/01/nx.png",
  9973. positiveY: "jt3dSDK/imgs/skybox/01/py.png",
  9974. negativeY: "jt3dSDK/imgs/skybox/01/ny.png",
  9975. positiveZ: "jt3dSDK/imgs/skybox/01/pz.png",
  9976. negativeZ: "jt3dSDK/imgs/skybox/01/nz.png"
  9977. };
  9978. break;
  9979. case "\u9634\u5929":
  9980. options2.sources = {
  9981. positiveX: "jt3dSDK/imgs/skybox/02/px.jpg",
  9982. negativeX: "jt3dSDK/imgs/skybox/02/nx.jpg",
  9983. positiveY: "jt3dSDK/imgs/skybox/02/py.jpg",
  9984. negativeY: "jt3dSDK/imgs/skybox/02/ny.jpg",
  9985. positiveZ: "jt3dSDK/imgs/skybox/02/pz.jpg",
  9986. negativeZ: "jt3dSDK/imgs/skybox/02/nz.jpg"
  9987. };
  9988. break;
  9989. case "\u84DD\u5929":
  9990. options2.sources = {
  9991. positiveX: "jt3dSDK/imgs/skybox/03/px.jpg",
  9992. negativeX: "jt3dSDK/imgs/skybox/03/nx.jpg",
  9993. positiveY: "jt3dSDK/imgs/skybox/03/py.jpg",
  9994. negativeY: "jt3dSDK/imgs/skybox/03/ny.jpg",
  9995. positiveZ: "jt3dSDK/imgs/skybox/03/pz.jpg",
  9996. negativeZ: "jt3dSDK/imgs/skybox/03/nz.jpg"
  9997. };
  9998. break;
  9999. case "\u7D2B\u8272\u661F\u7A7A":
  10000. options2.sources = {
  10001. positiveX: "jt3dSDK/imgs/skybox/04/px.jpg",
  10002. negativeX: "jt3dSDK/imgs/skybox/04/nx.jpg",
  10003. positiveY: "jt3dSDK/imgs/skybox/04/py.jpg",
  10004. negativeY: "jt3dSDK/imgs/skybox/04/ny.jpg",
  10005. positiveZ: "jt3dSDK/imgs/skybox/04/pz.jpg",
  10006. negativeZ: "jt3dSDK/imgs/skybox/04/nz.jpg"
  10007. };
  10008. break;
  10009. case "\u84DD\u8272\u661F\u7A7A":
  10010. options2.sources = {
  10011. positiveX: "jt3dSDK/imgs/skybox/05/px.jpg",
  10012. negativeX: "jt3dSDK/imgs/skybox/05/nx.jpg",
  10013. positiveY: "jt3dSDK/imgs/skybox/05/py.jpg",
  10014. negativeY: "jt3dSDK/imgs/skybox/05/ny.jpg",
  10015. positiveZ: "jt3dSDK/imgs/skybox/05/pz.jpg",
  10016. negativeZ: "jt3dSDK/imgs/skybox/05/nz.jpg"
  10017. };
  10018. break;
  10019. }
  10020. } else if (!Cesium.defined(options2.sources.positiveX) || !Cesium.defined(options2.sources.negativeX) || !Cesium.defined(options2.sources.positiveY) || !Cesium.defined(options2.sources.negativeY) || !Cesium.defined(options2.sources.positiveZ) || !Cesium.defined(options2.sources.negativeZ)) {
  10021. throw new Cesium.DeveloperError(
  10022. "options.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  10023. );
  10024. }
  10025. let _self = this;
  10026. let groundSkyBox = new SkyBoxOnGround({
  10027. sources: options2.sources,
  10028. show: true
  10029. });
  10030. _self._viewer.scene.postRender.addEventListener(() => {
  10031. var e = _self._viewer.camera.position;
  10032. if (Cesium.Cartographic.fromCartesian(e).height < options2.height) {
  10033. _self._viewer.scene.skyBox = groundSkyBox;
  10034. } else {
  10035. _self._viewer.scene.skyBox = _self._defaultSkyBox;
  10036. }
  10037. });
  10038. }
  10039. });
  10040. class ParticleSystem {
  10041. constructor(viewer2) {
  10042. if (!viewer2)
  10043. throw new DeveloperError("no viewer object!");
  10044. this.viewer = viewer2;
  10045. }
  10046. }
  10047. Object.assign(ParticleSystem.prototype, {
  10048. createParticleFire: function(coordinates) {
  10049. this.viewer.clock.shouldAnimate = true;
  10050. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  10051. var entity = this.viewer.entities.add({
  10052. position: position2
  10053. });
  10054. function computeModelMatrix(entity2, time) {
  10055. var position3 = Cesium.Property.getValueOrUndefined(entity2.position);
  10056. var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position3);
  10057. return modelMatrix;
  10058. }
  10059. var viewModel = {
  10060. startScale: 3,
  10061. endScale: 1.5,
  10062. minimumParticleLife: 1.5,
  10063. maximumParticleLife: 1.8,
  10064. minimumSpeed: 7,
  10065. maximumSpeed: 9,
  10066. particleSize: 2,
  10067. emissionRate: 200
  10068. };
  10069. var primitive = this.viewer.scene.primitives.add(
  10070. new Cesium.ParticleSystem({
  10071. image: "jt3dSDK/imgs/particlesystem/fire.png",
  10072. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10073. startColor: new Cesium.Color(1, 1, 1, 1),
  10074. endColor: new Cesium.Color(0.5, 0, 0, 0),
  10075. startScale: viewModel.startScale,
  10076. endScale: viewModel.endScale,
  10077. minimumParticleLife: viewModel.minimumParticleLife,
  10078. maximumParticleLife: viewModel.maximumParticleLife,
  10079. minimumSpeed: viewModel.minimumSpeed,
  10080. maximumSpeed: viewModel.maximumSpeed,
  10081. emissionRate: viewModel.emissionRate,
  10082. lifetime: 16,
  10083. loop: true,
  10084. sizeInMeters: true,
  10085. emitter: new Cesium.ConeEmitter(Cesium.Math.toRadians(45)),
  10086. modelMatrix: computeModelMatrix(entity, Cesium.JulianDate.now())
  10087. })
  10088. );
  10089. entity.remove = function() {
  10090. viewer.entities.remove(entity);
  10091. viewer.scene.primitives.remove(primitive);
  10092. };
  10093. return entity;
  10094. },
  10095. createParticleWater: function(coordinates) {
  10096. let viewer2 = this.viewer;
  10097. this.viewer.clock.shouldAnimate = true;
  10098. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  10099. var entity = this.viewer.entities.add({
  10100. position: position2
  10101. });
  10102. function computeModelMatrix(entity2, time) {
  10103. return entity2.computeModelMatrix(time, new Cesium.Matrix4());
  10104. }
  10105. function computeEmitterModelMatrix() {
  10106. let hpr = Cesium.HeadingPitchRoll.fromDegrees(viewModel.heading, viewModel.pitch, viewModel.roll);
  10107. let trs = new Cesium.TranslationRotationScale();
  10108. trs.translation = Cesium.Cartesian3.fromElements(0, 0, 1);
  10109. trs.rotation = Cesium.Quaternion.fromHeadingPitchRoll(hpr);
  10110. let Matrix42 = Cesium.Matrix4.fromTranslationRotationScale(trs);
  10111. return Matrix42;
  10112. }
  10113. function updateCallback(p, dt2) {
  10114. var gravityScratch = new Cesium.Cartesian3();
  10115. var position3 = p.position;
  10116. Cesium.Cartesian3.normalize(position3, gravityScratch);
  10117. Cesium.Cartesian3.multiplyByScalar(gravityScratch, viewModel.gravity * dt2, gravityScratch);
  10118. p.velocity = Cesium.Cartesian3.add(p.velocity, gravityScratch, p.velocity);
  10119. }
  10120. function update(scene, time) {
  10121. waterParticleSystem.modelMatrix = computeModelMatrix(entity, time);
  10122. waterParticleSystem.emitterModelMatrix = computeEmitterModelMatrix();
  10123. }
  10124. viewer2.scene.preUpdate.addEventListener(update);
  10125. var viewModel = {
  10126. startScale: 1,
  10127. endScale: 7,
  10128. minimumParticleLife: 6,
  10129. maximumParticleLife: 7,
  10130. minimumSpeed: 9,
  10131. maximumSpeed: 9.5,
  10132. particleSize: 1,
  10133. emissionRate: 60,
  10134. gravity: -4,
  10135. heading: 110,
  10136. pitch: 30,
  10137. roll: 0
  10138. };
  10139. var waterParticleSystem = new Cesium.ParticleSystem({
  10140. image: "jt3dSDK/imgs/particlesystem/water.png",
  10141. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10142. startColor: new Cesium.Color(1, 1, 1, 0.6),
  10143. endColor: new Cesium.Color(0.8, 0.86, 1, 0.4),
  10144. startScale: viewModel.startScale,
  10145. endScale: viewModel.endScale,
  10146. minimumParticleLife: viewModel.minimumParticleLife,
  10147. maximumParticleLife: viewModel.maximumParticleLife,
  10148. minimumSpeed: viewModel.minimumSpeed,
  10149. maximumSpeed: viewModel.maximumSpeed,
  10150. emissionRate: viewModel.emissionRate,
  10151. sizeInMeters: true,
  10152. emitter: new Cesium.CircleEmitter(0.2),
  10153. modelMatrix: computeModelMatrix(entity),
  10154. emitterModelMatrix: computeEmitterModelMatrix(),
  10155. updateCallback
  10156. });
  10157. viewer2.scene.primitives.add(waterParticleSystem);
  10158. entity.remove = function() {
  10159. viewer2.entities.remove(entity);
  10160. viewer2.scene.primitives.remove(waterParticleSystem);
  10161. };
  10162. return entity;
  10163. }
  10164. });
  10165. let SceneEffects = {
  10166. Weather,
  10167. SkyBox,
  10168. ParticleSystem
  10169. };
  10170. class ImageLayerSplit {
  10171. constructor(viewer2) {
  10172. if (!viewer2)
  10173. throw new Cesium.DeveloperError("no viewer object!");
  10174. this._viewer = viewer2;
  10175. }
  10176. }
  10177. Object.assign(ImageLayerSplit.prototype, {
  10178. initSplit() {
  10179. let _self = this;
  10180. this.viewer = this._viewer;
  10181. let sliderDiv = document.getElementById("image_slider");
  10182. if (sliderDiv == null) {
  10183. sliderDiv = document.createElement("div");
  10184. sliderDiv.id = "image_slider";
  10185. sliderDiv.style.position = "absolute";
  10186. sliderDiv.style.left = "50%";
  10187. sliderDiv.style.top = "0px";
  10188. sliderDiv.style.backgroundColor = "#d3d3d3";
  10189. sliderDiv.style.width = "5px";
  10190. sliderDiv.style.height = "100%";
  10191. sliderDiv.style.zIndex = "9999";
  10192. sliderDiv.onmouseover = function() {
  10193. this.style.cursor = "ew-resize";
  10194. };
  10195. document.body.appendChild(sliderDiv);
  10196. }
  10197. this.slider = sliderDiv;
  10198. viewer.scene.splitPosition = this.slider.offsetLeft / this.slider.parentElement.offsetWidth;
  10199. if (this.handler) {
  10200. this.handler.destroy();
  10201. this.handler = null;
  10202. }
  10203. this.handler = new Cesium.ScreenSpaceEventHandler(this.slider);
  10204. var moveActive = false;
  10205. function move(movement) {
  10206. if (!moveActive) {
  10207. return;
  10208. }
  10209. var relativeOffset = movement.endPosition.x;
  10210. var splitPosition = (_self.slider.offsetLeft + relativeOffset) / _self.slider.parentElement.offsetWidth;
  10211. _self.slider.style.left = `${100 * splitPosition}%`;
  10212. viewer.scene.splitPosition = splitPosition;
  10213. }
  10214. this.handler.setInputAction(function() {
  10215. moveActive = true;
  10216. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  10217. this.handler.setInputAction(function() {
  10218. moveActive = true;
  10219. }, Cesium.ScreenSpaceEventType.PINCH_START);
  10220. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10221. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);
  10222. this.handler.setInputAction(function() {
  10223. moveActive = false;
  10224. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  10225. this.handler.setInputAction(function() {
  10226. moveActive = false;
  10227. }, Cesium.ScreenSpaceEventType.PINCH_END);
  10228. },
  10229. addSplitLayer(earthAtLeft, earthAtRight) {
  10230. if (this.earthAtLeft) {
  10231. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10232. }
  10233. if (this.earthAtRight) {
  10234. this._viewer.imageryLayers.remove(this.earthAtRight);
  10235. }
  10236. this.earthAtLeft = earthAtLeft;
  10237. this.earthAtRight = earthAtRight;
  10238. this.earthAtLeft.splitDirection = Cesium.SplitDirection.LEFT;
  10239. this.earthAtRight.splitDirection = Cesium.SplitDirection.RIGHT;
  10240. },
  10241. removeSplitLayer() {
  10242. document.body.removeChild(this.slider);
  10243. if (this.earthAtLeft) {
  10244. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10245. }
  10246. if (this.earthAtRight) {
  10247. this._viewer.imageryLayers.remove(this.earthAtRight);
  10248. }
  10249. }
  10250. });
  10251. class ViewerSplitScreen {
  10252. constructor() {
  10253. }
  10254. }
  10255. Object.assign(ViewerSplitScreen.prototype, {
  10256. initHandler(viewer1, viewer2) {
  10257. var _self = this;
  10258. if (_self.handler1 && _self.handler1.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)) {
  10259. return;
  10260. }
  10261. _self.handler1 = new Cesium.ScreenSpaceEventHandler(viewer1.scene.canvas);
  10262. _self.handler2 = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  10263. _self.handler1.setInputAction(function(movement) {
  10264. var _camerca = viewer1.camera;
  10265. viewer2.camera.setView({
  10266. destination: _camerca.position,
  10267. orientation: {
  10268. direction: _camerca._direction,
  10269. up: _camerca.up,
  10270. heading: _camerca.heading,
  10271. pitch: _camerca.pitch,
  10272. roll: _camerca.roll
  10273. }
  10274. });
  10275. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10276. _self.handler1.setInputAction(function(movement) {
  10277. var _camerca = viewer1.camera;
  10278. viewer2.camera.setView({
  10279. destination: _camerca.position,
  10280. orientation: {
  10281. direction: _camerca._direction,
  10282. up: _camerca.up,
  10283. heading: _camerca.heading,
  10284. pitch: _camerca.pitch,
  10285. roll: _camerca.roll
  10286. }
  10287. });
  10288. }, Cesium.ScreenSpaceEventType.WHEEL);
  10289. _self.handler2.setInputAction(function(movement) {
  10290. var _camerca = viewer2.camera;
  10291. viewer1.camera.setView({
  10292. destination: _camerca.position,
  10293. orientation: {
  10294. direction: _camerca._direction,
  10295. up: _camerca.up,
  10296. heading: _camerca.heading,
  10297. pitch: _camerca.pitch,
  10298. roll: _camerca.roll
  10299. }
  10300. });
  10301. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10302. _self.handler2.setInputAction(function(movement) {
  10303. var _camerca = viewer2.camera;
  10304. viewer1.camera.setView({
  10305. destination: _camerca.position,
  10306. orientation: {
  10307. direction: _camerca._direction,
  10308. up: _camerca.up,
  10309. heading: _camerca.heading,
  10310. pitch: _camerca.pitch,
  10311. roll: _camerca.roll
  10312. }
  10313. });
  10314. }, Cesium.ScreenSpaceEventType.WHEEL);
  10315. },
  10316. clearHandler() {
  10317. var _self = this;
  10318. if (_self.handler1) {
  10319. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10320. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10321. }
  10322. if (_self.handler2) {
  10323. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10324. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10325. }
  10326. }
  10327. });
  10328. let SceneControl = {
  10329. ImageLayerSplit,
  10330. ViewerSplitScreen
  10331. };
  10332. class TrackRoam {
  10333. constructor(viewer2) {
  10334. if (!viewer2)
  10335. throw new Cesium.DeveloperError("no viewer object!");
  10336. this._viewer = viewer2;
  10337. this._draw3DObj = null;
  10338. }
  10339. _startFly(pathsData, options2) {
  10340. var _self = this;
  10341. options2 = options2 || {};
  10342. options2.time = Cesium.defaultValue(options2.time, 360);
  10343. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10344. options2.height = Cesium.defaultValue(options2.height, 5);
  10345. options2.role = Cesium.defaultValue(options2.role, 1);
  10346. this.url = options2.modelUrl;
  10347. this.time = options2.time;
  10348. this.isPathShow = options2.isPathShow;
  10349. this.height = options2.height;
  10350. this.role = options2.role;
  10351. _self.clearFlyPaths();
  10352. _self._viewer.camera.setView({
  10353. destination: pathsData.position,
  10354. orientation: pathsData.orientation
  10355. });
  10356. setTimeout(function() {
  10357. executeFly3D();
  10358. }, 200);
  10359. function executeFly3D() {
  10360. if (pathsData && pathsData.geometry) {
  10361. var positionA = pathsData.geometry.coordinates;
  10362. let positions = positionA.map((point2) => {
  10363. return Cesium.Cartesian3.fromDegrees(point2.lng, point2.lat, point2.height);
  10364. });
  10365. let distance2 = [];
  10366. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10367. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10368. distance2.push(dis);
  10369. }
  10370. let times = [Cesium.JulianDate.fromDate(new Date())];
  10371. times.push(Cesium.JulianDate.addSeconds(times[0], _self.time, new Cesium.JulianDate()));
  10372. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10373. let s = Cesium.JulianDate.addSeconds(times[i2], _self.time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10374. times.push(s);
  10375. }
  10376. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10377. oriSamples.addSamples(times, positions);
  10378. let startTime = times[0];
  10379. let stopTime = times[times.length - 1];
  10380. _self._viewer.clock.startTime = startTime.clone();
  10381. _self._viewer.clock.stopTime = stopTime.clone();
  10382. _self._viewer.clock.currentTime = startTime.clone();
  10383. _self._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10384. _self._viewer.clock.multiplier = 10;
  10385. let timeOfResolution = 6;
  10386. let samplesNum = Math.floor(
  10387. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10388. );
  10389. let sampledPositions = [];
  10390. let sampledTimes = [];
  10391. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10392. let sampleTime = Cesium.JulianDate.addSeconds(
  10393. startTime,
  10394. i2 * timeOfResolution,
  10395. new Cesium.JulianDate()
  10396. );
  10397. let tmpPos = oriSamples.getValue(sampleTime);
  10398. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10399. sampledTimes.push(sampleTime);
  10400. }
  10401. Cesium.sampleTerrainMostDetailed(
  10402. _self._viewer.terrainProvider,
  10403. sampledPositions
  10404. ).then(() => {
  10405. let carPositionProperty = new Cesium.SampledPositionProperty();
  10406. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10407. sampledPositions[i2].height = sampledPositions[i2].height + _self.height;
  10408. }
  10409. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10410. carPositionProperty.addSample(
  10411. sampledTimes[i2],
  10412. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10413. );
  10414. }
  10415. var position2 = carPositionProperty;
  10416. _self.entityFly = _self._viewer.entities.add({
  10417. availability: new Cesium.TimeIntervalCollection([
  10418. new Cesium.TimeInterval({
  10419. start: startTime,
  10420. stop: stopTime
  10421. })
  10422. ]),
  10423. position: position2,
  10424. orientation: new Cesium.VelocityOrientationProperty(position2),
  10425. point: {
  10426. color: Cesium.Color.RED,
  10427. outlineColor: Cesium.Color.WHITE,
  10428. outlineWidth: 2,
  10429. pixelSize: 10
  10430. },
  10431. path: {
  10432. show: _self.isPathShow,
  10433. resolution: 1,
  10434. material: new Cesium.PolylineGlowMaterialProperty({
  10435. glowPower: 0.1,
  10436. color: Cesium.Color.YELLOW
  10437. }),
  10438. width: 10
  10439. }
  10440. });
  10441. if (_self.role == 0)
  10442. ;
  10443. else if (_self.role == 1) {
  10444. _self._viewer.trackedEntity = _self.entityFly;
  10445. } else if (_self.role == 2) {
  10446. _self._viewer.trackedEntity = _self.entityFly;
  10447. let exection = function TimeExecution() {
  10448. if (_self._viewer.clock.shouldAnimate === true) {
  10449. let center2 = _self.entity.position.getValue(
  10450. _self._viewer.clock.currentTime
  10451. );
  10452. let orientation = _self.entity.orientation.getValue(
  10453. _self._viewer.clock.currentTime
  10454. );
  10455. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10456. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10457. _self._viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(-50, 0, 250));
  10458. }
  10459. };
  10460. _self._viewer.clock.onTick.addEventListener(exection);
  10461. } else if (_self.role == 3) {
  10462. _self._viewer.trackedEntity = _self.entityFly;
  10463. let exection = function TimeExecution() {
  10464. if (_self._viewer.clock.shouldAnimate === true) {
  10465. let center2 = _self.entity.position.getValue(
  10466. _self._viewer.clock.currentTime
  10467. );
  10468. _self._viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10469. }
  10470. };
  10471. _self._viewer.clock.onTick.addEventListener(exection);
  10472. }
  10473. });
  10474. } else {
  10475. return;
  10476. }
  10477. }
  10478. }
  10479. }
  10480. Object.assign(TrackRoam.prototype, {
  10481. drawFlyPaths(coordinates, options2) {
  10482. return new Promise((resolve2, reject2) => {
  10483. let _self = this;
  10484. _self.clearFlyPaths();
  10485. let position2 = _self._viewer.camera.position;
  10486. let heading = _self._viewer.camera.heading;
  10487. let pitch = _self._viewer.camera.pitch;
  10488. let roll = _self._viewer.camera.roll;
  10489. var pathsData = {
  10490. "orientation": {
  10491. "heading": heading,
  10492. "pitch": pitch,
  10493. "roll": roll
  10494. },
  10495. "position": position2,
  10496. "clampToGround": true,
  10497. "geometry": {
  10498. "type": "LineString",
  10499. "coordinates": coordinates
  10500. }
  10501. };
  10502. _self._draw3DObj = pathsData;
  10503. resolve2(true);
  10504. });
  10505. },
  10506. clearFlyPaths() {
  10507. this._draw3DObj = null;
  10508. this._viewer.trackedEntity = void 0;
  10509. this._viewer.entities.remove(this.entityFly);
  10510. },
  10511. startFly(options2, callError) {
  10512. if (this._draw3DObj) {
  10513. this._startFly(this._draw3DObj, options2);
  10514. } else {
  10515. if (callError)
  10516. callError("\u6F2B\u6E38\u8DEF\u7EBF\u4E0D\u5B58\u5728");
  10517. }
  10518. },
  10519. pauseFly() {
  10520. var clockViewModel = this._viewer.clockViewModel;
  10521. if (clockViewModel.shouldAnimate) {
  10522. clockViewModel.shouldAnimate = false;
  10523. } else if (this._viewer.clockViewModel.canAnimate) {
  10524. clockViewModel.shouldAnimate = true;
  10525. }
  10526. },
  10527. forwardFly() {
  10528. var clockViewModel = this._viewer.clockViewModel;
  10529. var multiplier = clockViewModel.multiplier;
  10530. if (multiplier < 0) {
  10531. clockViewModel.multiplier = -multiplier;
  10532. }
  10533. clockViewModel.shouldAnimate = true;
  10534. },
  10535. backwardsFly() {
  10536. var clockViewModel = this._viewer.clockViewModel;
  10537. var multiplier = clockViewModel.multiplier;
  10538. if (multiplier > 0) {
  10539. clockViewModel.multiplier = -multiplier;
  10540. }
  10541. clockViewModel.shouldAnimate = true;
  10542. },
  10543. outFly() {
  10544. var start2 = Cesium.JulianDate.fromDate(new Date());
  10545. this._viewer.clock.startTime = start2.clone();
  10546. var stop = Cesium.JulianDate.addSeconds(start2, 3e8, new Cesium.JulianDate());
  10547. this._viewer.clock.stopTime = stop.clone();
  10548. this.clearFlyPaths();
  10549. }
  10550. });
  10551. class Roaming {
  10552. constructor(viewer2, positions, options2) {
  10553. if (!viewer2)
  10554. throw new Cesium.DeveloperError("no viewer object!");
  10555. if (!positions)
  10556. throw new Cesium.DeveloperError("no positions Array!");
  10557. this.viewer = viewer2;
  10558. this.entity = void 0;
  10559. options2 = options2 || {};
  10560. options2.time = Cesium.defaultValue(options2.time, 360);
  10561. options2.speed = Cesium.defaultValue(options2.speed, 10);
  10562. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10563. options2.height = Cesium.defaultValue(options2.height, 5);
  10564. options2.role = Cesium.defaultValue(options2.role, 1);
  10565. options2.followedX = Cesium.defaultValue(options2.followedX, 50);
  10566. options2.followedZ = Cesium.defaultValue(options2.followedZ, 10);
  10567. this.time = options2.time;
  10568. this.speed = options2.speed;
  10569. this.isPathShow = options2.isPathShow;
  10570. this.height = options2.height;
  10571. this.role = options2.role;
  10572. this.followedX = options2.followedX;
  10573. this.followedZ = options2.followedZ;
  10574. this.model = options2.model;
  10575. this.billboard = options2.billboard;
  10576. this.point = options2.point;
  10577. this.label = options2.label;
  10578. this.property = this.ComputeRoamingLineProperty(positions, this.time);
  10579. }
  10580. ComputeRoamingLineProperty(Lines, time) {
  10581. let positions = [];
  10582. if (Lines[0] instanceof Cesium.Cartesian3) {
  10583. positions = Lines;
  10584. } else {
  10585. positions = Lines.map((point2) => {
  10586. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10587. });
  10588. }
  10589. let distance2 = [];
  10590. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10591. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10592. distance2.push(dis);
  10593. }
  10594. let times = [Cesium.JulianDate.fromDate(new Date())];
  10595. times.push(Cesium.JulianDate.addSeconds(times[0], time, new Cesium.JulianDate()));
  10596. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10597. let s = Cesium.JulianDate.addSeconds(times[i2], time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10598. times.push(s);
  10599. }
  10600. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10601. oriSamples.addSamples(times, positions);
  10602. let startTime = times[0];
  10603. let stopTime = times[times.length - 1];
  10604. this.viewer.clock.startTime = startTime.clone();
  10605. this.viewer.clock.stopTime = stopTime.clone();
  10606. this.viewer.clock.currentTime = startTime.clone();
  10607. this.viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10608. this.viewer.clock.multiplier = this.speed;
  10609. let timeOfResolution = 6;
  10610. let samplesNum = Math.floor(
  10611. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10612. );
  10613. let sampledPositions = [];
  10614. let sampledTimes = [];
  10615. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10616. let sampleTime = Cesium.JulianDate.addSeconds(
  10617. startTime,
  10618. i2 * timeOfResolution,
  10619. new Cesium.JulianDate()
  10620. );
  10621. let tmpPos = oriSamples.getValue(sampleTime);
  10622. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10623. sampledTimes.push(sampleTime);
  10624. }
  10625. Cesium.sampleTerrainMostDetailed(
  10626. this.viewer.terrainProvider,
  10627. sampledPositions
  10628. ).then((updatedPositions) => {
  10629. let carPositionProperty = new Cesium.SampledPositionProperty();
  10630. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10631. sampledPositions[i2].height = sampledPositions[i2].height + this.height;
  10632. }
  10633. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10634. carPositionProperty.addSample(
  10635. sampledTimes[i2],
  10636. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10637. );
  10638. }
  10639. var position2 = carPositionProperty;
  10640. this.InitRoaming(position2, startTime, stopTime, this.isPathShow);
  10641. });
  10642. }
  10643. InitRoaming(position2, start2, stop, isPathShow) {
  10644. this.entity = this.viewer.entities.add({
  10645. availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
  10646. start: start2,
  10647. stop
  10648. })]),
  10649. position: position2,
  10650. orientation: new Cesium.VelocityOrientationProperty(position2),
  10651. path: {
  10652. resolution: 1,
  10653. material: new Cesium.PolylineGlowMaterialProperty({
  10654. glowPower: 0.1,
  10655. color: Cesium.Color.YELLOW
  10656. }),
  10657. width: 10,
  10658. show: isPathShow
  10659. }
  10660. });
  10661. if (this.model) {
  10662. let model = this.model;
  10663. this.entity.model = {
  10664. uri: model.url,
  10665. minimumPixelSize: 64,
  10666. maximumSize: 128,
  10667. maximumScale: 200,
  10668. show: true,
  10669. silhouetteColor: Cesium.Color.WHITE,
  10670. debugWireframe: false,
  10671. debugShowBoundingVolume: false,
  10672. scale: 20,
  10673. runAnimations: true
  10674. };
  10675. } else if (this.billboard) {
  10676. let billboard = this.billboard;
  10677. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  10678. this.entity.billboard = {
  10679. image: billboard.imgUrl,
  10680. show: true,
  10681. width: 30,
  10682. scale: 1,
  10683. height: 30,
  10684. pixelOffset: new Cesium.Cartesian2(0, -14)
  10685. };
  10686. } else {
  10687. let point2 = {};
  10688. if (this.point) {
  10689. point2 = this.point;
  10690. }
  10691. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  10692. if (point2.color) {
  10693. if (point2.color instanceof Array) {
  10694. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  10695. } else if (typeof point2.color === "string") {
  10696. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  10697. } else {
  10698. point2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  10699. }
  10700. }
  10701. if (point2.outlineColor) {
  10702. if (point2.outlineColor instanceof Array) {
  10703. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  10704. } else if (typeof point2.outlineColor === "string") {
  10705. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  10706. } else {
  10707. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10708. }
  10709. }
  10710. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 2);
  10711. this.entity.point = point2;
  10712. }
  10713. if (this.label) {
  10714. let label2 = this.label;
  10715. label2.text = Cesium.defaultValue(label2.text, "");
  10716. label2.font = Cesium.defaultValue(label2.font, "24px Helvetica");
  10717. if (label2.fillColor) {
  10718. if (label2.fillColor instanceof Array) {
  10719. label2.fillColor = new Cesium.Color(label2.fillColor[0] / 255, label2.fillColor[1] / 255, label2.fillColor[2] / 255, label2.fillColor[3]);
  10720. } else if (typeof label2.fillColor === "string") {
  10721. label2.fillColor = new Cesium.Color.fromCssColorString(label2.fillColor);
  10722. } else {
  10723. label2.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10724. }
  10725. }
  10726. if (label2.outlineColor) {
  10727. if (label2.outlineColor instanceof Array) {
  10728. label2.outlineColor = new Cesium.Color(label2.outlineColor[0] / 255, label2.outlineColor[1] / 255, label2.outlineColor[2] / 255, label2.outlineColor[3]);
  10729. } else if (typeof label2.outlineColor === "string") {
  10730. label2.outlineColor = new Cesium.Color.fromCssColorString(label2.outlineColor);
  10731. } else {
  10732. label2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10733. }
  10734. }
  10735. label2.outlineWidth = Cesium.defaultValue(label2.outlineWidth, 1);
  10736. label2.showBackground = Cesium.defaultValue(label2.showBackground, false);
  10737. if (label2.backgroundColor) {
  10738. if (label2.backgroundColor instanceof Array) {
  10739. label2.backgroundColor = new Cesium.Color(label2.backgroundColor[0] / 255, label2.backgroundColor[1] / 255, label2.backgroundColor[2] / 255, label2.backgroundColor[3]);
  10740. } else if (typeof label2.backgroundColor === "string") {
  10741. label2.backgroundColor = new Cesium.Color.fromCssColorString(label2.backgroundColor);
  10742. } else {
  10743. label2.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10744. }
  10745. }
  10746. label2.pixelOffset = Cesium.defaultValue(label2.pixelOffset, 0);
  10747. label2.scale = Cesium.defaultValue(label2.scale, 1);
  10748. label2.near = Cesium.defaultValue(label2.near, 150);
  10749. label2.nearValue = Cesium.defaultValue(label2.nearValue, 1);
  10750. label2.far = Cesium.defaultValue(label2.far, 2400);
  10751. label2.farValue = Cesium.defaultValue(label2.farValue, 0);
  10752. this.entity.label = {
  10753. text: label2.text,
  10754. font: label2.font,
  10755. fillColor: label2.fillColor,
  10756. outlineColor: label2.outlineColor,
  10757. outlineWidth: label2.outlineWidth,
  10758. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  10759. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  10760. showBackground: label2.showBackground,
  10761. backgroundColor: label2.backgroundColor,
  10762. backgroundPadding: new Cesium.Cartesian2(6, 6),
  10763. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  10764. pixelOffset: new Cesium.Cartesian2(0, label2.pixelOffset),
  10765. scale: label2.scale
  10766. };
  10767. }
  10768. this.entity.position.setInterpolationOptions({
  10769. interpolationDegree: 5,
  10770. interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
  10771. });
  10772. this.initRole(this.role);
  10773. }
  10774. initRole(role) {
  10775. let _self = this;
  10776. if (role == 0) {
  10777. this.viewer.trackedEntity = void 0;
  10778. let len = _self.viewer.clock.onTick.numberOfListeners;
  10779. for (let i2 = 0; i2 < len; i2++) {
  10780. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10781. }
  10782. } else if (role == 1) {
  10783. this.viewer.trackedEntity = this.entity;
  10784. let len = _self.viewer.clock.onTick.numberOfListeners;
  10785. for (let i2 = 0; i2 < len; i2++) {
  10786. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10787. }
  10788. } else if (role == 2) {
  10789. this.viewer.trackedEntity = this.entity;
  10790. let exection = function TimeExecution() {
  10791. if (_self.viewer.clock.shouldAnimate === true) {
  10792. let center2 = _self.entity.position.getValue(
  10793. _self.viewer.clock.currentTime
  10794. );
  10795. let orientation = _self.entity.orientation.getValue(
  10796. _self.viewer.clock.currentTime
  10797. );
  10798. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10799. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10800. var transformX = _self.followedX || 50;
  10801. var transformZ = _self.followedZ || 10;
  10802. _self.viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(transformX, 0, transformZ));
  10803. }
  10804. };
  10805. this.viewer.clock.onTick.addEventListener(exection);
  10806. } else if (role == 3) {
  10807. this.viewer.trackedEntity = this.entity;
  10808. let exection = function TimeExecution() {
  10809. if (_self.viewer.clock.shouldAnimate === true) {
  10810. let center2 = _self.entity.position.getValue(
  10811. _self.viewer.clock.currentTime
  10812. );
  10813. _self.viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10814. }
  10815. };
  10816. this.viewer.clock.onTick.addEventListener(exection);
  10817. }
  10818. }
  10819. PauseOrContinue(state) {
  10820. this.viewer.clock.shouldAnimate = state;
  10821. }
  10822. forwardFly() {
  10823. var multiplier = this.viewer.clock.multiplier;
  10824. if (multiplier < 0) {
  10825. this.viewer.clock.multiplier = -multiplier;
  10826. }
  10827. this.viewer.clock.shouldAnimate = true;
  10828. }
  10829. backwardsFly() {
  10830. var multiplier = this.viewer.clock.multiplier;
  10831. if (multiplier > 0) {
  10832. this.viewer.clock.multiplier = -multiplier;
  10833. }
  10834. this.viewer.clock.shouldAnimate = true;
  10835. }
  10836. ChangeRoamingSpeed(value) {
  10837. this.viewer.clock.multiplier = value;
  10838. }
  10839. EndRoaming() {
  10840. if (this.entity !== void 0) {
  10841. this.viewer.entities.remove(this.entity);
  10842. }
  10843. this.viewer.trackedEntity = void 0;
  10844. this.viewer.clock.shouldAnimate = false;
  10845. let len = this.viewer.clock.onTick.numberOfListeners;
  10846. for (let i2 = 0; i2 < len; i2++) {
  10847. this.viewer.clock.onTick.removeEventListener(this.viewer.clock.onTick._listeners[i2]);
  10848. }
  10849. }
  10850. }
  10851. class PolygonObject {
  10852. constructor(viewer2) {
  10853. if (!viewer2)
  10854. throw new Cesium.DeveloperError("no viewer object!");
  10855. this._viewer = viewer2;
  10856. this._drawEntities = [];
  10857. this._polygonEntity = null;
  10858. }
  10859. }
  10860. Object.assign(PolygonObject.prototype, {
  10861. drawPolygonByGeoJson(geoJsonUrl, options2) {
  10862. return new Promise((resolve2, reject2) => {
  10863. let _self = this;
  10864. if (!Cesium.defined(geoJsonUrl)) {
  10865. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  10866. }
  10867. options2 = options2 || {};
  10868. options2.id = options2.id || setSessionid$1();
  10869. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  10870. options2.color = Cesium.defaultValue(options2.color, "#FF0000");
  10871. options2.outlineColor = Cesium.defaultValue(options2.outlineColor, "#FFFF00");
  10872. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10873. options2.extrudedHeight = Cesium.defaultValue(options2.extrudedHeight, 0);
  10874. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  10875. clampToGround: true,
  10876. stroke: Cesium.Color.WHITE,
  10877. strokeWidth: 3,
  10878. fill: Cesium.Color.RED.withAlpha(0.5)
  10879. });
  10880. promise.then((dataSource) => {
  10881. _self._viewer.dataSources.add(dataSource);
  10882. dataSource.name = options2.id;
  10883. let entities2 = dataSource.entities.values;
  10884. for (let index2 = 0; index2 < entities2.length; index2++) {
  10885. let entity = entities2[index2];
  10886. entity.polygon.material = new Cesium.Color.fromCssColorString(color).withAlpha(0.1);
  10887. entity.polygon.extrudedHeight = options2.extrudedHeight;
  10888. entity.polygon.fill = false;
  10889. entity.polygon.outline = false;
  10890. entity.polygon.outlineWidth = options2.outlineWidth;
  10891. entity.polygon.outlineColor = options2.outlineColor;
  10892. entity.polyline = {
  10893. positions: entity.polygon.hierarchy._value.positions,
  10894. width: entity.polygon.outlineWidth,
  10895. material: new Cesium.Color.fromCssColorString(color).withAlpha(0.1)
  10896. };
  10897. if (options2.clampToGround) {
  10898. entity.polyline.clampToGround = true;
  10899. }
  10900. }
  10901. resolve2(entities2);
  10902. });
  10903. });
  10904. },
  10905. generatePolygonByPoints(points2, options2) {
  10906. return new Promise((resolve2, reject2) => {
  10907. let _self = this;
  10908. if (!Cesium.defined(points2)) {
  10909. throw new Cesium.DeveloperError("points is required.");
  10910. }
  10911. if (points2.length < 3) {
  10912. reject2("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  10913. }
  10914. let positions = points2.map((point2) => {
  10915. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10916. });
  10917. options2 = options2 || {};
  10918. options2.id = options2.id || setSessionid$1();
  10919. options2.fill = options2.fill || true;
  10920. if (options2.color) {
  10921. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  10922. } else {
  10923. options2.color = new Cesium.Color.fromCssColorString("#ff0000");
  10924. }
  10925. options2.outline = options2.outline || false;
  10926. if (options2.outlineColor) {
  10927. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  10928. } else {
  10929. options2.outlineColor = new Cesium.Color.fromCssColorString("#000");
  10930. }
  10931. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10932. let entity = new Cesium.Entity({
  10933. id: options2.id,
  10934. name: "Generate surfaces based on coordinate points",
  10935. polygon: {
  10936. hierarchy: positions,
  10937. material: options2.color,
  10938. fill: options2.fill,
  10939. outline: options2.outline,
  10940. outlineWidth: options2.outlineWidth,
  10941. outlineColor: options2.outlineColor
  10942. }
  10943. });
  10944. if (options2.outline) {
  10945. entity.polyline = {
  10946. positions: entity.polygon.hierarchy._value.positions,
  10947. width: options2.outlineWidth,
  10948. material: options2.outlineColor,
  10949. clampToGround: true
  10950. };
  10951. }
  10952. _self._viewer.entities.add(entity);
  10953. resolve2(entity);
  10954. });
  10955. }
  10956. });
  10957. class CircleMaterialProperty$1 {
  10958. constructor(options2) {
  10959. this._viewer = options2.viewer;
  10960. this._definitionChanged = new Cesium.Event();
  10961. this._color = void 0;
  10962. this.color = options2.color || Cesium.Color.BLUE;
  10963. this.count = options2.count || 1;
  10964. this.duration = options2.duration || 1e3;
  10965. this._time = new Date().getTime();
  10966. this._materialTypeName = "jtCircleMaterial";
  10967. this._param = {
  10968. color: this.color._value.toCssColorString(),
  10969. duration: this.duration,
  10970. count: this.count
  10971. };
  10972. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  10973. fabric: {
  10974. type: this._materialTypeName,
  10975. uniforms: {
  10976. time: 0,
  10977. color: new Cesium.Color(1, 0, 0, 0.5),
  10978. count: 1
  10979. },
  10980. source: this._getCircleMaterial()
  10981. },
  10982. translucent: function(material) {
  10983. return true;
  10984. }
  10985. });
  10986. }
  10987. _getCircleMaterial() {
  10988. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  10989. return circleMaterial;
  10990. }
  10991. }
  10992. Object.assign(CircleMaterialProperty$1.prototype, {
  10993. getType: function(time) {
  10994. return this._materialTypeName;
  10995. },
  10996. getValue: function(time, result) {
  10997. if (!Cesium.defined(result)) {
  10998. result = {};
  10999. }
  11000. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  11001. result.count = this.count;
  11002. if (this.duration) {
  11003. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  11004. }
  11005. this._viewer.scene.requestRender();
  11006. return result;
  11007. },
  11008. equals: function(other) {
  11009. return this === other || other instanceof CircleMaterialProperty$1 && Cesium.Property.equals(this._color, other._color);
  11010. }
  11011. });
  11012. Object.defineProperties(CircleMaterialProperty$1.prototype, {
  11013. isConstant: {
  11014. get: function() {
  11015. return false;
  11016. }
  11017. },
  11018. definitionChanged: {
  11019. get: function() {
  11020. return this._definitionChanged;
  11021. }
  11022. },
  11023. color: Cesium.createPropertyDescriptor("color")
  11024. });
  11025. class CircleRippleMaterialProperty {
  11026. constructor(options2) {
  11027. this._definitionChanged = new Cesium.Event();
  11028. this._color = void 0;
  11029. this._speed = void 0;
  11030. this.color = options2.color;
  11031. this.speed = options2.speed;
  11032. this.count = options2.count;
  11033. this.gradient = options2.gradient;
  11034. }
  11035. get isConstant() {
  11036. return false;
  11037. }
  11038. get definitionChanged() {
  11039. return this._definitionChanged;
  11040. }
  11041. getType(time) {
  11042. return Cesium.Material.CircleRippleMaterialType;
  11043. }
  11044. getValue(time, result) {
  11045. if (!Cesium.defined(result)) {
  11046. result = {};
  11047. }
  11048. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  11049. result.speed = Cesium.Property.getValueOrDefault(this._speed, time, 10, result.speed);
  11050. result.count = this.count;
  11051. result.gradient = this.gradient;
  11052. return result;
  11053. }
  11054. equals(other) {
  11055. return this === other || other instanceof CircleRippleMaterialProperty && Cesium.Property.equals(this._color, other._color) && Cesium.Property.equals(this._speed, other._speed) && Cesium.Property.equals(this.count, other.count) && Cesium.Property.equals(this.gradient, other.gradient);
  11056. }
  11057. }
  11058. Object.defineProperties(CircleRippleMaterialProperty.prototype, {
  11059. color: Cesium.createPropertyDescriptor("color"),
  11060. speed: Cesium.createPropertyDescriptor("speed"),
  11061. count: Cesium.createPropertyDescriptor("count"),
  11062. gradient: Cesium.createPropertyDescriptor("gradient")
  11063. });
  11064. Cesium.CircleRippleMaterialProperty = CircleRippleMaterialProperty;
  11065. Cesium.Material.CircleRippleMaterialProperty = "CircleRippleMaterialProperty";
  11066. Cesium.Material.CircleRippleMaterialType = "CircleRippleMaterialType";
  11067. Cesium.Material.CircleRippleMaterialSource = `
  11068. uniform vec4 color;
  11069. uniform float speed;
  11070. uniform float count;
  11071. uniform float gradient;
  11072. czm_material czm_getMaterial(czm_materialInput materialInput)
  11073. {
  11074. czm_material material = czm_getDefaultMaterial(materialInput);
  11075. material.diffuse = 1.5 * color.rgb;
  11076. vec2 st = materialInput.st;
  11077. float dis = distance(st, vec2(0.5, 0.5));
  11078. float per = fract(czm_frameNumber * speed / 1000.0);
  11079. if(count == 1.0){
  11080. if(dis > per * 0.5){
  11081. discard;
  11082. }else {
  11083. material.alpha = color.a * dis / per / 2.0;
  11084. }
  11085. } else {
  11086. vec3 str = materialInput.str;
  11087. if(abs(str.z) > 0.001){
  11088. discard;
  11089. }
  11090. if(dis > 0.5){
  11091. discard;
  11092. } else {
  11093. float perDis = 0.5 / count;
  11094. float disNum;
  11095. float bl = 0.0;
  11096. for(int i = 0; i <= 999; i++){
  11097. if(float(i) <= count){
  11098. disNum = perDis * float(i) - dis + per / count;
  11099. if(disNum > 0.0){
  11100. if(disNum < perDis){
  11101. bl = 1.0 - disNum / perDis;
  11102. }
  11103. else if(disNum - perDis < perDis){
  11104. bl = 1.0 - abs(1.0 - disNum / perDis);
  11105. }
  11106. material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));
  11107. }
  11108. }
  11109. }
  11110. }
  11111. }
  11112. return material;
  11113. }
  11114. `;
  11115. Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleRippleMaterialType, {
  11116. fabric: {
  11117. type: Cesium.Material.CircleRippleMaterialType,
  11118. uniforms: {
  11119. color: new Cesium.Color(1, 0, 0, 1),
  11120. speed: 3,
  11121. count: 4,
  11122. gradient: 0.2
  11123. },
  11124. source: Cesium.Material.CircleRippleMaterialSource
  11125. },
  11126. translucent: function(material) {
  11127. return true;
  11128. }
  11129. });
  11130. class CircleObject {
  11131. constructor(viewer2) {
  11132. if (!viewer2)
  11133. throw new Cesium.DeveloperError("no viewer object!");
  11134. this._viewer = viewer2;
  11135. }
  11136. }
  11137. Object.assign(CircleObject.prototype, {
  11138. drawCircle: function(centerPoint, radius, options2) {
  11139. return new Promise((resolve2, reject2) => {
  11140. this._viewer;
  11141. if (!Cesium.defined(centerPoint)) {
  11142. throw new Cesium.DeveloperError("centerPoint is required.");
  11143. }
  11144. if (!Cesium.defined(radius)) {
  11145. throw new Cesium.DeveloperError("radius is required.");
  11146. }
  11147. let position2;
  11148. if (centerPoint instanceof Cesium.Cartesian3) {
  11149. position2 = centerPoint;
  11150. } else {
  11151. position2 = Cesium.Cartesian3.fromDegrees(centerPoint[0], centerPoint[1], centerPoint[2] || 0);
  11152. }
  11153. if (typeof radius === "number" && radius > 0) {
  11154. radius = radius;
  11155. } else {
  11156. radius = 100;
  11157. }
  11158. options2 = options2 || {};
  11159. options2.id = options2.id || setSessionid$1();
  11160. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  11161. options2.CircleType = Cesium.defaultValue(options2.CircleType, "ColorCircle");
  11162. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  11163. options2.count = Cesium.defaultValue(options2.count, 1);
  11164. if (options2.color) {
  11165. if (options2.color instanceof Array) {
  11166. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  11167. } else if (typeof options2.color === "string") {
  11168. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  11169. } else {
  11170. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  11171. }
  11172. }
  11173. if (options2.outlineColor) {
  11174. if (options2.outlineColor instanceof Array) {
  11175. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  11176. } else if (typeof options2.outlineColor === "string") {
  11177. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  11178. } else {
  11179. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  11180. }
  11181. }
  11182. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 0);
  11183. let polygonMaterial = options2.color;
  11184. options2.outlineColor;
  11185. if (options2.CircleType === "DynamicCircle") {
  11186. polygonMaterial = new Cesium.CircleRippleMaterialProperty({
  11187. color: options2.color,
  11188. speed: options2.duration / 1e3,
  11189. count: options2.count,
  11190. gradient: 0.2
  11191. });
  11192. }
  11193. let entity = new Cesium.Entity({
  11194. id: options2.id,
  11195. position: position2,
  11196. ellipse: {
  11197. semiMinorAxis: radius,
  11198. semiMajorAxis: radius,
  11199. material: polygonMaterial,
  11200. outline: true,
  11201. outlineColor: options2.outlineColor,
  11202. outlineWidth: options2.outlineWidth
  11203. }
  11204. });
  11205. resolve2(entity);
  11206. });
  11207. }
  11208. });
  11209. Cesium.Primitive.prototype.setUseGeometry = function(geometry2) {
  11210. this._useGeometry = geometry2;
  11211. };
  11212. Cesium.Primitive.prototype.getUseGeometry = function() {
  11213. return this._useGeometry;
  11214. };
  11215. class SketchViewModel {
  11216. constructor(viewer2, options2) {
  11217. this._viewer = viewer2;
  11218. this._init(options2);
  11219. }
  11220. _init(options2) {
  11221. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  11222. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  11223. this._entities = this._viewer.entities;
  11224. this._pointEntitys = [];
  11225. this._sketchPointImage = void 0;
  11226. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  11227. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  11228. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  11229. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  11230. this._sketchEntityName = "sketchEntity";
  11231. this._sketchTempPoints = [];
  11232. this._sketchPoints = [];
  11233. this._sketchOutputPoints = [];
  11234. this._sketchTempPolyline = void 0;
  11235. this._sketchPolyline = void 0;
  11236. this._sketchTempPolygon = void 0;
  11237. this._sketchPolygon = void 0;
  11238. this._sketchTempAltituePolyline = void 0;
  11239. this._sketchAltitudePolyline = void 0;
  11240. this._sketchAltitudeInitHeight = 0;
  11241. this._sketchTempSpatialPolyline = void 0;
  11242. this._sketchSpatialPolyline = void 0;
  11243. this._sketchTempCircle = void 0;
  11244. this._sketchCircle = void 0;
  11245. this._sketchTempRectangle = void 0;
  11246. this._sketchRectangle = void 0;
  11247. this._sketchTempTriangleAltitudePolyline = void 0;
  11248. this._sketchTriangleAltituePolyline = void 0;
  11249. this._sketchTempSpatialTriangle = void 0;
  11250. this._sketchSpatialTriangle = void 0;
  11251. this._lineLabel = void 0;
  11252. this._polygonLabel = void 0;
  11253. options2 = options2 || {};
  11254. if (options2.isDrawPoint) {
  11255. this._isDrawPoint = options2.isDrawPoint;
  11256. } else {
  11257. this._isDrawPoint = false;
  11258. }
  11259. if (options2.isRetainDrawPoint) {
  11260. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  11261. } else {
  11262. this._isRetainDrawPoint = false;
  11263. }
  11264. this._param = {
  11265. moveLineWidth: 2,
  11266. lineWidth: 2,
  11267. moveAltitudeLineWidth: 2,
  11268. altitudeLineWidth: 2,
  11269. spatialLineWidth: 2,
  11270. moveEllipseColor: [0, 255, 0, 0.5],
  11271. moveEllipseOutline: true,
  11272. moveEllipseOutlineColor: [255, 0, 0, 0.5],
  11273. moveEllipseOutlineWidth: 1,
  11274. spatialLineWidth: 2,
  11275. ellipseColor: [0, 0, 255, 0.5],
  11276. ellipseOutline: true,
  11277. ellipseOutlineColor: [255, 0, 0, 0.5],
  11278. ellipseOutlineWidth: 1
  11279. };
  11280. this._setMoveLineStyle(void 0);
  11281. this._setLineStyle(void 0);
  11282. this._setMovePolygonStyle(void 0);
  11283. this._setPolygonStyle(void 0);
  11284. this._setMoveAltitudeLineStyle(void 0);
  11285. this._setAltitudeLineStyle(void 0);
  11286. this._setMoveEllipseStyle(void 0);
  11287. this._setEllipseStyle(void 0);
  11288. this._setSpatialLineStyle(void 0);
  11289. if (options2 && options2.iconType) {
  11290. switch (options2.iconType) {
  11291. case SketchViewModel.SketchIconType.Normal:
  11292. this._sketchPointImage = this._iconNormal;
  11293. break;
  11294. case SketchViewModel.SketchIconType.Blue:
  11295. this._sketchPointImage = this._iconBlue;
  11296. break;
  11297. case SketchViewModel.SketchIconType.Green:
  11298. this._sketchPointImage = this._iconGreen;
  11299. break;
  11300. case SketchViewModel.SketchIconType.Violet:
  11301. this._sketchPointImage = this._iconViolet;
  11302. break;
  11303. default:
  11304. this._sketchPointImage = this._iconNormal;
  11305. break;
  11306. }
  11307. } else {
  11308. this._sketchPointImage = this._iconNormal;
  11309. }
  11310. }
  11311. _arcToDegree(arc) {
  11312. return arc / Math.PI * 180;
  11313. }
  11314. _toColor(red, green, blue, alpha) {
  11315. let normalColor = new Cesium.Color(0, 0, 0, 1);
  11316. if (typeof red != "number")
  11317. return normalColor;
  11318. if (typeof green != "number")
  11319. return normalColor;
  11320. if (typeof blue != "number")
  11321. return normalColor;
  11322. if (typeof alpha != "number")
  11323. return normalColor;
  11324. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  11325. return normalColor;
  11326. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  11327. }
  11328. _toColorFromArray(array) {
  11329. if (!array || array.length === void 0 || array.length === 0)
  11330. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  11331. let r2 = 255, g = 255, b = 255, a = 1;
  11332. if (array.length === 1) {
  11333. r2 = parseInt(array[0]);
  11334. } else if (array.length === 2) {
  11335. r2 = parseInt(array[0]);
  11336. g = parseInt(array[1]);
  11337. } else if (array.length === 3) {
  11338. r2 = parseInt(array[0]);
  11339. g = parseInt(array[1]);
  11340. b = parseInt(array[2]);
  11341. } else if (array.length >= 4) {
  11342. r2 = parseInt(array[0]);
  11343. g = parseInt(array[1]);
  11344. b = parseInt(array[2]);
  11345. a = parseFloat(array[3]);
  11346. }
  11347. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  11348. }
  11349. _updateScene() {
  11350. this._viewer.scene.requestRender();
  11351. }
  11352. _getScreenClickPosition(screenPosition) {
  11353. let resCartesian = void 0;
  11354. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  11355. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11356. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11357. if (Cesium.defined(position2)) {
  11358. resCartesian = {
  11359. x: position2.x,
  11360. y: position2.y,
  11361. z: position2.z
  11362. };
  11363. }
  11364. return resCartesian;
  11365. }
  11366. _getScreenClickPositionAndHeight(screenPoint) {
  11367. var lng = void 0, lat = void 0, height2 = void 0;
  11368. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  11369. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11370. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11371. var feature2 = this._viewer.scene.pick(screenPoint);
  11372. if (feature2 == void 0) {
  11373. lng = this._arcToDegree(cartographic.longitude);
  11374. lat = this._arcToDegree(cartographic.latitude);
  11375. height2 = cartographic.height;
  11376. } else {
  11377. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  11378. if (Cesium.defined(cartesian)) {
  11379. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  11380. lng = this._arcToDegree(cartographic.longitude);
  11381. lat = this._arcToDegree(cartographic.latitude);
  11382. height2 = cartographic.height;
  11383. }
  11384. }
  11385. return {
  11386. lng,
  11387. lat,
  11388. height: height2
  11389. };
  11390. }
  11391. _transfromFromScreenPoint(screenPosition) {
  11392. let location = this._getScreenClickPositionAndHeight(screenPosition);
  11393. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  11394. return {
  11395. gLocation: location,
  11396. sLocation: cartesian
  11397. };
  11398. }
  11399. _removeEntityByName(entityName) {
  11400. var entities2 = this._entities;
  11401. if (!entities2 || !entities2.values)
  11402. return;
  11403. var delEntitys = [];
  11404. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  11405. if (entities2.values[i2].name == entityName) {
  11406. delEntitys.push(entities2.values[i2]);
  11407. }
  11408. }
  11409. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  11410. entities2.remove(delEntitys[i2]);
  11411. }
  11412. this._updateScene();
  11413. }
  11414. _removeEntityByObject(objEntity) {
  11415. if (!Cesium.defined(objEntity))
  11416. return;
  11417. this._entities.remove(objEntity);
  11418. }
  11419. _createPoint(coord, label2) {
  11420. let _self = this;
  11421. let entity = new Cesium.Entity({
  11422. name: _self._sketchEntityName + "_Point",
  11423. position: coord,
  11424. billboard: {
  11425. image: _self._sketchPointImage,
  11426. horizontalOrigin: Cesium.HorizontalOrigin.center,
  11427. verticalOrigin: Cesium.VerticalOrigin.bottom,
  11428. scale: 0.5,
  11429. pixelOffset: new Cesium.Cartesian2(0, -11),
  11430. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11431. }
  11432. });
  11433. if (label2) {
  11434. entity.label = {
  11435. text: label2,
  11436. font: "12px sans-serif",
  11437. fillColor: this._toColor(255, 255, 255, 1),
  11438. outlineColor: this._toColor(0, 154, 94, 1),
  11439. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  11440. outlineWidth: 1,
  11441. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  11442. pixelOffset: new Cesium.Cartesian2(0, -28),
  11443. showBackground: true,
  11444. backgroundColor: this._toColor(0, 0, 0, 0.6),
  11445. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11446. };
  11447. }
  11448. this._entities.add(entity);
  11449. this._pointEntitys.push(entity);
  11450. this._updateScene();
  11451. }
  11452. _removePointEntitys() {
  11453. this._removeEntityByName(this._sketchEntityName + "_Point");
  11454. this._pointEntitys = [];
  11455. }
  11456. _createTempPolyline() {
  11457. let _self = this;
  11458. if (!Cesium.defined(this._sketchTempPolyline)) {
  11459. this._sketchTempPolyline = new Cesium.Entity({
  11460. name: _self._sketchEntityName,
  11461. polyline: {
  11462. show: true,
  11463. positions: new Cesium.CallbackProperty(function() {
  11464. return _self._sketchTempPoints;
  11465. }, false),
  11466. material: _self._tempLineMaterial,
  11467. width: _self._param.moveLineWidth,
  11468. clampToGround: true
  11469. }
  11470. });
  11471. this._entities.add(this._sketchTempPolyline);
  11472. this._updateScene();
  11473. }
  11474. }
  11475. _createPolyline() {
  11476. let _self = this;
  11477. if (!Cesium.defined(this._sketchPolyline)) {
  11478. this._sketchPolyline = new Cesium.Entity({
  11479. name: _self._sketchEntityName,
  11480. polyline: {
  11481. show: true,
  11482. positions: _self._sketchPoints,
  11483. material: _self._lineMaterial,
  11484. width: _self._param.lineWidth,
  11485. clampToGround: true
  11486. }
  11487. });
  11488. this._entities.add(this._sketchPolyline);
  11489. this._updateScene();
  11490. }
  11491. }
  11492. _createTempSpatialPolyline() {
  11493. let _self = this;
  11494. if (!Cesium.defined(this._sketchTempSpatialPolyline)) {
  11495. this._sketchTempSpatialPolyline = new Cesium.Entity({
  11496. name: _self._sketchEntityName,
  11497. polyline: {
  11498. show: true,
  11499. positions: new Cesium.CallbackProperty(function() {
  11500. return _self._sketchTempPoints;
  11501. }, false),
  11502. material: _self._tempLineMaterial,
  11503. width: _self._param.moveLineWidth,
  11504. clampToGround: false
  11505. }
  11506. });
  11507. this._entities.add(this._sketchTempSpatialPolyline);
  11508. this._updateScene();
  11509. }
  11510. }
  11511. _createSpatialPolyline() {
  11512. let _self = this;
  11513. if (!Cesium.defined(this._sketchSpatialPolyline)) {
  11514. this._sketchSpatialPolyline = new Cesium.Entity({
  11515. name: _self._sketchEntityName,
  11516. polyline: {
  11517. show: true,
  11518. positions: _self._sketchPoints,
  11519. material: _self._spatialLineMaterial,
  11520. width: _self._param.spatialLineWidth,
  11521. clampToGround: false
  11522. }
  11523. });
  11524. this._entities.add(this._sketchSpatialPolyline);
  11525. this._updateScene();
  11526. }
  11527. }
  11528. _createTempPolygon() {
  11529. let _self = this;
  11530. if (!Cesium.defined(this._sketchTempPolygon)) {
  11531. this._sketchTempPolygon = new Cesium.Entity({
  11532. name: _self._sketchEntityName,
  11533. polygon: {
  11534. show: true,
  11535. hierarchy: new Cesium.CallbackProperty(function() {
  11536. return {
  11537. positions: _self._sketchTempPoints
  11538. };
  11539. }, false),
  11540. material: _self._tempPolygonMaterial,
  11541. classificationType: Cesium.ClassificationType.BOTH
  11542. }
  11543. });
  11544. this._entities.add(this._sketchTempPolygon);
  11545. this._updateScene();
  11546. }
  11547. }
  11548. _createPolygon() {
  11549. let _self = this;
  11550. if (!Cesium.defined(this._sketchPolygon)) {
  11551. this._sketchPoints.push(this._sketchPoints[0]);
  11552. this._sketchPolygon = new Cesium.Entity({
  11553. name: _self._sketchEntityName,
  11554. polygon: {
  11555. show: true,
  11556. hierarchy: {
  11557. positions: _self._sketchPoints
  11558. },
  11559. material: _self._polygonMaterial,
  11560. classificationType: Cesium.ClassificationType.BOTH
  11561. },
  11562. polyline: {
  11563. show: true,
  11564. positions: _self._sketchPoints,
  11565. material: _self._lineMaterial,
  11566. width: _self._param.lineWidth,
  11567. clampToGround: true
  11568. }
  11569. });
  11570. this._entities.add(this._sketchPolygon);
  11571. this._updateScene();
  11572. }
  11573. }
  11574. _createPolygonBody(options2) {
  11575. let _self = this;
  11576. let appendHeight = parseFloat(100);
  11577. if (options2 && options2.height && typeof options2.height === "number")
  11578. appendHeight = parseFloat(options2.height);
  11579. let wallColor = [255, 255, 0, 1];
  11580. let polygonColor = [0, 0, 255, 0.65];
  11581. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  11582. polygonColor = this._checkColorAndAlpha(options2.color);
  11583. if (!Cesium.defined(this._sketchPolygon)) {
  11584. let shaderSource = "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n material.diffuse = color.rgb;\n material.alpha = color.a;\n return material;\n}";
  11585. let wallMaterial = new Cesium.Material({
  11586. fabric: {
  11587. type: "wallMaterial",
  11588. uniforms: {
  11589. color: _self._toColorFromArray(wallColor),
  11590. speed: 100
  11591. },
  11592. source: shaderSource
  11593. }
  11594. });
  11595. new Cesium.MaterialAppearance({
  11596. material: wallMaterial
  11597. });
  11598. let polygonAppearance = new Cesium.MaterialAppearance({
  11599. material: new Cesium.Material({
  11600. fabric: {
  11601. type: "Color",
  11602. uniforms: {
  11603. color: _self._toColorFromArray(polygonColor)
  11604. }
  11605. }
  11606. })
  11607. });
  11608. let wallMinimumHeights = [];
  11609. let wallMaximumHeights = [];
  11610. for (let i2 = 0; i2 < _self._sketchOutputPoints.length; i2++) {
  11611. let height3 = parseFloat(_self._sketchOutputPoints[i2].height);
  11612. wallMinimumHeights.push(height3);
  11613. wallMaximumHeights.push(height3 + appendHeight);
  11614. }
  11615. let height2 = parseFloat(_self._sketchOutputPoints[0].height);
  11616. wallMinimumHeights.push(height2);
  11617. wallMaximumHeights.push(height2 + appendHeight);
  11618. let tempPoints = [];
  11619. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  11620. tempPoints.push(_self._sketchPoints[i2]);
  11621. }
  11622. tempPoints.push(_self._sketchPoints[0]);
  11623. new Cesium.WallGeometry({
  11624. positions: tempPoints,
  11625. maximumHeights: wallMaximumHeights,
  11626. minimumHeights: wallMinimumHeights
  11627. });
  11628. let polygonGeometry = new Cesium.PolygonGeometry({
  11629. polygonHierarchy: new Cesium.PolygonHierarchy(tempPoints),
  11630. perPositionHeight: true,
  11631. extrudedHeight: Math.max.apply(null, wallMaximumHeights)
  11632. });
  11633. let polygonPrimitive = new Cesium.Primitive({
  11634. geometryInstances: new Cesium.GeometryInstance({
  11635. geometry: polygonGeometry
  11636. }),
  11637. appearance: polygonAppearance,
  11638. releaseGeometryInstances: false
  11639. });
  11640. polygonPrimitive.setUseGeometry({
  11641. cPoints: _self._sketchPoints,
  11642. gPoints: _self._sketchOutputPoints,
  11643. height: appendHeight,
  11644. color: polygonColor
  11645. });
  11646. this._viewer.scene.primitives.add(polygonPrimitive);
  11647. }
  11648. }
  11649. _callUpdaeEllipseCenterPosition() {
  11650. let _self = this;
  11651. return function() {
  11652. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11653. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11654. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11655. return _self._sketchEllipseCenterPosition;
  11656. };
  11657. }
  11658. _callUpdateAltitudePolylinePositions() {
  11659. let _self = this;
  11660. return function() {
  11661. _self._sketchAltitudePolylinePostions = [];
  11662. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  11663. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11664. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11665. let point_temp = Cesium.Cartesian3.fromDegrees(
  11666. Cesium.Math.toDegrees(
  11667. point1cartographic.longitude
  11668. ),
  11669. Cesium.Math.toDegrees(point1cartographic.latitude),
  11670. point2cartographic.height
  11671. );
  11672. _self._sketchAltitudePolylinePostions.push(point_temp);
  11673. return _self._sketchAltitudePolylinePostions;
  11674. };
  11675. }
  11676. _callUpdateEllipseMinorAxis() {
  11677. let _self = this;
  11678. return function() {
  11679. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11680. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11681. let geodesic = new Cesium.EllipsoidGeodesic();
  11682. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11683. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11684. if (_self._sketchEllipseRadius <= 0)
  11685. _self._sketchEllipseRadius = 1;
  11686. return _self._sketchEllipseRadius;
  11687. };
  11688. }
  11689. _callUpdateEllipseHeight() {
  11690. let _self = this;
  11691. return function() {
  11692. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11693. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11694. let height_temp = cartographic1.height - cartographic.height;
  11695. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  11696. return _self._sketchEllipseHeight;
  11697. };
  11698. }
  11699. _createTempAltitudePolyline() {
  11700. let _self = this;
  11701. if (!Cesium.defined(this._sketchTempAltituePolyline)) {
  11702. this._sketchTempAltituePolyline = new Cesium.Entity({
  11703. name: _self._sketchEntityName,
  11704. position: new Cesium.CallbackProperty(
  11705. _self._callUpdaeEllipseCenterPosition(),
  11706. false
  11707. ),
  11708. polyline: {
  11709. show: true,
  11710. positions: new Cesium.CallbackProperty(
  11711. _self._callUpdateAltitudePolylinePositions(),
  11712. false
  11713. ),
  11714. material: _self._tempAlititudeLineMaterial,
  11715. width: _self._param.moveAltitudeLineWidth,
  11716. clampToGround: false
  11717. },
  11718. ellipse: {
  11719. show: true,
  11720. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11721. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11722. height: new Cesium.CallbackProperty(_self._callUpdateEllipseHeight(), false),
  11723. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  11724. outline: _self._param.moveEllipseOutline,
  11725. outlineWidth: _self._param.moveEllipseOutlineWidth,
  11726. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  11727. }
  11728. });
  11729. _self._entities.add(_self._sketchTempAltituePolyline);
  11730. }
  11731. }
  11732. _createAltitudePolyline() {
  11733. let _self = this;
  11734. if (!Cesium.defined(this._sketchAltitudePolyline)) {
  11735. this._sketchAltitudePolyline = new Cesium.Entity({
  11736. name: _self._sketchEntityName,
  11737. position: _self._sketchEllipseCenterPosition,
  11738. polyline: {
  11739. show: true,
  11740. positions: _self._sketchAltitudePolylinePostions,
  11741. material: _self._altitudeLineMaterial,
  11742. width: _self._param.altitudeLineWidth,
  11743. clampToGround: false
  11744. },
  11745. ellipse: {
  11746. show: true,
  11747. semiMinorAxis: _self._sketchEllipseRadius,
  11748. semiMajorAxis: _self._sketchEllipseRadius,
  11749. height: _self._sketchEllipseHeight,
  11750. material: _self._toColorFromArray(_self._param.ellipseColor),
  11751. outline: _self._param.ellipseOutline,
  11752. outlineWidth: _self._param.ellipseOutlineWidth,
  11753. outlineColor: _self._toColorFromArray(_self._param.ellipseOutlineColor)
  11754. }
  11755. });
  11756. _self._entities.add(_self._sketchAltitudePolyline);
  11757. }
  11758. }
  11759. _callEllipseOutlineCoordinate() {
  11760. let _self = this;
  11761. return function() {
  11762. let positionCenter = _self._sketchEllipseCenterPosition;
  11763. let positionRotate = _self._sketchTempPoints[1];
  11764. _self._ellipseOutlineCoordinates = [];
  11765. for (let angle = 5; angle < 360; ) {
  11766. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  11767. _self._ellipseOutlineCoordinates.push(newPosition);
  11768. angle = angle + 5;
  11769. }
  11770. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  11771. return _self._ellipseOutlineCoordinates;
  11772. };
  11773. }
  11774. _createTempCircle(centerPosition) {
  11775. let _self = this;
  11776. if (!Cesium.defined(this._sketchTempCircle)) {
  11777. _self._sketchEllipseCenterPosition = centerPosition.clone();
  11778. this._sketchTempCircle = new Cesium.Entity({
  11779. name: _self._sketchEntityName,
  11780. position: centerPosition,
  11781. polyline: {
  11782. show: true,
  11783. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(), false),
  11784. material: _self._tempLineMaterial,
  11785. width: _self._param.moveLineWidth,
  11786. clampToGround: true
  11787. },
  11788. ellipse: {
  11789. show: true,
  11790. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11791. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11792. material: _self._tempPolygonMaterial,
  11793. classificationType: Cesium.ClassificationType.BOTH
  11794. }
  11795. });
  11796. _self._entities.add(_self._sketchTempCircle);
  11797. }
  11798. }
  11799. _rotatedPointByAngle(position_A, position_B, angle) {
  11800. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  11801. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  11802. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  11803. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  11804. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  11805. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  11806. var new_z = localPosition_A.z;
  11807. return Cesium.Matrix4.multiplyByPoint(
  11808. localToWorld_Matrix,
  11809. new Cesium.Cartesian3(new_x, new_y, new_z),
  11810. new Cesium.Cartesian3()
  11811. );
  11812. }
  11813. _createCircle() {
  11814. let _self = this;
  11815. if (!Cesium.defined(this._sketchCircle)) {
  11816. this._sketchCircle = new Cesium.Entity({
  11817. name: _self._sketchEntityName,
  11818. position: _self._sketchEllipseCenterPosition,
  11819. polyline: {
  11820. show: true,
  11821. positions: _self._ellipseOutlineCoordinates,
  11822. material: _self._lineMaterial,
  11823. width: _self._param.lineWidth,
  11824. clampToGround: true
  11825. },
  11826. ellipse: {
  11827. show: true,
  11828. semiMinorAxis: _self._sketchEllipseRadius,
  11829. semiMajorAxis: _self._sketchEllipseRadius,
  11830. material: _self._polygonMaterial,
  11831. classificationType: Cesium.ClassificationType.BOTH
  11832. }
  11833. });
  11834. _self._entities.add(_self._sketchCircle);
  11835. }
  11836. }
  11837. _callUpdateRectangleCoordinates() {
  11838. let _self = this;
  11839. return function() {
  11840. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  11841. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  11842. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  11843. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  11844. _self._rectangleCoordinates = [0, 0, 1, 1];
  11845. if (lng0 < lng1) {
  11846. _self._rectangleCoordinates[0] = lng0;
  11847. _self._rectangleCoordinates[2] = lng1;
  11848. } else {
  11849. _self._rectangleCoordinates[0] = lng1;
  11850. _self._rectangleCoordinates[2] = lng0;
  11851. }
  11852. if (lat0 < lat1) {
  11853. _self._rectangleCoordinates[1] = lat0;
  11854. _self._rectangleCoordinates[3] = lat1;
  11855. } else {
  11856. _self._rectangleCoordinates[1] = lat1;
  11857. _self._rectangleCoordinates[3] = lat0;
  11858. }
  11859. let rectangle = Cesium.Rectangle.fromDegrees(
  11860. _self._rectangleCoordinates[0],
  11861. _self._rectangleCoordinates[1],
  11862. _self._rectangleCoordinates[2],
  11863. _self._rectangleCoordinates[3]
  11864. );
  11865. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  11866. _self._rectangleOutlineCoordinates = res.cPoints;
  11867. _self._sketchOutputPoints = res.gPoints;
  11868. return rectangle;
  11869. };
  11870. }
  11871. _calculateRectangleOutlineCoordinates(rectangle) {
  11872. let south_east = Cesium.Rectangle.southeast(rectangle);
  11873. let se2 = Cesium.Cartographic.toCartesian(south_east);
  11874. let south_west = Cesium.Rectangle.southwest(rectangle);
  11875. let sw = Cesium.Cartographic.toCartesian(south_west);
  11876. let north_east = Cesium.Rectangle.northeast(rectangle);
  11877. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  11878. let north_west = Cesium.Rectangle.northwest(rectangle);
  11879. let nw = Cesium.Cartographic.toCartesian(north_west);
  11880. let gPoints = [];
  11881. gPoints.push({
  11882. lng: Cesium.Math.toDegrees(south_west.longitude),
  11883. lat: Cesium.Math.toDegrees(south_west.latitude),
  11884. height: south_west.height
  11885. });
  11886. gPoints.push({
  11887. lng: Cesium.Math.toDegrees(south_east.longitude),
  11888. lat: Cesium.Math.toDegrees(south_east.latitude),
  11889. height: south_east.height
  11890. });
  11891. gPoints.push({
  11892. lng: Cesium.Math.toDegrees(north_east.longitude),
  11893. lat: Cesium.Math.toDegrees(north_east.latitude),
  11894. height: north_east.height
  11895. });
  11896. gPoints.push({
  11897. lng: Cesium.Math.toDegrees(north_west.longitude),
  11898. lat: Cesium.Math.toDegrees(north_west.latitude),
  11899. height: north_west.height
  11900. });
  11901. gPoints.push({
  11902. lng: Cesium.Math.toDegrees(south_west.longitude),
  11903. lat: Cesium.Math.toDegrees(south_west.latitude),
  11904. height: south_west.height
  11905. });
  11906. return {
  11907. cPoints: [sw, se2, ne2, nw, sw],
  11908. gPoints
  11909. };
  11910. }
  11911. _callUpdateRectangleOutlineCoordinates() {
  11912. let _self = this;
  11913. return function() {
  11914. return _self._rectangleOutlineCoordinates;
  11915. };
  11916. }
  11917. _createTempRectangle() {
  11918. let _self = this;
  11919. if (!Cesium.defined(this._sketchTempRectangle)) {
  11920. this._sketchTempRectangle = new Cesium.Entity({
  11921. name: _self._sketchEntityName,
  11922. polyline: {
  11923. show: true,
  11924. positions: new Cesium.CallbackProperty(_self._callUpdateRectangleOutlineCoordinates(), false),
  11925. material: _self._tempLineMaterial,
  11926. width: _self._param.moveLineWidth,
  11927. clampToGround: true
  11928. },
  11929. rectangle: {
  11930. show: true,
  11931. coordinates: new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(), false),
  11932. material: _self._tempPolygonMaterial,
  11933. classificationType: Cesium.ClassificationType.BOTH
  11934. }
  11935. });
  11936. _self._entities.add(_self._sketchTempRectangle);
  11937. }
  11938. }
  11939. _createRectangle() {
  11940. let _self = this;
  11941. if (!Cesium.defined(this._sketchRectangle)) {
  11942. this._sketchRectangle = new Cesium.Entity({
  11943. name: _self._sketchEntityName,
  11944. polyline: {
  11945. show: true,
  11946. positions: _self._rectangleOutlineCoordinates,
  11947. material: _self._lineMaterial,
  11948. width: _self._param.lineWidth,
  11949. clampToGround: true
  11950. },
  11951. rectangle: {
  11952. show: true,
  11953. coordinates: Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]),
  11954. material: _self._polygonMaterial,
  11955. classificationType: Cesium.ClassificationType.BOTH
  11956. }
  11957. });
  11958. _self._entities.add(_self._sketchRectangle);
  11959. }
  11960. }
  11961. _callUpdaeTriangleEllipseCenterPosition() {
  11962. let _self = this;
  11963. return function() {
  11964. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11965. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11966. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11967. return _self._sketchEllipseCenterPosition;
  11968. };
  11969. }
  11970. _callUpdateTriangleAltitudePolylinePositions() {
  11971. let _self = this;
  11972. return function() {
  11973. _self._sketchAltitudePolylinePostions = [];
  11974. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[1]);
  11975. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11976. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11977. let point_temp = Cesium.Cartesian3.fromDegrees(
  11978. Cesium.Math.toDegrees(
  11979. point1cartographic.longitude
  11980. ),
  11981. Cesium.Math.toDegrees(point1cartographic.latitude),
  11982. point2cartographic.height
  11983. );
  11984. _self._sketchAltitudePolylinePostions.push(point_temp);
  11985. return _self._sketchAltitudePolylinePostions;
  11986. };
  11987. }
  11988. _callUpdateTriangleEllipseMinorAxis() {
  11989. let _self = this;
  11990. return function() {
  11991. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11992. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11993. let geodesic = new Cesium.EllipsoidGeodesic();
  11994. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11995. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11996. if (_self._sketchEllipseRadius <= 0)
  11997. _self._sketchEllipseRadius = 1;
  11998. return _self._sketchEllipseRadius;
  11999. };
  12000. }
  12001. _callUpdateTriangleEllipseHeight() {
  12002. let _self = this;
  12003. return function() {
  12004. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12005. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  12006. let height_temp = cartographic1.height - cartographic.height;
  12007. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  12008. return _self._sketchEllipseHeight;
  12009. };
  12010. }
  12011. _callUpdateTriangleSpatialPolylinePositions() {
  12012. let _self = this;
  12013. return function() {
  12014. _self._sketchTriangleSpatialPolylinePositions = [];
  12015. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchTempPoints[0]);
  12016. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchEllipseCenterPosition);
  12017. return _self._sketchTriangleSpatialPolylinePositions;
  12018. };
  12019. }
  12020. _createTriangleSpatialPolyline() {
  12021. let _self = this;
  12022. this._sketchSpatialPolyline = new Cesium.Entity({
  12023. name: _self._sketchEntityName,
  12024. polyline: {
  12025. show: true,
  12026. positions: _self._sketchTriangleSpatialPolylinePositions,
  12027. material: _self._spatialLineMaterial,
  12028. width: _self._param.spatialLineWidth,
  12029. clampToGround: false
  12030. }
  12031. });
  12032. this._entities.add(this._sketchSpatialPolyline);
  12033. }
  12034. _createTempTriangleAltitudePolylineAndSpatialPolyline() {
  12035. let _self = this;
  12036. if (!Cesium.defined(this._sketchTempTriangleAltitudePolyline) && !Cesium.defined(this._sketchTempSpatialPolyline)) {
  12037. this._sketchTempTriangleAltitudePolyline = new Cesium.Entity({
  12038. name: _self._sketchEntityName,
  12039. position: new Cesium.CallbackProperty(
  12040. _self._callUpdaeTriangleEllipseCenterPosition(),
  12041. false
  12042. ),
  12043. polyline: {
  12044. show: true,
  12045. positions: new Cesium.CallbackProperty(
  12046. _self._callUpdateTriangleAltitudePolylinePositions(),
  12047. false
  12048. ),
  12049. material: _self._tempAlititudeLineMaterial,
  12050. width: _self._param.moveAltitudeLineWidth,
  12051. clampToGround: false
  12052. },
  12053. ellipse: {
  12054. show: true,
  12055. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  12056. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  12057. height: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseHeight(), false),
  12058. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  12059. outline: _self._param.moveEllipseOutline,
  12060. outlineWidth: _self._param.moveEllipseOutlineWidth,
  12061. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  12062. }
  12063. });
  12064. _self._entities.add(_self._sketchTempTriangleAltitudePolyline);
  12065. _self._sketchTempSpatialPolyline = new Cesium.Entity({
  12066. name: _self._sketchEntityName,
  12067. polyline: {
  12068. show: true,
  12069. positions: new Cesium.CallbackProperty(_self._callUpdateTriangleSpatialPolylinePositions(), false),
  12070. material: _self._tempLineMaterial,
  12071. width: _self._param.moveLineWidth,
  12072. clampToGround: false
  12073. }
  12074. });
  12075. _self._entities.add(_self._sketchTempSpatialPolyline);
  12076. }
  12077. }
  12078. _createTempSpatialTriangle() {
  12079. let _self = this;
  12080. if (!Cesium.defined(this._sketchTempSpatialTriangle)) {
  12081. this._sketchTempSpatialTriangle = new Cesium.Entity({
  12082. name: _self._sketchEntityName,
  12083. polyline: {
  12084. show: true,
  12085. positions: new Cesium.CallbackProperty(function() {
  12086. _self._sketchSpatialTrianglePositions = [];
  12087. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12088. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12089. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12090. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12091. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12092. _self._sketchSpatialTrianglePositions.push(point_temp);
  12093. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12094. return _self._sketchSpatialTrianglePositions;
  12095. }, false),
  12096. material: _self._tempLineMaterial,
  12097. width: _self._param.moveLineWidth,
  12098. clampToGround: false
  12099. }
  12100. });
  12101. this._entities.add(this._sketchTempSpatialTriangle);
  12102. this._updateScene();
  12103. }
  12104. }
  12105. _createSpatialTriangle() {
  12106. let _self = this;
  12107. if (!Cesium.defined(this._sketchSpatialTriangle)) {
  12108. this._sketchSpatialTriangle = new Cesium.Entity({
  12109. name: _self._sketchEntityName,
  12110. polyline: {
  12111. show: true,
  12112. positions: _self._sketchSpatialTrianglePositions,
  12113. material: _self._lineMaterial,
  12114. width: _self._param.lineWidth,
  12115. clampToGround: false
  12116. }
  12117. });
  12118. this._entities.add(this._sketchSpatialTriangle);
  12119. this._updateScene();
  12120. }
  12121. }
  12122. _setMoveLineStyle(options2) {
  12123. let _self = this;
  12124. let color2 = [255, 255, 255, 1];
  12125. let lineWidth = 3;
  12126. let isOutline = false;
  12127. let power = 0.2;
  12128. let outlineColor = [255, 0, 0, 1];
  12129. let outlineWidth = 1;
  12130. if (options2 && options2.color && options2.color.length === 4)
  12131. color2 = options2.color;
  12132. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12133. isOutline = options2.outline;
  12134. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12135. outlineColor = options2.outlineColor;
  12136. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12137. outlineWidth = options2.outlineWidth;
  12138. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12139. lineWidth = options2.lineWidth;
  12140. if (options2 && options2.power)
  12141. power = options2.power;
  12142. if (isOutline) {
  12143. this._tempLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12144. color: _self._toColorFromArray(color2),
  12145. outlineColor: _self._toColorFromArray(outlineColor),
  12146. outlineWidth
  12147. });
  12148. } else {
  12149. if (power === void 0) {
  12150. this._tempLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12151. color: _self._toColorFromArray(color2)
  12152. });
  12153. } else {
  12154. this._tempLineMaterial = new Cesium.PolylineGlowMaterialProperty({
  12155. color: _self._toColorFromArray(color2),
  12156. glowPower: power
  12157. });
  12158. }
  12159. }
  12160. this._param.moveLineWidth = lineWidth;
  12161. }
  12162. _setLineStyle(options2) {
  12163. let _self = this;
  12164. let color2 = [255, 255, 255, 1];
  12165. let lineWidth = 2;
  12166. let outlineColor = [0, 255, 0, 0.6];
  12167. let outlineWidth = 1;
  12168. if (options2 && options2.color && options2.color.length === 4)
  12169. color2 = options2.color;
  12170. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12171. outlineColor = options2.outlineColor;
  12172. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12173. outlineWidth = options2.outlineWidth;
  12174. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12175. lineWidth = options2.lineWidth;
  12176. this._lineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12177. color: _self._toColorFromArray(color2),
  12178. outlineColor: _self._toColorFromArray(outlineColor),
  12179. outlineWidth
  12180. });
  12181. this._param.lineWidth = lineWidth;
  12182. }
  12183. _setSpatialLineStyle(options2) {
  12184. let _self = this;
  12185. let color2 = [255, 255, 0, 1];
  12186. let lineWidth = 2;
  12187. let outlineColor = [255, 255, 255, 1];
  12188. let outlineWidth = 1;
  12189. if (options2 && options2.color && options2.color.length === 4)
  12190. color2 = options2.color;
  12191. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12192. outlineColor = options2.outlineColor;
  12193. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12194. outlineWidth = options2.outlineWidth;
  12195. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12196. lineWidth = options2.lineWidth;
  12197. this._spatialLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12198. color: _self._toColorFromArray(color2),
  12199. outlineColor: _self._toColorFromArray(outlineColor),
  12200. outlineWidth
  12201. });
  12202. this._param.spatialLineWidth = lineWidth;
  12203. }
  12204. _setMovePolygonStyle(options2) {
  12205. let polygonColor = [255, 0, 0, 0.3];
  12206. if (options2 && options2.color && options2.color.length === 4)
  12207. polygonColor = options2.color;
  12208. this._tempPolygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12209. }
  12210. _setPolygonStyle(options2) {
  12211. let polygonColor = [0, 0, 255, 0.3];
  12212. if (options2 && options2.color && options2.color.length === 4)
  12213. polygonColor = options2.color;
  12214. this._polygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12215. }
  12216. _setMoveAltitudeLineStyle(options2) {
  12217. let _self = this;
  12218. let color2 = [255, 255, 255, 1];
  12219. let lineWidth = 2;
  12220. let isOutline = true;
  12221. let outlineColor = [255, 255, 0, 1];
  12222. let outlineWidth = 1;
  12223. if (options2 && options2.color && options2.color.length === 4)
  12224. color2 = options2.color;
  12225. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12226. isOutline = options2.outline;
  12227. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12228. outlineColor = options2.outlineColor;
  12229. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12230. outlineWidth = options2.outlineWidth;
  12231. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12232. lineWidth = options2.lineWidth;
  12233. if (isOutline) {
  12234. this._tempAlititudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12235. color: _self._toColorFromArray(color2),
  12236. outlineColor: _self._toColorFromArray(outlineColor),
  12237. outlineWidth
  12238. });
  12239. } else {
  12240. this._tempAlititudeLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12241. color: _self._toColorFromArray(color2)
  12242. });
  12243. }
  12244. this._param.moveAltitudeLineWidth = lineWidth;
  12245. }
  12246. _setAltitudeLineStyle(options2) {
  12247. let _self = this;
  12248. let color2 = [255, 255, 255, 1];
  12249. let lineWidth = 2;
  12250. let outlineColor = [0, 0, 255, 1];
  12251. let outlineWidth = 1;
  12252. if (options2 && options2.color && options2.color.length === 4)
  12253. color2 = options2.color;
  12254. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12255. outlineColor = options2.outlineColor;
  12256. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12257. outlineWidth = options2.outlineWidth;
  12258. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12259. lineWidth = options2.lineWidth;
  12260. this._altitudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12261. color: _self._toColorFromArray(color2),
  12262. outlineColor: _self._toColorFromArray(outlineColor),
  12263. outlineWidth
  12264. });
  12265. this._param.altitudeLineWidth = lineWidth;
  12266. }
  12267. _setMoveEllipseStyle(options2) {
  12268. if (options2 && options2.color && options2.color.length === 4)
  12269. this._param.moveEllipseColor = options2.color;
  12270. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12271. this._param.moveEllipseOutlineWidth = options2.outlineWidth;
  12272. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12273. this._param.moveEllipseOutline = options2.outline;
  12274. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12275. this._param.moveEllipseOutlineColor = options2.outlineColor;
  12276. }
  12277. _setEllipseStyle(options2) {
  12278. if (options2 && options2.color && options2.color.length === 4)
  12279. this._param.ellipseColor = options2.color;
  12280. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12281. this._param.ellipseOutlineWidth = options2.outlineWidth;
  12282. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12283. this._param.ellipseOutline = options2.outline;
  12284. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12285. this._param.ellipseOutlineColor = options2.outlineColor;
  12286. }
  12287. _clear(isAll) {
  12288. if (isAll != void 0 && isAll === true) {
  12289. this._removeEntityByName(this._sketchEntityName);
  12290. this._removePointEntitys();
  12291. }
  12292. this._sketchTempPoints = [];
  12293. this._sketchPoints = [];
  12294. this._sketchOutputPoints = [];
  12295. this._sketchTempPolyline = void 0;
  12296. this._sketchPolyline = void 0;
  12297. this._sketchTempPolygon = void 0;
  12298. this._sketchPolygon = void 0;
  12299. this._sketchTempAltituePolyline = void 0;
  12300. this._sketchAltitudePolyline = void 0;
  12301. this._sketchTempSpatialPolyline = void 0;
  12302. this._sketchSpatialPolyline = void 0;
  12303. this._sketchTempCircle = void 0;
  12304. this._sketchCircle = void 0;
  12305. this._sketchTempRectangle = void 0;
  12306. this._sketchRectangle = void 0;
  12307. this._sketchTempTriangleAltitudePolyline = void 0;
  12308. this._sketchTriangleAltituePolyline = void 0;
  12309. this._sketchTempSpatialTriangle = void 0;
  12310. this._sketchSpatialTriangle = void 0;
  12311. }
  12312. _checkAppOrWeb() {
  12313. if (window.navigator.userAgent.match(
  12314. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  12315. )) {
  12316. return SketchViewModel.RuntimeEnvironment.App;
  12317. } else {
  12318. return SketchViewModel.RuntimeEnvironment.Web;
  12319. }
  12320. }
  12321. _isRuntimeApp() {
  12322. if (this._checkAppOrWeb() === SketchViewModel.RuntimeEnvironment.App) {
  12323. return true;
  12324. }
  12325. return false;
  12326. }
  12327. }
  12328. Object.assign(SketchViewModel.prototype, {
  12329. setMoveLineStyle: function(options2) {
  12330. this._setMoveLineStyle(options2);
  12331. },
  12332. setLineStyle: function(options2) {
  12333. this._setLineStyle(options2);
  12334. },
  12335. setSpatialLineStyle: function() {
  12336. this._setSpatialLineStyle(options);
  12337. },
  12338. setMovePolygonStyle: function(options2) {
  12339. this._setMovePolygonStyle(options2);
  12340. },
  12341. setPolygonStyle: function(options2) {
  12342. this._setPolygonStyle(options2);
  12343. },
  12344. setMoveAltitudeLineStyle: function(options2) {
  12345. this._setMoveAltitudeLineStyle(options2);
  12346. },
  12347. setAltitudeLineStyle: function(options2) {
  12348. this._setAltitudeLineStyle(options2);
  12349. },
  12350. setMoveEllipseStyle: function(options2) {
  12351. this._setMoveEllipseStyle(options2);
  12352. },
  12353. setEllipseStyle: function(options2) {
  12354. this._setEllipseStyle(options2);
  12355. },
  12356. setLabel: function(options2) {
  12357. if (!options2) {
  12358. options2 = {
  12359. lineLabel: void 0,
  12360. polygonLabel: void 0
  12361. };
  12362. }
  12363. if (options2.lineLabel)
  12364. this._lineLabel = options2.lineLabel;
  12365. if (options2.polygonLabel)
  12366. this._lineLabel = options2.polygonLabel;
  12367. }
  12368. });
  12369. Object.assign(SketchViewModel.prototype, {
  12370. _registerLeftClickEvent: function(handler, callChange) {
  12371. let _self = this;
  12372. if (!handler)
  12373. return;
  12374. handler.setInputAction(function(event2) {
  12375. _self._lock = true;
  12376. if (_self._timer != null)
  12377. clearTimeout(_self._timer);
  12378. _self._timer = setTimeout(function() {
  12379. if (callChange)
  12380. callChange(event2);
  12381. _self._lock = false;
  12382. }, 200);
  12383. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12384. },
  12385. _registerLeftDoubleClickEvent: function(handler, callChange) {
  12386. let _self = this;
  12387. if (!handler)
  12388. return;
  12389. handler.setInputAction(function(event2) {
  12390. if (_self._timer != null)
  12391. clearTimeout(_self._timer);
  12392. _self._lock = false;
  12393. if (callChange)
  12394. callChange(event2);
  12395. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  12396. },
  12397. _registerMouseMoveEvent: function(handler, callChange) {
  12398. let _self = this;
  12399. if (!handler)
  12400. return;
  12401. handler.setInputAction(function(event2) {
  12402. if (_self._lock === void 0 || _self._lock === false) {
  12403. if (callChange)
  12404. callChange(event2);
  12405. }
  12406. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12407. },
  12408. _registerRightClickEvent: function(handler, callChange) {
  12409. if (!handler)
  12410. return;
  12411. handler.setInputAction(function(event2) {
  12412. if (callChange)
  12413. callChange(event2);
  12414. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12415. },
  12416. _clearEvent: function(handler) {
  12417. if (!handler)
  12418. return;
  12419. handler.destroy();
  12420. handler = null;
  12421. }
  12422. });
  12423. Object.assign(SketchViewModel.prototype, {
  12424. _sketchDrawPoint(handler, options2) {
  12425. let _self = this;
  12426. this._registerLeftClickEvent(handler, function(event2) {
  12427. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12428. if (!Cesium.defined(loc2.sLocation))
  12429. return;
  12430. if (_self._isDrawPoint) {
  12431. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12432. }
  12433. _self._clearEvent(handler);
  12434. if (options2.onComplete)
  12435. options2.onComplete(loc2.sLocation, loc2.gLocation);
  12436. });
  12437. },
  12438. _sketchDrawMultiplePoint(handler, options2) {
  12439. let _self = this;
  12440. this._registerLeftClickEvent(handler, function(event2) {
  12441. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12442. if (!Cesium.defined(loc2.sLocation))
  12443. return;
  12444. if (_self._isDrawPoint) {
  12445. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12446. }
  12447. _self._sketchPoints.push(loc2.sLocation);
  12448. _self._sketchOutputPoints.push(loc2.gLocation);
  12449. if (options2.onAdded)
  12450. options2.onAdded(loc2.sLocation, loc2.gLocation);
  12451. });
  12452. this._registerRightClickEvent(handler, function(event2) {
  12453. if (_self._sketchPoints.length > 0) {
  12454. _self._sketchPoints.pop();
  12455. _self._sketchOutputPoints.pop();
  12456. if (options2.onUndo)
  12457. options2.onUndo();
  12458. }
  12459. });
  12460. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12461. _self._clearEvent();
  12462. if (options2.onComplete)
  12463. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12464. });
  12465. },
  12466. _sketchDrawPolyline(handler, options2) {
  12467. let _self = this;
  12468. this._registerLeftClickEvent(handler, function(event2) {
  12469. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12470. if (!Cesium.defined(loc2.sLocation))
  12471. return;
  12472. if (_self._isDrawPoint) {
  12473. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12474. }
  12475. if (_self._sketchTempPoints.length === 0) {
  12476. _self._createTempPolyline();
  12477. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12478. }
  12479. _self._sketchTempPoints.push(loc2.sLocation);
  12480. _self._sketchPoints.push(loc2.sLocation.clone());
  12481. _self._sketchOutputPoints.push(loc2.gLocation);
  12482. if (options2.onAdded)
  12483. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12484. });
  12485. this._registerMouseMoveEvent(handler, function(event2) {
  12486. if (_self._isRuntimeApp())
  12487. return;
  12488. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12489. if (!Cesium.defined(loc2.sLocation))
  12490. return;
  12491. if (Cesium.defined(_self._sketchTempPolyline)) {
  12492. _self._sketchTempPoints.pop();
  12493. _self._sketchTempPoints.push(loc2.sLocation);
  12494. if (options2.onMoving)
  12495. options2.onMoving(loc2.sLocation);
  12496. }
  12497. });
  12498. this._registerRightClickEvent(handler, function(event2) {
  12499. if (_self._sketchTempPoints.length > 2) {
  12500. _self._sketchPoints.pop();
  12501. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12502. if (_self._isDrawPoint) {
  12503. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12504. _self._entities.remove(lastPointEntity);
  12505. _self._pointEntitys.pop();
  12506. }
  12507. if (options2.onUndo)
  12508. options2.onUndo();
  12509. }
  12510. });
  12511. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12512. if (_self._isRuntimeApp())
  12513. return;
  12514. if (_self._sketchPoints.length < 2) {
  12515. if (options2.onError)
  12516. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12517. return;
  12518. }
  12519. _self._removeEntityByObject(_self._sketchTempPolyline);
  12520. _self._createPolyline();
  12521. if (!_self._isRetainDrawPoint)
  12522. _self._removePointEntitys();
  12523. _self._clearEvent(handler);
  12524. if (options2.onComplete)
  12525. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12526. });
  12527. },
  12528. _sketchDrawSpatialPolyline(handler, options2) {
  12529. let _self = this;
  12530. this._registerLeftClickEvent(handler, function(event2) {
  12531. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12532. if (!Cesium.defined(loc2.sLocation))
  12533. return;
  12534. if (_self._isDrawPoint) {
  12535. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12536. }
  12537. if (_self._sketchTempPoints.length === 0) {
  12538. _self._createTempSpatialPolyline();
  12539. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12540. }
  12541. _self._sketchTempPoints.push(loc2.sLocation);
  12542. _self._sketchPoints.push(loc2.sLocation.clone());
  12543. _self._sketchOutputPoints.push(loc2.gLocation);
  12544. if (options2.onAdded)
  12545. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12546. });
  12547. this._registerMouseMoveEvent(handler, function(event2) {
  12548. if (_self._isRuntimeApp())
  12549. return;
  12550. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12551. if (!Cesium.defined(loc2.sLocation))
  12552. return;
  12553. if (Cesium.defined(_self._sketchTempSpatialPolyline)) {
  12554. _self._sketchTempPoints.pop();
  12555. _self._sketchTempPoints.push(loc2.sLocation);
  12556. if (options2.onMoving)
  12557. options2.onMoving(loc2.sLocation);
  12558. }
  12559. });
  12560. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12561. if (_self._isRuntimeApp())
  12562. return;
  12563. if (_self._sketchPoints.length < 2) {
  12564. if (options2.onError)
  12565. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12566. return;
  12567. }
  12568. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12569. _self._createSpatialPolyline();
  12570. _self._removePointEntitys();
  12571. _self._clearEvent(handler);
  12572. if (options2.onComplete)
  12573. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12574. });
  12575. this._registerRightClickEvent(handler, function(event2) {
  12576. if (_self._sketchTempPoints.length > 2) {
  12577. _self._sketchPoints.pop();
  12578. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12579. if (options2.onUndo)
  12580. options2.onUndo();
  12581. }
  12582. });
  12583. },
  12584. _sketchDrawPolygon(handler, options2) {
  12585. let _self = this;
  12586. this._registerLeftClickEvent(handler, function(event2) {
  12587. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12588. if (!Cesium.defined(loc2.sLocation))
  12589. return;
  12590. if (_self._isDrawPoint) {
  12591. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12592. }
  12593. if (_self._sketchTempPoints.length === 0) {
  12594. _self._createTempPolygon();
  12595. _self._createTempPolyline();
  12596. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12597. }
  12598. _self._sketchTempPoints.push(loc2.sLocation);
  12599. _self._sketchPoints.push(loc2.sLocation.clone());
  12600. _self._sketchOutputPoints.push(loc2.gLocation);
  12601. if (options2.onAdded)
  12602. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12603. });
  12604. this._registerMouseMoveEvent(handler, function(event2) {
  12605. if (_self._isRuntimeApp())
  12606. return;
  12607. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12608. if (!Cesium.defined(loc2.sLocation))
  12609. return;
  12610. if (Cesium.defined(_self._sketchTempPolygon)) {
  12611. _self._sketchTempPoints.pop();
  12612. _self._sketchTempPoints.push(loc2.sLocation);
  12613. if (options2.onMoving)
  12614. options2.onMoving(loc2.sLocation);
  12615. }
  12616. });
  12617. this._registerRightClickEvent(handler, function(event2) {
  12618. if (_self._sketchTempPoints.length > 2) {
  12619. _self._sketchPoints.pop();
  12620. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12621. if (_self._isDrawPoint) {
  12622. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12623. _self._entities.remove(lastPointEntity);
  12624. _self._pointEntitys.pop();
  12625. }
  12626. if (options2.onUndo)
  12627. options2.onUndo();
  12628. }
  12629. });
  12630. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12631. if (_self._isRuntimeApp())
  12632. return;
  12633. if (_self._sketchPoints.length < 3) {
  12634. if (options2.onError)
  12635. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12636. return;
  12637. }
  12638. _self._removeEntityByObject(_self._sketchTempPolygon);
  12639. _self._removeEntityByObject(_self._sketchTempPolyline);
  12640. _self._createPolygon();
  12641. if (!_self._isRetainDrawPoint)
  12642. _self._removePointEntitys();
  12643. _self._clearEvent(handler);
  12644. if (options2.onComplete)
  12645. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12646. });
  12647. },
  12648. _sketchDrawCircle: function(handler, options2) {
  12649. let _self = this;
  12650. this._registerLeftClickEvent(handler, function(event2) {
  12651. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12652. if (!Cesium.defined(loc2.sLocation))
  12653. return;
  12654. if (_self._sketchTempPoints.length === 0) {
  12655. if (_self._isDrawPoint) {
  12656. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12657. }
  12658. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12659. _self._sketchTempPoints.push(loc2.sLocation);
  12660. _self._sketchPoints.push(loc2.sLocation.clone());
  12661. _self._sketchOutputPoints.push(loc2.gLocation);
  12662. _self._createTempCircle(loc2.sLocation);
  12663. if (options2.onAdded)
  12664. options2.onAdded(loc2.sLocation);
  12665. } else {
  12666. if (_self._isRuntimeApp()) {
  12667. _self._sketchTempPoints.pop();
  12668. _self._sketchTempPoints.push(loc2.sLocation);
  12669. let positionCenter = _self._sketchEllipseCenterPosition;
  12670. let positionRotate = _self._sketchTempPoints[1];
  12671. _self._ellipseOutlineCoordinates = [];
  12672. for (let angle = 5; angle < 360; ) {
  12673. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  12674. _self._ellipseOutlineCoordinates.push(newPosition);
  12675. angle = angle + 5;
  12676. }
  12677. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  12678. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12679. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12680. let geodesic = new Cesium.EllipsoidGeodesic();
  12681. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12682. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12683. if (_self._sketchEllipseRadius <= 0)
  12684. _self._sketchEllipseRadius = 1;
  12685. }
  12686. _self._removePointEntitys();
  12687. _self._removeEntityByObject(_self._sketchTempCircle);
  12688. _self._createCircle();
  12689. _self._clearEvent(handler);
  12690. if (options2.onComplete)
  12691. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  12692. }
  12693. });
  12694. this._registerMouseMoveEvent(handler, function(event2) {
  12695. if (_self._isRuntimeApp())
  12696. return;
  12697. if (!Cesium.defined(_self._sketchTempCircle))
  12698. return;
  12699. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12700. if (cartesian == void 0)
  12701. return;
  12702. _self._sketchTempPoints.pop();
  12703. _self._sketchTempPoints.push(cartesian);
  12704. });
  12705. },
  12706. _sketchDrawHeightPolyline: function(handler, options2) {
  12707. let _self = this;
  12708. this._registerLeftClickEvent(handler, function(event2) {
  12709. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12710. if (!Cesium.defined(loc2.sLocation))
  12711. return;
  12712. if (_self._sketchTempPoints.length === 0) {
  12713. if (_self._isDrawPoint) {
  12714. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12715. }
  12716. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12717. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12718. _self._sketchTempPoints.push(loc2.sLocation);
  12719. _self._sketchPoints.push(loc2.sLocation.clone());
  12720. if (options2.onAdded)
  12721. options2.onAdded(loc2.sLocation);
  12722. } else {
  12723. if (_self._isRuntimeApp()) {
  12724. _self._sketchTempPoints.pop();
  12725. _self._sketchTempPoints.push(loc2.sLocation);
  12726. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12727. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12728. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12729. _self._sketchAltitudePolylinePostions = [];
  12730. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  12731. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12732. _self._sketchAltitudePolylinePostions.push(point_temp);
  12733. let geodesic = new Cesium.EllipsoidGeodesic();
  12734. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12735. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12736. if (_self._sketchEllipseRadius <= 0)
  12737. _self._sketchEllipseRadius = 1;
  12738. let height_temp = point2cartographic.height - point1cartographic.height;
  12739. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  12740. }
  12741. _self._removePointEntitys();
  12742. _self._removeEntityByObject(_self._sketchTempAltituePolyline);
  12743. _self._createAltitudePolyline();
  12744. _self._clearEvent(handler);
  12745. if (options2.onComplete) {
  12746. options2.onComplete(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12747. }
  12748. }
  12749. });
  12750. this._registerMouseMoveEvent(handler, function(event2) {
  12751. if (_self._isRuntimeApp())
  12752. return;
  12753. if (_self._sketchTempPoints == void 0 || _self._sketchTempPoints.length == 0)
  12754. return;
  12755. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12756. if (cartesian == void 0)
  12757. return;
  12758. if (_self._sketchTempPoints.length >= 2) {
  12759. if (!Cesium.defined(_self._sketchTempAltituePolyline)) {
  12760. _self._createTempAltitudePolyline();
  12761. } else {
  12762. _self._sketchTempPoints.pop();
  12763. _self._sketchTempPoints.push(cartesian);
  12764. }
  12765. if (options2.onMoving) {
  12766. options2.onMoving(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12767. }
  12768. }
  12769. });
  12770. },
  12771. _sketchDrawRectangle: function(handler, options2) {
  12772. let _self = this;
  12773. this._registerLeftClickEvent(handler, function(event2) {
  12774. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12775. if (!Cesium.defined(loc2.sLocation))
  12776. return;
  12777. if (_self._sketchTempPoints.length === 0) {
  12778. if (_self._isDrawPoint) {
  12779. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12780. }
  12781. _self._sketchTempPoints.push(loc2.gLocation);
  12782. _self._sketchTempPoints.push(loc2.gLocation);
  12783. _self._sketchPoints.push(loc2.gLocation);
  12784. _self._createTempRectangle();
  12785. if (options2.onAdded)
  12786. options2.onAdded(loc2.sLocation);
  12787. } else {
  12788. if (_self._isRuntimeApp()) {
  12789. _self._sketchTempPoints.pop();
  12790. _self._sketchTempPoints.push(loc2.gLocation);
  12791. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  12792. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  12793. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  12794. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  12795. _self._rectangleCoordinates = [0, 0, 1, 1];
  12796. if (lng0 < lng1) {
  12797. _self._rectangleCoordinates[0] = lng0;
  12798. _self._rectangleCoordinates[2] = lng1;
  12799. } else {
  12800. _self._rectangleCoordinates[0] = lng1;
  12801. _self._rectangleCoordinates[2] = lng0;
  12802. }
  12803. if (lat0 < lat1) {
  12804. _self._rectangleCoordinates[1] = lat0;
  12805. _self._rectangleCoordinates[3] = lat1;
  12806. } else {
  12807. _self._rectangleCoordinates[1] = lat1;
  12808. _self._rectangleCoordinates[3] = lat0;
  12809. }
  12810. let rectangle = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  12811. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  12812. _self._rectangleOutlineCoordinates = res.cPoints;
  12813. _self._sketchOutputPoints = res.gPoints;
  12814. }
  12815. _self._removePointEntitys();
  12816. _self._removeEntityByObject(_self._sketchTempRectangle);
  12817. _self._createRectangle();
  12818. handler.destroy();
  12819. handler = null;
  12820. if (options2.onComplete)
  12821. options2.onComplete(_self._sketchOutputPoints);
  12822. }
  12823. });
  12824. this._registerMouseMoveEvent(handler, function(event2) {
  12825. if (_self._isRuntimeApp())
  12826. return;
  12827. if (!Cesium.defined(_self._sketchTempRectangle))
  12828. return;
  12829. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12830. if (!Cesium.defined(loc2.sLocation))
  12831. return;
  12832. _self._sketchTempPoints.pop();
  12833. _self._sketchTempPoints.push(loc2.gLocation);
  12834. });
  12835. },
  12836. _sketchDrawTriangle: function(handler, options2) {
  12837. let _self = this;
  12838. handler.setInputAction(function(event2) {
  12839. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12840. return;
  12841. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12842. if (!Cesium.defined(loc2.sLocation))
  12843. return;
  12844. if (_self._sketchPoints.length == 0) {
  12845. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12846. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12847. _self._sketchTempPoints.push(loc2.sLocation);
  12848. _self._sketchPoints.push(loc2.sLocation);
  12849. _self._createTempPolyline();
  12850. } else if (_self._sketchPoints.length === 1) {
  12851. _self._createPoint(loc2.sLocation, "\u9AD8\u5EA6\u8D77\u70B9");
  12852. _self._entities.remove(_self._sketchTempPolyline);
  12853. _self._sketchPoints.push(loc2.sLocation);
  12854. _self._createPolyline();
  12855. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12856. _self._sketchPoints.push(loc2.sLocation);
  12857. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12858. _self._createTempTriangleAltitudePolylineAndSpatialPolyline();
  12859. }
  12860. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12861. handler.setInputAction(function(event2) {
  12862. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12863. return;
  12864. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12865. if (cartesian == void 0)
  12866. return;
  12867. _self._sketchTempPoints.pop();
  12868. _self._sketchTempPoints.push(cartesian);
  12869. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12870. handler.setInputAction(function(event2) {
  12871. if (_self._sketchPoints.length < 2) {
  12872. if (options2.onError)
  12873. options2.onError("\u7ED8\u5236\u56FE\u5F62\u4E0D\u5B8C\u6574\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12874. return;
  12875. }
  12876. _self._removePointEntitys();
  12877. _self._removeEntityByObject(_self._sketchTempTriangleAltitudePolyline);
  12878. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12879. _self._createAltitudePolyline();
  12880. _self._createTriangleSpatialPolyline();
  12881. handler.destroy();
  12882. handler = null;
  12883. options2.onComplete(
  12884. _self._sketchPoints,
  12885. _self._sketchTriangleSpatialPolylinePositions,
  12886. _self._sketchAltitudePolylinePostions,
  12887. _self._sketchEllipseCenterPosition
  12888. );
  12889. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12890. },
  12891. _sketchDrawPolygonBody(handler, options2) {
  12892. let _self = this;
  12893. this._registerLeftClickEvent(handler, function(event2) {
  12894. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12895. if (!Cesium.defined(loc2.sLocation))
  12896. return;
  12897. if (_self._isDrawPoint) {
  12898. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12899. }
  12900. if (_self._sketchTempPoints.length === 0) {
  12901. _self._createTempPolygon();
  12902. _self._createTempPolyline();
  12903. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12904. }
  12905. _self._sketchTempPoints.push(loc2.sLocation);
  12906. _self._sketchPoints.push(loc2.sLocation.clone());
  12907. _self._sketchOutputPoints.push(loc2.gLocation);
  12908. if (options2.onAdded)
  12909. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12910. });
  12911. this._registerMouseMoveEvent(handler, function(event2) {
  12912. if (_self._isRuntimeApp())
  12913. return;
  12914. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12915. if (!Cesium.defined(loc2.sLocation))
  12916. return;
  12917. if (Cesium.defined(_self._sketchTempPolygon)) {
  12918. _self._sketchTempPoints.pop();
  12919. _self._sketchTempPoints.push(loc2.sLocation);
  12920. if (options2.onMoving)
  12921. options2.onMoving(loc2.sLocation);
  12922. }
  12923. });
  12924. this._registerRightClickEvent(handler, function(event2) {
  12925. if (_self._sketchTempPoints.length > 2) {
  12926. _self._sketchPoints.pop();
  12927. _self._sketchOutputPoints.pop();
  12928. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12929. if (options2.onUndo)
  12930. options2.onUndo(_self._sketchPoints);
  12931. }
  12932. });
  12933. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12934. if (_self._isRuntimeApp())
  12935. return;
  12936. if (_self._sketchPoints.length < 3) {
  12937. if (options2.onError)
  12938. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12939. return;
  12940. }
  12941. _self._removeEntityByObject(_self._sketchTempPolygon);
  12942. _self._removeEntityByObject(_self._sketchTempPolyline);
  12943. _self._createPolygonBody({
  12944. height: 30,
  12945. color: [255, 255, 0, 0.9]
  12946. });
  12947. _self._removePointEntitys();
  12948. _self._clearEvent(handler);
  12949. if (options2.onComplete)
  12950. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12951. });
  12952. },
  12953. _sketchDrawTriangleA: function(handler, options2) {
  12954. let _self = this;
  12955. this._registerLeftClickEvent(handler, function(event2) {
  12956. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12957. return;
  12958. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12959. if (!Cesium.defined(loc2.sLocation))
  12960. return;
  12961. if (_self._sketchPoints.length == 0) {
  12962. if (_self._isDrawPoint) {
  12963. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12964. }
  12965. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12966. _self._sketchTempPoints.push(loc2.sLocation);
  12967. _self._sketchPoints.push(loc2.sLocation);
  12968. _self._createTempSpatialTriangle();
  12969. if (options2.onAdded)
  12970. options2.onAdded(loc2.sLocation);
  12971. } else if (_self._sketchPoints.length > 0) {
  12972. if (_self._isRuntimeApp()) {
  12973. _self._sketchTempPoints.pop();
  12974. _self._sketchTempPoints.push(loc2.sLocation);
  12975. _self._sketchSpatialTrianglePositions = [];
  12976. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12977. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12978. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12979. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12980. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12981. _self._sketchSpatialTrianglePositions.push(point_temp);
  12982. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12983. }
  12984. _self._removePointEntitys();
  12985. _self._removeEntityByObject(_self._sketchTempSpatialTriangle);
  12986. _self._createSpatialTriangle();
  12987. _self._clearEvent(handler);
  12988. if (options2.onComplete)
  12989. options2.onComplete(_self._sketchSpatialTrianglePositions);
  12990. }
  12991. });
  12992. this._registerMouseMoveEvent(handler, function(event2) {
  12993. if (_self._isRuntimeApp())
  12994. return;
  12995. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12996. return;
  12997. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12998. if (cartesian == void 0)
  12999. return;
  13000. _self._sketchTempPoints.pop();
  13001. _self._sketchTempPoints.push(cartesian);
  13002. if (options2.onMoving)
  13003. options2.onMoving(cartesian);
  13004. });
  13005. },
  13006. sketchTools: function(toolsType, options2) {
  13007. let _self = this;
  13008. this._clear();
  13009. _self._sketchEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  13010. switch (toolsType) {
  13011. case SketchViewModel.SketchType.Point:
  13012. _self._sketchDrawPoint(_self._sketchEventHandler, options2);
  13013. break;
  13014. case SketchViewModel.SketchType.Line:
  13015. _self._sketchDrawPolyline(_self._sketchEventHandler, options2);
  13016. break;
  13017. case SketchViewModel.SketchType.Polygon:
  13018. _self._sketchDrawPolygon(_self._sketchEventHandler, options2);
  13019. break;
  13020. case SketchViewModel.SketchType.Height:
  13021. _self._sketchDrawHeightPolyline(_self._sketchEventHandler, options2);
  13022. break;
  13023. case SketchViewModel.SketchType.Spatial:
  13024. _self._sketchDrawSpatialPolyline(_self._sketchEventHandler, options2);
  13025. break;
  13026. case SketchViewModel.SketchType.Circle:
  13027. _self._sketchDrawCircle(_self._sketchEventHandler, options2);
  13028. break;
  13029. case SketchViewModel.SketchType.Rectangle:
  13030. _self._sketchDrawRectangle(_self._sketchEventHandler, options2);
  13031. break;
  13032. case SketchViewModel.SketchType.Triangle:
  13033. _self._sketchDrawTriangleA(_self._sketchEventHandler, options2);
  13034. break;
  13035. case SketchViewModel.SketchType.PolygonBody:
  13036. _self._sketchDrawPolygonBody(_self._sketchEventHandler, options2);
  13037. break;
  13038. case SketchViewModel.SketchType.MultiplePoint:
  13039. _self._sketchDrawMultiplePoint(_self._sketchEventHandler, options2);
  13040. break;
  13041. }
  13042. },
  13043. sketchDrawFeacture: function(points2, type2, options2) {
  13044. let _self = this;
  13045. if (points2 === void 0 || points2.length === void 0 || points2.length < 2) {
  13046. if (options2 && options2.onError)
  13047. options2.onError("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  13048. return;
  13049. }
  13050. this._sketchPoints = [];
  13051. for (let i2 = 0; i2 < points2.length; ) {
  13052. this._sketchPoints.push(Cesium.Cartesian3.fromDegrees(points2[i2], points2[i2 + 1], points2[i2 + 2]));
  13053. i2 = i2 + 3;
  13054. }
  13055. switch (type2) {
  13056. case SketchViewModel.SketchType.DrawPoint:
  13057. _self._createPoint(_self._sketchPoints[0], _self._lineLabel);
  13058. if (options2 && options2.onComplete)
  13059. options2.onComplete(_self._pointEntitys);
  13060. break;
  13061. case SketchViewModel.SketchType.DrawMultiplePoint:
  13062. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  13063. _self._createPoint(_self._sketchPoints[i2], _self._lineLabel);
  13064. }
  13065. if (options2 && options2.onComplete)
  13066. options2.onComplete(_self._pointEntitys);
  13067. break;
  13068. case SketchViewModel.SketchType.DrawPolyline:
  13069. if (_self._sketchPoints.length < 2) {
  13070. if (options2 && options2.onError)
  13071. options2.onError("\u70B9\u6570\u5C11\u4E8E2\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13072. } else {
  13073. _self._createPolyline();
  13074. if (options2 && options2.onComplete)
  13075. options2.onComplete(_self._sketchPolyline);
  13076. }
  13077. break;
  13078. case SketchViewModel.SketchType.DrawPolygon:
  13079. if (_self._sketchPoints.length < 3) {
  13080. if (options2 && options2.onError)
  13081. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13082. } else {
  13083. _self._createPolygon();
  13084. if (options2 && options2.onComplete)
  13085. options2.onComplete(_self._sketchPolygon);
  13086. }
  13087. break;
  13088. default:
  13089. if (options2 && options2.onError)
  13090. options2.onError("\u7ED8\u5236\u7C7B\u578B\u5F02\u5E38\uFF01");
  13091. break;
  13092. }
  13093. },
  13094. sketchClear: function() {
  13095. this._clear(true);
  13096. this._clearEvent(this._sketchEventHandler);
  13097. },
  13098. sketchInit: function() {
  13099. this._clear(false);
  13100. }
  13101. });
  13102. Object.assign(SketchViewModel.prototype, {
  13103. _checkColor: function(color2) {
  13104. if (color2 === void 0 || color2 === null)
  13105. return false;
  13106. if (typeof color2 != "number")
  13107. return false;
  13108. let intColor = parseInt(color2);
  13109. if (intColor < 0 || intColor > 255)
  13110. return false;
  13111. return true;
  13112. },
  13113. _checkAlpha: function(alpha) {
  13114. if (alpha === void 0 || alpha === null)
  13115. return false;
  13116. if (typeof alpha != "number")
  13117. return false;
  13118. let floatAlpha = parseFloat(alpha);
  13119. if (floatAlpha < 0 || floatAlpha > 1)
  13120. return false;
  13121. return true;
  13122. },
  13123. _checkColorAndAlpha: function(colorAndAlpah) {
  13124. let setColor = void 0;
  13125. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  13126. return void 0;
  13127. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  13128. setColor = [colorAndAlpah[0], 0, 0, 1];
  13129. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13130. colorAndAlpah[1]
  13131. )) {
  13132. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  13133. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13134. colorAndAlpah[1]
  13135. ) && this._checkColor(colorAndAlpah[2])) {
  13136. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  13137. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13138. colorAndAlpah[1]
  13139. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  13140. colorAndAlpah[3]
  13141. )) {
  13142. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  13143. }
  13144. return setColor;
  13145. },
  13146. sketchEditPickPolygonBody: function(options2) {
  13147. let _self = this;
  13148. let primitive = _self._sketchPickPolygonBody;
  13149. if (primitive === void 0) {
  13150. if (options2.onComplete)
  13151. options2.onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13152. return;
  13153. }
  13154. let color2 = primitive._useGeometry.color;
  13155. let height2 = primitive._useGeometry.height;
  13156. this._sketchPoints = primitive._useGeometry.cPoints;
  13157. this._sketchOutputPoints = primitive._useGeometry.gPoints;
  13158. if (options2 && options2.height && typeof options2.height === "number")
  13159. height2 = parseInt(options2.height);
  13160. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  13161. color2 = this._checkColorAndAlpha(options2.color);
  13162. this._viewer.scene.primitives.remove(primitive);
  13163. this._createPolygonBody({
  13164. color: color2,
  13165. height: height2
  13166. });
  13167. if (options2.onComplete)
  13168. options2.onComplete(void 0);
  13169. },
  13170. sketchRemovePickPolygonBody: function(onComplete) {
  13171. let _self = this;
  13172. let primitive = _self._sketchPickPolygonBody;
  13173. if (primitive === void 0) {
  13174. if (onComplete)
  13175. onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13176. return;
  13177. }
  13178. this._viewer.scene.primitives.remove(primitive);
  13179. if (onComplete)
  13180. onComplete(void 0);
  13181. },
  13182. sketchPick: function(onComplete) {
  13183. let _self = this;
  13184. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  13185. handler.setInputAction(function(event2) {
  13186. let pickObj = _self._viewer.scene.pick(event2.position);
  13187. if (pickObj && pickObj.primitive && pickObj.primitive._useGeometry != void 0) {
  13188. _self._sketchPickPolygonBody = pickObj.primitive;
  13189. if (onComplete)
  13190. onComplete({
  13191. color: pickObj.primitive._useGeometry.color,
  13192. height: pickObj.primitive._useGeometry.height
  13193. });
  13194. } else {
  13195. _self._sketchPickPolygonBody = void 0;
  13196. if (onComplete)
  13197. onComplete(void 0);
  13198. }
  13199. handler.destroy();
  13200. handler = null;
  13201. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  13202. }
  13203. });
  13204. SketchViewModel.SketchType = Object.freeze({
  13205. Point: "point",
  13206. MultiplePoint: "multiplePoint",
  13207. Line: "line",
  13208. Polygon: "polygon",
  13209. Height: "height",
  13210. Spatial: "spatial",
  13211. Circle: "circle",
  13212. Rectangle: "rectangle",
  13213. Triangle: "triangle",
  13214. PolygonBody: "polygonBody",
  13215. DrawPoint: "drawPoint",
  13216. DrawMultiplePoint: "drawMultiplePoint",
  13217. DrawPolyline: "drawPolyline",
  13218. DrawPolygon: "drawPolygon"
  13219. });
  13220. SketchViewModel.SketchIconType = Object.freeze({
  13221. Normal: "normal",
  13222. Blue: "blue",
  13223. Green: "green",
  13224. Violet: "violter"
  13225. });
  13226. SketchViewModel.RuntimeEnvironment = Object.freeze({
  13227. App: "app",
  13228. Web: "web"
  13229. });
  13230. class CommonTools {
  13231. constructor(viewer2, options2) {
  13232. this._viewer = viewer2;
  13233. options2 = options2 || {};
  13234. if (options2.isDrawPoint) {
  13235. this._isDrawPoint = options2.isDrawPoint;
  13236. } else {
  13237. this._isDrawPoint = false;
  13238. }
  13239. if (options2.isRetainDrawPoint) {
  13240. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  13241. } else {
  13242. this._isRetainDrawPoint = false;
  13243. }
  13244. if (options2.isClear) {
  13245. this._isClear = options2.isClear;
  13246. } else {
  13247. this._isClear = false;
  13248. }
  13249. this._sketchViewModel = new SketchViewModel(viewer2, {
  13250. iconType: SketchViewModel.SketchIconType.Blue,
  13251. isDrawPoint: this._isDrawPoint,
  13252. isRetainDrawPoint: this._isRetainDrawPoint
  13253. });
  13254. let buttonDiv = document.getElementById("drawButtonDiv");
  13255. if (buttonDiv) {
  13256. document.body.removeChild(buttonDiv);
  13257. }
  13258. this._init();
  13259. }
  13260. _init() {
  13261. this._measureEntityName = "MeasureEntity";
  13262. this._entities = this._viewer.entities;
  13263. this._measurePointImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  13264. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  13265. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  13266. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  13267. this._measureTempPoints = [];
  13268. }
  13269. _updateScene() {
  13270. this._viewer.scene.requestRender();
  13271. }
  13272. _removeEntityByName(entityName) {
  13273. let entities2 = this._entities;
  13274. if (!entities2 || !entities2.values)
  13275. return;
  13276. let delEntitys = [];
  13277. for (let i2 = 0; i2 < entities2.values.length; i2++) {
  13278. if (entities2.values[i2].name == entityName) {
  13279. delEntitys.push(entities2.values[i2]);
  13280. }
  13281. }
  13282. for (let i2 = 0; i2 < delEntitys.length; i2++) {
  13283. entities2.remove(delEntitys[i2]);
  13284. }
  13285. this._updateScene();
  13286. }
  13287. _clear(isAll) {
  13288. if (isAll != void 0 && isAll === true) {
  13289. this._removeEntityByName(this._measureEntityName);
  13290. if (this._sketchViewModel != void 0) {
  13291. this._sketchViewModel.sketchClear();
  13292. }
  13293. }
  13294. this._measureTempPoints = [];
  13295. this._altitudeDynamicLabel = void 0;
  13296. this._tooltipRemove();
  13297. let buttonDiv = document.getElementById("drawButtonDiv");
  13298. if (buttonDiv) {
  13299. document.body.removeChild(buttonDiv);
  13300. }
  13301. }
  13302. _toColor(red, green, blue, alpha) {
  13303. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  13304. }
  13305. _cartesianToGeography(cartesian) {
  13306. let ellipsoid = Cesium.Ellipsoid.WGS84;
  13307. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  13308. let latitude = Cesium.Math.toDegrees(cartographic.latitude);
  13309. let longitude = Cesium.Math.toDegrees(cartographic.longitude);
  13310. let altitude = cartographic.height;
  13311. return {
  13312. lon: longitude,
  13313. lat: latitude,
  13314. hei: altitude
  13315. };
  13316. }
  13317. _createPoint(coord, label2) {
  13318. let _self = this;
  13319. let entity = new Cesium.Entity({
  13320. name: _self._measureEntityName,
  13321. position: coord,
  13322. billboard: {
  13323. image: _self._iconBlue,
  13324. horizontalOrigin: Cesium.HorizontalOrigin.center,
  13325. verticalOrigin: Cesium.VerticalOrigin.bottom,
  13326. scale: 0.5,
  13327. pixelOffset: new Cesium.Cartesian2(0, -11),
  13328. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13329. }
  13330. });
  13331. if (label2) {
  13332. entity.label = {
  13333. text: label2,
  13334. font: "30px SimHei",
  13335. scale: 0.5,
  13336. fillColor: this._toColor(255, 255, 255, 1),
  13337. outlineColor: this._toColor(14, 30, 79, 1),
  13338. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13339. outlineWidth: 2,
  13340. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13341. showBackground: true,
  13342. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13343. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13344. pixelOffset: new Cesium.Cartesian2(0, -28)
  13345. };
  13346. }
  13347. this._entities.add(entity);
  13348. this._updateScene();
  13349. return entity;
  13350. }
  13351. _createLabel(coord, label2) {
  13352. let _self = this;
  13353. let entity = new Cesium.Entity({
  13354. name: _self._measureEntityName,
  13355. position: coord,
  13356. label: {
  13357. text: label2,
  13358. font: "30px SimHei",
  13359. scale: 0.5,
  13360. fillColor: this._toColor(255, 255, 255, 1),
  13361. outlineColor: this._toColor(14, 30, 79, 1),
  13362. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13363. outlineWidth: 2,
  13364. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13365. showBackground: true,
  13366. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13367. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13368. pixelOffset: new Cesium.Cartesian2(0, -14)
  13369. }
  13370. });
  13371. this._entities.add(entity);
  13372. this._updateScene();
  13373. }
  13374. _createAltitudeDynamicLabel() {
  13375. let _self = this;
  13376. this._altitudeDynamicLabel = new Cesium.Entity({
  13377. name: _self._measureEntityName,
  13378. position: new Cesium.CallbackProperty(function() {
  13379. return _self._altitudeLabelPosition;
  13380. }, false),
  13381. label: {
  13382. text: new Cesium.CallbackProperty(function() {
  13383. return _self._altitudeLabelText;
  13384. }, false),
  13385. font: "12px sans-serif",
  13386. fillColor: this._toColor(255, 255, 255, 1),
  13387. outlineColor: this._toColor(0, 154, 94, 1),
  13388. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13389. outlineWidth: 1,
  13390. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13391. pixelOffset: new Cesium.Cartesian2(0, -28),
  13392. showBackground: true,
  13393. backgroundColor: this._toColor(0, 0, 0, 0.6),
  13394. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13395. }
  13396. });
  13397. this._entities.add(this._altitudeDynamicLabel);
  13398. this._updateScene();
  13399. }
  13400. _measureDistance(positions) {
  13401. let distance2 = 0;
  13402. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13403. let point1cartographic = Cesium.Cartographic.fromCartesian(positions[i2]);
  13404. let point2cartographic = Cesium.Cartographic.fromCartesian(positions[i2 + 1]);
  13405. let geodesic = new Cesium.EllipsoidGeodesic();
  13406. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13407. let s = geodesic.surfaceDistance;
  13408. s = Math.sqrt(Math.pow(s, 2) + Math.pow(
  13409. point2cartographic.height - point1cartographic.height,
  13410. 2
  13411. ));
  13412. distance2 = distance2 + s;
  13413. }
  13414. if (distance2 < 1e3)
  13415. return distance2.toFixed(2) + "\u7C73";
  13416. else
  13417. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13418. }
  13419. _measureSpaceDistance(positions) {
  13420. let distance2 = 0;
  13421. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13422. let point1 = positions[i2];
  13423. let point2 = positions[i2 + 1];
  13424. let sx = Math.abs(point1.x - point2.x);
  13425. let sy = Math.abs(point1.y - point2.y);
  13426. let sz = Math.abs(point1.z - point2.z);
  13427. let s = Math.sqrt(Math.pow(sx, 2) + Math.pow(sy, 2) + Math.pow(sz, 2));
  13428. distance2 = distance2 + s;
  13429. }
  13430. if (distance2 < 1e3)
  13431. return distance2.toFixed(2) + "\u7C73";
  13432. else
  13433. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13434. }
  13435. _measureAreaBearing(from3, to) {
  13436. let radiansPerDegree = Math.PI / 180;
  13437. let degreesPerRadian = 180 / Math.PI;
  13438. let lat1 = from3.lat * radiansPerDegree;
  13439. let lon1 = from3.lon * radiansPerDegree;
  13440. let lat2 = to.lat * radiansPerDegree;
  13441. let lon2 = to.lon * radiansPerDegree;
  13442. let angle = -Math.atan2(Math.sin(lon1 - lon2) * Math.cos(lat2), Math.cos(lat1) * Math.sin(
  13443. lat2
  13444. ) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2));
  13445. if (angle < 0) {
  13446. angle += Math.PI * 2;
  13447. }
  13448. angle = angle * degreesPerRadian;
  13449. return angle;
  13450. }
  13451. _calculateAreaAngle(p1, p2, p3) {
  13452. let bearing21 = this._measureAreaBearing(p2, p1);
  13453. let bearing23 = this._measureAreaBearing(p2, p3);
  13454. let angle = bearing21 - bearing23;
  13455. if (angle < 0) {
  13456. angle += 360;
  13457. }
  13458. return angle;
  13459. }
  13460. _calculateDistance(point1, point2) {
  13461. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  13462. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  13463. let geodesic = new Cesium.EllipsoidGeodesic();
  13464. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13465. let s = geodesic.surfaceDistance;
  13466. s = Math.sqrt(Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2));
  13467. return s;
  13468. }
  13469. _measureArea(points2, cartesianPoints) {
  13470. let self2 = this;
  13471. let res = 0;
  13472. for (let i2 = 0; i2 < points2.length - 2; i2++) {
  13473. let j = (i2 + 1) % points2.length;
  13474. let k = (i2 + 2) % points2.length;
  13475. let totalAngle = self2._calculateAreaAngle(points2[i2], points2[j], points2[k]);
  13476. let dis_temp1 = self2._calculateDistance(cartesianPoints[i2], cartesianPoints[j]);
  13477. let dis_temp2 = self2._calculateDistance(cartesianPoints[j], cartesianPoints[k]);
  13478. res += dis_temp1 * dis_temp2 * Math.abs(Math.sin(totalAngle));
  13479. }
  13480. return res;
  13481. }
  13482. _calculatePolylineAltitudeHeight(points2) {
  13483. if (points2 === void 0 || points2.length < 2)
  13484. return -1;
  13485. let cartographic = Cesium.Cartographic.fromCartesian(points2[0]);
  13486. let cartographic1 = Cesium.Cartographic.fromCartesian(points2[1]);
  13487. let height_temp = cartographic1.height - cartographic.height;
  13488. return Math.abs(height_temp).toFixed(2) + "\u7C73";
  13489. }
  13490. _setMousePointerStyle() {
  13491. document.querySelector("body").style.cursor = "crosshair";
  13492. }
  13493. _initMousePointerStyle() {
  13494. document.querySelector("body").style.cursor = "default";
  13495. }
  13496. _checkAppOrWeb() {
  13497. if (window.navigator.userAgent.match(
  13498. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  13499. )) {
  13500. return CommonTools.RuntimeEnvironment.App;
  13501. } else {
  13502. return CommonTools.RuntimeEnvironment.Web;
  13503. }
  13504. }
  13505. _isRuntimeApp() {
  13506. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.App) {
  13507. return true;
  13508. }
  13509. return false;
  13510. }
  13511. _isRuntimeWeb() {
  13512. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.Web) {
  13513. return true;
  13514. }
  13515. return false;
  13516. }
  13517. _createOperationMainDom() {
  13518. let buttonDiv = document.createElement("div");
  13519. buttonDiv.id = "drawButtonDiv";
  13520. buttonDiv.style.width = "80px";
  13521. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  13522. buttonDiv.style.borderRadius = "5px";
  13523. buttonDiv.style.display = "flex";
  13524. buttonDiv.style.flexDirection = "column";
  13525. buttonDiv.style.padding = "8px";
  13526. buttonDiv.style.justifyContent = "center";
  13527. buttonDiv.style.position = "absolute";
  13528. buttonDiv.style.bottom = "150px";
  13529. buttonDiv.style.right = "10px";
  13530. let btnUndo = document.createElement("button");
  13531. btnUndo.id = "btnDrawBackout";
  13532. btnUndo.style.height = "30px";
  13533. btnUndo.style.marginBottom = "8px";
  13534. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  13535. btnUndo.style.color = "rgb(255, 255, 255)";
  13536. btnUndo.style.border = "0px solid red";
  13537. btnUndo.style.borderRadius = "5px";
  13538. btnUndo.innerHTML = "\u56DE\u9000";
  13539. btnUndo.style.fontSize = "13px";
  13540. btnUndo.style.cursor = "pointer";
  13541. buttonDiv.appendChild(btnUndo);
  13542. let btnCompletion = document.createElement("button");
  13543. btnCompletion.id = "btnDrawComplete";
  13544. btnCompletion.style.height = "30px";
  13545. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  13546. btnCompletion.style.color = "rgb(255, 255, 255)";
  13547. btnCompletion.style.border = "0px solid red";
  13548. btnCompletion.style.borderRadius = "5px";
  13549. btnCompletion.innerHTML = "\u5B8C\u6210";
  13550. btnCompletion.style.fontSize = "13px";
  13551. btnCompletion.style.cursor = "pointer";
  13552. buttonDiv.appendChild(btnCompletion);
  13553. document.body.appendChild(buttonDiv);
  13554. }
  13555. _showTooltipMessage(message) {
  13556. let msgMainDom = document.getElementById("messageMainDom");
  13557. if (msgMainDom !== null && msgMainDom !== void 0) {
  13558. document.body.removeChild(msgMainDom);
  13559. }
  13560. msgMainDom = document.createElement("div");
  13561. msgMainDom.style.width = "30%";
  13562. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  13563. msgMainDom.style.height = "45px";
  13564. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  13565. msgMainDom.style.borderRadius = "8px";
  13566. msgMainDom.style.display = "flex";
  13567. msgMainDom.style.alignItems = "center";
  13568. msgMainDom.style.paddingLeft = "10px";
  13569. msgMainDom.style.color = "rgb(91, 188, 48)";
  13570. msgMainDom.style.fontSize = "14px";
  13571. msgMainDom.style.fontWeight = "600";
  13572. msgMainDom.style.position = "absolute";
  13573. msgMainDom.style.left = "35%";
  13574. msgMainDom.style.transition = "transform 1s";
  13575. msgMainDom.style.transform = "translateY(-90px)";
  13576. msgMainDom.style.top = "0px";
  13577. msgMainDom.style.zIndex = 1e3;
  13578. document.body.appendChild(msgMainDom);
  13579. let strHtml = "";
  13580. strHtml += "<div style='";
  13581. strHtml += "background-color: rgb(88, 185, 45);";
  13582. strHtml += "color: rgb(255, 255, 255);";
  13583. strHtml += "height: 24px;";
  13584. strHtml += "width: 24px;";
  13585. strHtml += "border-radius: 20px;";
  13586. strHtml += "display: flex;";
  13587. strHtml += "justify-content: center;";
  13588. strHtml += "align-items: center;";
  13589. strHtml += "font-size: 14px;";
  13590. strHtml += "margin-right: 18px;";
  13591. strHtml += "'>&#10003</div>";
  13592. strHtml += "<div>" + message + "</div>";
  13593. msgMainDom.innerHTML = strHtml;
  13594. msgMainDom.addEventListener("transitionend", function() {
  13595. setTimeout(function() {
  13596. document.body.removeChild(msgMainDom);
  13597. }, 1e3);
  13598. }, false);
  13599. setTimeout(function() {
  13600. msgMainDom.style.transform = "translateY(50px)";
  13601. }, 100);
  13602. }
  13603. }
  13604. Object.assign(CommonTools.prototype, {
  13605. _tooltipInit: function(text) {
  13606. this._tooltipId = "tooltipJt";
  13607. let tooltipObj = document.getElementById(this._tooltipId);
  13608. if (tooltipObj === null) {
  13609. tooltipObj = document.createElement("div");
  13610. tooltipObj.id = this._tooltipId;
  13611. document.body.appendChild(tooltipObj);
  13612. let divStyle = "";
  13613. divStyle += "top: 30px;";
  13614. divStyle += "left: 30px;";
  13615. divStyle += "position: absolute;";
  13616. divStyle += "display: flex;";
  13617. divStyle += "align-items: center;";
  13618. divStyle += "width: 12x0px;";
  13619. divStyle += "height: auto;";
  13620. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  13621. divStyle += "border-radius: 5px;";
  13622. divStyle += "color: rgb(255, 255, 255);";
  13623. divStyle += "font-size: 12px;";
  13624. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  13625. divStyle += "padding: 8px;";
  13626. divStyle += "border:solid 1px rgb(255,0,0);";
  13627. tooltipObj.setAttribute("style", divStyle);
  13628. }
  13629. if (text != void 0)
  13630. tooltipObj.innerHTML = text;
  13631. document.onmousemove = function(event2) {
  13632. tooltipObj.style.left = event2.clientX + 10 + "px";
  13633. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  13634. };
  13635. },
  13636. _tooltipRemove: function() {
  13637. let tooltipObj = document.getElementById(this._tooltipId);
  13638. if (tooltipObj != null) {
  13639. document.body.removeChild(tooltipObj);
  13640. }
  13641. },
  13642. _tooltipSetText: function(text) {
  13643. let tooltipObj = document.getElementById(this._tooltipId);
  13644. if (tooltipObj != null) {
  13645. tooltipObj.innerHTML = text;
  13646. }
  13647. }
  13648. });
  13649. Object.assign(CommonTools.prototype, {
  13650. clear: function() {
  13651. this._clear(true);
  13652. this._initMousePointerStyle();
  13653. }
  13654. });
  13655. Object.assign(CommonTools.prototype, {
  13656. measureLength: function(callError) {
  13657. let _self = this;
  13658. this._tempEntitys = [];
  13659. this._clear(this._isClear);
  13660. this._setMousePointerStyle();
  13661. if (this._isRuntimeApp()) {
  13662. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13663. } else {
  13664. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13665. }
  13666. if (this._isRuntimeWeb()) {
  13667. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13668. onAdded: function(cPoints, gPoints) {
  13669. if (cPoints.length === 1) {
  13670. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13671. } else {
  13672. let distince = _self._measureDistance(cPoints);
  13673. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13674. distince += " +" + _self._measureDistance(tempPoints);
  13675. _self._tempEntitys.push(_self._createPoint(
  13676. cPoints[cPoints.length - 1],
  13677. distince
  13678. ));
  13679. }
  13680. },
  13681. onUndo: function() {
  13682. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13683. _self._tempEntitys.pop();
  13684. },
  13685. onMoving: function(cPoint, scPoint) {
  13686. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13687. },
  13688. onError: function(error) {
  13689. if (callError)
  13690. callError(error);
  13691. },
  13692. onComplete: function(cPoints, gPoints) {
  13693. _self._initMousePointerStyle();
  13694. _self._tooltipRemove();
  13695. }
  13696. });
  13697. } else {
  13698. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13699. onAdded: function(cPoints, gPoints) {
  13700. if (cPoints.length === 1) {
  13701. _self._tooltipRemove();
  13702. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13703. let buttonDiv = document.getElementById("drawButtonDiv");
  13704. if (buttonDiv == null) {
  13705. _self._createOperationMainDom();
  13706. document.getElementById("btnDrawBackout").onclick = () => {
  13707. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13708. _self._sketchViewModel._sketchPoints.pop();
  13709. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13710. if (_self._sketchViewModel._isDrawPoint) {
  13711. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13712. _self._sketchViewModel._entities.remove(lastPointEntity);
  13713. _self._sketchViewModel._pointEntitys.pop();
  13714. }
  13715. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13716. _self._tempEntitys.pop();
  13717. }
  13718. };
  13719. document.getElementById("btnDrawComplete").onclick = () => {
  13720. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13721. if (callError)
  13722. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13723. return;
  13724. }
  13725. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13726. _self._sketchViewModel._createPolyline();
  13727. if (!_self._sketchViewModel._isRetainDrawPoint)
  13728. _self._sketchViewModel._removePointEntitys();
  13729. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13730. _self._initMousePointerStyle();
  13731. _self._tooltipRemove();
  13732. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13733. if (buttonDiv2) {
  13734. document.body.removeChild(buttonDiv2);
  13735. }
  13736. };
  13737. }
  13738. } else {
  13739. let distince = _self._measureDistance(cPoints);
  13740. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13741. distince += " +" + _self._measureDistance(tempPoints);
  13742. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13743. }
  13744. }
  13745. });
  13746. }
  13747. },
  13748. measureSpatialLength: function(callError) {
  13749. let _self = this;
  13750. this._clear(this._isClear);
  13751. this._setMousePointerStyle();
  13752. if (this._isRuntimeApp()) {
  13753. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13754. } else {
  13755. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13756. }
  13757. this._tempEntitys = [];
  13758. if (this._isRuntimeWeb()) {
  13759. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13760. onAdded: function(cPoints, gPoints) {
  13761. if (cPoints.length === 1) {
  13762. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13763. } else {
  13764. let distince = _self._measureSpaceDistance(cPoints);
  13765. _self._tempEntitys.push(_self._createPoint(
  13766. cPoints[cPoints.length - 1],
  13767. distince
  13768. ));
  13769. }
  13770. },
  13771. onUndo: function() {
  13772. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13773. _self._tempEntitys.pop();
  13774. },
  13775. onMoving: function(cPoint, scPoint) {
  13776. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13777. },
  13778. onError: function(error) {
  13779. if (callError)
  13780. callError(error);
  13781. },
  13782. onComplete: function(cPoints, gPoints) {
  13783. _self._initMousePointerStyle();
  13784. _self._tooltipRemove();
  13785. }
  13786. });
  13787. } else {
  13788. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13789. onAdded: function(cPoints, gPoints) {
  13790. if (cPoints.length === 1) {
  13791. _self._tooltipRemove();
  13792. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13793. let buttonDiv = document.getElementById("drawButtonDiv");
  13794. if (buttonDiv == null) {
  13795. _self._createOperationMainDom();
  13796. document.getElementById("btnDrawBackout").onclick = () => {
  13797. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13798. _self._sketchViewModel._sketchPoints.pop();
  13799. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13800. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13801. _self._tempEntitys.pop();
  13802. }
  13803. };
  13804. document.getElementById("btnDrawComplete").onclick = () => {
  13805. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13806. if (callError)
  13807. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13808. return;
  13809. }
  13810. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempSpatialPolyline);
  13811. _self._sketchViewModel._createSpatialPolyline();
  13812. _self._sketchViewModel._removePointEntitys();
  13813. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13814. _self._initMousePointerStyle();
  13815. _self._tooltipRemove();
  13816. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13817. if (buttonDiv2) {
  13818. document.body.removeChild(buttonDiv2);
  13819. }
  13820. };
  13821. }
  13822. } else {
  13823. let distince = _self._measureSpaceDistance(cPoints);
  13824. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13825. }
  13826. }
  13827. });
  13828. }
  13829. },
  13830. measureArea: function(callError) {
  13831. let _self = this;
  13832. this._clear(this._isClear);
  13833. this._setMousePointerStyle();
  13834. if (this._isRuntimeApp()) {
  13835. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13836. } else {
  13837. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13838. }
  13839. var _areaLabel = "";
  13840. if (this._isRuntimeWeb()) {
  13841. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13842. onAdded: function(cPoints, gPoints) {
  13843. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13844. if (cPoints.length === 1) {
  13845. _areaLabel = "\u8D77\u70B9";
  13846. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13847. var lable = _areaLabel;
  13848. return lable;
  13849. }, false));
  13850. } else if (cPoints.length >= 3) {
  13851. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13852. if (area > 1e5) {
  13853. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13854. } else {
  13855. _areaLabel = area.toFixed(2) + "m\xB2";
  13856. }
  13857. }
  13858. },
  13859. onUndo: function() {
  13860. _self._measureTempPoints.pop();
  13861. if (_self._measureTempPoints.length === 1)
  13862. _self._areaLabel = "\u8D77\u70B9";
  13863. },
  13864. onMoving: function(cPoint, scPoint) {
  13865. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13866. },
  13867. onError: function(error) {
  13868. if (callError)
  13869. callError(error);
  13870. },
  13871. onComplete: function(cPoints, gPoints) {
  13872. _self._initMousePointerStyle();
  13873. _self._tooltipRemove();
  13874. }
  13875. });
  13876. } else {
  13877. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13878. onAdded: function(cPoints, gPoints) {
  13879. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13880. if (cPoints.length === 1) {
  13881. _self._tooltipRemove();
  13882. _areaLabel = "\u8D77\u70B9";
  13883. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13884. var lable = _areaLabel;
  13885. return lable;
  13886. }, false));
  13887. let buttonDiv = document.getElementById("drawButtonDiv");
  13888. if (buttonDiv == null) {
  13889. _self._createOperationMainDom();
  13890. document.getElementById("btnDrawBackout").onclick = () => {
  13891. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13892. _self._sketchViewModel._sketchPoints.pop();
  13893. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13894. if (_self._sketchViewModel._isDrawPoint) {
  13895. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13896. _self._entities.remove(lastPointEntity);
  13897. _self._sketchViewModel._pointEntitys.pop();
  13898. }
  13899. _self._measureTempPoints.pop();
  13900. if (_self._measureTempPoints.length === 1)
  13901. _self._areaLabel = "\u8D77\u70B9";
  13902. }
  13903. };
  13904. document.getElementById("btnDrawComplete").onclick = () => {
  13905. if (_self._sketchViewModel._sketchPoints.length < 3) {
  13906. if (callError)
  13907. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13908. return;
  13909. }
  13910. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  13911. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13912. _self._sketchViewModel._createPolygon();
  13913. if (!_self._sketchViewModel._isRetainDrawPoint)
  13914. _self._sketchViewModel._removePointEntitys();
  13915. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13916. _self._initMousePointerStyle();
  13917. _self._tooltipRemove();
  13918. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13919. if (buttonDiv2) {
  13920. document.body.removeChild(buttonDiv2);
  13921. }
  13922. };
  13923. }
  13924. } else if (cPoints.length >= 3) {
  13925. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13926. if (area > 1e5) {
  13927. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13928. } else {
  13929. _areaLabel = area.toFixed(2) + "m\xB2";
  13930. }
  13931. }
  13932. }
  13933. });
  13934. }
  13935. },
  13936. measureHeight: function(callError) {
  13937. let _self = this;
  13938. this._clear(this._isClear);
  13939. this._setMousePointerStyle();
  13940. if (this._isRuntimeApp()) {
  13941. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13942. } else {
  13943. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13944. }
  13945. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Height, {
  13946. onAdded: function(cPoint) {
  13947. if (_self._isRuntimeApp()) {
  13948. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13949. } else {
  13950. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13951. }
  13952. },
  13953. onMoving: function(cPoints, centerPoint) {
  13954. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13955. _self._altitudeLabelPosition = centerPoint;
  13956. _self._altitudeLabelText = height2;
  13957. if (_self._altitudeDynamicLabel === void 0) {
  13958. _self._createAltitudeDynamicLabel();
  13959. }
  13960. },
  13961. onError: function(error) {
  13962. if (callError)
  13963. callError(error);
  13964. },
  13965. onComplete: function(cPoints, centerPoint) {
  13966. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13967. _self._entities.remove(_self._altitudeDynamicLabel);
  13968. _self._createLabel(centerPoint, height2);
  13969. _self._initMousePointerStyle();
  13970. _self._tooltipRemove();
  13971. }
  13972. });
  13973. },
  13974. measureTriangle: function(callError) {
  13975. let _self = this;
  13976. this._clear(this._isClear);
  13977. this._setMousePointerStyle();
  13978. if (this._isRuntimeApp()) {
  13979. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13980. } else {
  13981. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13982. }
  13983. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Triangle, {
  13984. onAdded: function(cPoint) {
  13985. if (_self._isRuntimeApp()) {
  13986. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13987. } else {
  13988. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13989. }
  13990. },
  13991. onMoving: function(cPoint) {
  13992. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13993. },
  13994. onError: function(error) {
  13995. if (callError)
  13996. callError(error);
  13997. },
  13998. onComplete: function(positions) {
  13999. _self._initMousePointerStyle();
  14000. _self._tooltipRemove();
  14001. let sPoints = [positions[0], positions[1]];
  14002. let sDistince = _self._measureSpaceDistance(sPoints);
  14003. let hPoints = [positions[1], positions[2]];
  14004. let hDistince = _self._measureSpaceDistance(hPoints);
  14005. let hePoints = [positions[2], positions[0]];
  14006. let height2 = _self._calculatePolylineAltitudeHeight(hePoints);
  14007. _self._createLabel(positions[0], "\u659C\u8DDD:" + sDistince);
  14008. _self._createLabel(positions[1], "\u5E73\u8DDD:" + hDistince);
  14009. _self._createLabel(positions[2], "\u9AD8\u5EA6:" + height2);
  14010. }
  14011. });
  14012. }
  14013. });
  14014. Object.assign(CommonTools.prototype, {
  14015. queryByPoint: function(callComplete) {
  14016. let _self = this;
  14017. this._setMousePointerStyle();
  14018. this._clear(this._isClear);
  14019. if (this._isRuntimeApp()) {
  14020. this._showTooltipMessage("\u70B9\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  14021. } else {
  14022. this._tooltipInit("\u5355\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  14023. }
  14024. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Point, {
  14025. onComplete: function(cPoint, gPoint) {
  14026. _self._initMousePointerStyle();
  14027. _self._tooltipRemove();
  14028. _self._createPoint(cPoint);
  14029. let coordinates = gPoint.lng + "," + gPoint.lat;
  14030. if (callComplete)
  14031. callComplete(coordinates);
  14032. }
  14033. });
  14034. },
  14035. queryByMultiplePoint: function(callComplete) {
  14036. let _self = this;
  14037. this._setMousePointerStyle();
  14038. this._clear(this._isClear);
  14039. this._tooltipInit("\u70B9\u51FB\u4F4D\u7F6E\u7ED8\u5236<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14040. this._tempEntitys = [];
  14041. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.MultiplePoint, {
  14042. onAdded: function(cPoint, gPoint) {
  14043. let res = gPoint.lng.toFixed(6) + "," + gPoint.lat.toFixed(6);
  14044. _self._tempEntitys.push(_self._createPoint(cPoint, res));
  14045. },
  14046. onUndo: function() {
  14047. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  14048. _self._tempEntitys.pop();
  14049. },
  14050. onComplete: function(cPoints, gPoints) {
  14051. _self._initMousePointerStyle();
  14052. _self._tooltipRemove();
  14053. let res = [];
  14054. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14055. res.push(gPoints[i2].lng);
  14056. res.push(gPoints[i2].lat);
  14057. }
  14058. if (callComplete)
  14059. callComplete(res);
  14060. }
  14061. });
  14062. },
  14063. queryByLine: function(callComplete, callError) {
  14064. let _self = this;
  14065. this._clear(this._isClear);
  14066. this._setMousePointerStyle();
  14067. if (this._isRuntimeApp()) {
  14068. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14069. } else {
  14070. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14071. }
  14072. if (this._isRuntimeWeb()) {
  14073. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14074. onAdded: function(cPoints, gPoints) {
  14075. },
  14076. onMoving: function(cPoint, scPoint) {
  14077. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14078. },
  14079. onError: function(error) {
  14080. if (callError)
  14081. callError(error);
  14082. },
  14083. onComplete: function(cPoints, gPoints) {
  14084. _self._initMousePointerStyle();
  14085. _self._tooltipRemove();
  14086. let coordinates = void 0;
  14087. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14088. let point2 = gPoints[i2];
  14089. if (coordinates === void 0)
  14090. coordinates = point2.lng + "," + point2.lat;
  14091. else
  14092. coordinates += "," + point2.lng + "," + point2.lat;
  14093. }
  14094. if (callComplete)
  14095. callComplete(coordinates);
  14096. }
  14097. });
  14098. } else {
  14099. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14100. onAdded: function(cPoints, gPoints) {
  14101. if (cPoints.length === 1) {
  14102. _self._tooltipRemove();
  14103. let buttonDiv = document.getElementById("drawButtonDiv");
  14104. if (buttonDiv == null) {
  14105. _self._createOperationMainDom();
  14106. document.getElementById("btnDrawBackout").onclick = () => {
  14107. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14108. _self._sketchViewModel._sketchPoints.pop();
  14109. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14110. if (_self._sketchViewModel._isDrawPoint) {
  14111. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14112. _self._sketchViewModel._entities.remove(lastPointEntity);
  14113. _self._sketchViewModel._pointEntitys.pop();
  14114. }
  14115. }
  14116. };
  14117. document.getElementById("btnDrawComplete").onclick = () => {
  14118. if (_self._sketchViewModel._sketchPoints.length < 2) {
  14119. if (callError)
  14120. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14121. return;
  14122. }
  14123. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14124. _self._sketchViewModel._createPolyline();
  14125. if (!_self._sketchViewModel._isRetainDrawPoint)
  14126. _self._sketchViewModel._removePointEntitys();
  14127. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14128. _self._initMousePointerStyle();
  14129. _self._tooltipRemove();
  14130. let coordinates = void 0;
  14131. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14132. let point2 = gPoints[i2];
  14133. if (coordinates === void 0)
  14134. coordinates = point2.lng + "," + point2.lat;
  14135. else
  14136. coordinates += "," + point2.lng + "," + point2.lat;
  14137. }
  14138. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14139. if (buttonDiv2) {
  14140. document.body.removeChild(buttonDiv2);
  14141. }
  14142. if (callComplete)
  14143. callComplete(coordinates);
  14144. };
  14145. }
  14146. }
  14147. }
  14148. });
  14149. }
  14150. },
  14151. queryByPolygon: function(callComplete, callError) {
  14152. let _self = this;
  14153. this._clear(this._isClear);
  14154. this._setMousePointerStyle();
  14155. if (this._isRuntimeApp()) {
  14156. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14157. } else {
  14158. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14159. }
  14160. if (this._isRuntimeWeb()) {
  14161. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14162. onMoving: function(cPoint, scPoint) {
  14163. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14164. },
  14165. onError: function(error) {
  14166. if (callError)
  14167. callError(error);
  14168. },
  14169. onComplete: function(cPoints, gPoints) {
  14170. _self._initMousePointerStyle();
  14171. _self._tooltipRemove();
  14172. let coordinates = void 0;
  14173. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14174. let point2 = gPoints[i2];
  14175. if (coordinates === void 0)
  14176. coordinates = point2.lng + "," + point2.lat;
  14177. else
  14178. coordinates += "," + point2.lng + "," + point2.lat;
  14179. }
  14180. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14181. if (callComplete)
  14182. callComplete(coordinates);
  14183. }
  14184. });
  14185. } else {
  14186. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14187. onAdded: function(cPoints, gPoints) {
  14188. if (cPoints.length === 1) {
  14189. _self._tooltipRemove();
  14190. let buttonDiv = document.getElementById("drawButtonDiv");
  14191. if (buttonDiv == null) {
  14192. _self._createOperationMainDom();
  14193. document.getElementById("btnDrawBackout").onclick = () => {
  14194. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14195. _self._sketchViewModel._sketchPoints.pop();
  14196. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14197. if (_self._sketchViewModel._isDrawPoint) {
  14198. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14199. _self._entities.remove(lastPointEntity);
  14200. _self._sketchViewModel._pointEntitys.pop();
  14201. }
  14202. }
  14203. };
  14204. document.getElementById("btnDrawComplete").onclick = () => {
  14205. if (_self._sketchViewModel._sketchPoints.length < 3) {
  14206. if (callError)
  14207. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14208. return;
  14209. }
  14210. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  14211. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14212. _self._sketchViewModel._createPolygon();
  14213. if (!_self._sketchViewModel._isRetainDrawPoint)
  14214. _self._sketchViewModel._removePointEntitys();
  14215. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14216. _self._initMousePointerStyle();
  14217. _self._tooltipRemove();
  14218. let coordinates = void 0;
  14219. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14220. let point2 = gPoints[i2];
  14221. if (coordinates === void 0)
  14222. coordinates = point2.lng + "," + point2.lat;
  14223. else
  14224. coordinates += "," + point2.lng + "," + point2.lat;
  14225. }
  14226. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14227. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14228. if (buttonDiv2) {
  14229. document.body.removeChild(buttonDiv2);
  14230. }
  14231. if (callComplete)
  14232. callComplete(coordinates);
  14233. };
  14234. }
  14235. }
  14236. }
  14237. });
  14238. }
  14239. },
  14240. queryByCircle: function(callComplete) {
  14241. let _self = this;
  14242. this._clear(this._isClear);
  14243. this._setMousePointerStyle();
  14244. if (this._isRuntimeApp()) {
  14245. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14246. } else {
  14247. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14248. }
  14249. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Circle, {
  14250. onAdded: function(center2) {
  14251. if (_self._isRuntimeApp()) {
  14252. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14253. } else {
  14254. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14255. }
  14256. },
  14257. onComplete: function(center2, radius) {
  14258. _self._initMousePointerStyle();
  14259. _self._tooltipRemove();
  14260. if (callComplete)
  14261. callComplete(center2.lng + "," + center2.lat, radius);
  14262. }
  14263. });
  14264. },
  14265. queryByRectangle: function(callComplete) {
  14266. let _self = this;
  14267. this._clear(this._isClear);
  14268. this._setMousePointerStyle();
  14269. if (this._isRuntimeApp()) {
  14270. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14271. } else {
  14272. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14273. }
  14274. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Rectangle, {
  14275. onAdded: function(center2) {
  14276. if (_self._isRuntimeApp()) {
  14277. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14278. } else {
  14279. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14280. }
  14281. },
  14282. onComplete: function(gPoints) {
  14283. _self._initMousePointerStyle();
  14284. _self._tooltipRemove();
  14285. let coordinates = void 0;
  14286. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14287. let point2 = gPoints[i2];
  14288. if (coordinates === void 0)
  14289. coordinates = point2.lng + "," + point2.lat;
  14290. else
  14291. coordinates += "," + point2.lng + "," + point2.lat;
  14292. }
  14293. if (callComplete)
  14294. callComplete(coordinates);
  14295. }
  14296. });
  14297. }
  14298. });
  14299. Object.assign(CommonTools.prototype, {
  14300. drawPolygonBody: function(callComplete) {
  14301. let _self = this;
  14302. this._clear(this._isClear);
  14303. this._setMousePointerStyle();
  14304. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14305. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.PolygonBody, {
  14306. onAdded: function(cPoints, gPoints) {
  14307. if (cPoints.length === 0) {
  14308. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14309. } else if (cPoints.length < 3) {
  14310. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14311. } else {
  14312. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14313. }
  14314. },
  14315. onUndo: function(cPoints) {
  14316. if (cPoints.length === 0) {
  14317. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14318. } else if (cPoints.length < 3) {
  14319. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14320. } else {
  14321. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14322. }
  14323. },
  14324. onComplete: function(cPoints, gPoints) {
  14325. _self._initMousePointerStyle();
  14326. _self._tooltipRemove();
  14327. if (callComplete)
  14328. callComplete();
  14329. }
  14330. });
  14331. },
  14332. drawPointFeacture: function(points2, options2) {
  14333. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPoint, options2);
  14334. },
  14335. drawMultiplePointFeacture: function(points2, options2) {
  14336. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawMultiplePoint, options2);
  14337. },
  14338. drawPolylineFeacture: function(points2, options2) {
  14339. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolyline, options2);
  14340. },
  14341. drawPolygonFeacture: function(points2, options2) {
  14342. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolygon, options2);
  14343. }
  14344. });
  14345. Object.assign(CommonTools.prototype, {
  14346. tooltipInit: function(text) {
  14347. this._tooltipInit(text);
  14348. },
  14349. tooltipRemove: function() {
  14350. this._tooltipRemove();
  14351. },
  14352. tooltipSetText: function(text) {
  14353. this._tooltipSetText(text);
  14354. }
  14355. });
  14356. Object.assign(CommonTools.prototype, {
  14357. pickPolygonBody: function(callComplete) {
  14358. this._sketchViewModel.sketchPick(function(options2) {
  14359. if (options2 === void 0) {
  14360. if (callComplete)
  14361. callComplete(void 0);
  14362. } else {
  14363. if (callComplete)
  14364. callComplete({
  14365. color: options2.color,
  14366. height: options2.height
  14367. });
  14368. }
  14369. });
  14370. },
  14371. setPolygonBody: function(options2) {
  14372. this._sketchViewModel.sketchEditPickPolygonBody({
  14373. color: options2.color,
  14374. height: options2.height,
  14375. onComplete: options2.onComplete
  14376. });
  14377. },
  14378. removePolygonBody: function(onComplete) {
  14379. this._sketchViewModel.sketchRemovePickPolygonBody(onComplete);
  14380. }
  14381. });
  14382. CommonTools.RuntimeEnvironment = Object.freeze({
  14383. App: "app",
  14384. Web: "web"
  14385. });
  14386. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  14387. const handleEvent = (event2) => {
  14388. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event2);
  14389. if (checkForDefaultPrevented === false || !shouldPrevent) {
  14390. return oursHandler == null ? void 0 : oursHandler(event2);
  14391. }
  14392. };
  14393. return handleEvent;
  14394. };
  14395. var _a;
  14396. const isClient = typeof window !== "undefined";
  14397. const isString$1 = (val) => typeof val === "string";
  14398. const noop$3 = () => {
  14399. };
  14400. const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
  14401. function resolveUnref(r2) {
  14402. return typeof r2 === "function" ? r2() : unref(r2);
  14403. }
  14404. function identity(arg) {
  14405. return arg;
  14406. }
  14407. function tryOnScopeDispose(fn2) {
  14408. if (getCurrentScope()) {
  14409. onScopeDispose(fn2);
  14410. return true;
  14411. }
  14412. return false;
  14413. }
  14414. function tryOnMounted(fn2, sync = true) {
  14415. if (getCurrentInstance())
  14416. onMounted(fn2);
  14417. else if (sync)
  14418. fn2();
  14419. else
  14420. nextTick(fn2);
  14421. }
  14422. function useTimeoutFn(cb, interval, options2 = {}) {
  14423. const {
  14424. immediate = true
  14425. } = options2;
  14426. const isPending = ref(false);
  14427. let timer = null;
  14428. function clear() {
  14429. if (timer) {
  14430. clearTimeout(timer);
  14431. timer = null;
  14432. }
  14433. }
  14434. function stop() {
  14435. isPending.value = false;
  14436. clear();
  14437. }
  14438. function start2(...args) {
  14439. clear();
  14440. isPending.value = true;
  14441. timer = setTimeout(() => {
  14442. isPending.value = false;
  14443. timer = null;
  14444. cb(...args);
  14445. }, resolveUnref(interval));
  14446. }
  14447. if (immediate) {
  14448. isPending.value = true;
  14449. if (isClient)
  14450. start2();
  14451. }
  14452. tryOnScopeDispose(stop);
  14453. return {
  14454. isPending: readonly(isPending),
  14455. start: start2,
  14456. stop
  14457. };
  14458. }
  14459. function unrefElement(elRef) {
  14460. var _a2;
  14461. const plain = resolveUnref(elRef);
  14462. return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
  14463. }
  14464. const defaultWindow = isClient ? window : void 0;
  14465. function useEventListener(...args) {
  14466. let target;
  14467. let events;
  14468. let listeners;
  14469. let options2;
  14470. if (isString$1(args[0]) || Array.isArray(args[0])) {
  14471. [events, listeners, options2] = args;
  14472. target = defaultWindow;
  14473. } else {
  14474. [target, events, listeners, options2] = args;
  14475. }
  14476. if (!target)
  14477. return noop$3;
  14478. if (!Array.isArray(events))
  14479. events = [events];
  14480. if (!Array.isArray(listeners))
  14481. listeners = [listeners];
  14482. const cleanups = [];
  14483. const cleanup = () => {
  14484. cleanups.forEach((fn2) => fn2());
  14485. cleanups.length = 0;
  14486. };
  14487. const register = (el, event2, listener, options22) => {
  14488. el.addEventListener(event2, listener, options22);
  14489. return () => el.removeEventListener(event2, listener, options22);
  14490. };
  14491. const stopWatch = watch(() => [unrefElement(target), resolveUnref(options2)], ([el, options22]) => {
  14492. cleanup();
  14493. if (!el)
  14494. return;
  14495. cleanups.push(...events.flatMap((event2) => {
  14496. return listeners.map((listener) => register(el, event2, listener, options22));
  14497. }));
  14498. }, { immediate: true, flush: "post" });
  14499. const stop = () => {
  14500. stopWatch();
  14501. cleanup();
  14502. };
  14503. tryOnScopeDispose(stop);
  14504. return stop;
  14505. }
  14506. let _iOSWorkaround = false;
  14507. function onClickOutside(target, handler, options2 = {}) {
  14508. const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options2;
  14509. if (!window2)
  14510. return;
  14511. if (isIOS && !_iOSWorkaround) {
  14512. _iOSWorkaround = true;
  14513. Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$3));
  14514. }
  14515. let shouldListen = true;
  14516. const shouldIgnore = (event2) => {
  14517. return ignore.some((target2) => {
  14518. if (typeof target2 === "string") {
  14519. return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event2.target || event2.composedPath().includes(el));
  14520. } else {
  14521. const el = unrefElement(target2);
  14522. return el && (event2.target === el || event2.composedPath().includes(el));
  14523. }
  14524. });
  14525. };
  14526. const listener = (event2) => {
  14527. const el = unrefElement(target);
  14528. if (!el || el === event2.target || event2.composedPath().includes(el))
  14529. return;
  14530. if (event2.detail === 0)
  14531. shouldListen = !shouldIgnore(event2);
  14532. if (!shouldListen) {
  14533. shouldListen = true;
  14534. return;
  14535. }
  14536. handler(event2);
  14537. };
  14538. const cleanup = [
  14539. useEventListener(window2, "click", listener, { passive: true, capture }),
  14540. useEventListener(window2, "pointerdown", (e) => {
  14541. const el = unrefElement(target);
  14542. if (el)
  14543. shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
  14544. }, { passive: true }),
  14545. detectIframe && useEventListener(window2, "blur", (event2) => {
  14546. var _a2;
  14547. const el = unrefElement(target);
  14548. if (((_a2 = window2.document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
  14549. handler(event2);
  14550. })
  14551. ].filter(Boolean);
  14552. const stop = () => cleanup.forEach((fn2) => fn2());
  14553. return stop;
  14554. }
  14555. function useSupported(callback2, sync = false) {
  14556. const isSupported = ref();
  14557. const update = () => isSupported.value = Boolean(callback2());
  14558. update();
  14559. tryOnMounted(update, sync);
  14560. return isSupported;
  14561. }
  14562. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  14563. const globalKey = "__vueuse_ssr_handlers__";
  14564. _global[globalKey] = _global[globalKey] || {};
  14565. _global[globalKey];
  14566. var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
  14567. var __hasOwnProp$g = Object.prototype.hasOwnProperty;
  14568. var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
  14569. var __objRest$2 = (source, exclude) => {
  14570. var target = {};
  14571. for (var prop in source)
  14572. if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
  14573. target[prop] = source[prop];
  14574. if (source != null && __getOwnPropSymbols$g)
  14575. for (var prop of __getOwnPropSymbols$g(source)) {
  14576. if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
  14577. target[prop] = source[prop];
  14578. }
  14579. return target;
  14580. };
  14581. function useResizeObserver(target, callback2, options2 = {}) {
  14582. const _a2 = options2, { window: window2 = defaultWindow } = _a2, observerOptions = __objRest$2(_a2, ["window"]);
  14583. let observer;
  14584. const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
  14585. const cleanup = () => {
  14586. if (observer) {
  14587. observer.disconnect();
  14588. observer = void 0;
  14589. }
  14590. };
  14591. const stopWatch = watch(() => unrefElement(target), (el) => {
  14592. cleanup();
  14593. if (isSupported.value && window2 && el) {
  14594. observer = new ResizeObserver(callback2);
  14595. observer.observe(el, observerOptions);
  14596. }
  14597. }, { immediate: true, flush: "post" });
  14598. const stop = () => {
  14599. cleanup();
  14600. stopWatch();
  14601. };
  14602. tryOnScopeDispose(stop);
  14603. return {
  14604. isSupported,
  14605. stop
  14606. };
  14607. }
  14608. var SwipeDirection;
  14609. (function(SwipeDirection2) {
  14610. SwipeDirection2["UP"] = "UP";
  14611. SwipeDirection2["RIGHT"] = "RIGHT";
  14612. SwipeDirection2["DOWN"] = "DOWN";
  14613. SwipeDirection2["LEFT"] = "LEFT";
  14614. SwipeDirection2["NONE"] = "NONE";
  14615. })(SwipeDirection || (SwipeDirection = {}));
  14616. var __defProp2 = Object.defineProperty;
  14617. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  14618. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14619. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  14620. var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  14621. var __spreadValues = (a, b) => {
  14622. for (var prop in b || (b = {}))
  14623. if (__hasOwnProp.call(b, prop))
  14624. __defNormalProp2(a, prop, b[prop]);
  14625. if (__getOwnPropSymbols)
  14626. for (var prop of __getOwnPropSymbols(b)) {
  14627. if (__propIsEnum.call(b, prop))
  14628. __defNormalProp2(a, prop, b[prop]);
  14629. }
  14630. return a;
  14631. };
  14632. const _TransitionPresets = {
  14633. easeInSine: [0.12, 0, 0.39, 0],
  14634. easeOutSine: [0.61, 1, 0.88, 1],
  14635. easeInOutSine: [0.37, 0, 0.63, 1],
  14636. easeInQuad: [0.11, 0, 0.5, 0],
  14637. easeOutQuad: [0.5, 1, 0.89, 1],
  14638. easeInOutQuad: [0.45, 0, 0.55, 1],
  14639. easeInCubic: [0.32, 0, 0.67, 0],
  14640. easeOutCubic: [0.33, 1, 0.68, 1],
  14641. easeInOutCubic: [0.65, 0, 0.35, 1],
  14642. easeInQuart: [0.5, 0, 0.75, 0],
  14643. easeOutQuart: [0.25, 1, 0.5, 1],
  14644. easeInOutQuart: [0.76, 0, 0.24, 1],
  14645. easeInQuint: [0.64, 0, 0.78, 0],
  14646. easeOutQuint: [0.22, 1, 0.36, 1],
  14647. easeInOutQuint: [0.83, 0, 0.17, 1],
  14648. easeInExpo: [0.7, 0, 0.84, 0],
  14649. easeOutExpo: [0.16, 1, 0.3, 1],
  14650. easeInOutExpo: [0.87, 0, 0.13, 1],
  14651. easeInCirc: [0.55, 0, 1, 0.45],
  14652. easeOutCirc: [0, 0.55, 0.45, 1],
  14653. easeInOutCirc: [0.85, 0, 0.15, 1],
  14654. easeInBack: [0.36, 0, 0.66, -0.56],
  14655. easeOutBack: [0.34, 1.56, 0.64, 1],
  14656. easeInOutBack: [0.68, -0.6, 0.32, 1.6]
  14657. };
  14658. __spreadValues({
  14659. linear: identity
  14660. }, _TransitionPresets);
  14661. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  14662. const getClientXY = (event2) => {
  14663. let clientX;
  14664. let clientY;
  14665. if (event2.type === "touchend") {
  14666. clientY = event2.changedTouches[0].clientY;
  14667. clientX = event2.changedTouches[0].clientX;
  14668. } else if (event2.type.startsWith("touch")) {
  14669. clientY = event2.touches[0].clientY;
  14670. clientX = event2.touches[0].clientX;
  14671. } else {
  14672. clientY = event2.clientY;
  14673. clientX = event2.clientX;
  14674. }
  14675. return {
  14676. clientX,
  14677. clientY
  14678. };
  14679. };
  14680. const NOOP = () => {
  14681. };
  14682. const hasOwnProperty$9 = Object.prototype.hasOwnProperty;
  14683. const hasOwn = (val, key) => hasOwnProperty$9.call(val, key);
  14684. const isArray$2 = Array.isArray;
  14685. const isFunction$3 = (val) => typeof val === "function";
  14686. const isString = (val) => typeof val === "string";
  14687. const isObject$5 = (val) => val !== null && typeof val === "object";
  14688. const isPromise$2 = (val) => {
  14689. return isObject$5(val) && isFunction$3(val.then) && isFunction$3(val.catch);
  14690. };
  14691. const objectToString$1 = Object.prototype.toString;
  14692. const toTypeString = (value) => objectToString$1.call(value);
  14693. const toRawType = (value) => {
  14694. return toTypeString(value).slice(8, -1);
  14695. };
  14696. const cacheStringFunction = (fn2) => {
  14697. const cache = /* @__PURE__ */ Object.create(null);
  14698. return (str) => {
  14699. const hit = cache[str];
  14700. return hit || (cache[str] = fn2(str));
  14701. };
  14702. };
  14703. const camelizeRE = /-(\w)/g;
  14704. const camelize = cacheStringFunction((str) => {
  14705. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  14706. });
  14707. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  14708. var freeGlobal$1 = freeGlobal;
  14709. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  14710. var root = freeGlobal$1 || freeSelf || Function("return this")();
  14711. var root$1 = root;
  14712. var Symbol$1 = root$1.Symbol;
  14713. var Symbol$2 = Symbol$1;
  14714. var objectProto$b = Object.prototype;
  14715. var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
  14716. var nativeObjectToString$1 = objectProto$b.toString;
  14717. var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14718. function getRawTag(value) {
  14719. var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  14720. try {
  14721. value[symToStringTag$1] = void 0;
  14722. var unmasked = true;
  14723. } catch (e) {
  14724. }
  14725. var result = nativeObjectToString$1.call(value);
  14726. if (unmasked) {
  14727. if (isOwn) {
  14728. value[symToStringTag$1] = tag;
  14729. } else {
  14730. delete value[symToStringTag$1];
  14731. }
  14732. }
  14733. return result;
  14734. }
  14735. var objectProto$a = Object.prototype;
  14736. var nativeObjectToString = objectProto$a.toString;
  14737. function objectToString(value) {
  14738. return nativeObjectToString.call(value);
  14739. }
  14740. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  14741. var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14742. function baseGetTag(value) {
  14743. if (value == null) {
  14744. return value === void 0 ? undefinedTag : nullTag;
  14745. }
  14746. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  14747. }
  14748. function isObjectLike(value) {
  14749. return value != null && typeof value == "object";
  14750. }
  14751. var symbolTag$1 = "[object Symbol]";
  14752. function isSymbol(value) {
  14753. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
  14754. }
  14755. function arrayMap(array, iteratee) {
  14756. var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
  14757. while (++index2 < length) {
  14758. result[index2] = iteratee(array[index2], index2, array);
  14759. }
  14760. return result;
  14761. }
  14762. var isArray = Array.isArray;
  14763. var isArray$1 = isArray;
  14764. var INFINITY$1 = 1 / 0;
  14765. var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
  14766. function baseToString(value) {
  14767. if (typeof value == "string") {
  14768. return value;
  14769. }
  14770. if (isArray$1(value)) {
  14771. return arrayMap(value, baseToString) + "";
  14772. }
  14773. if (isSymbol(value)) {
  14774. return symbolToString ? symbolToString.call(value) : "";
  14775. }
  14776. var result = value + "";
  14777. return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
  14778. }
  14779. var reWhitespace = /\s/;
  14780. function trimmedEndIndex(string) {
  14781. var index2 = string.length;
  14782. while (index2-- && reWhitespace.test(string.charAt(index2))) {
  14783. }
  14784. return index2;
  14785. }
  14786. var reTrimStart = /^\s+/;
  14787. function baseTrim(string) {
  14788. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  14789. }
  14790. function isObject$4(value) {
  14791. var type2 = typeof value;
  14792. return value != null && (type2 == "object" || type2 == "function");
  14793. }
  14794. var NAN = 0 / 0;
  14795. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  14796. var reIsBinary = /^0b[01]+$/i;
  14797. var reIsOctal = /^0o[0-7]+$/i;
  14798. var freeParseInt = parseInt;
  14799. function toNumber(value) {
  14800. if (typeof value == "number") {
  14801. return value;
  14802. }
  14803. if (isSymbol(value)) {
  14804. return NAN;
  14805. }
  14806. if (isObject$4(value)) {
  14807. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  14808. value = isObject$4(other) ? other + "" : other;
  14809. }
  14810. if (typeof value != "string") {
  14811. return value === 0 ? value : +value;
  14812. }
  14813. value = baseTrim(value);
  14814. var isBinary = reIsBinary.test(value);
  14815. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  14816. }
  14817. var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  14818. function isFunction$2(value) {
  14819. if (!isObject$4(value)) {
  14820. return false;
  14821. }
  14822. var tag = baseGetTag(value);
  14823. return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
  14824. }
  14825. var coreJsData = root$1["__core-js_shared__"];
  14826. var coreJsData$1 = coreJsData;
  14827. var maskSrcKey = function() {
  14828. var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
  14829. return uid ? "Symbol(src)_1." + uid : "";
  14830. }();
  14831. function isMasked(func) {
  14832. return !!maskSrcKey && maskSrcKey in func;
  14833. }
  14834. var funcProto$1 = Function.prototype;
  14835. var funcToString$1 = funcProto$1.toString;
  14836. function toSource(func) {
  14837. if (func != null) {
  14838. try {
  14839. return funcToString$1.call(func);
  14840. } catch (e) {
  14841. }
  14842. try {
  14843. return func + "";
  14844. } catch (e) {
  14845. }
  14846. }
  14847. return "";
  14848. }
  14849. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  14850. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  14851. var funcProto = Function.prototype, objectProto$9 = Object.prototype;
  14852. var funcToString = funcProto.toString;
  14853. var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
  14854. var reIsNative = RegExp(
  14855. "^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  14856. );
  14857. function baseIsNative(value) {
  14858. if (!isObject$4(value) || isMasked(value)) {
  14859. return false;
  14860. }
  14861. var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
  14862. return pattern.test(toSource(value));
  14863. }
  14864. function getValue(object, key) {
  14865. return object == null ? void 0 : object[key];
  14866. }
  14867. function getNative(object, key) {
  14868. var value = getValue(object, key);
  14869. return baseIsNative(value) ? value : void 0;
  14870. }
  14871. var WeakMap$1 = getNative(root$1, "WeakMap");
  14872. var WeakMap$2 = WeakMap$1;
  14873. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  14874. var reIsUint = /^(?:0|[1-9]\d*)$/;
  14875. function isIndex(value, length) {
  14876. var type2 = typeof value;
  14877. length = length == null ? MAX_SAFE_INTEGER$1 : length;
  14878. return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  14879. }
  14880. function eq(value, other) {
  14881. return value === other || value !== value && other !== other;
  14882. }
  14883. var MAX_SAFE_INTEGER = 9007199254740991;
  14884. function isLength(value) {
  14885. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  14886. }
  14887. function isArrayLike(value) {
  14888. return value != null && isLength(value.length) && !isFunction$2(value);
  14889. }
  14890. var objectProto$8 = Object.prototype;
  14891. function isPrototype(value) {
  14892. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$8;
  14893. return value === proto;
  14894. }
  14895. function baseTimes(n, iteratee) {
  14896. var index2 = -1, result = Array(n);
  14897. while (++index2 < n) {
  14898. result[index2] = iteratee(index2);
  14899. }
  14900. return result;
  14901. }
  14902. var argsTag$2 = "[object Arguments]";
  14903. function baseIsArguments(value) {
  14904. return isObjectLike(value) && baseGetTag(value) == argsTag$2;
  14905. }
  14906. var objectProto$7 = Object.prototype;
  14907. var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
  14908. var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
  14909. var isArguments = baseIsArguments(function() {
  14910. return arguments;
  14911. }()) ? baseIsArguments : function(value) {
  14912. return isObjectLike(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  14913. };
  14914. var isArguments$1 = isArguments;
  14915. function stubFalse() {
  14916. return false;
  14917. }
  14918. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  14919. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  14920. var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
  14921. var Buffer$1 = moduleExports$1 ? root$1.Buffer : void 0;
  14922. var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
  14923. var isBuffer = nativeIsBuffer || stubFalse;
  14924. var isBuffer$1 = isBuffer;
  14925. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
  14926. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  14927. var typedArrayTags = {};
  14928. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  14929. typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
  14930. function baseIsTypedArray(value) {
  14931. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  14932. }
  14933. function baseUnary(func) {
  14934. return function(value) {
  14935. return func(value);
  14936. };
  14937. }
  14938. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  14939. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  14940. var moduleExports = freeModule && freeModule.exports === freeExports;
  14941. var freeProcess = moduleExports && freeGlobal$1.process;
  14942. var nodeUtil = function() {
  14943. try {
  14944. var types = freeModule && freeModule.require && freeModule.require("util").types;
  14945. if (types) {
  14946. return types;
  14947. }
  14948. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  14949. } catch (e) {
  14950. }
  14951. }();
  14952. var nodeUtil$1 = nodeUtil;
  14953. var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
  14954. var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  14955. var isTypedArray$3 = isTypedArray$2;
  14956. var objectProto$6 = Object.prototype;
  14957. var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
  14958. function arrayLikeKeys(value, inherited) {
  14959. var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$3(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  14960. for (var key in value) {
  14961. if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
  14962. result.push(key);
  14963. }
  14964. }
  14965. return result;
  14966. }
  14967. function overArg(func, transform3) {
  14968. return function(arg) {
  14969. return func(transform3(arg));
  14970. };
  14971. }
  14972. var nativeKeys = overArg(Object.keys, Object);
  14973. var nativeKeys$1 = nativeKeys;
  14974. var objectProto$5 = Object.prototype;
  14975. var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
  14976. function baseKeys(object) {
  14977. if (!isPrototype(object)) {
  14978. return nativeKeys$1(object);
  14979. }
  14980. var result = [];
  14981. for (var key in Object(object)) {
  14982. if (hasOwnProperty$4.call(object, key) && key != "constructor") {
  14983. result.push(key);
  14984. }
  14985. }
  14986. return result;
  14987. }
  14988. function keys$2(object) {
  14989. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14990. }
  14991. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
  14992. function isKey(value, object) {
  14993. if (isArray$1(value)) {
  14994. return false;
  14995. }
  14996. var type2 = typeof value;
  14997. if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol(value)) {
  14998. return true;
  14999. }
  15000. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  15001. }
  15002. var nativeCreate = getNative(Object, "create");
  15003. var nativeCreate$1 = nativeCreate;
  15004. function hashClear() {
  15005. this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
  15006. this.size = 0;
  15007. }
  15008. function hashDelete(key) {
  15009. var result = this.has(key) && delete this.__data__[key];
  15010. this.size -= result ? 1 : 0;
  15011. return result;
  15012. }
  15013. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  15014. var objectProto$4 = Object.prototype;
  15015. var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
  15016. function hashGet(key) {
  15017. var data = this.__data__;
  15018. if (nativeCreate$1) {
  15019. var result = data[key];
  15020. return result === HASH_UNDEFINED$2 ? void 0 : result;
  15021. }
  15022. return hasOwnProperty$3.call(data, key) ? data[key] : void 0;
  15023. }
  15024. var objectProto$3 = Object.prototype;
  15025. var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
  15026. function hashHas(key) {
  15027. var data = this.__data__;
  15028. return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$2.call(data, key);
  15029. }
  15030. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  15031. function hashSet(key, value) {
  15032. var data = this.__data__;
  15033. this.size += this.has(key) ? 0 : 1;
  15034. data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
  15035. return this;
  15036. }
  15037. function Hash(entries) {
  15038. var index2 = -1, length = entries == null ? 0 : entries.length;
  15039. this.clear();
  15040. while (++index2 < length) {
  15041. var entry = entries[index2];
  15042. this.set(entry[0], entry[1]);
  15043. }
  15044. }
  15045. Hash.prototype.clear = hashClear;
  15046. Hash.prototype["delete"] = hashDelete;
  15047. Hash.prototype.get = hashGet;
  15048. Hash.prototype.has = hashHas;
  15049. Hash.prototype.set = hashSet;
  15050. function listCacheClear() {
  15051. this.__data__ = [];
  15052. this.size = 0;
  15053. }
  15054. function assocIndexOf(array, key) {
  15055. var length = array.length;
  15056. while (length--) {
  15057. if (eq(array[length][0], key)) {
  15058. return length;
  15059. }
  15060. }
  15061. return -1;
  15062. }
  15063. var arrayProto = Array.prototype;
  15064. var splice = arrayProto.splice;
  15065. function listCacheDelete(key) {
  15066. var data = this.__data__, index2 = assocIndexOf(data, key);
  15067. if (index2 < 0) {
  15068. return false;
  15069. }
  15070. var lastIndex = data.length - 1;
  15071. if (index2 == lastIndex) {
  15072. data.pop();
  15073. } else {
  15074. splice.call(data, index2, 1);
  15075. }
  15076. --this.size;
  15077. return true;
  15078. }
  15079. function listCacheGet(key) {
  15080. var data = this.__data__, index2 = assocIndexOf(data, key);
  15081. return index2 < 0 ? void 0 : data[index2][1];
  15082. }
  15083. function listCacheHas(key) {
  15084. return assocIndexOf(this.__data__, key) > -1;
  15085. }
  15086. function listCacheSet(key, value) {
  15087. var data = this.__data__, index2 = assocIndexOf(data, key);
  15088. if (index2 < 0) {
  15089. ++this.size;
  15090. data.push([key, value]);
  15091. } else {
  15092. data[index2][1] = value;
  15093. }
  15094. return this;
  15095. }
  15096. function ListCache(entries) {
  15097. var index2 = -1, length = entries == null ? 0 : entries.length;
  15098. this.clear();
  15099. while (++index2 < length) {
  15100. var entry = entries[index2];
  15101. this.set(entry[0], entry[1]);
  15102. }
  15103. }
  15104. ListCache.prototype.clear = listCacheClear;
  15105. ListCache.prototype["delete"] = listCacheDelete;
  15106. ListCache.prototype.get = listCacheGet;
  15107. ListCache.prototype.has = listCacheHas;
  15108. ListCache.prototype.set = listCacheSet;
  15109. var Map$2 = getNative(root$1, "Map");
  15110. var Map$3 = Map$2;
  15111. function mapCacheClear() {
  15112. this.size = 0;
  15113. this.__data__ = {
  15114. "hash": new Hash(),
  15115. "map": new (Map$3 || ListCache)(),
  15116. "string": new Hash()
  15117. };
  15118. }
  15119. function isKeyable(value) {
  15120. var type2 = typeof value;
  15121. return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
  15122. }
  15123. function getMapData(map, key) {
  15124. var data = map.__data__;
  15125. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  15126. }
  15127. function mapCacheDelete(key) {
  15128. var result = getMapData(this, key)["delete"](key);
  15129. this.size -= result ? 1 : 0;
  15130. return result;
  15131. }
  15132. function mapCacheGet(key) {
  15133. return getMapData(this, key).get(key);
  15134. }
  15135. function mapCacheHas(key) {
  15136. return getMapData(this, key).has(key);
  15137. }
  15138. function mapCacheSet(key, value) {
  15139. var data = getMapData(this, key), size = data.size;
  15140. data.set(key, value);
  15141. this.size += data.size == size ? 0 : 1;
  15142. return this;
  15143. }
  15144. function MapCache(entries) {
  15145. var index2 = -1, length = entries == null ? 0 : entries.length;
  15146. this.clear();
  15147. while (++index2 < length) {
  15148. var entry = entries[index2];
  15149. this.set(entry[0], entry[1]);
  15150. }
  15151. }
  15152. MapCache.prototype.clear = mapCacheClear;
  15153. MapCache.prototype["delete"] = mapCacheDelete;
  15154. MapCache.prototype.get = mapCacheGet;
  15155. MapCache.prototype.has = mapCacheHas;
  15156. MapCache.prototype.set = mapCacheSet;
  15157. var FUNC_ERROR_TEXT$1 = "Expected a function";
  15158. function memoize(func, resolver) {
  15159. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  15160. throw new TypeError(FUNC_ERROR_TEXT$1);
  15161. }
  15162. var memoized = function() {
  15163. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  15164. if (cache.has(key)) {
  15165. return cache.get(key);
  15166. }
  15167. var result = func.apply(this, args);
  15168. memoized.cache = cache.set(key, result) || cache;
  15169. return result;
  15170. };
  15171. memoized.cache = new (memoize.Cache || MapCache)();
  15172. return memoized;
  15173. }
  15174. memoize.Cache = MapCache;
  15175. var MAX_MEMOIZE_SIZE = 500;
  15176. function memoizeCapped(func) {
  15177. var result = memoize(func, function(key) {
  15178. if (cache.size === MAX_MEMOIZE_SIZE) {
  15179. cache.clear();
  15180. }
  15181. return key;
  15182. });
  15183. var cache = result.cache;
  15184. return result;
  15185. }
  15186. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  15187. var reEscapeChar = /\\(\\)?/g;
  15188. var stringToPath = memoizeCapped(function(string) {
  15189. var result = [];
  15190. if (string.charCodeAt(0) === 46) {
  15191. result.push("");
  15192. }
  15193. string.replace(rePropName, function(match, number, quote, subString) {
  15194. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  15195. });
  15196. return result;
  15197. });
  15198. var stringToPath$1 = stringToPath;
  15199. function toString$3(value) {
  15200. return value == null ? "" : baseToString(value);
  15201. }
  15202. function castPath(value, object) {
  15203. if (isArray$1(value)) {
  15204. return value;
  15205. }
  15206. return isKey(value, object) ? [value] : stringToPath$1(toString$3(value));
  15207. }
  15208. var INFINITY = 1 / 0;
  15209. function toKey(value) {
  15210. if (typeof value == "string" || isSymbol(value)) {
  15211. return value;
  15212. }
  15213. var result = value + "";
  15214. return result == "0" && 1 / value == -INFINITY ? "-0" : result;
  15215. }
  15216. function baseGet(object, path) {
  15217. path = castPath(path, object);
  15218. var index2 = 0, length = path.length;
  15219. while (object != null && index2 < length) {
  15220. object = object[toKey(path[index2++])];
  15221. }
  15222. return index2 && index2 == length ? object : void 0;
  15223. }
  15224. function get$2(object, path, defaultValue2) {
  15225. var result = object == null ? void 0 : baseGet(object, path);
  15226. return result === void 0 ? defaultValue2 : result;
  15227. }
  15228. function arrayPush(array, values3) {
  15229. var index2 = -1, length = values3.length, offset = array.length;
  15230. while (++index2 < length) {
  15231. array[offset + index2] = values3[index2];
  15232. }
  15233. return array;
  15234. }
  15235. function castArray() {
  15236. if (!arguments.length) {
  15237. return [];
  15238. }
  15239. var value = arguments[0];
  15240. return isArray$1(value) ? value : [value];
  15241. }
  15242. function stackClear() {
  15243. this.__data__ = new ListCache();
  15244. this.size = 0;
  15245. }
  15246. function stackDelete(key) {
  15247. var data = this.__data__, result = data["delete"](key);
  15248. this.size = data.size;
  15249. return result;
  15250. }
  15251. function stackGet(key) {
  15252. return this.__data__.get(key);
  15253. }
  15254. function stackHas(key) {
  15255. return this.__data__.has(key);
  15256. }
  15257. var LARGE_ARRAY_SIZE = 200;
  15258. function stackSet(key, value) {
  15259. var data = this.__data__;
  15260. if (data instanceof ListCache) {
  15261. var pairs = data.__data__;
  15262. if (!Map$3 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  15263. pairs.push([key, value]);
  15264. this.size = ++data.size;
  15265. return this;
  15266. }
  15267. data = this.__data__ = new MapCache(pairs);
  15268. }
  15269. data.set(key, value);
  15270. this.size = data.size;
  15271. return this;
  15272. }
  15273. function Stack(entries) {
  15274. var data = this.__data__ = new ListCache(entries);
  15275. this.size = data.size;
  15276. }
  15277. Stack.prototype.clear = stackClear;
  15278. Stack.prototype["delete"] = stackDelete;
  15279. Stack.prototype.get = stackGet;
  15280. Stack.prototype.has = stackHas;
  15281. Stack.prototype.set = stackSet;
  15282. function arrayFilter(array, predicate) {
  15283. var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  15284. while (++index2 < length) {
  15285. var value = array[index2];
  15286. if (predicate(value, index2, array)) {
  15287. result[resIndex++] = value;
  15288. }
  15289. }
  15290. return result;
  15291. }
  15292. function stubArray() {
  15293. return [];
  15294. }
  15295. var objectProto$2 = Object.prototype;
  15296. var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
  15297. var nativeGetSymbols = Object.getOwnPropertySymbols;
  15298. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  15299. if (object == null) {
  15300. return [];
  15301. }
  15302. object = Object(object);
  15303. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  15304. return propertyIsEnumerable.call(object, symbol);
  15305. });
  15306. };
  15307. var getSymbols$1 = getSymbols;
  15308. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  15309. var result = keysFunc(object);
  15310. return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
  15311. }
  15312. function getAllKeys(object) {
  15313. return baseGetAllKeys(object, keys$2, getSymbols$1);
  15314. }
  15315. var DataView$1 = getNative(root$1, "DataView");
  15316. var DataView$2 = DataView$1;
  15317. var Promise$1 = getNative(root$1, "Promise");
  15318. var Promise$2 = Promise$1;
  15319. var Set$2 = getNative(root$1, "Set");
  15320. var Set$3 = Set$2;
  15321. var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
  15322. var dataViewTag$1 = "[object DataView]";
  15323. var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$3), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$3), weakMapCtorString = toSource(WeakMap$2);
  15324. var getTag = baseGetTag;
  15325. if (DataView$2 && getTag(new DataView$2(new ArrayBuffer(1))) != dataViewTag$1 || Map$3 && getTag(new Map$3()) != mapTag$1 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$3 && getTag(new Set$3()) != setTag$1 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag) {
  15326. getTag = function(value) {
  15327. var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  15328. if (ctorString) {
  15329. switch (ctorString) {
  15330. case dataViewCtorString:
  15331. return dataViewTag$1;
  15332. case mapCtorString:
  15333. return mapTag$1;
  15334. case promiseCtorString:
  15335. return promiseTag;
  15336. case setCtorString:
  15337. return setTag$1;
  15338. case weakMapCtorString:
  15339. return weakMapTag;
  15340. }
  15341. }
  15342. return result;
  15343. };
  15344. }
  15345. var getTag$1 = getTag;
  15346. var Uint8Array$1 = root$1.Uint8Array;
  15347. var Uint8Array$2 = Uint8Array$1;
  15348. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  15349. function setCacheAdd(value) {
  15350. this.__data__.set(value, HASH_UNDEFINED);
  15351. return this;
  15352. }
  15353. function setCacheHas(value) {
  15354. return this.__data__.has(value);
  15355. }
  15356. function SetCache(values3) {
  15357. var index2 = -1, length = values3 == null ? 0 : values3.length;
  15358. this.__data__ = new MapCache();
  15359. while (++index2 < length) {
  15360. this.add(values3[index2]);
  15361. }
  15362. }
  15363. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  15364. SetCache.prototype.has = setCacheHas;
  15365. function arraySome(array, predicate) {
  15366. var index2 = -1, length = array == null ? 0 : array.length;
  15367. while (++index2 < length) {
  15368. if (predicate(array[index2], index2, array)) {
  15369. return true;
  15370. }
  15371. }
  15372. return false;
  15373. }
  15374. function cacheHas(cache, key) {
  15375. return cache.has(key);
  15376. }
  15377. var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  15378. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  15379. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
  15380. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  15381. return false;
  15382. }
  15383. var arrStacked = stack.get(array);
  15384. var othStacked = stack.get(other);
  15385. if (arrStacked && othStacked) {
  15386. return arrStacked == other && othStacked == array;
  15387. }
  15388. var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
  15389. stack.set(array, other);
  15390. stack.set(other, array);
  15391. while (++index2 < arrLength) {
  15392. var arrValue = array[index2], othValue = other[index2];
  15393. if (customizer) {
  15394. var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
  15395. }
  15396. if (compared !== void 0) {
  15397. if (compared) {
  15398. continue;
  15399. }
  15400. result = false;
  15401. break;
  15402. }
  15403. if (seen) {
  15404. if (!arraySome(other, function(othValue2, othIndex) {
  15405. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  15406. return seen.push(othIndex);
  15407. }
  15408. })) {
  15409. result = false;
  15410. break;
  15411. }
  15412. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  15413. result = false;
  15414. break;
  15415. }
  15416. }
  15417. stack["delete"](array);
  15418. stack["delete"](other);
  15419. return result;
  15420. }
  15421. function mapToArray(map) {
  15422. var index2 = -1, result = Array(map.size);
  15423. map.forEach(function(value, key) {
  15424. result[++index2] = [key, value];
  15425. });
  15426. return result;
  15427. }
  15428. function setToArray(set4) {
  15429. var index2 = -1, result = Array(set4.size);
  15430. set4.forEach(function(value) {
  15431. result[++index2] = value;
  15432. });
  15433. return result;
  15434. }
  15435. var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
  15436. var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
  15437. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
  15438. var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  15439. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  15440. switch (tag) {
  15441. case dataViewTag:
  15442. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  15443. return false;
  15444. }
  15445. object = object.buffer;
  15446. other = other.buffer;
  15447. case arrayBufferTag:
  15448. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object), new Uint8Array$2(other))) {
  15449. return false;
  15450. }
  15451. return true;
  15452. case boolTag:
  15453. case dateTag:
  15454. case numberTag:
  15455. return eq(+object, +other);
  15456. case errorTag:
  15457. return object.name == other.name && object.message == other.message;
  15458. case regexpTag:
  15459. case stringTag:
  15460. return object == other + "";
  15461. case mapTag:
  15462. var convert = mapToArray;
  15463. case setTag:
  15464. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
  15465. convert || (convert = setToArray);
  15466. if (object.size != other.size && !isPartial) {
  15467. return false;
  15468. }
  15469. var stacked = stack.get(object);
  15470. if (stacked) {
  15471. return stacked == other;
  15472. }
  15473. bitmask |= COMPARE_UNORDERED_FLAG;
  15474. stack.set(object, other);
  15475. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  15476. stack["delete"](object);
  15477. return result;
  15478. case symbolTag:
  15479. if (symbolValueOf) {
  15480. return symbolValueOf.call(object) == symbolValueOf.call(other);
  15481. }
  15482. }
  15483. return false;
  15484. }
  15485. var COMPARE_PARTIAL_FLAG$1 = 1;
  15486. var objectProto$1 = Object.prototype;
  15487. var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
  15488. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  15489. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  15490. if (objLength != othLength && !isPartial) {
  15491. return false;
  15492. }
  15493. var index2 = objLength;
  15494. while (index2--) {
  15495. var key = objProps[index2];
  15496. if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
  15497. return false;
  15498. }
  15499. }
  15500. var objStacked = stack.get(object);
  15501. var othStacked = stack.get(other);
  15502. if (objStacked && othStacked) {
  15503. return objStacked == other && othStacked == object;
  15504. }
  15505. var result = true;
  15506. stack.set(object, other);
  15507. stack.set(other, object);
  15508. var skipCtor = isPartial;
  15509. while (++index2 < objLength) {
  15510. key = objProps[index2];
  15511. var objValue = object[key], othValue = other[key];
  15512. if (customizer) {
  15513. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  15514. }
  15515. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  15516. result = false;
  15517. break;
  15518. }
  15519. skipCtor || (skipCtor = key == "constructor");
  15520. }
  15521. if (result && !skipCtor) {
  15522. var objCtor = object.constructor, othCtor = other.constructor;
  15523. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  15524. result = false;
  15525. }
  15526. }
  15527. stack["delete"](object);
  15528. stack["delete"](other);
  15529. return result;
  15530. }
  15531. var COMPARE_PARTIAL_FLAG = 1;
  15532. var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  15533. var objectProto = Object.prototype;
  15534. var hasOwnProperty = objectProto.hasOwnProperty;
  15535. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  15536. var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
  15537. objTag = objTag == argsTag ? objectTag : objTag;
  15538. othTag = othTag == argsTag ? objectTag : othTag;
  15539. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  15540. if (isSameTag && isBuffer$1(object)) {
  15541. if (!isBuffer$1(other)) {
  15542. return false;
  15543. }
  15544. objIsArr = true;
  15545. objIsObj = false;
  15546. }
  15547. if (isSameTag && !objIsObj) {
  15548. stack || (stack = new Stack());
  15549. return objIsArr || isTypedArray$3(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  15550. }
  15551. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  15552. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  15553. if (objIsWrapped || othIsWrapped) {
  15554. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  15555. stack || (stack = new Stack());
  15556. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  15557. }
  15558. }
  15559. if (!isSameTag) {
  15560. return false;
  15561. }
  15562. stack || (stack = new Stack());
  15563. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  15564. }
  15565. function baseIsEqual(value, other, bitmask, customizer, stack) {
  15566. if (value === other) {
  15567. return true;
  15568. }
  15569. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  15570. return value !== value && other !== other;
  15571. }
  15572. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  15573. }
  15574. var now = function() {
  15575. return root$1.Date.now();
  15576. };
  15577. var now$1 = now;
  15578. var FUNC_ERROR_TEXT = "Expected a function";
  15579. var nativeMax = Math.max, nativeMin = Math.min;
  15580. function debounce$2(func, wait, options2) {
  15581. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  15582. if (typeof func != "function") {
  15583. throw new TypeError(FUNC_ERROR_TEXT);
  15584. }
  15585. wait = toNumber(wait) || 0;
  15586. if (isObject$4(options2)) {
  15587. leading = !!options2.leading;
  15588. maxing = "maxWait" in options2;
  15589. maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
  15590. trailing = "trailing" in options2 ? !!options2.trailing : trailing;
  15591. }
  15592. function invokeFunc(time) {
  15593. var args = lastArgs, thisArg = lastThis;
  15594. lastArgs = lastThis = void 0;
  15595. lastInvokeTime = time;
  15596. result = func.apply(thisArg, args);
  15597. return result;
  15598. }
  15599. function leadingEdge(time) {
  15600. lastInvokeTime = time;
  15601. timerId = setTimeout(timerExpired, wait);
  15602. return leading ? invokeFunc(time) : result;
  15603. }
  15604. function remainingWait(time) {
  15605. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  15606. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  15607. }
  15608. function shouldInvoke(time) {
  15609. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  15610. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  15611. }
  15612. function timerExpired() {
  15613. var time = now$1();
  15614. if (shouldInvoke(time)) {
  15615. return trailingEdge(time);
  15616. }
  15617. timerId = setTimeout(timerExpired, remainingWait(time));
  15618. }
  15619. function trailingEdge(time) {
  15620. timerId = void 0;
  15621. if (trailing && lastArgs) {
  15622. return invokeFunc(time);
  15623. }
  15624. lastArgs = lastThis = void 0;
  15625. return result;
  15626. }
  15627. function cancel() {
  15628. if (timerId !== void 0) {
  15629. clearTimeout(timerId);
  15630. }
  15631. lastInvokeTime = 0;
  15632. lastArgs = lastCallTime = lastThis = timerId = void 0;
  15633. }
  15634. function flush() {
  15635. return timerId === void 0 ? result : trailingEdge(now$1());
  15636. }
  15637. function debounced() {
  15638. var time = now$1(), isInvoking = shouldInvoke(time);
  15639. lastArgs = arguments;
  15640. lastThis = this;
  15641. lastCallTime = time;
  15642. if (isInvoking) {
  15643. if (timerId === void 0) {
  15644. return leadingEdge(lastCallTime);
  15645. }
  15646. if (maxing) {
  15647. clearTimeout(timerId);
  15648. timerId = setTimeout(timerExpired, wait);
  15649. return invokeFunc(lastCallTime);
  15650. }
  15651. }
  15652. if (timerId === void 0) {
  15653. timerId = setTimeout(timerExpired, wait);
  15654. }
  15655. return result;
  15656. }
  15657. debounced.cancel = cancel;
  15658. debounced.flush = flush;
  15659. return debounced;
  15660. }
  15661. function fromPairs(pairs) {
  15662. var index2 = -1, length = pairs == null ? 0 : pairs.length, result = {};
  15663. while (++index2 < length) {
  15664. var pair = pairs[index2];
  15665. result[pair[0]] = pair[1];
  15666. }
  15667. return result;
  15668. }
  15669. function isEqual(value, other) {
  15670. return baseIsEqual(value, other);
  15671. }
  15672. function isNil(value) {
  15673. return value == null;
  15674. }
  15675. function isUndefined$1(value) {
  15676. return value === void 0;
  15677. }
  15678. const isUndefined = (val) => val === void 0;
  15679. const isBoolean = (val) => typeof val === "boolean";
  15680. const isNumber = (val) => typeof val === "number";
  15681. const isElement = (e) => {
  15682. if (typeof Element === "undefined")
  15683. return false;
  15684. return e instanceof Element;
  15685. };
  15686. const isStringNumber = (val) => {
  15687. if (!isString(val)) {
  15688. return false;
  15689. }
  15690. return !Number.isNaN(Number(val));
  15691. };
  15692. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  15693. const keysOf = (arr) => Object.keys(arr);
  15694. class ElementPlusError extends Error {
  15695. constructor(m) {
  15696. super(m);
  15697. this.name = "ElementPlusError";
  15698. }
  15699. }
  15700. function throwError(scope, m) {
  15701. throw new ElementPlusError(`[${scope}] ${m}`);
  15702. }
  15703. function debugWarn(scope, message) {
  15704. }
  15705. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  15706. const hasClass$2 = (el, cls) => {
  15707. if (!el || !cls)
  15708. return false;
  15709. if (cls.includes(" "))
  15710. throw new Error("className should not contain space.");
  15711. return el.classList.contains(cls);
  15712. };
  15713. const addClass$2 = (el, cls) => {
  15714. if (!el || !cls.trim())
  15715. return;
  15716. el.classList.add(...classNameToArray(cls));
  15717. };
  15718. const removeClass$2 = (el, cls) => {
  15719. if (!el || !cls.trim())
  15720. return;
  15721. el.classList.remove(...classNameToArray(cls));
  15722. };
  15723. const getStyle = (element, styleName) => {
  15724. var _a2;
  15725. if (!isClient || !element || !styleName)
  15726. return "";
  15727. let key = camelize(styleName);
  15728. if (key === "float")
  15729. key = "cssFloat";
  15730. try {
  15731. const style = element.style[key];
  15732. if (style)
  15733. return style;
  15734. const computed2 = (_a2 = document.defaultView) == null ? void 0 : _a2.getComputedStyle(element, "");
  15735. return computed2 ? computed2[key] : "";
  15736. } catch (e) {
  15737. return element.style[key];
  15738. }
  15739. };
  15740. function addUnit(value, defaultUnit = "px") {
  15741. if (!value)
  15742. return "";
  15743. if (isNumber(value) || isStringNumber(value)) {
  15744. return `${value}${defaultUnit}`;
  15745. } else if (isString(value)) {
  15746. return value;
  15747. }
  15748. }
  15749. let scrollBarWidth;
  15750. const getScrollBarWidth = (namespace) => {
  15751. var _a2;
  15752. if (!isClient)
  15753. return 0;
  15754. if (scrollBarWidth !== void 0)
  15755. return scrollBarWidth;
  15756. const outer = document.createElement("div");
  15757. outer.className = `${namespace}-scrollbar__wrap`;
  15758. outer.style.visibility = "hidden";
  15759. outer.style.width = "100px";
  15760. outer.style.position = "absolute";
  15761. outer.style.top = "-9999px";
  15762. document.body.appendChild(outer);
  15763. const widthNoScroll = outer.offsetWidth;
  15764. outer.style.overflow = "scroll";
  15765. const inner = document.createElement("div");
  15766. inner.style.width = "100%";
  15767. outer.appendChild(inner);
  15768. const widthWithScroll = inner.offsetWidth;
  15769. (_a2 = outer.parentNode) == null ? void 0 : _a2.removeChild(outer);
  15770. scrollBarWidth = widthNoScroll - widthWithScroll;
  15771. return scrollBarWidth;
  15772. };
  15773. function scrollIntoView(container, selected) {
  15774. if (!isClient)
  15775. return;
  15776. if (!selected) {
  15777. container.scrollTop = 0;
  15778. return;
  15779. }
  15780. const offsetParents = [];
  15781. let pointer = selected.offsetParent;
  15782. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  15783. offsetParents.push(pointer);
  15784. pointer = pointer.offsetParent;
  15785. }
  15786. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  15787. const bottom = top + selected.offsetHeight;
  15788. const viewRectTop = container.scrollTop;
  15789. const viewRectBottom = viewRectTop + container.clientHeight;
  15790. if (top < viewRectTop) {
  15791. container.scrollTop = top;
  15792. } else if (bottom > viewRectBottom) {
  15793. container.scrollTop = bottom - container.clientHeight;
  15794. }
  15795. }
  15796. /*! Element Plus Icons Vue v2.1.0 */
  15797. var export_helper_default = (sfc, props) => {
  15798. let target = sfc.__vccOpts || sfc;
  15799. for (let [key, val] of props)
  15800. target[key] = val;
  15801. return target;
  15802. };
  15803. var arrow_down_vue_vue_type_script_lang_default = {
  15804. name: "ArrowDown"
  15805. };
  15806. var _hoisted_16$2 = {
  15807. xmlns: "http://www.w3.org/2000/svg",
  15808. viewBox: "0 0 1024 1024"
  15809. }, _hoisted_26$2 = /* @__PURE__ */ createElementVNode(
  15810. "path",
  15811. {
  15812. fill: "currentColor",
  15813. d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
  15814. },
  15815. null,
  15816. -1
  15817. ), _hoisted_36$2 = [
  15818. _hoisted_26$2
  15819. ];
  15820. function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
  15821. return openBlock(), createElementBlock("svg", _hoisted_16$2, _hoisted_36$2);
  15822. }
  15823. var arrow_down_default = /* @__PURE__ */ export_helper_default(arrow_down_vue_vue_type_script_lang_default, [["render", _sfc_render6], ["__file", "arrow-down.vue"]]);
  15824. var arrow_right_vue_vue_type_script_lang_default = {
  15825. name: "ArrowRight"
  15826. };
  15827. var _hoisted_110 = {
  15828. xmlns: "http://www.w3.org/2000/svg",
  15829. viewBox: "0 0 1024 1024"
  15830. }, _hoisted_210 = /* @__PURE__ */ createElementVNode(
  15831. "path",
  15832. {
  15833. fill: "currentColor",
  15834. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
  15835. },
  15836. null,
  15837. -1
  15838. ), _hoisted_310 = [
  15839. _hoisted_210
  15840. ];
  15841. function _sfc_render10(_ctx, _cache, $props, $setup, $data, $options) {
  15842. return openBlock(), createElementBlock("svg", _hoisted_110, _hoisted_310);
  15843. }
  15844. var arrow_right_default = /* @__PURE__ */ export_helper_default(arrow_right_vue_vue_type_script_lang_default, [["render", _sfc_render10], ["__file", "arrow-right.vue"]]);
  15845. var arrow_up_vue_vue_type_script_lang_default = {
  15846. name: "ArrowUp"
  15847. };
  15848. var _hoisted_112 = {
  15849. xmlns: "http://www.w3.org/2000/svg",
  15850. viewBox: "0 0 1024 1024"
  15851. }, _hoisted_212 = /* @__PURE__ */ createElementVNode(
  15852. "path",
  15853. {
  15854. fill: "currentColor",
  15855. d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0z"
  15856. },
  15857. null,
  15858. -1
  15859. ), _hoisted_312 = [
  15860. _hoisted_212
  15861. ];
  15862. function _sfc_render12(_ctx, _cache, $props, $setup, $data, $options) {
  15863. return openBlock(), createElementBlock("svg", _hoisted_112, _hoisted_312);
  15864. }
  15865. var arrow_up_default = /* @__PURE__ */ export_helper_default(arrow_up_vue_vue_type_script_lang_default, [["render", _sfc_render12], ["__file", "arrow-up.vue"]]);
  15866. var circle_check_vue_vue_type_script_lang_default = {
  15867. name: "CircleCheck"
  15868. };
  15869. var _hoisted_149 = {
  15870. xmlns: "http://www.w3.org/2000/svg",
  15871. viewBox: "0 0 1024 1024"
  15872. }, _hoisted_249 = /* @__PURE__ */ createElementVNode(
  15873. "path",
  15874. {
  15875. fill: "currentColor",
  15876. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15877. },
  15878. null,
  15879. -1
  15880. ), _hoisted_348 = /* @__PURE__ */ createElementVNode(
  15881. "path",
  15882. {
  15883. fill: "currentColor",
  15884. d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
  15885. },
  15886. null,
  15887. -1
  15888. ), _hoisted_415 = [
  15889. _hoisted_249,
  15890. _hoisted_348
  15891. ];
  15892. function _sfc_render49(_ctx, _cache, $props, $setup, $data, $options) {
  15893. return openBlock(), createElementBlock("svg", _hoisted_149, _hoisted_415);
  15894. }
  15895. var circle_check_default = /* @__PURE__ */ export_helper_default(circle_check_vue_vue_type_script_lang_default, [["render", _sfc_render49], ["__file", "circle-check.vue"]]);
  15896. var circle_close_vue_vue_type_script_lang_default = {
  15897. name: "CircleClose"
  15898. };
  15899. var _hoisted_151 = {
  15900. xmlns: "http://www.w3.org/2000/svg",
  15901. viewBox: "0 0 1024 1024"
  15902. }, _hoisted_251 = /* @__PURE__ */ createElementVNode(
  15903. "path",
  15904. {
  15905. fill: "currentColor",
  15906. d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"
  15907. },
  15908. null,
  15909. -1
  15910. ), _hoisted_350 = /* @__PURE__ */ createElementVNode(
  15911. "path",
  15912. {
  15913. fill: "currentColor",
  15914. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15915. },
  15916. null,
  15917. -1
  15918. ), _hoisted_416 = [
  15919. _hoisted_251,
  15920. _hoisted_350
  15921. ];
  15922. function _sfc_render51(_ctx, _cache, $props, $setup, $data, $options) {
  15923. return openBlock(), createElementBlock("svg", _hoisted_151, _hoisted_416);
  15924. }
  15925. var circle_close_default = /* @__PURE__ */ export_helper_default(circle_close_vue_vue_type_script_lang_default, [["render", _sfc_render51], ["__file", "circle-close.vue"]]);
  15926. var close_vue_vue_type_script_lang_default = {
  15927. name: "Close"
  15928. };
  15929. var _hoisted_156 = {
  15930. xmlns: "http://www.w3.org/2000/svg",
  15931. viewBox: "0 0 1024 1024"
  15932. }, _hoisted_256 = /* @__PURE__ */ createElementVNode(
  15933. "path",
  15934. {
  15935. fill: "currentColor",
  15936. d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
  15937. },
  15938. null,
  15939. -1
  15940. ), _hoisted_355 = [
  15941. _hoisted_256
  15942. ];
  15943. function _sfc_render56(_ctx, _cache, $props, $setup, $data, $options) {
  15944. return openBlock(), createElementBlock("svg", _hoisted_156, _hoisted_355);
  15945. }
  15946. var close_default = /* @__PURE__ */ export_helper_default(close_vue_vue_type_script_lang_default, [["render", _sfc_render56], ["__file", "close.vue"]]);
  15947. var delete_vue_vue_type_script_lang_default = {
  15948. name: "Delete"
  15949. };
  15950. var _hoisted_180 = {
  15951. xmlns: "http://www.w3.org/2000/svg",
  15952. viewBox: "0 0 1024 1024"
  15953. }, _hoisted_280 = /* @__PURE__ */ createElementVNode(
  15954. "path",
  15955. {
  15956. fill: "currentColor",
  15957. d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
  15958. },
  15959. null,
  15960. -1
  15961. ), _hoisted_379 = [
  15962. _hoisted_280
  15963. ];
  15964. function _sfc_render80(_ctx, _cache, $props, $setup, $data, $options) {
  15965. return openBlock(), createElementBlock("svg", _hoisted_180, _hoisted_379);
  15966. }
  15967. var delete_default = /* @__PURE__ */ export_helper_default(delete_vue_vue_type_script_lang_default, [["render", _sfc_render80], ["__file", "delete.vue"]]);
  15968. var edit_vue_vue_type_script_lang_default = {
  15969. name: "Edit"
  15970. };
  15971. var _hoisted_194 = {
  15972. xmlns: "http://www.w3.org/2000/svg",
  15973. viewBox: "0 0 1024 1024"
  15974. }, _hoisted_294 = /* @__PURE__ */ createElementVNode(
  15975. "path",
  15976. {
  15977. fill: "currentColor",
  15978. d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z"
  15979. },
  15980. null,
  15981. -1
  15982. ), _hoisted_393 = /* @__PURE__ */ createElementVNode(
  15983. "path",
  15984. {
  15985. fill: "currentColor",
  15986. d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
  15987. },
  15988. null,
  15989. -1
  15990. ), _hoisted_431 = [
  15991. _hoisted_294,
  15992. _hoisted_393
  15993. ];
  15994. function _sfc_render94(_ctx, _cache, $props, $setup, $data, $options) {
  15995. return openBlock(), createElementBlock("svg", _hoisted_194, _hoisted_431);
  15996. }
  15997. var edit_default = /* @__PURE__ */ export_helper_default(edit_vue_vue_type_script_lang_default, [["render", _sfc_render94], ["__file", "edit.vue"]]);
  15998. var hide_vue_vue_type_script_lang_default = {
  15999. name: "Hide"
  16000. };
  16001. var _hoisted_1133 = {
  16002. xmlns: "http://www.w3.org/2000/svg",
  16003. viewBox: "0 0 1024 1024"
  16004. }, _hoisted_2133 = /* @__PURE__ */ createElementVNode(
  16005. "path",
  16006. {
  16007. fill: "currentColor",
  16008. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
  16009. },
  16010. null,
  16011. -1
  16012. ), _hoisted_3132 = /* @__PURE__ */ createElementVNode(
  16013. "path",
  16014. {
  16015. fill: "currentColor",
  16016. d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
  16017. },
  16018. null,
  16019. -1
  16020. ), _hoisted_438 = [
  16021. _hoisted_2133,
  16022. _hoisted_3132
  16023. ];
  16024. function _sfc_render133(_ctx, _cache, $props, $setup, $data, $options) {
  16025. return openBlock(), createElementBlock("svg", _hoisted_1133, _hoisted_438);
  16026. }
  16027. var hide_default = /* @__PURE__ */ export_helper_default(hide_vue_vue_type_script_lang_default, [["render", _sfc_render133], ["__file", "hide.vue"]]);
  16028. var loading_vue_vue_type_script_lang_default = {
  16029. name: "Loading"
  16030. };
  16031. var _hoisted_1150 = {
  16032. xmlns: "http://www.w3.org/2000/svg",
  16033. viewBox: "0 0 1024 1024"
  16034. }, _hoisted_2150 = /* @__PURE__ */ createElementVNode(
  16035. "path",
  16036. {
  16037. fill: "currentColor",
  16038. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
  16039. },
  16040. null,
  16041. -1
  16042. ), _hoisted_3149 = [
  16043. _hoisted_2150
  16044. ];
  16045. function _sfc_render150(_ctx, _cache, $props, $setup, $data, $options) {
  16046. return openBlock(), createElementBlock("svg", _hoisted_1150, _hoisted_3149);
  16047. }
  16048. var loading_default = /* @__PURE__ */ export_helper_default(loading_vue_vue_type_script_lang_default, [["render", _sfc_render150], ["__file", "loading.vue"]]);
  16049. var minus_vue_vue_type_script_lang_default = {
  16050. name: "Minus"
  16051. };
  16052. var _hoisted_1169 = {
  16053. xmlns: "http://www.w3.org/2000/svg",
  16054. viewBox: "0 0 1024 1024"
  16055. }, _hoisted_2169 = /* @__PURE__ */ createElementVNode(
  16056. "path",
  16057. {
  16058. fill: "currentColor",
  16059. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"
  16060. },
  16061. null,
  16062. -1
  16063. ), _hoisted_3168 = [
  16064. _hoisted_2169
  16065. ];
  16066. function _sfc_render169(_ctx, _cache, $props, $setup, $data, $options) {
  16067. return openBlock(), createElementBlock("svg", _hoisted_1169, _hoisted_3168);
  16068. }
  16069. var minus_default = /* @__PURE__ */ export_helper_default(minus_vue_vue_type_script_lang_default, [["render", _sfc_render169], ["__file", "minus.vue"]]);
  16070. var plus_vue_vue_type_script_lang_default = {
  16071. name: "Plus"
  16072. };
  16073. var _hoisted_1201 = {
  16074. xmlns: "http://www.w3.org/2000/svg",
  16075. viewBox: "0 0 1024 1024"
  16076. }, _hoisted_2201 = /* @__PURE__ */ createElementVNode(
  16077. "path",
  16078. {
  16079. fill: "currentColor",
  16080. d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"
  16081. },
  16082. null,
  16083. -1
  16084. ), _hoisted_3200 = [
  16085. _hoisted_2201
  16086. ];
  16087. function _sfc_render201(_ctx, _cache, $props, $setup, $data, $options) {
  16088. return openBlock(), createElementBlock("svg", _hoisted_1201, _hoisted_3200);
  16089. }
  16090. var plus_default = /* @__PURE__ */ export_helper_default(plus_vue_vue_type_script_lang_default, [["render", _sfc_render201], ["__file", "plus.vue"]]);
  16091. var setting_vue_vue_type_script_lang_default = {
  16092. name: "Setting"
  16093. };
  16094. var _hoisted_1231 = {
  16095. xmlns: "http://www.w3.org/2000/svg",
  16096. viewBox: "0 0 1024 1024"
  16097. }, _hoisted_2231 = /* @__PURE__ */ createElementVNode(
  16098. "path",
  16099. {
  16100. fill: "currentColor",
  16101. d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357.12 357.12 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a351.616 351.616 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357.12 357.12 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294.113 294.113 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293.12 293.12 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294.113 294.113 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288.282 288.282 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293.12 293.12 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a287.616 287.616 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384zm0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256z"
  16102. },
  16103. null,
  16104. -1
  16105. ), _hoisted_3230 = [
  16106. _hoisted_2231
  16107. ];
  16108. function _sfc_render231(_ctx, _cache, $props, $setup, $data, $options) {
  16109. return openBlock(), createElementBlock("svg", _hoisted_1231, _hoisted_3230);
  16110. }
  16111. var setting_default = /* @__PURE__ */ export_helper_default(setting_vue_vue_type_script_lang_default, [["render", _sfc_render231], ["__file", "setting.vue"]]);
  16112. var view_vue_vue_type_script_lang_default = {
  16113. name: "View"
  16114. };
  16115. var _hoisted_1283 = {
  16116. xmlns: "http://www.w3.org/2000/svg",
  16117. viewBox: "0 0 1024 1024"
  16118. }, _hoisted_2283 = /* @__PURE__ */ createElementVNode(
  16119. "path",
  16120. {
  16121. fill: "currentColor",
  16122. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
  16123. },
  16124. null,
  16125. -1
  16126. ), _hoisted_3282 = [
  16127. _hoisted_2283
  16128. ];
  16129. function _sfc_render283(_ctx, _cache, $props, $setup, $data, $options) {
  16130. return openBlock(), createElementBlock("svg", _hoisted_1283, _hoisted_3282);
  16131. }
  16132. var view_default = /* @__PURE__ */ export_helper_default(view_vue_vue_type_script_lang_default, [["render", _sfc_render283], ["__file", "view.vue"]]);
  16133. const epPropKey = "__epPropKey";
  16134. const definePropType = (val) => val;
  16135. const isEpProp = (val) => isObject$5(val) && !!val[epPropKey];
  16136. const buildProp = (prop, key) => {
  16137. if (!isObject$5(prop) || isEpProp(prop))
  16138. return prop;
  16139. const { values: values3, required, default: defaultValue2, type: type2, validator } = prop;
  16140. const _validator = values3 || validator ? (val) => {
  16141. let valid = false;
  16142. let allowedValues = [];
  16143. if (values3) {
  16144. allowedValues = Array.from(values3);
  16145. if (hasOwn(prop, "default")) {
  16146. allowedValues.push(defaultValue2);
  16147. }
  16148. valid || (valid = allowedValues.includes(val));
  16149. }
  16150. if (validator)
  16151. valid || (valid = validator(val));
  16152. if (!valid && allowedValues.length > 0) {
  16153. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  16154. warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  16155. }
  16156. return valid;
  16157. } : void 0;
  16158. const epProp = {
  16159. type: type2,
  16160. required: !!required,
  16161. validator: _validator,
  16162. [epPropKey]: true
  16163. };
  16164. if (hasOwn(prop, "default"))
  16165. epProp.default = defaultValue2;
  16166. return epProp;
  16167. };
  16168. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
  16169. key,
  16170. buildProp(option, key)
  16171. ]));
  16172. const iconPropType = definePropType([
  16173. String,
  16174. Object,
  16175. Function
  16176. ]);
  16177. const CloseComponents = {
  16178. Close: close_default
  16179. };
  16180. const ValidateComponentsMap = {
  16181. validating: loading_default,
  16182. success: circle_check_default,
  16183. error: circle_close_default
  16184. };
  16185. const withInstall = (main, extra) => {
  16186. main.install = (app) => {
  16187. for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
  16188. app.component(comp.name, comp);
  16189. }
  16190. };
  16191. if (extra) {
  16192. for (const [key, comp] of Object.entries(extra)) {
  16193. main[key] = comp;
  16194. }
  16195. }
  16196. return main;
  16197. };
  16198. const withNoopInstall = (component) => {
  16199. component.install = NOOP;
  16200. return component;
  16201. };
  16202. const composeRefs = (...refs) => {
  16203. return (el) => {
  16204. refs.forEach((ref2) => {
  16205. if (isFunction$3(ref2)) {
  16206. ref2(el);
  16207. } else {
  16208. ref2.value = el;
  16209. }
  16210. });
  16211. };
  16212. };
  16213. const EVENT_CODE = {
  16214. tab: "Tab",
  16215. enter: "Enter",
  16216. space: "Space",
  16217. left: "ArrowLeft",
  16218. up: "ArrowUp",
  16219. right: "ArrowRight",
  16220. down: "ArrowDown",
  16221. esc: "Escape",
  16222. delete: "Delete",
  16223. backspace: "Backspace",
  16224. numpadEnter: "NumpadEnter",
  16225. pageUp: "PageUp",
  16226. pageDown: "PageDown",
  16227. home: "Home",
  16228. end: "End"
  16229. };
  16230. const UPDATE_MODEL_EVENT = "update:modelValue";
  16231. const CHANGE_EVENT = "change";
  16232. const INPUT_EVENT = "input";
  16233. const componentSizes = ["", "default", "small", "large"];
  16234. const componentSizeMap = {
  16235. large: 40,
  16236. default: 32,
  16237. small: 24
  16238. };
  16239. const getComponentSize = (size) => {
  16240. return componentSizeMap[size || "default"];
  16241. };
  16242. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  16243. var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
  16244. PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
  16245. PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
  16246. PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
  16247. PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
  16248. PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
  16249. PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  16250. PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  16251. PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  16252. PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  16253. PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
  16254. PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  16255. PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
  16256. PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
  16257. return PatchFlags2;
  16258. })(PatchFlags || {});
  16259. const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
  16260. const generateId = () => Math.floor(Math.random() * 1e4);
  16261. const mutable = (val) => val;
  16262. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  16263. const LISTENER_PREFIX = /^on[A-Z]/;
  16264. const useAttrs = (params = {}) => {
  16265. const { excludeListeners = false, excludeKeys } = params;
  16266. const allExcludeKeys = computed$1(() => {
  16267. return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
  16268. });
  16269. const instance = getCurrentInstance();
  16270. if (!instance) {
  16271. return computed$1(() => ({}));
  16272. }
  16273. return computed$1(() => {
  16274. var _a2;
  16275. return fromPairs(Object.entries((_a2 = instance.proxy) == null ? void 0 : _a2.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
  16276. });
  16277. };
  16278. const useDeprecated = ({ from: from3, replacement, scope, version: version2, ref: ref2, type: type2 = "API" }, condition) => {
  16279. watch(() => unref(condition), (val) => {
  16280. }, {
  16281. immediate: true
  16282. });
  16283. };
  16284. const useDraggable = (targetRef, dragRef, draggable2) => {
  16285. let transform3 = {
  16286. offsetX: 0,
  16287. offsetY: 0
  16288. };
  16289. const onMousedown = (e) => {
  16290. const downX = e.clientX;
  16291. const downY = e.clientY;
  16292. const { offsetX, offsetY } = transform3;
  16293. const targetRect = targetRef.value.getBoundingClientRect();
  16294. const targetLeft = targetRect.left;
  16295. const targetTop = targetRect.top;
  16296. const targetWidth = targetRect.width;
  16297. const targetHeight = targetRect.height;
  16298. const clientWidth = document.documentElement.clientWidth;
  16299. const clientHeight = document.documentElement.clientHeight;
  16300. const minLeft = -targetLeft + offsetX;
  16301. const minTop = -targetTop + offsetY;
  16302. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  16303. const maxTop = clientHeight - targetTop - targetHeight + offsetY;
  16304. const onMousemove = (e2) => {
  16305. const moveX = Math.min(Math.max(offsetX + e2.clientX - downX, minLeft), maxLeft);
  16306. const moveY = Math.min(Math.max(offsetY + e2.clientY - downY, minTop), maxTop);
  16307. transform3 = {
  16308. offsetX: moveX,
  16309. offsetY: moveY
  16310. };
  16311. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  16312. };
  16313. const onMouseup = () => {
  16314. document.removeEventListener("mousemove", onMousemove);
  16315. document.removeEventListener("mouseup", onMouseup);
  16316. };
  16317. document.addEventListener("mousemove", onMousemove);
  16318. document.addEventListener("mouseup", onMouseup);
  16319. };
  16320. const onDraggable = () => {
  16321. if (dragRef.value && targetRef.value) {
  16322. dragRef.value.addEventListener("mousedown", onMousedown);
  16323. }
  16324. };
  16325. const offDraggable = () => {
  16326. if (dragRef.value && targetRef.value) {
  16327. dragRef.value.removeEventListener("mousedown", onMousedown);
  16328. }
  16329. };
  16330. onMounted(() => {
  16331. watchEffect(() => {
  16332. if (draggable2.value) {
  16333. onDraggable();
  16334. } else {
  16335. offDraggable();
  16336. }
  16337. });
  16338. });
  16339. onBeforeUnmount(() => {
  16340. offDraggable();
  16341. });
  16342. };
  16343. const useFocus = (el) => {
  16344. return {
  16345. focus: () => {
  16346. var _a2, _b;
  16347. (_b = (_a2 = el.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  16348. }
  16349. };
  16350. };
  16351. var English = {
  16352. name: "en",
  16353. el: {
  16354. colorpicker: {
  16355. confirm: "OK",
  16356. clear: "Clear",
  16357. defaultLabel: "color picker",
  16358. description: "current color is {color}. press enter to select a new color."
  16359. },
  16360. datepicker: {
  16361. now: "Now",
  16362. today: "Today",
  16363. cancel: "Cancel",
  16364. clear: "Clear",
  16365. confirm: "OK",
  16366. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  16367. monthTablePrompt: "Use the arrow keys and enter to select the month",
  16368. yearTablePrompt: "Use the arrow keys and enter to select the year",
  16369. selectedDate: "Selected date",
  16370. selectDate: "Select date",
  16371. selectTime: "Select time",
  16372. startDate: "Start Date",
  16373. startTime: "Start Time",
  16374. endDate: "End Date",
  16375. endTime: "End Time",
  16376. prevYear: "Previous Year",
  16377. nextYear: "Next Year",
  16378. prevMonth: "Previous Month",
  16379. nextMonth: "Next Month",
  16380. year: "",
  16381. month1: "January",
  16382. month2: "February",
  16383. month3: "March",
  16384. month4: "April",
  16385. month5: "May",
  16386. month6: "June",
  16387. month7: "July",
  16388. month8: "August",
  16389. month9: "September",
  16390. month10: "October",
  16391. month11: "November",
  16392. month12: "December",
  16393. week: "week",
  16394. weeks: {
  16395. sun: "Sun",
  16396. mon: "Mon",
  16397. tue: "Tue",
  16398. wed: "Wed",
  16399. thu: "Thu",
  16400. fri: "Fri",
  16401. sat: "Sat"
  16402. },
  16403. weeksFull: {
  16404. sun: "Sunday",
  16405. mon: "Monday",
  16406. tue: "Tuesday",
  16407. wed: "Wednesday",
  16408. thu: "Thursday",
  16409. fri: "Friday",
  16410. sat: "Saturday"
  16411. },
  16412. months: {
  16413. jan: "Jan",
  16414. feb: "Feb",
  16415. mar: "Mar",
  16416. apr: "Apr",
  16417. may: "May",
  16418. jun: "Jun",
  16419. jul: "Jul",
  16420. aug: "Aug",
  16421. sep: "Sep",
  16422. oct: "Oct",
  16423. nov: "Nov",
  16424. dec: "Dec"
  16425. }
  16426. },
  16427. inputNumber: {
  16428. decrease: "decrease number",
  16429. increase: "increase number"
  16430. },
  16431. select: {
  16432. loading: "Loading",
  16433. noMatch: "No matching data",
  16434. noData: "No data",
  16435. placeholder: "Select"
  16436. },
  16437. dropdown: {
  16438. toggleDropdown: "Toggle Dropdown"
  16439. },
  16440. cascader: {
  16441. noMatch: "No matching data",
  16442. loading: "Loading",
  16443. placeholder: "Select",
  16444. noData: "No data"
  16445. },
  16446. pagination: {
  16447. goto: "Go to",
  16448. pagesize: "/page",
  16449. total: "Total {total}",
  16450. pageClassifier: "",
  16451. page: "Page",
  16452. prev: "Go to previous page",
  16453. next: "Go to next page",
  16454. currentPage: "page {pager}",
  16455. prevPages: "Previous {pager} pages",
  16456. nextPages: "Next {pager} pages",
  16457. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  16458. },
  16459. dialog: {
  16460. close: "Close this dialog"
  16461. },
  16462. drawer: {
  16463. close: "Close this dialog"
  16464. },
  16465. messagebox: {
  16466. title: "Message",
  16467. confirm: "OK",
  16468. cancel: "Cancel",
  16469. error: "Illegal input",
  16470. close: "Close this dialog"
  16471. },
  16472. upload: {
  16473. deleteTip: "press delete to remove",
  16474. delete: "Delete",
  16475. preview: "Preview",
  16476. continue: "Continue"
  16477. },
  16478. slider: {
  16479. defaultLabel: "slider between {min} and {max}",
  16480. defaultRangeStartLabel: "pick start value",
  16481. defaultRangeEndLabel: "pick end value"
  16482. },
  16483. table: {
  16484. emptyText: "No Data",
  16485. confirmFilter: "Confirm",
  16486. resetFilter: "Reset",
  16487. clearFilter: "All",
  16488. sumText: "Sum"
  16489. },
  16490. tree: {
  16491. emptyText: "No Data"
  16492. },
  16493. transfer: {
  16494. noMatch: "No matching data",
  16495. noData: "No data",
  16496. titles: ["List 1", "List 2"],
  16497. filterPlaceholder: "Enter keyword",
  16498. noCheckedFormat: "{total} items",
  16499. hasCheckedFormat: "{checked}/{total} checked"
  16500. },
  16501. image: {
  16502. error: "FAILED"
  16503. },
  16504. pageHeader: {
  16505. title: "Back"
  16506. },
  16507. popconfirm: {
  16508. confirmButtonText: "Yes",
  16509. cancelButtonText: "No"
  16510. }
  16511. }
  16512. };
  16513. const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
  16514. const translate = (path, option, locale) => get$2(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
  16515. var _a2;
  16516. return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`;
  16517. });
  16518. const buildLocaleContext = (locale) => {
  16519. const lang = computed$1(() => unref(locale).name);
  16520. const localeRef = isRef(locale) ? locale : ref(locale);
  16521. return {
  16522. lang,
  16523. locale: localeRef,
  16524. t: buildTranslator(locale)
  16525. };
  16526. };
  16527. const localeContextKey = Symbol("localeContextKey");
  16528. const useLocale = (localeOverrides) => {
  16529. const locale = localeOverrides || inject(localeContextKey, ref());
  16530. return buildLocaleContext(computed$1(() => locale.value || English));
  16531. };
  16532. let activeEffectScope;
  16533. function recordEffectScope(effect, scope = activeEffectScope) {
  16534. if (scope && scope.active) {
  16535. scope.effects.push(effect);
  16536. }
  16537. }
  16538. const createDep = (effects) => {
  16539. const dep = new Set(effects);
  16540. dep.w = 0;
  16541. dep.n = 0;
  16542. return dep;
  16543. };
  16544. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  16545. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  16546. const initDepMarkers = ({ deps }) => {
  16547. if (deps.length) {
  16548. for (let i2 = 0; i2 < deps.length; i2++) {
  16549. deps[i2].w |= trackOpBit;
  16550. }
  16551. }
  16552. };
  16553. const finalizeDepMarkers = (effect) => {
  16554. const { deps } = effect;
  16555. if (deps.length) {
  16556. let ptr = 0;
  16557. for (let i2 = 0; i2 < deps.length; i2++) {
  16558. const dep = deps[i2];
  16559. if (wasTracked(dep) && !newTracked(dep)) {
  16560. dep.delete(effect);
  16561. } else {
  16562. deps[ptr++] = dep;
  16563. }
  16564. dep.w &= ~trackOpBit;
  16565. dep.n &= ~trackOpBit;
  16566. }
  16567. deps.length = ptr;
  16568. }
  16569. };
  16570. let effectTrackDepth = 0;
  16571. let trackOpBit = 1;
  16572. const maxMarkerBits = 30;
  16573. let activeEffect;
  16574. class ReactiveEffect {
  16575. constructor(fn2, scheduler = null, scope) {
  16576. this.fn = fn2;
  16577. this.scheduler = scheduler;
  16578. this.active = true;
  16579. this.deps = [];
  16580. this.parent = void 0;
  16581. recordEffectScope(this, scope);
  16582. }
  16583. run() {
  16584. if (!this.active) {
  16585. return this.fn();
  16586. }
  16587. let parent = activeEffect;
  16588. let lastShouldTrack = shouldTrack;
  16589. while (parent) {
  16590. if (parent === this) {
  16591. return;
  16592. }
  16593. parent = parent.parent;
  16594. }
  16595. try {
  16596. this.parent = activeEffect;
  16597. activeEffect = this;
  16598. shouldTrack = true;
  16599. trackOpBit = 1 << ++effectTrackDepth;
  16600. if (effectTrackDepth <= maxMarkerBits) {
  16601. initDepMarkers(this);
  16602. } else {
  16603. cleanupEffect(this);
  16604. }
  16605. return this.fn();
  16606. } finally {
  16607. if (effectTrackDepth <= maxMarkerBits) {
  16608. finalizeDepMarkers(this);
  16609. }
  16610. trackOpBit = 1 << --effectTrackDepth;
  16611. activeEffect = this.parent;
  16612. shouldTrack = lastShouldTrack;
  16613. this.parent = void 0;
  16614. if (this.deferStop) {
  16615. this.stop();
  16616. }
  16617. }
  16618. }
  16619. stop() {
  16620. if (activeEffect === this) {
  16621. this.deferStop = true;
  16622. } else if (this.active) {
  16623. cleanupEffect(this);
  16624. if (this.onStop) {
  16625. this.onStop();
  16626. }
  16627. this.active = false;
  16628. }
  16629. }
  16630. }
  16631. function cleanupEffect(effect2) {
  16632. const { deps } = effect2;
  16633. if (deps.length) {
  16634. for (let i2 = 0; i2 < deps.length; i2++) {
  16635. deps[i2].delete(effect2);
  16636. }
  16637. deps.length = 0;
  16638. }
  16639. }
  16640. let shouldTrack = true;
  16641. function trackEffects(dep, debuggerEventExtraInfo) {
  16642. let shouldTrack2 = false;
  16643. if (effectTrackDepth <= maxMarkerBits) {
  16644. if (!newTracked(dep)) {
  16645. dep.n |= trackOpBit;
  16646. shouldTrack2 = !wasTracked(dep);
  16647. }
  16648. } else {
  16649. shouldTrack2 = !dep.has(activeEffect);
  16650. }
  16651. if (shouldTrack2) {
  16652. dep.add(activeEffect);
  16653. activeEffect.deps.push(dep);
  16654. }
  16655. }
  16656. function triggerEffects(dep, debuggerEventExtraInfo) {
  16657. const effects = isArray$2(dep) ? dep : [...dep];
  16658. for (const effect2 of effects) {
  16659. if (effect2.computed) {
  16660. triggerEffect(effect2);
  16661. }
  16662. }
  16663. for (const effect2 of effects) {
  16664. if (!effect2.computed) {
  16665. triggerEffect(effect2);
  16666. }
  16667. }
  16668. }
  16669. function triggerEffect(effect2, debuggerEventExtraInfo) {
  16670. if (effect2 !== activeEffect || effect2.allowRecurse) {
  16671. if (effect2.scheduler) {
  16672. effect2.scheduler();
  16673. } else {
  16674. effect2.run();
  16675. }
  16676. }
  16677. }
  16678. function toRaw(observed) {
  16679. const raw = observed && observed["__v_raw"];
  16680. return raw ? toRaw(raw) : observed;
  16681. }
  16682. function trackRefValue(ref2) {
  16683. if (shouldTrack && activeEffect) {
  16684. ref2 = toRaw(ref2);
  16685. {
  16686. trackEffects(ref2.dep || (ref2.dep = createDep()));
  16687. }
  16688. }
  16689. }
  16690. function triggerRefValue(ref2, newVal) {
  16691. ref2 = toRaw(ref2);
  16692. const dep = ref2.dep;
  16693. if (dep) {
  16694. {
  16695. triggerEffects(dep);
  16696. }
  16697. }
  16698. }
  16699. class ComputedRefImpl {
  16700. constructor(getter, _setter, isReadonly, isSSR) {
  16701. this._setter = _setter;
  16702. this.dep = void 0;
  16703. this.__v_isRef = true;
  16704. this["__v_isReadonly"] = false;
  16705. this._dirty = true;
  16706. this.effect = new ReactiveEffect(getter, () => {
  16707. if (!this._dirty) {
  16708. this._dirty = true;
  16709. triggerRefValue(this);
  16710. }
  16711. });
  16712. this.effect.computed = this;
  16713. this.effect.active = this._cacheable = !isSSR;
  16714. this["__v_isReadonly"] = isReadonly;
  16715. }
  16716. get value() {
  16717. const self2 = toRaw(this);
  16718. trackRefValue(self2);
  16719. if (self2._dirty || !self2._cacheable) {
  16720. self2._dirty = false;
  16721. self2._value = self2.effect.run();
  16722. }
  16723. return self2._value;
  16724. }
  16725. set value(newValue) {
  16726. this._setter(newValue);
  16727. }
  16728. }
  16729. function computed(getterOrOptions, debugOptions, isSSR = false) {
  16730. let getter;
  16731. let setter;
  16732. const onlyGetter = isFunction$3(getterOrOptions);
  16733. if (onlyGetter) {
  16734. getter = getterOrOptions;
  16735. setter = NOOP;
  16736. } else {
  16737. getter = getterOrOptions.get;
  16738. setter = getterOrOptions.set;
  16739. }
  16740. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  16741. return cRef;
  16742. }
  16743. const defaultNamespace = "el";
  16744. const statePrefix = "is-";
  16745. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  16746. let cls = `${namespace}-${block}`;
  16747. if (blockSuffix) {
  16748. cls += `-${blockSuffix}`;
  16749. }
  16750. if (element) {
  16751. cls += `__${element}`;
  16752. }
  16753. if (modifier) {
  16754. cls += `--${modifier}`;
  16755. }
  16756. return cls;
  16757. };
  16758. const namespaceContextKey = Symbol("namespaceContextKey");
  16759. const useGetDerivedNamespace = (namespaceOverrides) => {
  16760. const derivedNamespace = namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace));
  16761. const namespace = computed$1(() => {
  16762. return unref(derivedNamespace) || defaultNamespace;
  16763. });
  16764. return namespace;
  16765. };
  16766. const useNamespace = (block, namespaceOverrides) => {
  16767. const namespace = useGetDerivedNamespace(namespaceOverrides);
  16768. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  16769. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  16770. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  16771. const be2 = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  16772. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  16773. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  16774. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  16775. const is = (name, ...args) => {
  16776. const state = args.length >= 1 ? args[0] : true;
  16777. return name && state ? `${statePrefix}${name}` : "";
  16778. };
  16779. const cssVar = (object) => {
  16780. const styles = {};
  16781. for (const key in object) {
  16782. if (object[key]) {
  16783. styles[`--${namespace.value}-${key}`] = object[key];
  16784. }
  16785. }
  16786. return styles;
  16787. };
  16788. const cssVarBlock = (object) => {
  16789. const styles = {};
  16790. for (const key in object) {
  16791. if (object[key]) {
  16792. styles[`--${namespace.value}-${block}-${key}`] = object[key];
  16793. }
  16794. }
  16795. return styles;
  16796. };
  16797. const cssVarName = (name) => `--${namespace.value}-${name}`;
  16798. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  16799. return {
  16800. namespace,
  16801. b,
  16802. e,
  16803. m,
  16804. be: be2,
  16805. em,
  16806. bm,
  16807. bem,
  16808. is,
  16809. cssVar,
  16810. cssVarName,
  16811. cssVarBlock,
  16812. cssVarBlockName
  16813. };
  16814. };
  16815. const useLockscreen = (trigger2, options2 = {}) => {
  16816. if (!isRef(trigger2)) {
  16817. throwError("[useLockscreen]", "You need to pass a ref param to this function");
  16818. }
  16819. const ns = options2.ns || useNamespace("popup");
  16820. const hiddenCls = computed(() => ns.bm("parent", "hidden"));
  16821. if (!isClient || hasClass$2(document.body, hiddenCls.value)) {
  16822. return;
  16823. }
  16824. let scrollBarWidth2 = 0;
  16825. let withoutHiddenClass = false;
  16826. let bodyWidth = "0";
  16827. const cleanup = () => {
  16828. setTimeout(() => {
  16829. removeClass$2(document == null ? void 0 : document.body, hiddenCls.value);
  16830. if (withoutHiddenClass && document) {
  16831. document.body.style.width = bodyWidth;
  16832. }
  16833. }, 200);
  16834. };
  16835. watch(trigger2, (val) => {
  16836. if (!val) {
  16837. cleanup();
  16838. return;
  16839. }
  16840. withoutHiddenClass = !hasClass$2(document.body, hiddenCls.value);
  16841. if (withoutHiddenClass) {
  16842. bodyWidth = document.body.style.width;
  16843. }
  16844. scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
  16845. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  16846. const bodyOverflowY = getStyle(document.body, "overflowY");
  16847. if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
  16848. document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
  16849. }
  16850. addClass$2(document.body, hiddenCls.value);
  16851. });
  16852. onScopeDispose(() => cleanup());
  16853. };
  16854. const _prop = buildProp({
  16855. type: definePropType(Boolean),
  16856. default: null
  16857. });
  16858. const _event = buildProp({
  16859. type: definePropType(Function)
  16860. });
  16861. const createModelToggleComposable = (name) => {
  16862. const updateEventKey = `update:${name}`;
  16863. const updateEventKeyRaw = `onUpdate:${name}`;
  16864. const useModelToggleEmits2 = [updateEventKey];
  16865. const useModelToggleProps2 = {
  16866. [name]: _prop,
  16867. [updateEventKeyRaw]: _event
  16868. };
  16869. const useModelToggle2 = ({
  16870. indicator,
  16871. toggleReason,
  16872. shouldHideWhenRouteChanges,
  16873. shouldProceed,
  16874. onShow,
  16875. onHide
  16876. }) => {
  16877. const instance = getCurrentInstance();
  16878. const { emit } = instance;
  16879. const props = instance.props;
  16880. const hasUpdateHandler = computed$1(() => isFunction$3(props[updateEventKeyRaw]));
  16881. const isModelBindingAbsent = computed$1(() => props[name] === null);
  16882. const doShow = (event2) => {
  16883. if (indicator.value === true) {
  16884. return;
  16885. }
  16886. indicator.value = true;
  16887. if (toggleReason) {
  16888. toggleReason.value = event2;
  16889. }
  16890. if (isFunction$3(onShow)) {
  16891. onShow(event2);
  16892. }
  16893. };
  16894. const doHide = (event2) => {
  16895. if (indicator.value === false) {
  16896. return;
  16897. }
  16898. indicator.value = false;
  16899. if (toggleReason) {
  16900. toggleReason.value = event2;
  16901. }
  16902. if (isFunction$3(onHide)) {
  16903. onHide(event2);
  16904. }
  16905. };
  16906. const show = (event2) => {
  16907. if (props.disabled === true || isFunction$3(shouldProceed) && !shouldProceed())
  16908. return;
  16909. const shouldEmit = hasUpdateHandler.value && isClient;
  16910. if (shouldEmit) {
  16911. emit(updateEventKey, true);
  16912. }
  16913. if (isModelBindingAbsent.value || !shouldEmit) {
  16914. doShow(event2);
  16915. }
  16916. };
  16917. const hide = (event2) => {
  16918. if (props.disabled === true || !isClient)
  16919. return;
  16920. const shouldEmit = hasUpdateHandler.value && isClient;
  16921. if (shouldEmit) {
  16922. emit(updateEventKey, false);
  16923. }
  16924. if (isModelBindingAbsent.value || !shouldEmit) {
  16925. doHide(event2);
  16926. }
  16927. };
  16928. const onChange = (val) => {
  16929. if (!isBoolean(val))
  16930. return;
  16931. if (props.disabled && val) {
  16932. if (hasUpdateHandler.value) {
  16933. emit(updateEventKey, false);
  16934. }
  16935. } else if (indicator.value !== val) {
  16936. if (val) {
  16937. doShow();
  16938. } else {
  16939. doHide();
  16940. }
  16941. }
  16942. };
  16943. const toggle = () => {
  16944. if (indicator.value) {
  16945. hide();
  16946. } else {
  16947. show();
  16948. }
  16949. };
  16950. watch(() => props[name], onChange);
  16951. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
  16952. watch(() => ({
  16953. ...instance.proxy.$route
  16954. }), () => {
  16955. if (shouldHideWhenRouteChanges.value && indicator.value) {
  16956. hide();
  16957. }
  16958. });
  16959. }
  16960. onMounted(() => {
  16961. onChange(props[name]);
  16962. });
  16963. return {
  16964. hide,
  16965. show,
  16966. toggle,
  16967. hasUpdateHandler
  16968. };
  16969. };
  16970. return {
  16971. useModelToggle: useModelToggle2,
  16972. useModelToggleProps: useModelToggleProps2,
  16973. useModelToggleEmits: useModelToggleEmits2
  16974. };
  16975. };
  16976. const useProp = (name) => {
  16977. const vm = getCurrentInstance();
  16978. return computed$1(() => {
  16979. var _a2, _b;
  16980. return (_b = (_a2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a2.$props) == null ? void 0 : _b[name];
  16981. });
  16982. };
  16983. var E = "top", R = "bottom", W = "right", P = "left", me = "auto", G = [E, R, W, P], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t2, e) {
  16984. return t2.concat([e + "-" + U, e + "-" + J]);
  16985. }, []), Ee = [].concat(G, [me]).reduce(function(t2, e) {
  16986. return t2.concat([e, e + "-" + U, e + "-" + J]);
  16987. }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt = "afterWrite", ot = [Ge, Je, Ke, Qe, Ze, et, tt, nt, rt];
  16988. function C(t2) {
  16989. return t2 ? (t2.nodeName || "").toLowerCase() : null;
  16990. }
  16991. function H(t2) {
  16992. if (t2 == null)
  16993. return window;
  16994. if (t2.toString() !== "[object Window]") {
  16995. var e = t2.ownerDocument;
  16996. return e && e.defaultView || window;
  16997. }
  16998. return t2;
  16999. }
  17000. function Q(t2) {
  17001. var e = H(t2).Element;
  17002. return t2 instanceof e || t2 instanceof Element;
  17003. }
  17004. function B(t2) {
  17005. var e = H(t2).HTMLElement;
  17006. return t2 instanceof e || t2 instanceof HTMLElement;
  17007. }
  17008. function Pe(t2) {
  17009. if (typeof ShadowRoot == "undefined")
  17010. return false;
  17011. var e = H(t2).ShadowRoot;
  17012. return t2 instanceof e || t2 instanceof ShadowRoot;
  17013. }
  17014. function Mt(t2) {
  17015. var e = t2.state;
  17016. Object.keys(e.elements).forEach(function(n) {
  17017. var r2 = e.styles[n] || {}, o = e.attributes[n] || {}, i2 = e.elements[n];
  17018. !B(i2) || !C(i2) || (Object.assign(i2.style, r2), Object.keys(o).forEach(function(a) {
  17019. var s = o[a];
  17020. s === false ? i2.removeAttribute(a) : i2.setAttribute(a, s === true ? "" : s);
  17021. }));
  17022. });
  17023. }
  17024. function Rt(t2) {
  17025. var e = t2.state, n = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  17026. return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
  17027. Object.keys(e.elements).forEach(function(r2) {
  17028. var o = e.elements[r2], i2 = e.attributes[r2] || {}, a = Object.keys(e.styles.hasOwnProperty(r2) ? e.styles[r2] : n[r2]), s = a.reduce(function(f, c) {
  17029. return f[c] = "", f;
  17030. }, {});
  17031. !B(o) || !C(o) || (Object.assign(o.style, s), Object.keys(i2).forEach(function(f) {
  17032. o.removeAttribute(f);
  17033. }));
  17034. });
  17035. };
  17036. }
  17037. var Ae = { name: "applyStyles", enabled: true, phase: "write", fn: Mt, effect: Rt, requires: ["computeStyles"] };
  17038. function q(t2) {
  17039. return t2.split("-")[0];
  17040. }
  17041. var X = Math.max, ve = Math.min, Z = Math.round;
  17042. function ee(t2, e) {
  17043. e === void 0 && (e = false);
  17044. var n = t2.getBoundingClientRect(), r2 = 1, o = 1;
  17045. if (B(t2) && e) {
  17046. var i2 = t2.offsetHeight, a = t2.offsetWidth;
  17047. a > 0 && (r2 = Z(n.width) / a || 1), i2 > 0 && (o = Z(n.height) / i2 || 1);
  17048. }
  17049. return { width: n.width / r2, height: n.height / o, top: n.top / o, right: n.right / r2, bottom: n.bottom / o, left: n.left / r2, x: n.left / r2, y: n.top / o };
  17050. }
  17051. function ke(t2) {
  17052. var e = ee(t2), n = t2.offsetWidth, r2 = t2.offsetHeight;
  17053. return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r2) <= 1 && (r2 = e.height), { x: t2.offsetLeft, y: t2.offsetTop, width: n, height: r2 };
  17054. }
  17055. function it(t2, e) {
  17056. var n = e.getRootNode && e.getRootNode();
  17057. if (t2.contains(e))
  17058. return true;
  17059. if (n && Pe(n)) {
  17060. var r2 = e;
  17061. do {
  17062. if (r2 && t2.isSameNode(r2))
  17063. return true;
  17064. r2 = r2.parentNode || r2.host;
  17065. } while (r2);
  17066. }
  17067. return false;
  17068. }
  17069. function N(t2) {
  17070. return H(t2).getComputedStyle(t2);
  17071. }
  17072. function Wt(t2) {
  17073. return ["table", "td", "th"].indexOf(C(t2)) >= 0;
  17074. }
  17075. function I(t2) {
  17076. return ((Q(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
  17077. }
  17078. function ge(t2) {
  17079. return C(t2) === "html" ? t2 : t2.assignedSlot || t2.parentNode || (Pe(t2) ? t2.host : null) || I(t2);
  17080. }
  17081. function at(t2) {
  17082. return !B(t2) || N(t2).position === "fixed" ? null : t2.offsetParent;
  17083. }
  17084. function Bt(t2) {
  17085. var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
  17086. if (n && B(t2)) {
  17087. var r2 = N(t2);
  17088. if (r2.position === "fixed")
  17089. return null;
  17090. }
  17091. var o = ge(t2);
  17092. for (Pe(o) && (o = o.host); B(o) && ["html", "body"].indexOf(C(o)) < 0; ) {
  17093. var i2 = N(o);
  17094. if (i2.transform !== "none" || i2.perspective !== "none" || i2.contain === "paint" || ["transform", "perspective"].indexOf(i2.willChange) !== -1 || e && i2.willChange === "filter" || e && i2.filter && i2.filter !== "none")
  17095. return o;
  17096. o = o.parentNode;
  17097. }
  17098. return null;
  17099. }
  17100. function se(t2) {
  17101. for (var e = H(t2), n = at(t2); n && Wt(n) && N(n).position === "static"; )
  17102. n = at(n);
  17103. return n && (C(n) === "html" || C(n) === "body" && N(n).position === "static") ? e : n || Bt(t2) || e;
  17104. }
  17105. function Le(t2) {
  17106. return ["top", "bottom"].indexOf(t2) >= 0 ? "x" : "y";
  17107. }
  17108. function fe(t2, e, n) {
  17109. return X(t2, ve(e, n));
  17110. }
  17111. function St(t2, e, n) {
  17112. var r2 = fe(t2, e, n);
  17113. return r2 > n ? n : r2;
  17114. }
  17115. function st() {
  17116. return { top: 0, right: 0, bottom: 0, left: 0 };
  17117. }
  17118. function ft(t2) {
  17119. return Object.assign({}, st(), t2);
  17120. }
  17121. function ct(t2, e) {
  17122. return e.reduce(function(n, r2) {
  17123. return n[r2] = t2, n;
  17124. }, {});
  17125. }
  17126. var Tt = function(t2, e) {
  17127. return t2 = typeof t2 == "function" ? t2(Object.assign({}, e.rects, { placement: e.placement })) : t2, ft(typeof t2 != "number" ? t2 : ct(t2, G));
  17128. };
  17129. function Ht(t2) {
  17130. var e, n = t2.state, r2 = t2.name, o = t2.options, i2 = n.elements.arrow, a = n.modifiersData.popperOffsets, s = q(n.placement), f = Le(s), c = [P, W].indexOf(s) >= 0, u = c ? "height" : "width";
  17131. if (!(!i2 || !a)) {
  17132. var m = Tt(o.padding, n), v = ke(i2), l = f === "y" ? E : P, h2 = f === "y" ? R : W, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], x = se(i2), y = x ? f === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, $2 = p / 2 - g / 2, d2 = m[l], b = y - v[u] - m[h2], w = y / 2 - v[u] / 2 + $2, O = fe(d2, w, b), j = f;
  17133. n.modifiersData[r2] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
  17134. }
  17135. }
  17136. function Ct(t2) {
  17137. var e = t2.state, n = t2.options, r2 = n.element, o = r2 === void 0 ? "[data-popper-arrow]" : r2;
  17138. o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !it(e.elements.popper, o) || (e.elements.arrow = o));
  17139. }
  17140. var pt = { name: "arrow", enabled: true, phase: "main", fn: Ht, effect: Ct, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
  17141. function te(t2) {
  17142. return t2.split("-")[1];
  17143. }
  17144. var qt = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
  17145. function Vt(t2) {
  17146. var e = t2.x, n = t2.y, r2 = window, o = r2.devicePixelRatio || 1;
  17147. return { x: Z(e * o) / o || 0, y: Z(n * o) / o || 0 };
  17148. }
  17149. function ut(t2) {
  17150. var e, n = t2.popper, r2 = t2.popperRect, o = t2.placement, i2 = t2.variation, a = t2.offsets, s = t2.position, f = t2.gpuAcceleration, c = t2.adaptive, u = t2.roundOffsets, m = t2.isFixed, v = a.x, l = v === void 0 ? 0 : v, h2 = a.y, p = h2 === void 0 ? 0 : h2, g = typeof u == "function" ? u({ x: l, y: p }) : { x: l, y: p };
  17151. l = g.x, p = g.y;
  17152. var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $2 = P, d2 = E, b = window;
  17153. if (c) {
  17154. var w = se(n), O = "clientHeight", j = "clientWidth";
  17155. if (w === H(n) && (w = I(n), N(w).position !== "static" && s === "absolute" && (O = "scrollHeight", j = "scrollWidth")), w = w, o === E || (o === P || o === W) && i2 === J) {
  17156. d2 = R;
  17157. var A = m && w === b && b.visualViewport ? b.visualViewport.height : w[O];
  17158. p -= A - r2.height, p *= f ? 1 : -1;
  17159. }
  17160. if (o === P || (o === E || o === R) && i2 === J) {
  17161. $2 = W;
  17162. var k = m && w === b && b.visualViewport ? b.visualViewport.width : w[j];
  17163. l -= k - r2.width, l *= f ? 1 : -1;
  17164. }
  17165. }
  17166. var D = Object.assign({ position: s }, c && qt), S = u === true ? Vt({ x: l, y: p }) : { x: l, y: p };
  17167. if (l = S.x, p = S.y, f) {
  17168. var L;
  17169. return Object.assign({}, D, (L = {}, L[d2] = y ? "0" : "", L[$2] = x ? "0" : "", L.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + l + "px, " + p + "px)" : "translate3d(" + l + "px, " + p + "px, 0)", L));
  17170. }
  17171. return Object.assign({}, D, (e = {}, e[d2] = y ? p + "px" : "", e[$2] = x ? l + "px" : "", e.transform = "", e));
  17172. }
  17173. function Nt(t2) {
  17174. var e = t2.state, n = t2.options, r2 = n.gpuAcceleration, o = r2 === void 0 ? true : r2, i2 = n.adaptive, a = i2 === void 0 ? true : i2, s = n.roundOffsets, f = s === void 0 ? true : s, c = { placement: q(e.placement), variation: te(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: o, isFixed: e.options.strategy === "fixed" };
  17175. e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, ut(Object.assign({}, c, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: f })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, ut(Object.assign({}, c, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: f })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
  17176. }
  17177. var Me = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: Nt, data: {} }, ye = { passive: true };
  17178. function It(t2) {
  17179. var e = t2.state, n = t2.instance, r2 = t2.options, o = r2.scroll, i2 = o === void 0 ? true : o, a = r2.resize, s = a === void 0 ? true : a, f = H(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  17180. return i2 && c.forEach(function(u) {
  17181. u.addEventListener("scroll", n.update, ye);
  17182. }), s && f.addEventListener("resize", n.update, ye), function() {
  17183. i2 && c.forEach(function(u) {
  17184. u.removeEventListener("scroll", n.update, ye);
  17185. }), s && f.removeEventListener("resize", n.update, ye);
  17186. };
  17187. }
  17188. var Re = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
  17189. }, effect: It, data: {} }, _t = { left: "right", right: "left", bottom: "top", top: "bottom" };
  17190. function be(t2) {
  17191. return t2.replace(/left|right|bottom|top/g, function(e) {
  17192. return _t[e];
  17193. });
  17194. }
  17195. var zt = { start: "end", end: "start" };
  17196. function lt(t2) {
  17197. return t2.replace(/start|end/g, function(e) {
  17198. return zt[e];
  17199. });
  17200. }
  17201. function We(t2) {
  17202. var e = H(t2), n = e.pageXOffset, r2 = e.pageYOffset;
  17203. return { scrollLeft: n, scrollTop: r2 };
  17204. }
  17205. function Be(t2) {
  17206. return ee(I(t2)).left + We(t2).scrollLeft;
  17207. }
  17208. function Ft(t2) {
  17209. var e = H(t2), n = I(t2), r2 = e.visualViewport, o = n.clientWidth, i2 = n.clientHeight, a = 0, s = 0;
  17210. return r2 && (o = r2.width, i2 = r2.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r2.offsetLeft, s = r2.offsetTop)), { width: o, height: i2, x: a + Be(t2), y: s };
  17211. }
  17212. function Ut(t2) {
  17213. var e, n = I(t2), r2 = We(t2), o = (e = t2.ownerDocument) == null ? void 0 : e.body, i2 = X(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = X(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), s = -r2.scrollLeft + Be(t2), f = -r2.scrollTop;
  17214. return N(o || n).direction === "rtl" && (s += X(n.clientWidth, o ? o.clientWidth : 0) - i2), { width: i2, height: a, x: s, y: f };
  17215. }
  17216. function Se(t2) {
  17217. var e = N(t2), n = e.overflow, r2 = e.overflowX, o = e.overflowY;
  17218. return /auto|scroll|overlay|hidden/.test(n + o + r2);
  17219. }
  17220. function dt(t2) {
  17221. return ["html", "body", "#document"].indexOf(C(t2)) >= 0 ? t2.ownerDocument.body : B(t2) && Se(t2) ? t2 : dt(ge(t2));
  17222. }
  17223. function ce(t2, e) {
  17224. var n;
  17225. e === void 0 && (e = []);
  17226. var r2 = dt(t2), o = r2 === ((n = t2.ownerDocument) == null ? void 0 : n.body), i2 = H(r2), a = o ? [i2].concat(i2.visualViewport || [], Se(r2) ? r2 : []) : r2, s = e.concat(a);
  17227. return o ? s : s.concat(ce(ge(a)));
  17228. }
  17229. function Te(t2) {
  17230. return Object.assign({}, t2, { left: t2.x, top: t2.y, right: t2.x + t2.width, bottom: t2.y + t2.height });
  17231. }
  17232. function Xt(t2) {
  17233. var e = ee(t2);
  17234. return e.top = e.top + t2.clientTop, e.left = e.left + t2.clientLeft, e.bottom = e.top + t2.clientHeight, e.right = e.left + t2.clientWidth, e.width = t2.clientWidth, e.height = t2.clientHeight, e.x = e.left, e.y = e.top, e;
  17235. }
  17236. function ht(t2, e) {
  17237. return e === je ? Te(Ft(t2)) : Q(e) ? Xt(e) : Te(Ut(I(t2)));
  17238. }
  17239. function Yt(t2) {
  17240. var e = ce(ge(t2)), n = ["absolute", "fixed"].indexOf(N(t2).position) >= 0, r2 = n && B(t2) ? se(t2) : t2;
  17241. return Q(r2) ? e.filter(function(o) {
  17242. return Q(o) && it(o, r2) && C(o) !== "body";
  17243. }) : [];
  17244. }
  17245. function Gt(t2, e, n) {
  17246. var r2 = e === "clippingParents" ? Yt(t2) : [].concat(e), o = [].concat(r2, [n]), i2 = o[0], a = o.reduce(function(s, f) {
  17247. var c = ht(t2, f);
  17248. return s.top = X(c.top, s.top), s.right = ve(c.right, s.right), s.bottom = ve(c.bottom, s.bottom), s.left = X(c.left, s.left), s;
  17249. }, ht(t2, i2));
  17250. return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
  17251. }
  17252. function mt(t2) {
  17253. var e = t2.reference, n = t2.element, r2 = t2.placement, o = r2 ? q(r2) : null, i2 = r2 ? te(r2) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, f;
  17254. switch (o) {
  17255. case E:
  17256. f = { x: a, y: e.y - n.height };
  17257. break;
  17258. case R:
  17259. f = { x: a, y: e.y + e.height };
  17260. break;
  17261. case W:
  17262. f = { x: e.x + e.width, y: s };
  17263. break;
  17264. case P:
  17265. f = { x: e.x - n.width, y: s };
  17266. break;
  17267. default:
  17268. f = { x: e.x, y: e.y };
  17269. }
  17270. var c = o ? Le(o) : null;
  17271. if (c != null) {
  17272. var u = c === "y" ? "height" : "width";
  17273. switch (i2) {
  17274. case U:
  17275. f[c] = f[c] - (e[u] / 2 - n[u] / 2);
  17276. break;
  17277. case J:
  17278. f[c] = f[c] + (e[u] / 2 - n[u] / 2);
  17279. break;
  17280. }
  17281. }
  17282. return f;
  17283. }
  17284. function ne(t2, e) {
  17285. e === void 0 && (e = {});
  17286. var n = e, r2 = n.placement, o = r2 === void 0 ? t2.placement : r2, i2 = n.boundary, a = i2 === void 0 ? Xe : i2, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? false : m, l = n.padding, h2 = l === void 0 ? 0 : l, p = ft(typeof h2 != "number" ? h2 : ct(h2, G)), g = u === K ? Ye : K, x = t2.rects.popper, y = t2.elements[v ? g : u], $2 = Gt(Q(y) ? y : y.contextElement || I(t2.elements.popper), a, f), d2 = ee(t2.elements.reference), b = mt({ reference: d2, element: x, strategy: "absolute", placement: o }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d2, j = { top: $2.top - O.top + p.top, bottom: O.bottom - $2.bottom + p.bottom, left: $2.left - O.left + p.left, right: O.right - $2.right + p.right }, A = t2.modifiersData.offset;
  17287. if (u === K && A) {
  17288. var k = A[o];
  17289. Object.keys(j).forEach(function(D) {
  17290. var S = [W, R].indexOf(D) >= 0 ? 1 : -1, L = [E, R].indexOf(D) >= 0 ? "y" : "x";
  17291. j[D] += k[L] * S;
  17292. });
  17293. }
  17294. return j;
  17295. }
  17296. function Jt(t2, e) {
  17297. e === void 0 && (e = {});
  17298. var n = e, r2 = n.placement, o = n.boundary, i2 = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r2), m = u ? s ? De : De.filter(function(h2) {
  17299. return te(h2) === u;
  17300. }) : G, v = m.filter(function(h2) {
  17301. return c.indexOf(h2) >= 0;
  17302. });
  17303. v.length === 0 && (v = m);
  17304. var l = v.reduce(function(h2, p) {
  17305. return h2[p] = ne(t2, { placement: p, boundary: o, rootBoundary: i2, padding: a })[q(p)], h2;
  17306. }, {});
  17307. return Object.keys(l).sort(function(h2, p) {
  17308. return l[h2] - l[p];
  17309. });
  17310. }
  17311. function Kt(t2) {
  17312. if (q(t2) === me)
  17313. return [];
  17314. var e = be(t2);
  17315. return [lt(t2), e, lt(e)];
  17316. }
  17317. function Qt(t2) {
  17318. var e = t2.state, n = t2.options, r2 = t2.name;
  17319. if (!e.modifiersData[r2]._skip) {
  17320. for (var o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, h2 = l === void 0 ? true : l, p = n.allowedAutoPlacements, g = e.options.placement, x = q(g), y = x === g, $2 = f || (y || !h2 ? [be(g)] : Kt(g)), d2 = [g].concat($2).reduce(function(z, V) {
  17321. return z.concat(q(V) === me ? Jt(e, { placement: V, boundary: u, rootBoundary: m, padding: c, flipVariations: h2, allowedAutoPlacements: p }) : V);
  17322. }, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = true, A = d2[0], k = 0; k < d2.length; k++) {
  17323. var D = d2[k], S = q(D), L = te(D) === U, re = [E, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, { placement: D, boundary: u, rootBoundary: m, altBoundary: v, padding: c }), T = re ? L ? W : P : L ? R : E;
  17324. b[oe] > w[oe] && (T = be(T));
  17325. var pe = be(T), _ = [];
  17326. if (i2 && _.push(M[S] <= 0), s && _.push(M[T] <= 0, M[pe] <= 0), _.every(function(z) {
  17327. return z;
  17328. })) {
  17329. A = D, j = false;
  17330. break;
  17331. }
  17332. O.set(D, _);
  17333. }
  17334. if (j)
  17335. for (var ue = h2 ? 3 : 1, xe = function(z) {
  17336. var V = d2.find(function(de) {
  17337. var ae = O.get(de);
  17338. if (ae)
  17339. return ae.slice(0, z).every(function(Y) {
  17340. return Y;
  17341. });
  17342. });
  17343. if (V)
  17344. return A = V, "break";
  17345. }, ie = ue; ie > 0; ie--) {
  17346. var le = xe(ie);
  17347. if (le === "break")
  17348. break;
  17349. }
  17350. e.placement !== A && (e.modifiersData[r2]._skip = true, e.placement = A, e.reset = true);
  17351. }
  17352. }
  17353. var vt = { name: "flip", enabled: true, phase: "main", fn: Qt, requiresIfExists: ["offset"], data: { _skip: false } };
  17354. function gt(t2, e, n) {
  17355. return n === void 0 && (n = { x: 0, y: 0 }), { top: t2.top - e.height - n.y, right: t2.right - e.width + n.x, bottom: t2.bottom - e.height + n.y, left: t2.left - e.width - n.x };
  17356. }
  17357. function yt(t2) {
  17358. return [E, W, R, P].some(function(e) {
  17359. return t2[e] >= 0;
  17360. });
  17361. }
  17362. function Zt(t2) {
  17363. var e = t2.state, n = t2.name, r2 = e.rects.reference, o = e.rects.popper, i2 = e.modifiersData.preventOverflow, a = ne(e, { elementContext: "reference" }), s = ne(e, { altBoundary: true }), f = gt(a, r2), c = gt(s, o, i2), u = yt(f), m = yt(c);
  17364. e.modifiersData[n] = { referenceClippingOffsets: f, popperEscapeOffsets: c, isReferenceHidden: u, hasPopperEscaped: m }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": m });
  17365. }
  17366. var bt = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Zt };
  17367. function en$1(t2, e, n) {
  17368. var r2 = q(t2), o = [P, E].indexOf(r2) >= 0 ? -1 : 1, i2 = typeof n == "function" ? n(Object.assign({}, e, { placement: t2 })) : n, a = i2[0], s = i2[1];
  17369. return a = a || 0, s = (s || 0) * o, [P, W].indexOf(r2) >= 0 ? { x: s, y: a } : { x: a, y: s };
  17370. }
  17371. function tn(t2) {
  17372. var e = t2.state, n = t2.options, r2 = t2.name, o = n.offset, i2 = o === void 0 ? [0, 0] : o, a = Ee.reduce(function(u, m) {
  17373. return u[m] = en$1(m, e.rects, i2), u;
  17374. }, {}), s = a[e.placement], f = s.x, c = s.y;
  17375. e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r2] = a;
  17376. }
  17377. var wt = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: tn };
  17378. function nn(t2) {
  17379. var e = t2.state, n = t2.name;
  17380. e.modifiersData[n] = mt({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
  17381. }
  17382. var He = { name: "popperOffsets", enabled: true, phase: "read", fn: nn, data: {} };
  17383. function rn(t2) {
  17384. return t2 === "x" ? "y" : "x";
  17385. }
  17386. function on$2(t2) {
  17387. var e = t2.state, n = t2.options, r2 = t2.name, o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? true : v, h2 = n.tetherOffset, p = h2 === void 0 ? 0 : h2, g = ne(e, { boundary: f, rootBoundary: c, padding: m, altBoundary: u }), x = q(e.placement), y = te(e.placement), $2 = !y, d2 = Le(x), b = rn(d2), w = e.modifiersData.popperOffsets, O = e.rects.reference, j = e.rects.popper, A = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, k = typeof A == "number" ? { mainAxis: A, altAxis: A } : Object.assign({ mainAxis: 0, altAxis: 0 }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = { x: 0, y: 0 };
  17388. if (w) {
  17389. if (i2) {
  17390. var L, re = d2 === "y" ? E : P, oe = d2 === "y" ? R : W, M = d2 === "y" ? "height" : "width", T = w[d2], pe = T + g[re], _ = T - g[oe], ue = l ? -j[M] / 2 : 0, xe = y === U ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : { width: 0, height: 0 }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : st(), de = V[re], ae = V[oe], Y = fe(0, O[M], z[M]), jt = $2 ? O[M] / 2 - ue - Y - de - k.mainAxis : xe - Y - de - k.mainAxis, Dt = $2 ? -O[M] / 2 + ue + Y + ae + k.mainAxis : ie + Y + ae + k.mainAxis, Oe = e.elements.arrow && se(e.elements.arrow), Et = Oe ? d2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L = D == null ? void 0 : D[d2]) != null ? L : 0, Pt = T + jt - Ce - Et, At = T + Dt - Ce, qe = fe(l ? ve(pe, Pt) : pe, T, l ? X(_, At) : _);
  17391. w[d2] = qe, S[d2] = qe - T;
  17392. }
  17393. if (s) {
  17394. var Ve, kt = d2 === "x" ? E : P, Lt = d2 === "x" ? R : W, F = w[b], he = b === "y" ? "height" : "width", Ne = F + g[kt], Ie = F - g[Lt], $e = [E, P].indexOf(x) !== -1, _e = (Ve = D == null ? void 0 : D[b]) != null ? Ve : 0, ze = $e ? Ne : F - O[he] - j[he] - _e + k.altAxis, Fe = $e ? F + O[he] + j[he] - _e - k.altAxis : Ie, Ue = l && $e ? St(ze, F, Fe) : fe(l ? ze : Ne, F, l ? Fe : Ie);
  17395. w[b] = Ue, S[b] = Ue - F;
  17396. }
  17397. e.modifiersData[r2] = S;
  17398. }
  17399. }
  17400. var xt = { name: "preventOverflow", enabled: true, phase: "main", fn: on$2, requiresIfExists: ["offset"] };
  17401. function an(t2) {
  17402. return { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop };
  17403. }
  17404. function sn(t2) {
  17405. return t2 === H(t2) || !B(t2) ? We(t2) : an(t2);
  17406. }
  17407. function fn(t2) {
  17408. var e = t2.getBoundingClientRect(), n = Z(e.width) / t2.offsetWidth || 1, r2 = Z(e.height) / t2.offsetHeight || 1;
  17409. return n !== 1 || r2 !== 1;
  17410. }
  17411. function cn(t2, e, n) {
  17412. n === void 0 && (n = false);
  17413. var r2 = B(e), o = B(e) && fn(e), i2 = I(e), a = ee(t2, o), s = { scrollLeft: 0, scrollTop: 0 }, f = { x: 0, y: 0 };
  17414. return (r2 || !r2 && !n) && ((C(e) !== "body" || Se(i2)) && (s = sn(e)), B(e) ? (f = ee(e, true), f.x += e.clientLeft, f.y += e.clientTop) : i2 && (f.x = Be(i2))), { x: a.left + s.scrollLeft - f.x, y: a.top + s.scrollTop - f.y, width: a.width, height: a.height };
  17415. }
  17416. function pn(t2) {
  17417. var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r2 = [];
  17418. t2.forEach(function(i2) {
  17419. e.set(i2.name, i2);
  17420. });
  17421. function o(i2) {
  17422. n.add(i2.name);
  17423. var a = [].concat(i2.requires || [], i2.requiresIfExists || []);
  17424. a.forEach(function(s) {
  17425. if (!n.has(s)) {
  17426. var f = e.get(s);
  17427. f && o(f);
  17428. }
  17429. }), r2.push(i2);
  17430. }
  17431. return t2.forEach(function(i2) {
  17432. n.has(i2.name) || o(i2);
  17433. }), r2;
  17434. }
  17435. function un(t2) {
  17436. var e = pn(t2);
  17437. return ot.reduce(function(n, r2) {
  17438. return n.concat(e.filter(function(o) {
  17439. return o.phase === r2;
  17440. }));
  17441. }, []);
  17442. }
  17443. function ln(t2) {
  17444. var e;
  17445. return function() {
  17446. return e || (e = new Promise(function(n) {
  17447. Promise.resolve().then(function() {
  17448. e = void 0, n(t2());
  17449. });
  17450. })), e;
  17451. };
  17452. }
  17453. function dn(t2) {
  17454. var e = t2.reduce(function(n, r2) {
  17455. var o = n[r2.name];
  17456. return n[r2.name] = o ? Object.assign({}, o, r2, { options: Object.assign({}, o.options, r2.options), data: Object.assign({}, o.data, r2.data) }) : r2, n;
  17457. }, {});
  17458. return Object.keys(e).map(function(n) {
  17459. return e[n];
  17460. });
  17461. }
  17462. var Ot = { placement: "bottom", modifiers: [], strategy: "absolute" };
  17463. function $t() {
  17464. for (var t2 = arguments.length, e = new Array(t2), n = 0; n < t2; n++)
  17465. e[n] = arguments[n];
  17466. return !e.some(function(r2) {
  17467. return !(r2 && typeof r2.getBoundingClientRect == "function");
  17468. });
  17469. }
  17470. function we(t2) {
  17471. t2 === void 0 && (t2 = {});
  17472. var e = t2, n = e.defaultModifiers, r2 = n === void 0 ? [] : n, o = e.defaultOptions, i2 = o === void 0 ? Ot : o;
  17473. return function(a, s, f) {
  17474. f === void 0 && (f = i2);
  17475. var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ot, i2), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, u = [], m = false, v = { state: c, setOptions: function(p) {
  17476. var g = typeof p == "function" ? p(c.options) : p;
  17477. h2(), c.options = Object.assign({}, i2, c.options, g), c.scrollParents = { reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [], popper: ce(s) };
  17478. var x = un(dn([].concat(r2, c.options.modifiers)));
  17479. return c.orderedModifiers = x.filter(function(y) {
  17480. return y.enabled;
  17481. }), l(), v.update();
  17482. }, forceUpdate: function() {
  17483. if (!m) {
  17484. var p = c.elements, g = p.reference, x = p.popper;
  17485. if ($t(g, x)) {
  17486. c.rects = { reference: cn(g, se(x), c.options.strategy === "fixed"), popper: ke(x) }, c.reset = false, c.placement = c.options.placement, c.orderedModifiers.forEach(function(j) {
  17487. return c.modifiersData[j.name] = Object.assign({}, j.data);
  17488. });
  17489. for (var y = 0; y < c.orderedModifiers.length; y++) {
  17490. if (c.reset === true) {
  17491. c.reset = false, y = -1;
  17492. continue;
  17493. }
  17494. var $2 = c.orderedModifiers[y], d2 = $2.fn, b = $2.options, w = b === void 0 ? {} : b, O = $2.name;
  17495. typeof d2 == "function" && (c = d2({ state: c, options: w, name: O, instance: v }) || c);
  17496. }
  17497. }
  17498. }
  17499. }, update: ln(function() {
  17500. return new Promise(function(p) {
  17501. v.forceUpdate(), p(c);
  17502. });
  17503. }), destroy: function() {
  17504. h2(), m = true;
  17505. } };
  17506. if (!$t(a, s))
  17507. return v;
  17508. v.setOptions(f).then(function(p) {
  17509. !m && f.onFirstUpdate && f.onFirstUpdate(p);
  17510. });
  17511. function l() {
  17512. c.orderedModifiers.forEach(function(p) {
  17513. var g = p.name, x = p.options, y = x === void 0 ? {} : x, $2 = p.effect;
  17514. if (typeof $2 == "function") {
  17515. var d2 = $2({ state: c, name: g, instance: v, options: y }), b = function() {
  17516. };
  17517. u.push(d2 || b);
  17518. }
  17519. });
  17520. }
  17521. function h2() {
  17522. u.forEach(function(p) {
  17523. return p();
  17524. }), u = [];
  17525. }
  17526. return v;
  17527. };
  17528. }
  17529. we();
  17530. var mn = [Re, He, Me, Ae];
  17531. we({ defaultModifiers: mn });
  17532. var gn = [Re, He, Me, Ae, wt, vt, xt, pt, bt], yn = we({ defaultModifiers: gn });
  17533. const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
  17534. const stateUpdater = {
  17535. name: "updateState",
  17536. enabled: true,
  17537. phase: "write",
  17538. fn: ({ state }) => {
  17539. const derivedState = deriveState(state);
  17540. Object.assign(states.value, derivedState);
  17541. },
  17542. requires: ["computeStyles"]
  17543. };
  17544. const options2 = computed$1(() => {
  17545. const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
  17546. return {
  17547. onFirstUpdate,
  17548. placement: placement || "bottom",
  17549. strategy: strategy || "absolute",
  17550. modifiers: [
  17551. ...modifiers || [],
  17552. stateUpdater,
  17553. { name: "applyStyles", enabled: false }
  17554. ]
  17555. };
  17556. });
  17557. const instanceRef = shallowRef();
  17558. const states = ref({
  17559. styles: {
  17560. popper: {
  17561. position: unref(options2).strategy,
  17562. left: "0",
  17563. top: "0"
  17564. },
  17565. arrow: {
  17566. position: "absolute"
  17567. }
  17568. },
  17569. attributes: {}
  17570. });
  17571. const destroy = () => {
  17572. if (!instanceRef.value)
  17573. return;
  17574. instanceRef.value.destroy();
  17575. instanceRef.value = void 0;
  17576. };
  17577. watch(options2, (newOptions) => {
  17578. const instance = unref(instanceRef);
  17579. if (instance) {
  17580. instance.setOptions(newOptions);
  17581. }
  17582. }, {
  17583. deep: true
  17584. });
  17585. watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
  17586. destroy();
  17587. if (!referenceElement || !popperElement)
  17588. return;
  17589. instanceRef.value = yn(referenceElement, popperElement, unref(options2));
  17590. });
  17591. onBeforeUnmount(() => {
  17592. destroy();
  17593. });
  17594. return {
  17595. state: computed$1(() => {
  17596. var _a2;
  17597. return { ...((_a2 = unref(instanceRef)) == null ? void 0 : _a2.state) || {} };
  17598. }),
  17599. styles: computed$1(() => unref(states).styles),
  17600. attributes: computed$1(() => unref(states).attributes),
  17601. update: () => {
  17602. var _a2;
  17603. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.update();
  17604. },
  17605. forceUpdate: () => {
  17606. var _a2;
  17607. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.forceUpdate();
  17608. },
  17609. instanceRef: computed$1(() => unref(instanceRef))
  17610. };
  17611. };
  17612. function deriveState(state) {
  17613. const elements = Object.keys(state.elements);
  17614. const styles = fromPairs(elements.map((element) => [element, state.styles[element] || {}]));
  17615. const attributes = fromPairs(elements.map((element) => [element, state.attributes[element]]));
  17616. return {
  17617. styles,
  17618. attributes
  17619. };
  17620. }
  17621. const useSameTarget = (handleClick) => {
  17622. if (!handleClick) {
  17623. return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
  17624. }
  17625. let mousedownTarget = false;
  17626. let mouseupTarget = false;
  17627. const onClick = (e) => {
  17628. if (mousedownTarget && mouseupTarget) {
  17629. handleClick(e);
  17630. }
  17631. mousedownTarget = mouseupTarget = false;
  17632. };
  17633. const onMousedown = (e) => {
  17634. mousedownTarget = e.target === e.currentTarget;
  17635. };
  17636. const onMouseup = (e) => {
  17637. mouseupTarget = e.target === e.currentTarget;
  17638. };
  17639. return { onClick, onMousedown, onMouseup };
  17640. };
  17641. function useTimeout() {
  17642. let timeoutHandle;
  17643. const registerTimeout = (fn2, delay) => {
  17644. cancelTimeout();
  17645. timeoutHandle = window.setTimeout(fn2, delay);
  17646. };
  17647. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  17648. tryOnScopeDispose(() => cancelTimeout());
  17649. return {
  17650. registerTimeout,
  17651. cancelTimeout
  17652. };
  17653. }
  17654. const defaultIdInjection = {
  17655. prefix: Math.floor(Math.random() * 1e4),
  17656. current: 0
  17657. };
  17658. const ID_INJECTION_KEY = Symbol("elIdInjection");
  17659. const useIdInjection = () => {
  17660. return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  17661. };
  17662. const useId = (deterministicId) => {
  17663. const idInjection = useIdInjection();
  17664. const namespace = useGetDerivedNamespace();
  17665. const idRef = computed$1(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  17666. return idRef;
  17667. };
  17668. let registeredEscapeHandlers = [];
  17669. const cachedHandler = (e) => {
  17670. const event2 = e;
  17671. if (event2.key === EVENT_CODE.esc) {
  17672. registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event2));
  17673. }
  17674. };
  17675. const useEscapeKeydown = (handler) => {
  17676. onMounted(() => {
  17677. if (registeredEscapeHandlers.length === 0) {
  17678. document.addEventListener("keydown", cachedHandler);
  17679. }
  17680. if (isClient)
  17681. registeredEscapeHandlers.push(handler);
  17682. });
  17683. onBeforeUnmount(() => {
  17684. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  17685. if (registeredEscapeHandlers.length === 0) {
  17686. if (isClient)
  17687. document.removeEventListener("keydown", cachedHandler);
  17688. }
  17689. });
  17690. };
  17691. let cachedContainer;
  17692. const usePopperContainerId = () => {
  17693. const namespace = useGetDerivedNamespace();
  17694. const idInjection = useIdInjection();
  17695. const id = computed$1(() => {
  17696. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  17697. });
  17698. const selector = computed$1(() => `#${id.value}`);
  17699. return {
  17700. id,
  17701. selector
  17702. };
  17703. };
  17704. const createContainer = (id) => {
  17705. const container = document.createElement("div");
  17706. container.id = id;
  17707. document.body.appendChild(container);
  17708. return container;
  17709. };
  17710. const usePopperContainer = () => {
  17711. const { id, selector } = usePopperContainerId();
  17712. onBeforeMount(() => {
  17713. if (!isClient)
  17714. return;
  17715. if (!cachedContainer && !document.body.querySelector(selector.value)) {
  17716. cachedContainer = createContainer(id.value);
  17717. }
  17718. });
  17719. return {
  17720. id,
  17721. selector
  17722. };
  17723. };
  17724. const useDelayedToggleProps = buildProps({
  17725. showAfter: {
  17726. type: Number,
  17727. default: 0
  17728. },
  17729. hideAfter: {
  17730. type: Number,
  17731. default: 200
  17732. },
  17733. autoClose: {
  17734. type: Number,
  17735. default: 0
  17736. }
  17737. });
  17738. const useDelayedToggle = ({
  17739. showAfter,
  17740. hideAfter,
  17741. autoClose,
  17742. open,
  17743. close
  17744. }) => {
  17745. const { registerTimeout } = useTimeout();
  17746. const {
  17747. registerTimeout: registerTimeoutForAutoClose,
  17748. cancelTimeout: cancelTimeoutForAutoClose
  17749. } = useTimeout();
  17750. const onOpen = (event2) => {
  17751. registerTimeout(() => {
  17752. open(event2);
  17753. const _autoClose = unref(autoClose);
  17754. if (isNumber(_autoClose) && _autoClose > 0) {
  17755. registerTimeoutForAutoClose(() => {
  17756. close(event2);
  17757. }, _autoClose);
  17758. }
  17759. }, unref(showAfter));
  17760. };
  17761. const onClose = (event2) => {
  17762. cancelTimeoutForAutoClose();
  17763. registerTimeout(() => {
  17764. close(event2);
  17765. }, unref(hideAfter));
  17766. };
  17767. return {
  17768. onOpen,
  17769. onClose
  17770. };
  17771. };
  17772. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  17773. const useForwardRef = (forwardRef) => {
  17774. const setForwardRef = (el) => {
  17775. forwardRef.value = el;
  17776. };
  17777. provide(FORWARD_REF_INJECTION_KEY, {
  17778. setForwardRef
  17779. });
  17780. };
  17781. const useForwardRefDirective = (setForwardRef) => {
  17782. return {
  17783. mounted(el) {
  17784. setForwardRef(el);
  17785. },
  17786. updated(el) {
  17787. setForwardRef(el);
  17788. },
  17789. unmounted() {
  17790. setForwardRef(null);
  17791. }
  17792. };
  17793. };
  17794. const zIndex = ref(0);
  17795. const defaultInitialZIndex = 2e3;
  17796. const zIndexContextKey = Symbol("zIndexContextKey");
  17797. const useZIndex = (zIndexOverrides) => {
  17798. const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, void 0);
  17799. const initialZIndex = computed$1(() => {
  17800. const zIndexFromInjection = unref(zIndexInjection);
  17801. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  17802. });
  17803. const currentZIndex = computed$1(() => initialZIndex.value + zIndex.value);
  17804. const nextZIndex = () => {
  17805. zIndex.value++;
  17806. return currentZIndex.value;
  17807. };
  17808. return {
  17809. initialZIndex,
  17810. currentZIndex,
  17811. nextZIndex
  17812. };
  17813. };
  17814. function useCursor(input) {
  17815. const selectionRef = ref();
  17816. function recordCursor() {
  17817. if (input.value == void 0)
  17818. return;
  17819. const { selectionStart, selectionEnd, value } = input.value;
  17820. if (selectionStart == null || selectionEnd == null)
  17821. return;
  17822. const beforeTxt = value.slice(0, Math.max(0, selectionStart));
  17823. const afterTxt = value.slice(Math.max(0, selectionEnd));
  17824. selectionRef.value = {
  17825. selectionStart,
  17826. selectionEnd,
  17827. value,
  17828. beforeTxt,
  17829. afterTxt
  17830. };
  17831. }
  17832. function setCursor() {
  17833. if (input.value == void 0 || selectionRef.value == void 0)
  17834. return;
  17835. const { value } = input.value;
  17836. const { beforeTxt, afterTxt, selectionStart } = selectionRef.value;
  17837. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
  17838. return;
  17839. let startPos = value.length;
  17840. if (value.endsWith(afterTxt)) {
  17841. startPos = value.length - afterTxt.length;
  17842. } else if (value.startsWith(beforeTxt)) {
  17843. startPos = beforeTxt.length;
  17844. } else {
  17845. const beforeLastChar = beforeTxt[selectionStart - 1];
  17846. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  17847. if (newIndex !== -1) {
  17848. startPos = newIndex + 1;
  17849. }
  17850. }
  17851. input.value.setSelectionRange(startPos, startPos);
  17852. }
  17853. return [recordCursor, setCursor];
  17854. }
  17855. const useSizeProp = buildProp({
  17856. type: String,
  17857. values: componentSizes,
  17858. required: false
  17859. });
  17860. const SIZE_INJECTION_KEY = Symbol("size");
  17861. const useGlobalSize = () => {
  17862. const injectedSize = inject(SIZE_INJECTION_KEY, {});
  17863. return computed$1(() => {
  17864. return unref(injectedSize.size) || "";
  17865. });
  17866. };
  17867. const configProviderContextKey = Symbol();
  17868. const globalConfig = ref();
  17869. function useGlobalConfig(key, defaultValue2 = void 0) {
  17870. const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
  17871. if (key) {
  17872. return computed$1(() => {
  17873. var _a2, _b;
  17874. return (_b = (_a2 = config.value) == null ? void 0 : _a2[key]) != null ? _b : defaultValue2;
  17875. });
  17876. } else {
  17877. return config;
  17878. }
  17879. }
  17880. const provideGlobalConfig = (config, app, global2 = false) => {
  17881. var _a2;
  17882. const inSetup = !!getCurrentInstance();
  17883. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  17884. const provideFn = (_a2 = app == null ? void 0 : app.provide) != null ? _a2 : inSetup ? provide : void 0;
  17885. if (!provideFn) {
  17886. return;
  17887. }
  17888. const context = computed$1(() => {
  17889. const cfg = unref(config);
  17890. if (!(oldConfig == null ? void 0 : oldConfig.value))
  17891. return cfg;
  17892. return mergeConfig(oldConfig.value, cfg);
  17893. });
  17894. provideFn(configProviderContextKey, context);
  17895. provideFn(localeContextKey, computed$1(() => context.value.locale));
  17896. provideFn(namespaceContextKey, computed$1(() => context.value.namespace));
  17897. provideFn(zIndexContextKey, computed$1(() => context.value.zIndex));
  17898. provideFn(SIZE_INJECTION_KEY, {
  17899. size: computed$1(() => context.value.size || "")
  17900. });
  17901. if (global2 || !globalConfig.value) {
  17902. globalConfig.value = context.value;
  17903. }
  17904. return context;
  17905. };
  17906. const mergeConfig = (a, b) => {
  17907. var _a2;
  17908. const keys3 = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
  17909. const obj = {};
  17910. for (const key of keys3) {
  17911. obj[key] = (_a2 = b[key]) != null ? _a2 : a[key];
  17912. }
  17913. return obj;
  17914. };
  17915. const configProviderProps = buildProps({
  17916. a11y: {
  17917. type: Boolean,
  17918. default: true
  17919. },
  17920. locale: {
  17921. type: definePropType(Object)
  17922. },
  17923. size: useSizeProp,
  17924. button: {
  17925. type: definePropType(Object)
  17926. },
  17927. experimentalFeatures: {
  17928. type: definePropType(Object)
  17929. },
  17930. keyboardNavigation: {
  17931. type: Boolean,
  17932. default: true
  17933. },
  17934. message: {
  17935. type: definePropType(Object)
  17936. },
  17937. zIndex: Number,
  17938. namespace: {
  17939. type: String,
  17940. default: "el"
  17941. }
  17942. });
  17943. const messageConfig = {};
  17944. const ConfigProvider = defineComponent({
  17945. name: "ElConfigProvider",
  17946. props: configProviderProps,
  17947. setup(props, { slots }) {
  17948. watch(() => props.message, (val) => {
  17949. Object.assign(messageConfig, val != null ? val : {});
  17950. }, { immediate: true, deep: true });
  17951. const config = provideGlobalConfig(props);
  17952. return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
  17953. }
  17954. });
  17955. const ElConfigProvider = withInstall(ConfigProvider);
  17956. var _export_sfc$1 = (sfc, props) => {
  17957. const target = sfc.__vccOpts || sfc;
  17958. for (const [key, val] of props) {
  17959. target[key] = val;
  17960. }
  17961. return target;
  17962. };
  17963. const iconProps = buildProps({
  17964. size: {
  17965. type: definePropType([Number, String])
  17966. },
  17967. color: {
  17968. type: String
  17969. }
  17970. });
  17971. const __default__$o = defineComponent({
  17972. name: "ElIcon",
  17973. inheritAttrs: false
  17974. });
  17975. const _sfc_main$B = /* @__PURE__ */ defineComponent({
  17976. ...__default__$o,
  17977. props: iconProps,
  17978. setup(__props) {
  17979. const props = __props;
  17980. const ns = useNamespace("icon");
  17981. const style = computed$1(() => {
  17982. const { size, color: color2 } = props;
  17983. if (!size && !color2)
  17984. return {};
  17985. return {
  17986. fontSize: isUndefined(size) ? void 0 : addUnit(size),
  17987. "--color": color2
  17988. };
  17989. });
  17990. return (_ctx, _cache) => {
  17991. return openBlock(), createElementBlock("i", mergeProps({
  17992. class: unref(ns).b(),
  17993. style: unref(style)
  17994. }, _ctx.$attrs), [
  17995. renderSlot(_ctx.$slots, "default")
  17996. ], 16);
  17997. };
  17998. }
  17999. });
  18000. var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
  18001. const ElIcon = withInstall(Icon);
  18002. const formContextKey = Symbol("formContextKey");
  18003. const formItemContextKey = Symbol("formItemContextKey");
  18004. const useFormSize = (fallback, ignore = {}) => {
  18005. const emptyRef = ref(void 0);
  18006. const size = ignore.prop ? emptyRef : useProp("size");
  18007. const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
  18008. const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
  18009. const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
  18010. return computed$1(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "");
  18011. };
  18012. const useFormDisabled = (fallback) => {
  18013. const disabled = useProp("disabled");
  18014. const form = inject(formContextKey, void 0);
  18015. return computed$1(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
  18016. };
  18017. const useFormItem = () => {
  18018. const form = inject(formContextKey, void 0);
  18019. const formItem = inject(formItemContextKey, void 0);
  18020. return {
  18021. form,
  18022. formItem
  18023. };
  18024. };
  18025. const useFormItemInputId = (props, {
  18026. formItemContext,
  18027. disableIdGeneration,
  18028. disableIdManagement
  18029. }) => {
  18030. if (!disableIdGeneration) {
  18031. disableIdGeneration = ref(false);
  18032. }
  18033. if (!disableIdManagement) {
  18034. disableIdManagement = ref(false);
  18035. }
  18036. const inputId = ref();
  18037. let idUnwatch = void 0;
  18038. const isLabeledByFormItem = computed$1(() => {
  18039. var _a2;
  18040. return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a2 = formItemContext.inputIds) == null ? void 0 : _a2.length) <= 1);
  18041. });
  18042. onMounted(() => {
  18043. idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
  18044. const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
  18045. if (newId !== inputId.value) {
  18046. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  18047. inputId.value && formItemContext.removeInputId(inputId.value);
  18048. if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
  18049. formItemContext.addInputId(newId);
  18050. }
  18051. }
  18052. inputId.value = newId;
  18053. }
  18054. }, { immediate: true });
  18055. });
  18056. onUnmounted(() => {
  18057. idUnwatch && idUnwatch();
  18058. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  18059. inputId.value && formItemContext.removeInputId(inputId.value);
  18060. }
  18061. });
  18062. return {
  18063. isLabeledByFormItem,
  18064. inputId
  18065. };
  18066. };
  18067. let hiddenTextarea = void 0;
  18068. const HIDDEN_STYLE = `
  18069. height:0 !important;
  18070. visibility:hidden !important;
  18071. ${isFirefox() ? "" : "overflow:hidden !important;"}
  18072. position:absolute !important;
  18073. z-index:-1000 !important;
  18074. top:0 !important;
  18075. right:0 !important;
  18076. `;
  18077. const CONTEXT_STYLE = [
  18078. "letter-spacing",
  18079. "line-height",
  18080. "padding-top",
  18081. "padding-bottom",
  18082. "font-family",
  18083. "font-weight",
  18084. "font-size",
  18085. "text-rendering",
  18086. "text-transform",
  18087. "width",
  18088. "text-indent",
  18089. "padding-left",
  18090. "padding-right",
  18091. "border-width",
  18092. "box-sizing"
  18093. ];
  18094. function calculateNodeStyling(targetElement) {
  18095. const style = window.getComputedStyle(targetElement);
  18096. const boxSizing = style.getPropertyValue("box-sizing");
  18097. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  18098. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  18099. const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";");
  18100. return { contextStyle, paddingSize, borderSize, boxSizing };
  18101. }
  18102. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  18103. var _a2;
  18104. if (!hiddenTextarea) {
  18105. hiddenTextarea = document.createElement("textarea");
  18106. document.body.appendChild(hiddenTextarea);
  18107. }
  18108. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  18109. hiddenTextarea.setAttribute("style", `${contextStyle};${HIDDEN_STYLE}`);
  18110. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  18111. let height2 = hiddenTextarea.scrollHeight;
  18112. const result = {};
  18113. if (boxSizing === "border-box") {
  18114. height2 = height2 + borderSize;
  18115. } else if (boxSizing === "content-box") {
  18116. height2 = height2 - paddingSize;
  18117. }
  18118. hiddenTextarea.value = "";
  18119. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  18120. if (isNumber(minRows)) {
  18121. let minHeight = singleRowHeight * minRows;
  18122. if (boxSizing === "border-box") {
  18123. minHeight = minHeight + paddingSize + borderSize;
  18124. }
  18125. height2 = Math.max(minHeight, height2);
  18126. result.minHeight = `${minHeight}px`;
  18127. }
  18128. if (isNumber(maxRows)) {
  18129. let maxHeight = singleRowHeight * maxRows;
  18130. if (boxSizing === "border-box") {
  18131. maxHeight = maxHeight + paddingSize + borderSize;
  18132. }
  18133. height2 = Math.min(maxHeight, height2);
  18134. }
  18135. result.height = `${height2}px`;
  18136. (_a2 = hiddenTextarea.parentNode) == null ? void 0 : _a2.removeChild(hiddenTextarea);
  18137. hiddenTextarea = void 0;
  18138. return result;
  18139. }
  18140. const inputProps = buildProps({
  18141. id: {
  18142. type: String,
  18143. default: void 0
  18144. },
  18145. size: useSizeProp,
  18146. disabled: Boolean,
  18147. modelValue: {
  18148. type: definePropType([
  18149. String,
  18150. Number,
  18151. Object
  18152. ]),
  18153. default: ""
  18154. },
  18155. type: {
  18156. type: String,
  18157. default: "text"
  18158. },
  18159. resize: {
  18160. type: String,
  18161. values: ["none", "both", "horizontal", "vertical"]
  18162. },
  18163. autosize: {
  18164. type: definePropType([Boolean, Object]),
  18165. default: false
  18166. },
  18167. autocomplete: {
  18168. type: String,
  18169. default: "off"
  18170. },
  18171. formatter: {
  18172. type: Function
  18173. },
  18174. parser: {
  18175. type: Function
  18176. },
  18177. placeholder: {
  18178. type: String
  18179. },
  18180. form: {
  18181. type: String
  18182. },
  18183. readonly: {
  18184. type: Boolean,
  18185. default: false
  18186. },
  18187. clearable: {
  18188. type: Boolean,
  18189. default: false
  18190. },
  18191. showPassword: {
  18192. type: Boolean,
  18193. default: false
  18194. },
  18195. showWordLimit: {
  18196. type: Boolean,
  18197. default: false
  18198. },
  18199. suffixIcon: {
  18200. type: iconPropType
  18201. },
  18202. prefixIcon: {
  18203. type: iconPropType
  18204. },
  18205. containerRole: {
  18206. type: String,
  18207. default: void 0
  18208. },
  18209. label: {
  18210. type: String,
  18211. default: void 0
  18212. },
  18213. tabindex: {
  18214. type: [String, Number],
  18215. default: 0
  18216. },
  18217. validateEvent: {
  18218. type: Boolean,
  18219. default: true
  18220. },
  18221. inputStyle: {
  18222. type: definePropType([Object, Array, String]),
  18223. default: () => mutable({})
  18224. }
  18225. });
  18226. const inputEmits = {
  18227. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  18228. input: (value) => isString(value),
  18229. change: (value) => isString(value),
  18230. focus: (evt) => evt instanceof FocusEvent,
  18231. blur: (evt) => evt instanceof FocusEvent,
  18232. clear: () => true,
  18233. mouseleave: (evt) => evt instanceof MouseEvent,
  18234. mouseenter: (evt) => evt instanceof MouseEvent,
  18235. keydown: (evt) => evt instanceof Event,
  18236. compositionstart: (evt) => evt instanceof CompositionEvent,
  18237. compositionupdate: (evt) => evt instanceof CompositionEvent,
  18238. compositionend: (evt) => evt instanceof CompositionEvent
  18239. };
  18240. const _hoisted_1$g = ["role"];
  18241. const _hoisted_2$a = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"];
  18242. const _hoisted_3$6 = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"];
  18243. const __default__$n = defineComponent({
  18244. name: "ElInput",
  18245. inheritAttrs: false
  18246. });
  18247. const _sfc_main$A = /* @__PURE__ */ defineComponent({
  18248. ...__default__$n,
  18249. props: inputProps,
  18250. emits: inputEmits,
  18251. setup(__props, { expose, emit }) {
  18252. const props = __props;
  18253. const rawAttrs = useAttrs$1();
  18254. const slots = useSlots();
  18255. const containerAttrs = computed$1(() => {
  18256. const comboBoxAttrs = {};
  18257. if (props.containerRole === "combobox") {
  18258. comboBoxAttrs["aria-haspopup"] = rawAttrs["aria-haspopup"];
  18259. comboBoxAttrs["aria-owns"] = rawAttrs["aria-owns"];
  18260. comboBoxAttrs["aria-expanded"] = rawAttrs["aria-expanded"];
  18261. }
  18262. return comboBoxAttrs;
  18263. });
  18264. const containerKls = computed$1(() => [
  18265. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  18266. nsInput.m(inputSize.value),
  18267. nsInput.is("disabled", inputDisabled.value),
  18268. nsInput.is("exceed", inputExceed.value),
  18269. {
  18270. [nsInput.b("group")]: slots.prepend || slots.append,
  18271. [nsInput.bm("group", "append")]: slots.append,
  18272. [nsInput.bm("group", "prepend")]: slots.prepend,
  18273. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  18274. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  18275. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value
  18276. },
  18277. rawAttrs.class
  18278. ]);
  18279. const wrapperKls = computed$1(() => [
  18280. nsInput.e("wrapper"),
  18281. nsInput.is("focus", focused.value)
  18282. ]);
  18283. const attrs = useAttrs({
  18284. excludeKeys: computed$1(() => {
  18285. return Object.keys(containerAttrs.value);
  18286. })
  18287. });
  18288. const { form, formItem } = useFormItem();
  18289. const { inputId } = useFormItemInputId(props, {
  18290. formItemContext: formItem
  18291. });
  18292. const inputSize = useFormSize();
  18293. const inputDisabled = useFormDisabled();
  18294. const nsInput = useNamespace("input");
  18295. const nsTextarea = useNamespace("textarea");
  18296. const input = shallowRef();
  18297. const textarea = shallowRef();
  18298. const focused = ref(false);
  18299. const hovering = ref(false);
  18300. const isComposing = ref(false);
  18301. const passwordVisible = ref(false);
  18302. const countStyle = ref();
  18303. const textareaCalcStyle = shallowRef(props.inputStyle);
  18304. const _ref = computed$1(() => input.value || textarea.value);
  18305. const needStatusIcon = computed$1(() => {
  18306. var _a2;
  18307. return (_a2 = form == null ? void 0 : form.statusIcon) != null ? _a2 : false;
  18308. });
  18309. const validateState = computed$1(() => (formItem == null ? void 0 : formItem.validateState) || "");
  18310. const validateIcon = computed$1(() => validateState.value && ValidateComponentsMap[validateState.value]);
  18311. const passwordIcon = computed$1(() => passwordVisible.value ? view_default : hide_default);
  18312. const containerStyle = computed$1(() => [
  18313. rawAttrs.style,
  18314. props.inputStyle
  18315. ]);
  18316. const textareaStyle = computed$1(() => [
  18317. props.inputStyle,
  18318. textareaCalcStyle.value,
  18319. { resize: props.resize }
  18320. ]);
  18321. const nativeInputValue = computed$1(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  18322. const showClear = computed$1(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
  18323. const showPwdVisible = computed$1(() => props.showPassword && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (!!nativeInputValue.value || focused.value));
  18324. const isWordLimitVisible = computed$1(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  18325. const textLength = computed$1(() => nativeInputValue.value.length);
  18326. const inputExceed = computed$1(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
  18327. const suffixVisible = computed$1(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  18328. const [recordCursor, setCursor] = useCursor(input);
  18329. useResizeObserver(textarea, (entries) => {
  18330. onceInitSizeTextarea();
  18331. if (!isWordLimitVisible.value || props.resize !== "both")
  18332. return;
  18333. const entry = entries[0];
  18334. const { width: width2 } = entry.contentRect;
  18335. countStyle.value = {
  18336. right: `calc(100% - ${width2 + 15 + 6}px)`
  18337. };
  18338. });
  18339. const resizeTextarea = () => {
  18340. const { type: type2, autosize } = props;
  18341. if (!isClient || type2 !== "textarea" || !textarea.value)
  18342. return;
  18343. if (autosize) {
  18344. const minRows = isObject$5(autosize) ? autosize.minRows : void 0;
  18345. const maxRows = isObject$5(autosize) ? autosize.maxRows : void 0;
  18346. const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
  18347. textareaCalcStyle.value = {
  18348. overflowY: "hidden",
  18349. ...textareaStyle2
  18350. };
  18351. nextTick(() => {
  18352. textarea.value.offsetHeight;
  18353. textareaCalcStyle.value = textareaStyle2;
  18354. });
  18355. } else {
  18356. textareaCalcStyle.value = {
  18357. minHeight: calcTextareaHeight(textarea.value).minHeight
  18358. };
  18359. }
  18360. };
  18361. const createOnceInitResize = (resizeTextarea2) => {
  18362. let isInit = false;
  18363. return () => {
  18364. var _a2;
  18365. if (isInit || !props.autosize)
  18366. return;
  18367. const isElHidden = ((_a2 = textarea.value) == null ? void 0 : _a2.offsetParent) === null;
  18368. if (!isElHidden) {
  18369. resizeTextarea2();
  18370. isInit = true;
  18371. }
  18372. };
  18373. };
  18374. const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
  18375. const setNativeInputValue = () => {
  18376. const input2 = _ref.value;
  18377. if (!input2 || input2.value === nativeInputValue.value)
  18378. return;
  18379. input2.value = nativeInputValue.value;
  18380. };
  18381. const handleInput = async (event2) => {
  18382. recordCursor();
  18383. let { value } = event2.target;
  18384. if (props.formatter) {
  18385. value = props.parser ? props.parser(value) : value;
  18386. value = props.formatter(value);
  18387. }
  18388. if (isComposing.value)
  18389. return;
  18390. if (value === nativeInputValue.value) {
  18391. setNativeInputValue();
  18392. return;
  18393. }
  18394. emit(UPDATE_MODEL_EVENT, value);
  18395. emit("input", value);
  18396. await nextTick();
  18397. setNativeInputValue();
  18398. setCursor();
  18399. };
  18400. const handleChange = (event2) => {
  18401. emit("change", event2.target.value);
  18402. };
  18403. const handleCompositionStart = (event2) => {
  18404. emit("compositionstart", event2);
  18405. isComposing.value = true;
  18406. };
  18407. const handleCompositionUpdate = (event2) => {
  18408. var _a2;
  18409. emit("compositionupdate", event2);
  18410. const text = (_a2 = event2.target) == null ? void 0 : _a2.value;
  18411. const lastCharacter = text[text.length - 1] || "";
  18412. isComposing.value = !isKorean(lastCharacter);
  18413. };
  18414. const handleCompositionEnd = (event2) => {
  18415. emit("compositionend", event2);
  18416. if (isComposing.value) {
  18417. isComposing.value = false;
  18418. handleInput(event2);
  18419. }
  18420. };
  18421. const handlePasswordVisible = () => {
  18422. passwordVisible.value = !passwordVisible.value;
  18423. focus();
  18424. };
  18425. const focus = async () => {
  18426. var _a2;
  18427. await nextTick();
  18428. (_a2 = _ref.value) == null ? void 0 : _a2.focus();
  18429. };
  18430. const blur = () => {
  18431. var _a2;
  18432. return (_a2 = _ref.value) == null ? void 0 : _a2.blur();
  18433. };
  18434. const handleFocus = (event2) => {
  18435. focused.value = true;
  18436. emit("focus", event2);
  18437. };
  18438. const handleBlur = (event2) => {
  18439. var _a2;
  18440. focused.value = false;
  18441. emit("blur", event2);
  18442. if (props.validateEvent) {
  18443. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  18444. }
  18445. };
  18446. const handleMouseLeave = (evt) => {
  18447. hovering.value = false;
  18448. emit("mouseleave", evt);
  18449. };
  18450. const handleMouseEnter = (evt) => {
  18451. hovering.value = true;
  18452. emit("mouseenter", evt);
  18453. };
  18454. const handleKeydown = (evt) => {
  18455. emit("keydown", evt);
  18456. };
  18457. const select = () => {
  18458. var _a2;
  18459. (_a2 = _ref.value) == null ? void 0 : _a2.select();
  18460. };
  18461. const clear = () => {
  18462. emit(UPDATE_MODEL_EVENT, "");
  18463. emit("change", "");
  18464. emit("clear");
  18465. emit("input", "");
  18466. };
  18467. watch(() => props.modelValue, () => {
  18468. var _a2;
  18469. nextTick(() => resizeTextarea());
  18470. if (props.validateEvent) {
  18471. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  18472. }
  18473. });
  18474. watch(nativeInputValue, () => setNativeInputValue());
  18475. watch(() => props.type, async () => {
  18476. await nextTick();
  18477. setNativeInputValue();
  18478. resizeTextarea();
  18479. });
  18480. onMounted(() => {
  18481. if (!props.formatter && props.parser)
  18482. ;
  18483. setNativeInputValue();
  18484. nextTick(resizeTextarea);
  18485. });
  18486. expose({
  18487. input,
  18488. textarea,
  18489. ref: _ref,
  18490. textareaStyle,
  18491. autosize: toRef(props, "autosize"),
  18492. focus,
  18493. blur,
  18494. select,
  18495. clear,
  18496. resizeTextarea
  18497. });
  18498. return (_ctx, _cache) => {
  18499. return withDirectives((openBlock(), createElementBlock("div", mergeProps(unref(containerAttrs), {
  18500. class: unref(containerKls),
  18501. style: unref(containerStyle),
  18502. role: _ctx.containerRole,
  18503. onMouseenter: handleMouseEnter,
  18504. onMouseleave: handleMouseLeave
  18505. }), [
  18506. createCommentVNode(" input "),
  18507. _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18508. createCommentVNode(" prepend slot "),
  18509. _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
  18510. key: 0,
  18511. class: normalizeClass(unref(nsInput).be("group", "prepend"))
  18512. }, [
  18513. renderSlot(_ctx.$slots, "prepend")
  18514. ], 2)) : createCommentVNode("v-if", true),
  18515. createElementVNode("div", {
  18516. class: normalizeClass(unref(wrapperKls))
  18517. }, [
  18518. createCommentVNode(" prefix slot "),
  18519. _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
  18520. key: 0,
  18521. class: normalizeClass(unref(nsInput).e("prefix"))
  18522. }, [
  18523. createElementVNode("span", {
  18524. class: normalizeClass(unref(nsInput).e("prefix-inner")),
  18525. onClick: focus
  18526. }, [
  18527. renderSlot(_ctx.$slots, "prefix"),
  18528. _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18529. key: 0,
  18530. class: normalizeClass(unref(nsInput).e("icon"))
  18531. }, {
  18532. default: withCtx(() => [
  18533. (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
  18534. ]),
  18535. _: 1
  18536. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18537. ], 2)
  18538. ], 2)) : createCommentVNode("v-if", true),
  18539. createElementVNode("input", mergeProps({
  18540. id: unref(inputId),
  18541. ref_key: "input",
  18542. ref: input,
  18543. class: unref(nsInput).e("inner")
  18544. }, unref(attrs), {
  18545. type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
  18546. disabled: unref(inputDisabled),
  18547. formatter: _ctx.formatter,
  18548. parser: _ctx.parser,
  18549. readonly: _ctx.readonly,
  18550. autocomplete: _ctx.autocomplete,
  18551. tabindex: _ctx.tabindex,
  18552. "aria-label": _ctx.label,
  18553. placeholder: _ctx.placeholder,
  18554. style: _ctx.inputStyle,
  18555. form: props.form,
  18556. onCompositionstart: handleCompositionStart,
  18557. onCompositionupdate: handleCompositionUpdate,
  18558. onCompositionend: handleCompositionEnd,
  18559. onInput: handleInput,
  18560. onFocus: handleFocus,
  18561. onBlur: handleBlur,
  18562. onChange: handleChange,
  18563. onKeydown: handleKeydown
  18564. }), null, 16, _hoisted_2$a),
  18565. createCommentVNode(" suffix slot "),
  18566. unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
  18567. key: 1,
  18568. class: normalizeClass(unref(nsInput).e("suffix"))
  18569. }, [
  18570. createElementVNode("span", {
  18571. class: normalizeClass(unref(nsInput).e("suffix-inner")),
  18572. onClick: focus
  18573. }, [
  18574. !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18575. renderSlot(_ctx.$slots, "suffix"),
  18576. _ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18577. key: 0,
  18578. class: normalizeClass(unref(nsInput).e("icon"))
  18579. }, {
  18580. default: withCtx(() => [
  18581. (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
  18582. ]),
  18583. _: 1
  18584. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18585. ], 64)) : createCommentVNode("v-if", true),
  18586. unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
  18587. key: 1,
  18588. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
  18589. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  18590. onClick: clear
  18591. }, {
  18592. default: withCtx(() => [
  18593. createVNode(unref(circle_close_default))
  18594. ]),
  18595. _: 1
  18596. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
  18597. unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
  18598. key: 2,
  18599. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
  18600. onClick: handlePasswordVisible
  18601. }, {
  18602. default: withCtx(() => [
  18603. (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
  18604. ]),
  18605. _: 1
  18606. }, 8, ["class"])) : createCommentVNode("v-if", true),
  18607. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18608. key: 3,
  18609. class: normalizeClass(unref(nsInput).e("count"))
  18610. }, [
  18611. createElementVNode("span", {
  18612. class: normalizeClass(unref(nsInput).e("count-inner"))
  18613. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)
  18614. ], 2)) : createCommentVNode("v-if", true),
  18615. unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
  18616. key: 4,
  18617. class: normalizeClass([
  18618. unref(nsInput).e("icon"),
  18619. unref(nsInput).e("validateIcon"),
  18620. unref(nsInput).is("loading", unref(validateState) === "validating")
  18621. ])
  18622. }, {
  18623. default: withCtx(() => [
  18624. (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
  18625. ]),
  18626. _: 1
  18627. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18628. ], 2)
  18629. ], 2)) : createCommentVNode("v-if", true)
  18630. ], 2),
  18631. createCommentVNode(" append slot "),
  18632. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  18633. key: 1,
  18634. class: normalizeClass(unref(nsInput).be("group", "append"))
  18635. }, [
  18636. renderSlot(_ctx.$slots, "append")
  18637. ], 2)) : createCommentVNode("v-if", true)
  18638. ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  18639. createCommentVNode(" textarea "),
  18640. createElementVNode("textarea", mergeProps({
  18641. id: unref(inputId),
  18642. ref_key: "textarea",
  18643. ref: textarea,
  18644. class: unref(nsTextarea).e("inner")
  18645. }, unref(attrs), {
  18646. tabindex: _ctx.tabindex,
  18647. disabled: unref(inputDisabled),
  18648. readonly: _ctx.readonly,
  18649. autocomplete: _ctx.autocomplete,
  18650. style: unref(textareaStyle),
  18651. "aria-label": _ctx.label,
  18652. placeholder: _ctx.placeholder,
  18653. form: props.form,
  18654. onCompositionstart: handleCompositionStart,
  18655. onCompositionupdate: handleCompositionUpdate,
  18656. onCompositionend: handleCompositionEnd,
  18657. onInput: handleInput,
  18658. onFocus: handleFocus,
  18659. onBlur: handleBlur,
  18660. onChange: handleChange,
  18661. onKeydown: handleKeydown
  18662. }), null, 16, _hoisted_3$6),
  18663. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18664. key: 0,
  18665. style: normalizeStyle(countStyle.value),
  18666. class: normalizeClass(unref(nsInput).e("count"))
  18667. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 7)) : createCommentVNode("v-if", true)
  18668. ], 64))
  18669. ], 16, _hoisted_1$g)), [
  18670. [vShow, _ctx.type !== "hidden"]
  18671. ]);
  18672. };
  18673. }
  18674. });
  18675. var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
  18676. const ElInput = withInstall(Input);
  18677. const GAP = 4;
  18678. const BAR_MAP = {
  18679. vertical: {
  18680. offset: "offsetHeight",
  18681. scroll: "scrollTop",
  18682. scrollSize: "scrollHeight",
  18683. size: "height",
  18684. key: "vertical",
  18685. axis: "Y",
  18686. client: "clientY",
  18687. direction: "top"
  18688. },
  18689. horizontal: {
  18690. offset: "offsetWidth",
  18691. scroll: "scrollLeft",
  18692. scrollSize: "scrollWidth",
  18693. size: "width",
  18694. key: "horizontal",
  18695. axis: "X",
  18696. client: "clientX",
  18697. direction: "left"
  18698. }
  18699. };
  18700. const renderThumbStyle = ({
  18701. move,
  18702. size,
  18703. bar
  18704. }) => ({
  18705. [bar.size]: size,
  18706. transform: `translate${bar.axis}(${move}%)`
  18707. });
  18708. const scrollbarContextKey = Symbol("scrollbarContextKey");
  18709. const thumbProps = buildProps({
  18710. vertical: Boolean,
  18711. size: String,
  18712. move: Number,
  18713. ratio: {
  18714. type: Number,
  18715. required: true
  18716. },
  18717. always: Boolean
  18718. });
  18719. const COMPONENT_NAME$4 = "Thumb";
  18720. const _sfc_main$z = /* @__PURE__ */ defineComponent({
  18721. __name: "thumb",
  18722. props: thumbProps,
  18723. setup(__props) {
  18724. const props = __props;
  18725. const scrollbar = inject(scrollbarContextKey);
  18726. const ns = useNamespace("scrollbar");
  18727. if (!scrollbar)
  18728. throwError(COMPONENT_NAME$4, "can not inject scrollbar context");
  18729. const instance = ref();
  18730. const thumb = ref();
  18731. const thumbState = ref({});
  18732. const visible = ref(false);
  18733. let cursorDown = false;
  18734. let cursorLeave = false;
  18735. let originalOnSelectStart = isClient ? document.onselectstart : null;
  18736. const bar = computed$1(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  18737. const thumbStyle = computed$1(() => renderThumbStyle({
  18738. size: props.size,
  18739. move: props.move,
  18740. bar: bar.value
  18741. }));
  18742. const offsetRatio = computed$1(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  18743. const clickThumbHandler = (e) => {
  18744. var _a2;
  18745. e.stopPropagation();
  18746. if (e.ctrlKey || [1, 2].includes(e.button))
  18747. return;
  18748. (_a2 = window.getSelection()) == null ? void 0 : _a2.removeAllRanges();
  18749. startDrag(e);
  18750. const el = e.currentTarget;
  18751. if (!el)
  18752. return;
  18753. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  18754. };
  18755. const clickTrackHandler = (e) => {
  18756. if (!thumb.value || !instance.value || !scrollbar.wrapElement)
  18757. return;
  18758. const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
  18759. const thumbHalf = thumb.value[bar.value.offset] / 2;
  18760. const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18761. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18762. };
  18763. const startDrag = (e) => {
  18764. e.stopImmediatePropagation();
  18765. cursorDown = true;
  18766. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  18767. document.addEventListener("mouseup", mouseUpDocumentHandler);
  18768. originalOnSelectStart = document.onselectstart;
  18769. document.onselectstart = () => false;
  18770. };
  18771. const mouseMoveDocumentHandler = (e) => {
  18772. if (!instance.value || !thumb.value)
  18773. return;
  18774. if (cursorDown === false)
  18775. return;
  18776. const prevPage = thumbState.value[bar.value.axis];
  18777. if (!prevPage)
  18778. return;
  18779. const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
  18780. const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
  18781. const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18782. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18783. };
  18784. const mouseUpDocumentHandler = () => {
  18785. cursorDown = false;
  18786. thumbState.value[bar.value.axis] = 0;
  18787. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  18788. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18789. restoreOnselectstart();
  18790. if (cursorLeave)
  18791. visible.value = false;
  18792. };
  18793. const mouseMoveScrollbarHandler = () => {
  18794. cursorLeave = false;
  18795. visible.value = !!props.size;
  18796. };
  18797. const mouseLeaveScrollbarHandler = () => {
  18798. cursorLeave = true;
  18799. visible.value = cursorDown;
  18800. };
  18801. onBeforeUnmount(() => {
  18802. restoreOnselectstart();
  18803. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18804. });
  18805. const restoreOnselectstart = () => {
  18806. if (document.onselectstart !== originalOnSelectStart)
  18807. document.onselectstart = originalOnSelectStart;
  18808. };
  18809. useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  18810. useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  18811. return (_ctx, _cache) => {
  18812. return openBlock(), createBlock(Transition, {
  18813. name: unref(ns).b("fade"),
  18814. persisted: ""
  18815. }, {
  18816. default: withCtx(() => [
  18817. withDirectives(createElementVNode("div", {
  18818. ref_key: "instance",
  18819. ref: instance,
  18820. class: normalizeClass([unref(ns).e("bar"), unref(ns).is(unref(bar).key)]),
  18821. onMousedown: clickTrackHandler
  18822. }, [
  18823. createElementVNode("div", {
  18824. ref_key: "thumb",
  18825. ref: thumb,
  18826. class: normalizeClass(unref(ns).e("thumb")),
  18827. style: normalizeStyle(unref(thumbStyle)),
  18828. onMousedown: clickThumbHandler
  18829. }, null, 38)
  18830. ], 34), [
  18831. [vShow, _ctx.always || visible.value]
  18832. ])
  18833. ]),
  18834. _: 1
  18835. }, 8, ["name"]);
  18836. };
  18837. }
  18838. });
  18839. var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);
  18840. const barProps = buildProps({
  18841. always: {
  18842. type: Boolean,
  18843. default: true
  18844. },
  18845. width: String,
  18846. height: String,
  18847. ratioX: {
  18848. type: Number,
  18849. default: 1
  18850. },
  18851. ratioY: {
  18852. type: Number,
  18853. default: 1
  18854. }
  18855. });
  18856. const _sfc_main$y = /* @__PURE__ */ defineComponent({
  18857. __name: "bar",
  18858. props: barProps,
  18859. setup(__props, { expose }) {
  18860. const props = __props;
  18861. const moveX = ref(0);
  18862. const moveY = ref(0);
  18863. const handleScroll = (wrap) => {
  18864. if (wrap) {
  18865. const offsetHeight = wrap.offsetHeight - GAP;
  18866. const offsetWidth = wrap.offsetWidth - GAP;
  18867. moveY.value = wrap.scrollTop * 100 / offsetHeight * props.ratioY;
  18868. moveX.value = wrap.scrollLeft * 100 / offsetWidth * props.ratioX;
  18869. }
  18870. };
  18871. expose({
  18872. handleScroll
  18873. });
  18874. return (_ctx, _cache) => {
  18875. return openBlock(), createElementBlock(Fragment, null, [
  18876. createVNode(Thumb, {
  18877. move: moveX.value,
  18878. ratio: _ctx.ratioX,
  18879. size: _ctx.width,
  18880. always: _ctx.always
  18881. }, null, 8, ["move", "ratio", "size", "always"]),
  18882. createVNode(Thumb, {
  18883. move: moveY.value,
  18884. ratio: _ctx.ratioY,
  18885. size: _ctx.height,
  18886. vertical: "",
  18887. always: _ctx.always
  18888. }, null, 8, ["move", "ratio", "size", "always"])
  18889. ], 64);
  18890. };
  18891. }
  18892. });
  18893. var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);
  18894. const scrollbarProps = buildProps({
  18895. height: {
  18896. type: [String, Number],
  18897. default: ""
  18898. },
  18899. maxHeight: {
  18900. type: [String, Number],
  18901. default: ""
  18902. },
  18903. native: {
  18904. type: Boolean,
  18905. default: false
  18906. },
  18907. wrapStyle: {
  18908. type: definePropType([String, Object, Array]),
  18909. default: ""
  18910. },
  18911. wrapClass: {
  18912. type: [String, Array],
  18913. default: ""
  18914. },
  18915. viewClass: {
  18916. type: [String, Array],
  18917. default: ""
  18918. },
  18919. viewStyle: {
  18920. type: [String, Array, Object],
  18921. default: ""
  18922. },
  18923. noresize: Boolean,
  18924. tag: {
  18925. type: String,
  18926. default: "div"
  18927. },
  18928. always: Boolean,
  18929. minSize: {
  18930. type: Number,
  18931. default: 20
  18932. }
  18933. });
  18934. const scrollbarEmits = {
  18935. scroll: ({
  18936. scrollTop,
  18937. scrollLeft
  18938. }) => [scrollTop, scrollLeft].every(isNumber)
  18939. };
  18940. const COMPONENT_NAME$3 = "ElScrollbar";
  18941. const __default__$m = defineComponent({
  18942. name: COMPONENT_NAME$3
  18943. });
  18944. const _sfc_main$x = /* @__PURE__ */ defineComponent({
  18945. ...__default__$m,
  18946. props: scrollbarProps,
  18947. emits: scrollbarEmits,
  18948. setup(__props, { expose, emit }) {
  18949. const props = __props;
  18950. const ns = useNamespace("scrollbar");
  18951. let stopResizeObserver = void 0;
  18952. let stopResizeListener = void 0;
  18953. const scrollbarRef = ref();
  18954. const wrapRef = ref();
  18955. const resizeRef = ref();
  18956. const sizeWidth = ref("0");
  18957. const sizeHeight = ref("0");
  18958. const barRef = ref();
  18959. const ratioY = ref(1);
  18960. const ratioX = ref(1);
  18961. const style = computed$1(() => {
  18962. const style2 = {};
  18963. if (props.height)
  18964. style2.height = addUnit(props.height);
  18965. if (props.maxHeight)
  18966. style2.maxHeight = addUnit(props.maxHeight);
  18967. return [props.wrapStyle, style2];
  18968. });
  18969. const wrapKls = computed$1(() => {
  18970. return [
  18971. props.wrapClass,
  18972. ns.e("wrap"),
  18973. { [ns.em("wrap", "hidden-default")]: !props.native }
  18974. ];
  18975. });
  18976. const resizeKls = computed$1(() => {
  18977. return [ns.e("view"), props.viewClass];
  18978. });
  18979. const handleScroll = () => {
  18980. var _a2;
  18981. if (wrapRef.value) {
  18982. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  18983. emit("scroll", {
  18984. scrollTop: wrapRef.value.scrollTop,
  18985. scrollLeft: wrapRef.value.scrollLeft
  18986. });
  18987. }
  18988. };
  18989. function scrollTo(arg1, arg2) {
  18990. if (isObject$5(arg1)) {
  18991. wrapRef.value.scrollTo(arg1);
  18992. } else if (isNumber(arg1) && isNumber(arg2)) {
  18993. wrapRef.value.scrollTo(arg1, arg2);
  18994. }
  18995. }
  18996. const setScrollTop = (value) => {
  18997. if (!isNumber(value)) {
  18998. return;
  18999. }
  19000. wrapRef.value.scrollTop = value;
  19001. };
  19002. const setScrollLeft = (value) => {
  19003. if (!isNumber(value)) {
  19004. return;
  19005. }
  19006. wrapRef.value.scrollLeft = value;
  19007. };
  19008. const update = () => {
  19009. if (!wrapRef.value)
  19010. return;
  19011. const offsetHeight = wrapRef.value.offsetHeight - GAP;
  19012. const offsetWidth = wrapRef.value.offsetWidth - GAP;
  19013. const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
  19014. const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
  19015. const height2 = Math.max(originalHeight, props.minSize);
  19016. const width2 = Math.max(originalWidth, props.minSize);
  19017. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height2 / (offsetHeight - height2));
  19018. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width2 / (offsetWidth - width2));
  19019. sizeHeight.value = height2 + GAP < offsetHeight ? `${height2}px` : "";
  19020. sizeWidth.value = width2 + GAP < offsetWidth ? `${width2}px` : "";
  19021. };
  19022. watch(() => props.noresize, (noresize) => {
  19023. if (noresize) {
  19024. stopResizeObserver == null ? void 0 : stopResizeObserver();
  19025. stopResizeListener == null ? void 0 : stopResizeListener();
  19026. } else {
  19027. ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
  19028. stopResizeListener = useEventListener("resize", update);
  19029. }
  19030. }, { immediate: true });
  19031. watch(() => [props.maxHeight, props.height], () => {
  19032. if (!props.native)
  19033. nextTick(() => {
  19034. var _a2;
  19035. update();
  19036. if (wrapRef.value) {
  19037. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  19038. }
  19039. });
  19040. });
  19041. provide(scrollbarContextKey, reactive({
  19042. scrollbarElement: scrollbarRef,
  19043. wrapElement: wrapRef
  19044. }));
  19045. onMounted(() => {
  19046. if (!props.native)
  19047. nextTick(() => {
  19048. update();
  19049. });
  19050. });
  19051. onUpdated(() => update());
  19052. expose({
  19053. wrapRef,
  19054. update,
  19055. scrollTo,
  19056. setScrollTop,
  19057. setScrollLeft,
  19058. handleScroll
  19059. });
  19060. return (_ctx, _cache) => {
  19061. return openBlock(), createElementBlock("div", {
  19062. ref_key: "scrollbarRef",
  19063. ref: scrollbarRef,
  19064. class: normalizeClass(unref(ns).b())
  19065. }, [
  19066. createElementVNode("div", {
  19067. ref_key: "wrapRef",
  19068. ref: wrapRef,
  19069. class: normalizeClass(unref(wrapKls)),
  19070. style: normalizeStyle(unref(style)),
  19071. onScroll: handleScroll
  19072. }, [
  19073. (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
  19074. ref_key: "resizeRef",
  19075. ref: resizeRef,
  19076. class: normalizeClass(unref(resizeKls)),
  19077. style: normalizeStyle(_ctx.viewStyle)
  19078. }, {
  19079. default: withCtx(() => [
  19080. renderSlot(_ctx.$slots, "default")
  19081. ]),
  19082. _: 3
  19083. }, 8, ["class", "style"]))
  19084. ], 38),
  19085. !_ctx.native ? (openBlock(), createBlock(Bar, {
  19086. key: 0,
  19087. ref_key: "barRef",
  19088. ref: barRef,
  19089. height: sizeHeight.value,
  19090. width: sizeWidth.value,
  19091. always: _ctx.always,
  19092. "ratio-x": ratioX.value,
  19093. "ratio-y": ratioY.value
  19094. }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
  19095. ], 2);
  19096. };
  19097. }
  19098. });
  19099. var Scrollbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
  19100. const ElScrollbar = withInstall(Scrollbar);
  19101. const POPPER_INJECTION_KEY = Symbol("popper");
  19102. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  19103. const roleTypes = [
  19104. "dialog",
  19105. "grid",
  19106. "group",
  19107. "listbox",
  19108. "menu",
  19109. "navigation",
  19110. "tooltip",
  19111. "tree"
  19112. ];
  19113. const popperProps = buildProps({
  19114. role: {
  19115. type: String,
  19116. values: roleTypes,
  19117. default: "tooltip"
  19118. }
  19119. });
  19120. const __default__$l = defineComponent({
  19121. name: "ElPopper",
  19122. inheritAttrs: false
  19123. });
  19124. const _sfc_main$w = /* @__PURE__ */ defineComponent({
  19125. ...__default__$l,
  19126. props: popperProps,
  19127. setup(__props, { expose }) {
  19128. const props = __props;
  19129. const triggerRef2 = ref();
  19130. const popperInstanceRef = ref();
  19131. const contentRef = ref();
  19132. const referenceRef = ref();
  19133. const role = computed$1(() => props.role);
  19134. const popperProvides = {
  19135. triggerRef: triggerRef2,
  19136. popperInstanceRef,
  19137. contentRef,
  19138. referenceRef,
  19139. role
  19140. };
  19141. expose(popperProvides);
  19142. provide(POPPER_INJECTION_KEY, popperProvides);
  19143. return (_ctx, _cache) => {
  19144. return renderSlot(_ctx.$slots, "default");
  19145. };
  19146. }
  19147. });
  19148. var Popper = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/popper.vue"]]);
  19149. const popperArrowProps = buildProps({
  19150. arrowOffset: {
  19151. type: Number,
  19152. default: 5
  19153. }
  19154. });
  19155. const __default__$k = defineComponent({
  19156. name: "ElPopperArrow",
  19157. inheritAttrs: false
  19158. });
  19159. const _sfc_main$v = /* @__PURE__ */ defineComponent({
  19160. ...__default__$k,
  19161. props: popperArrowProps,
  19162. setup(__props, { expose }) {
  19163. const props = __props;
  19164. const ns = useNamespace("popper");
  19165. const { arrowOffset, arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
  19166. watch(() => props.arrowOffset, (val) => {
  19167. arrowOffset.value = val;
  19168. });
  19169. onBeforeUnmount(() => {
  19170. arrowRef.value = void 0;
  19171. });
  19172. expose({
  19173. arrowRef
  19174. });
  19175. return (_ctx, _cache) => {
  19176. return openBlock(), createElementBlock("span", {
  19177. ref_key: "arrowRef",
  19178. ref: arrowRef,
  19179. class: normalizeClass(unref(ns).e("arrow")),
  19180. style: normalizeStyle(unref(arrowStyle)),
  19181. "data-popper-arrow": ""
  19182. }, null, 6);
  19183. };
  19184. }
  19185. });
  19186. var ElPopperArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);
  19187. const NAME = "ElOnlyChild";
  19188. const OnlyChild = defineComponent({
  19189. name: NAME,
  19190. setup(_, {
  19191. slots,
  19192. attrs
  19193. }) {
  19194. var _a2;
  19195. const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
  19196. const forwardRefDirective = useForwardRefDirective((_a2 = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a2 : NOOP);
  19197. return () => {
  19198. var _a22;
  19199. const defaultSlot = (_a22 = slots.default) == null ? void 0 : _a22.call(slots, attrs);
  19200. if (!defaultSlot)
  19201. return null;
  19202. if (defaultSlot.length > 1) {
  19203. return null;
  19204. }
  19205. const firstLegitNode = findFirstLegitChild(defaultSlot);
  19206. if (!firstLegitNode) {
  19207. return null;
  19208. }
  19209. return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
  19210. };
  19211. }
  19212. });
  19213. function findFirstLegitChild(node) {
  19214. if (!node)
  19215. return null;
  19216. const children = node;
  19217. for (const child of children) {
  19218. if (isObject$5(child)) {
  19219. switch (child.type) {
  19220. case Comment$1:
  19221. continue;
  19222. case Text$1:
  19223. case "svg":
  19224. return wrapTextContent(child);
  19225. case Fragment:
  19226. return findFirstLegitChild(child.children);
  19227. default:
  19228. return child;
  19229. }
  19230. }
  19231. return wrapTextContent(child);
  19232. }
  19233. return null;
  19234. }
  19235. function wrapTextContent(s) {
  19236. const ns = useNamespace("only-child");
  19237. return createVNode("span", {
  19238. "class": ns.e("content")
  19239. }, [s]);
  19240. }
  19241. const popperTriggerProps = buildProps({
  19242. virtualRef: {
  19243. type: definePropType(Object)
  19244. },
  19245. virtualTriggering: Boolean,
  19246. onMouseenter: {
  19247. type: definePropType(Function)
  19248. },
  19249. onMouseleave: {
  19250. type: definePropType(Function)
  19251. },
  19252. onClick: {
  19253. type: definePropType(Function)
  19254. },
  19255. onKeydown: {
  19256. type: definePropType(Function)
  19257. },
  19258. onFocus: {
  19259. type: definePropType(Function)
  19260. },
  19261. onBlur: {
  19262. type: definePropType(Function)
  19263. },
  19264. onContextmenu: {
  19265. type: definePropType(Function)
  19266. },
  19267. id: String,
  19268. open: Boolean
  19269. });
  19270. const __default__$j = defineComponent({
  19271. name: "ElPopperTrigger",
  19272. inheritAttrs: false
  19273. });
  19274. const _sfc_main$u = /* @__PURE__ */ defineComponent({
  19275. ...__default__$j,
  19276. props: popperTriggerProps,
  19277. setup(__props, { expose }) {
  19278. const props = __props;
  19279. const { role, triggerRef: triggerRef2 } = inject(POPPER_INJECTION_KEY, void 0);
  19280. useForwardRef(triggerRef2);
  19281. const ariaControls = computed$1(() => {
  19282. return ariaHaspopup.value ? props.id : void 0;
  19283. });
  19284. const ariaDescribedby = computed$1(() => {
  19285. if (role && role.value === "tooltip") {
  19286. return props.open && props.id ? props.id : void 0;
  19287. }
  19288. return void 0;
  19289. });
  19290. const ariaHaspopup = computed$1(() => {
  19291. if (role && role.value !== "tooltip") {
  19292. return role.value;
  19293. }
  19294. return void 0;
  19295. });
  19296. const ariaExpanded = computed$1(() => {
  19297. return ariaHaspopup.value ? `${props.open}` : void 0;
  19298. });
  19299. let virtualTriggerAriaStopWatch = void 0;
  19300. onMounted(() => {
  19301. watch(() => props.virtualRef, (virtualEl) => {
  19302. if (virtualEl) {
  19303. triggerRef2.value = unrefElement(virtualEl);
  19304. }
  19305. }, {
  19306. immediate: true
  19307. });
  19308. watch(triggerRef2, (el, prevEl) => {
  19309. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19310. virtualTriggerAriaStopWatch = void 0;
  19311. if (isElement(el)) {
  19312. [
  19313. "onMouseenter",
  19314. "onMouseleave",
  19315. "onClick",
  19316. "onKeydown",
  19317. "onFocus",
  19318. "onBlur",
  19319. "onContextmenu"
  19320. ].forEach((eventName) => {
  19321. var _a2;
  19322. const handler = props[eventName];
  19323. if (handler) {
  19324. el.addEventListener(eventName.slice(2).toLowerCase(), handler);
  19325. (_a2 = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a2.call(prevEl, eventName.slice(2).toLowerCase(), handler);
  19326. }
  19327. });
  19328. virtualTriggerAriaStopWatch = watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
  19329. [
  19330. "aria-controls",
  19331. "aria-describedby",
  19332. "aria-haspopup",
  19333. "aria-expanded"
  19334. ].forEach((key, idx) => {
  19335. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  19336. });
  19337. }, { immediate: true });
  19338. }
  19339. if (isElement(prevEl)) {
  19340. [
  19341. "aria-controls",
  19342. "aria-describedby",
  19343. "aria-haspopup",
  19344. "aria-expanded"
  19345. ].forEach((key) => prevEl.removeAttribute(key));
  19346. }
  19347. }, {
  19348. immediate: true
  19349. });
  19350. });
  19351. onBeforeUnmount(() => {
  19352. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19353. virtualTriggerAriaStopWatch = void 0;
  19354. });
  19355. expose({
  19356. triggerRef: triggerRef2
  19357. });
  19358. return (_ctx, _cache) => {
  19359. return !_ctx.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
  19360. "aria-controls": unref(ariaControls),
  19361. "aria-describedby": unref(ariaDescribedby),
  19362. "aria-expanded": unref(ariaExpanded),
  19363. "aria-haspopup": unref(ariaHaspopup)
  19364. }), {
  19365. default: withCtx(() => [
  19366. renderSlot(_ctx.$slots, "default")
  19367. ]),
  19368. _: 3
  19369. }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
  19370. };
  19371. }
  19372. });
  19373. var ElPopperTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);
  19374. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  19375. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  19376. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  19377. const FOCUS_AFTER_TRAPPED_OPTS = {
  19378. cancelable: true,
  19379. bubbles: false
  19380. };
  19381. const FOCUSOUT_PREVENTED_OPTS = {
  19382. cancelable: true,
  19383. bubbles: false
  19384. };
  19385. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  19386. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  19387. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  19388. const focusReason = ref();
  19389. const lastUserFocusTimestamp = ref(0);
  19390. const lastAutomatedFocusTimestamp = ref(0);
  19391. let focusReasonUserCount = 0;
  19392. const obtainAllFocusableElements = (element) => {
  19393. const nodes = [];
  19394. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
  19395. acceptNode: (node) => {
  19396. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  19397. if (node.disabled || node.hidden || isHiddenInput)
  19398. return NodeFilter.FILTER_SKIP;
  19399. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  19400. }
  19401. });
  19402. while (walker.nextNode())
  19403. nodes.push(walker.currentNode);
  19404. return nodes;
  19405. };
  19406. const getVisibleElement = (elements, container) => {
  19407. for (const element of elements) {
  19408. if (!isHidden(element, container))
  19409. return element;
  19410. }
  19411. };
  19412. const isHidden = (element, container) => {
  19413. if (getComputedStyle(element).visibility === "hidden")
  19414. return true;
  19415. while (element) {
  19416. if (container && element === container)
  19417. return false;
  19418. if (getComputedStyle(element).display === "none")
  19419. return true;
  19420. element = element.parentElement;
  19421. }
  19422. return false;
  19423. };
  19424. const getEdges = (container) => {
  19425. const focusable = obtainAllFocusableElements(container);
  19426. const first = getVisibleElement(focusable, container);
  19427. const last = getVisibleElement(focusable.reverse(), container);
  19428. return [first, last];
  19429. };
  19430. const isSelectable = (element) => {
  19431. return element instanceof HTMLInputElement && "select" in element;
  19432. };
  19433. const tryFocus = (element, shouldSelect) => {
  19434. if (element && element.focus) {
  19435. const prevFocusedElement = document.activeElement;
  19436. element.focus({ preventScroll: true });
  19437. lastAutomatedFocusTimestamp.value = window.performance.now();
  19438. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
  19439. element.select();
  19440. }
  19441. }
  19442. };
  19443. function removeFromStack(list, item) {
  19444. const copy2 = [...list];
  19445. const idx = list.indexOf(item);
  19446. if (idx !== -1) {
  19447. copy2.splice(idx, 1);
  19448. }
  19449. return copy2;
  19450. }
  19451. const createFocusableStack = () => {
  19452. let stack = [];
  19453. const push = (layer) => {
  19454. const currentLayer = stack[0];
  19455. if (currentLayer && layer !== currentLayer) {
  19456. currentLayer.pause();
  19457. }
  19458. stack = removeFromStack(stack, layer);
  19459. stack.unshift(layer);
  19460. };
  19461. const remove2 = (layer) => {
  19462. var _a2, _b;
  19463. stack = removeFromStack(stack, layer);
  19464. (_b = (_a2 = stack[0]) == null ? void 0 : _a2.resume) == null ? void 0 : _b.call(_a2);
  19465. };
  19466. return {
  19467. push,
  19468. remove: remove2
  19469. };
  19470. };
  19471. const focusFirstDescendant = (elements, shouldSelect = false) => {
  19472. const prevFocusedElement = document.activeElement;
  19473. for (const element of elements) {
  19474. tryFocus(element, shouldSelect);
  19475. if (document.activeElement !== prevFocusedElement)
  19476. return;
  19477. }
  19478. };
  19479. const focusableStack = createFocusableStack();
  19480. const isFocusCausedByUserEvent = () => {
  19481. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  19482. };
  19483. const notifyFocusReasonPointer = () => {
  19484. focusReason.value = "pointer";
  19485. lastUserFocusTimestamp.value = window.performance.now();
  19486. };
  19487. const notifyFocusReasonKeydown = () => {
  19488. focusReason.value = "keyboard";
  19489. lastUserFocusTimestamp.value = window.performance.now();
  19490. };
  19491. const useFocusReason = () => {
  19492. onMounted(() => {
  19493. if (focusReasonUserCount === 0) {
  19494. document.addEventListener("mousedown", notifyFocusReasonPointer);
  19495. document.addEventListener("touchstart", notifyFocusReasonPointer);
  19496. document.addEventListener("keydown", notifyFocusReasonKeydown);
  19497. }
  19498. focusReasonUserCount++;
  19499. });
  19500. onBeforeUnmount(() => {
  19501. focusReasonUserCount--;
  19502. if (focusReasonUserCount <= 0) {
  19503. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  19504. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  19505. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  19506. }
  19507. });
  19508. return {
  19509. focusReason,
  19510. lastUserFocusTimestamp,
  19511. lastAutomatedFocusTimestamp
  19512. };
  19513. };
  19514. const createFocusOutPreventedEvent = (detail) => {
  19515. return new CustomEvent(FOCUSOUT_PREVENTED, {
  19516. ...FOCUSOUT_PREVENTED_OPTS,
  19517. detail
  19518. });
  19519. };
  19520. const _sfc_main$t = defineComponent({
  19521. name: "ElFocusTrap",
  19522. inheritAttrs: false,
  19523. props: {
  19524. loop: Boolean,
  19525. trapped: Boolean,
  19526. focusTrapEl: Object,
  19527. focusStartEl: {
  19528. type: [Object, String],
  19529. default: "first"
  19530. }
  19531. },
  19532. emits: [
  19533. ON_TRAP_FOCUS_EVT,
  19534. ON_RELEASE_FOCUS_EVT,
  19535. "focusin",
  19536. "focusout",
  19537. "focusout-prevented",
  19538. "release-requested"
  19539. ],
  19540. setup(props, { emit }) {
  19541. const forwardRef = ref();
  19542. let lastFocusBeforeTrapped;
  19543. let lastFocusAfterTrapped;
  19544. const { focusReason: focusReason2 } = useFocusReason();
  19545. useEscapeKeydown((event2) => {
  19546. if (props.trapped && !focusLayer.paused) {
  19547. emit("release-requested", event2);
  19548. }
  19549. });
  19550. const focusLayer = {
  19551. paused: false,
  19552. pause() {
  19553. this.paused = true;
  19554. },
  19555. resume() {
  19556. this.paused = false;
  19557. }
  19558. };
  19559. const onKeydown = (e) => {
  19560. if (!props.loop && !props.trapped)
  19561. return;
  19562. if (focusLayer.paused)
  19563. return;
  19564. const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  19565. const { loop } = props;
  19566. const isTabbing = key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  19567. const currentFocusingEl = document.activeElement;
  19568. if (isTabbing && currentFocusingEl) {
  19569. const container = currentTarget;
  19570. const [first, last] = getEdges(container);
  19571. const isTabbable = first && last;
  19572. if (!isTabbable) {
  19573. if (currentFocusingEl === container) {
  19574. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19575. focusReason: focusReason2.value
  19576. });
  19577. emit("focusout-prevented", focusoutPreventedEvent);
  19578. if (!focusoutPreventedEvent.defaultPrevented) {
  19579. e.preventDefault();
  19580. }
  19581. }
  19582. } else {
  19583. if (!shiftKey && currentFocusingEl === last) {
  19584. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19585. focusReason: focusReason2.value
  19586. });
  19587. emit("focusout-prevented", focusoutPreventedEvent);
  19588. if (!focusoutPreventedEvent.defaultPrevented) {
  19589. e.preventDefault();
  19590. if (loop)
  19591. tryFocus(first, true);
  19592. }
  19593. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  19594. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19595. focusReason: focusReason2.value
  19596. });
  19597. emit("focusout-prevented", focusoutPreventedEvent);
  19598. if (!focusoutPreventedEvent.defaultPrevented) {
  19599. e.preventDefault();
  19600. if (loop)
  19601. tryFocus(last, true);
  19602. }
  19603. }
  19604. }
  19605. }
  19606. };
  19607. provide(FOCUS_TRAP_INJECTION_KEY, {
  19608. focusTrapRef: forwardRef,
  19609. onKeydown
  19610. });
  19611. watch(() => props.focusTrapEl, (focusTrapEl) => {
  19612. if (focusTrapEl) {
  19613. forwardRef.value = focusTrapEl;
  19614. }
  19615. }, { immediate: true });
  19616. watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
  19617. if (forwardRef2) {
  19618. forwardRef2.addEventListener("keydown", onKeydown);
  19619. forwardRef2.addEventListener("focusin", onFocusIn);
  19620. forwardRef2.addEventListener("focusout", onFocusOut);
  19621. }
  19622. if (oldForwardRef) {
  19623. oldForwardRef.removeEventListener("keydown", onKeydown);
  19624. oldForwardRef.removeEventListener("focusin", onFocusIn);
  19625. oldForwardRef.removeEventListener("focusout", onFocusOut);
  19626. }
  19627. });
  19628. const trapOnFocus = (e) => {
  19629. emit(ON_TRAP_FOCUS_EVT, e);
  19630. };
  19631. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  19632. const onFocusIn = (e) => {
  19633. const trapContainer = unref(forwardRef);
  19634. if (!trapContainer)
  19635. return;
  19636. const target = e.target;
  19637. const relatedTarget = e.relatedTarget;
  19638. const isFocusedInTrap = target && trapContainer.contains(target);
  19639. if (!props.trapped) {
  19640. const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
  19641. if (!isPrevFocusedInTrap) {
  19642. lastFocusBeforeTrapped = relatedTarget;
  19643. }
  19644. }
  19645. if (isFocusedInTrap)
  19646. emit("focusin", e);
  19647. if (focusLayer.paused)
  19648. return;
  19649. if (props.trapped) {
  19650. if (isFocusedInTrap) {
  19651. lastFocusAfterTrapped = target;
  19652. } else {
  19653. tryFocus(lastFocusAfterTrapped, true);
  19654. }
  19655. }
  19656. };
  19657. const onFocusOut = (e) => {
  19658. const trapContainer = unref(forwardRef);
  19659. if (focusLayer.paused || !trapContainer)
  19660. return;
  19661. if (props.trapped) {
  19662. const relatedTarget = e.relatedTarget;
  19663. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
  19664. setTimeout(() => {
  19665. if (!focusLayer.paused && props.trapped) {
  19666. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19667. focusReason: focusReason2.value
  19668. });
  19669. emit("focusout-prevented", focusoutPreventedEvent);
  19670. if (!focusoutPreventedEvent.defaultPrevented) {
  19671. tryFocus(lastFocusAfterTrapped, true);
  19672. }
  19673. }
  19674. }, 0);
  19675. }
  19676. } else {
  19677. const target = e.target;
  19678. const isFocusedInTrap = target && trapContainer.contains(target);
  19679. if (!isFocusedInTrap)
  19680. emit("focusout", e);
  19681. }
  19682. };
  19683. async function startTrap() {
  19684. await nextTick();
  19685. const trapContainer = unref(forwardRef);
  19686. if (trapContainer) {
  19687. focusableStack.push(focusLayer);
  19688. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  19689. lastFocusBeforeTrapped = prevFocusedElement;
  19690. const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
  19691. if (!isPrevFocusContained) {
  19692. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  19693. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19694. trapContainer.dispatchEvent(focusEvent);
  19695. if (!focusEvent.defaultPrevented) {
  19696. nextTick(() => {
  19697. let focusStartEl = props.focusStartEl;
  19698. if (!isString(focusStartEl)) {
  19699. tryFocus(focusStartEl);
  19700. if (document.activeElement !== focusStartEl) {
  19701. focusStartEl = "first";
  19702. }
  19703. }
  19704. if (focusStartEl === "first") {
  19705. focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  19706. }
  19707. if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
  19708. tryFocus(trapContainer);
  19709. }
  19710. });
  19711. }
  19712. }
  19713. }
  19714. }
  19715. function stopTrap() {
  19716. const trapContainer = unref(forwardRef);
  19717. if (trapContainer) {
  19718. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19719. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  19720. ...FOCUS_AFTER_TRAPPED_OPTS,
  19721. detail: {
  19722. focusReason: focusReason2.value
  19723. }
  19724. });
  19725. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  19726. trapContainer.dispatchEvent(releasedEvent);
  19727. if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
  19728. tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
  19729. }
  19730. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus);
  19731. focusableStack.remove(focusLayer);
  19732. }
  19733. }
  19734. onMounted(() => {
  19735. if (props.trapped) {
  19736. startTrap();
  19737. }
  19738. watch(() => props.trapped, (trapped) => {
  19739. if (trapped) {
  19740. startTrap();
  19741. } else {
  19742. stopTrap();
  19743. }
  19744. });
  19745. });
  19746. onBeforeUnmount(() => {
  19747. if (props.trapped) {
  19748. stopTrap();
  19749. }
  19750. });
  19751. return {
  19752. onKeydown
  19753. };
  19754. }
  19755. });
  19756. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  19757. return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  19758. }
  19759. var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["render", _sfc_render$7], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);
  19760. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  19761. const popperCoreConfigProps = buildProps({
  19762. boundariesPadding: {
  19763. type: Number,
  19764. default: 0
  19765. },
  19766. fallbackPlacements: {
  19767. type: definePropType(Array),
  19768. default: void 0
  19769. },
  19770. gpuAcceleration: {
  19771. type: Boolean,
  19772. default: true
  19773. },
  19774. offset: {
  19775. type: Number,
  19776. default: 12
  19777. },
  19778. placement: {
  19779. type: String,
  19780. values: Ee,
  19781. default: "bottom"
  19782. },
  19783. popperOptions: {
  19784. type: definePropType(Object),
  19785. default: () => ({})
  19786. },
  19787. strategy: {
  19788. type: String,
  19789. values: POSITIONING_STRATEGIES,
  19790. default: "absolute"
  19791. }
  19792. });
  19793. const popperContentProps = buildProps({
  19794. ...popperCoreConfigProps,
  19795. id: String,
  19796. style: {
  19797. type: definePropType([String, Array, Object])
  19798. },
  19799. className: {
  19800. type: definePropType([String, Array, Object])
  19801. },
  19802. effect: {
  19803. type: String,
  19804. default: "dark"
  19805. },
  19806. visible: Boolean,
  19807. enterable: {
  19808. type: Boolean,
  19809. default: true
  19810. },
  19811. pure: Boolean,
  19812. focusOnShow: {
  19813. type: Boolean,
  19814. default: false
  19815. },
  19816. trapping: {
  19817. type: Boolean,
  19818. default: false
  19819. },
  19820. popperClass: {
  19821. type: definePropType([String, Array, Object])
  19822. },
  19823. popperStyle: {
  19824. type: definePropType([String, Array, Object])
  19825. },
  19826. referenceEl: {
  19827. type: definePropType(Object)
  19828. },
  19829. triggerTargetEl: {
  19830. type: definePropType(Object)
  19831. },
  19832. stopPopperMouseEvent: {
  19833. type: Boolean,
  19834. default: true
  19835. },
  19836. ariaLabel: {
  19837. type: String,
  19838. default: void 0
  19839. },
  19840. virtualTriggering: Boolean,
  19841. zIndex: Number
  19842. });
  19843. const popperContentEmits = {
  19844. mouseenter: (evt) => evt instanceof MouseEvent,
  19845. mouseleave: (evt) => evt instanceof MouseEvent,
  19846. focus: () => true,
  19847. blur: () => true,
  19848. close: () => true
  19849. };
  19850. const buildPopperOptions = (props, modifiers = []) => {
  19851. const { placement, strategy, popperOptions } = props;
  19852. const options2 = {
  19853. placement,
  19854. strategy,
  19855. ...popperOptions,
  19856. modifiers: [...genModifiers(props), ...modifiers]
  19857. };
  19858. deriveExtraModifiers(options2, popperOptions == null ? void 0 : popperOptions.modifiers);
  19859. return options2;
  19860. };
  19861. const unwrapMeasurableEl = ($el) => {
  19862. if (!isClient)
  19863. return;
  19864. return unrefElement($el);
  19865. };
  19866. function genModifiers(options2) {
  19867. const { offset, gpuAcceleration, fallbackPlacements } = options2;
  19868. return [
  19869. {
  19870. name: "offset",
  19871. options: {
  19872. offset: [0, offset != null ? offset : 12]
  19873. }
  19874. },
  19875. {
  19876. name: "preventOverflow",
  19877. options: {
  19878. padding: {
  19879. top: 2,
  19880. bottom: 2,
  19881. left: 5,
  19882. right: 5
  19883. }
  19884. }
  19885. },
  19886. {
  19887. name: "flip",
  19888. options: {
  19889. padding: 5,
  19890. fallbackPlacements
  19891. }
  19892. },
  19893. {
  19894. name: "computeStyles",
  19895. options: {
  19896. gpuAcceleration
  19897. }
  19898. }
  19899. ];
  19900. }
  19901. function deriveExtraModifiers(options2, modifiers) {
  19902. if (modifiers) {
  19903. options2.modifiers = [...options2.modifiers, ...modifiers != null ? modifiers : []];
  19904. }
  19905. }
  19906. const DEFAULT_ARROW_OFFSET = 0;
  19907. const usePopperContent = (props) => {
  19908. const { popperInstanceRef, contentRef, triggerRef: triggerRef2, role } = inject(POPPER_INJECTION_KEY, void 0);
  19909. const arrowRef = ref();
  19910. const arrowOffset = ref();
  19911. const eventListenerModifier = computed$1(() => {
  19912. return {
  19913. name: "eventListeners",
  19914. enabled: !!props.visible
  19915. };
  19916. });
  19917. const arrowModifier = computed$1(() => {
  19918. var _a2;
  19919. const arrowEl = unref(arrowRef);
  19920. const offset = (_a2 = unref(arrowOffset)) != null ? _a2 : DEFAULT_ARROW_OFFSET;
  19921. return {
  19922. name: "arrow",
  19923. enabled: !isUndefined$1(arrowEl),
  19924. options: {
  19925. element: arrowEl,
  19926. padding: offset
  19927. }
  19928. };
  19929. });
  19930. const options2 = computed$1(() => {
  19931. return {
  19932. onFirstUpdate: () => {
  19933. update();
  19934. },
  19935. ...buildPopperOptions(props, [
  19936. unref(arrowModifier),
  19937. unref(eventListenerModifier)
  19938. ])
  19939. };
  19940. });
  19941. const computedReference = computed$1(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef2));
  19942. const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options2);
  19943. watch(instanceRef, (instance) => popperInstanceRef.value = instance);
  19944. onMounted(() => {
  19945. watch(() => {
  19946. var _a2;
  19947. return (_a2 = unref(computedReference)) == null ? void 0 : _a2.getBoundingClientRect();
  19948. }, () => {
  19949. update();
  19950. });
  19951. });
  19952. return {
  19953. attributes,
  19954. arrowRef,
  19955. contentRef,
  19956. instanceRef,
  19957. state,
  19958. styles,
  19959. role,
  19960. forceUpdate,
  19961. update
  19962. };
  19963. };
  19964. const usePopperContentDOM = (props, {
  19965. attributes,
  19966. styles,
  19967. role
  19968. }) => {
  19969. const { nextZIndex } = useZIndex();
  19970. const ns = useNamespace("popper");
  19971. const contentAttrs = computed$1(() => unref(attributes).popper);
  19972. const contentZIndex = ref(props.zIndex || nextZIndex());
  19973. const contentClass = computed$1(() => [
  19974. ns.b(),
  19975. ns.is("pure", props.pure),
  19976. ns.is(props.effect),
  19977. props.popperClass
  19978. ]);
  19979. const contentStyle = computed$1(() => {
  19980. return [
  19981. { zIndex: unref(contentZIndex) },
  19982. props.popperStyle || {},
  19983. unref(styles).popper
  19984. ];
  19985. });
  19986. const ariaModal = computed$1(() => role.value === "dialog" ? "false" : void 0);
  19987. const arrowStyle = computed$1(() => unref(styles).arrow || {});
  19988. const updateZIndex = () => {
  19989. contentZIndex.value = props.zIndex || nextZIndex();
  19990. };
  19991. return {
  19992. ariaModal,
  19993. arrowStyle,
  19994. contentAttrs,
  19995. contentClass,
  19996. contentStyle,
  19997. contentZIndex,
  19998. updateZIndex
  19999. };
  20000. };
  20001. const usePopperContentFocusTrap = (props, emit) => {
  20002. const trapped = ref(false);
  20003. const focusStartRef = ref();
  20004. const onFocusAfterTrapped = () => {
  20005. emit("focus");
  20006. };
  20007. const onFocusAfterReleased = (event2) => {
  20008. var _a2;
  20009. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) !== "pointer") {
  20010. focusStartRef.value = "first";
  20011. emit("blur");
  20012. }
  20013. };
  20014. const onFocusInTrap = (event2) => {
  20015. if (props.visible && !trapped.value) {
  20016. if (event2.target) {
  20017. focusStartRef.value = event2.target;
  20018. }
  20019. trapped.value = true;
  20020. }
  20021. };
  20022. const onFocusoutPrevented = (event2) => {
  20023. if (!props.trapping) {
  20024. if (event2.detail.focusReason === "pointer") {
  20025. event2.preventDefault();
  20026. }
  20027. trapped.value = false;
  20028. }
  20029. };
  20030. const onReleaseRequested = () => {
  20031. trapped.value = false;
  20032. emit("close");
  20033. };
  20034. return {
  20035. focusStartRef,
  20036. trapped,
  20037. onFocusAfterReleased,
  20038. onFocusAfterTrapped,
  20039. onFocusInTrap,
  20040. onFocusoutPrevented,
  20041. onReleaseRequested
  20042. };
  20043. };
  20044. const __default__$i = defineComponent({
  20045. name: "ElPopperContent"
  20046. });
  20047. const _sfc_main$s = /* @__PURE__ */ defineComponent({
  20048. ...__default__$i,
  20049. props: popperContentProps,
  20050. emits: popperContentEmits,
  20051. setup(__props, { expose, emit }) {
  20052. const props = __props;
  20053. const {
  20054. focusStartRef,
  20055. trapped,
  20056. onFocusAfterReleased,
  20057. onFocusAfterTrapped,
  20058. onFocusInTrap,
  20059. onFocusoutPrevented,
  20060. onReleaseRequested
  20061. } = usePopperContentFocusTrap(props, emit);
  20062. const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
  20063. const {
  20064. ariaModal,
  20065. arrowStyle,
  20066. contentAttrs,
  20067. contentClass,
  20068. contentStyle,
  20069. updateZIndex
  20070. } = usePopperContentDOM(props, {
  20071. styles,
  20072. attributes,
  20073. role
  20074. });
  20075. const formItemContext = inject(formItemContextKey, void 0);
  20076. const arrowOffset = ref();
  20077. provide(POPPER_CONTENT_INJECTION_KEY, {
  20078. arrowStyle,
  20079. arrowRef,
  20080. arrowOffset
  20081. });
  20082. if (formItemContext && (formItemContext.addInputId || formItemContext.removeInputId)) {
  20083. provide(formItemContextKey, {
  20084. ...formItemContext,
  20085. addInputId: NOOP,
  20086. removeInputId: NOOP
  20087. });
  20088. }
  20089. let triggerTargetAriaStopWatch = void 0;
  20090. const updatePopper = (shouldUpdateZIndex = true) => {
  20091. update();
  20092. shouldUpdateZIndex && updateZIndex();
  20093. };
  20094. const togglePopperAlive = () => {
  20095. updatePopper(false);
  20096. if (props.visible && props.focusOnShow) {
  20097. trapped.value = true;
  20098. } else if (props.visible === false) {
  20099. trapped.value = false;
  20100. }
  20101. };
  20102. onMounted(() => {
  20103. watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  20104. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20105. triggerTargetAriaStopWatch = void 0;
  20106. const el = unref(triggerTargetEl || contentRef.value);
  20107. const prevEl = unref(prevTriggerTargetEl || contentRef.value);
  20108. if (isElement(el)) {
  20109. triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
  20110. ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
  20111. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  20112. });
  20113. }, { immediate: true });
  20114. }
  20115. if (prevEl !== el && isElement(prevEl)) {
  20116. ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
  20117. prevEl.removeAttribute(key);
  20118. });
  20119. }
  20120. }, { immediate: true });
  20121. watch(() => props.visible, togglePopperAlive, { immediate: true });
  20122. });
  20123. onBeforeUnmount(() => {
  20124. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20125. triggerTargetAriaStopWatch = void 0;
  20126. });
  20127. expose({
  20128. popperContentRef: contentRef,
  20129. popperInstanceRef: instanceRef,
  20130. updatePopper,
  20131. contentStyle
  20132. });
  20133. return (_ctx, _cache) => {
  20134. return openBlock(), createElementBlock("div", mergeProps({
  20135. ref_key: "contentRef",
  20136. ref: contentRef
  20137. }, unref(contentAttrs), {
  20138. style: unref(contentStyle),
  20139. class: unref(contentClass),
  20140. tabindex: "-1",
  20141. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  20142. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  20143. }), [
  20144. createVNode(unref(ElFocusTrap), {
  20145. trapped: unref(trapped),
  20146. "trap-on-focus-in": true,
  20147. "focus-trap-el": unref(contentRef),
  20148. "focus-start-el": unref(focusStartRef),
  20149. onFocusAfterTrapped: unref(onFocusAfterTrapped),
  20150. onFocusAfterReleased: unref(onFocusAfterReleased),
  20151. onFocusin: unref(onFocusInTrap),
  20152. onFocusoutPrevented: unref(onFocusoutPrevented),
  20153. onReleaseRequested: unref(onReleaseRequested)
  20154. }, {
  20155. default: withCtx(() => [
  20156. renderSlot(_ctx.$slots, "default")
  20157. ]),
  20158. _: 3
  20159. }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
  20160. ], 16);
  20161. };
  20162. }
  20163. });
  20164. var ElPopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/content.vue"]]);
  20165. const ElPopper = withInstall(Popper);
  20166. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  20167. const useTooltipContentProps = buildProps({
  20168. ...useDelayedToggleProps,
  20169. ...popperContentProps,
  20170. appendTo: {
  20171. type: definePropType([String, Object])
  20172. },
  20173. content: {
  20174. type: String,
  20175. default: ""
  20176. },
  20177. rawContent: {
  20178. type: Boolean,
  20179. default: false
  20180. },
  20181. persistent: Boolean,
  20182. ariaLabel: String,
  20183. visible: {
  20184. type: definePropType(Boolean),
  20185. default: null
  20186. },
  20187. transition: String,
  20188. teleported: {
  20189. type: Boolean,
  20190. default: true
  20191. },
  20192. disabled: Boolean
  20193. });
  20194. const useTooltipTriggerProps = buildProps({
  20195. ...popperTriggerProps,
  20196. disabled: Boolean,
  20197. trigger: {
  20198. type: definePropType([String, Array]),
  20199. default: "hover"
  20200. },
  20201. triggerKeys: {
  20202. type: definePropType(Array),
  20203. default: () => [EVENT_CODE.enter, EVENT_CODE.space]
  20204. }
  20205. });
  20206. const {
  20207. useModelToggleProps: useTooltipModelToggleProps,
  20208. useModelToggleEmits: useTooltipModelToggleEmits,
  20209. useModelToggle: useTooltipModelToggle
  20210. } = createModelToggleComposable("visible");
  20211. const useTooltipProps = buildProps({
  20212. ...popperProps,
  20213. ...useTooltipModelToggleProps,
  20214. ...useTooltipContentProps,
  20215. ...useTooltipTriggerProps,
  20216. ...popperArrowProps,
  20217. showArrow: {
  20218. type: Boolean,
  20219. default: true
  20220. }
  20221. });
  20222. const tooltipEmits = [
  20223. ...useTooltipModelToggleEmits,
  20224. "before-show",
  20225. "before-hide",
  20226. "show",
  20227. "hide",
  20228. "open",
  20229. "close"
  20230. ];
  20231. const isTriggerType = (trigger2, type2) => {
  20232. if (isArray$2(trigger2)) {
  20233. return trigger2.includes(type2);
  20234. }
  20235. return trigger2 === type2;
  20236. };
  20237. const whenTrigger = (trigger2, type2, handler) => {
  20238. return (e) => {
  20239. isTriggerType(unref(trigger2), type2) && handler(e);
  20240. };
  20241. };
  20242. const __default__$h = defineComponent({
  20243. name: "ElTooltipTrigger"
  20244. });
  20245. const _sfc_main$r = /* @__PURE__ */ defineComponent({
  20246. ...__default__$h,
  20247. props: useTooltipTriggerProps,
  20248. setup(__props, { expose }) {
  20249. const props = __props;
  20250. const ns = useNamespace("tooltip");
  20251. const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20252. const triggerRef2 = ref(null);
  20253. const stopWhenControlledOrDisabled = () => {
  20254. if (unref(controlled) || props.disabled) {
  20255. return true;
  20256. }
  20257. };
  20258. const trigger2 = toRef(props, "trigger");
  20259. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onOpen));
  20260. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onClose));
  20261. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "click", (e) => {
  20262. if (e.button === 0) {
  20263. onToggle(e);
  20264. }
  20265. }));
  20266. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onOpen));
  20267. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onClose));
  20268. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "contextmenu", (e) => {
  20269. e.preventDefault();
  20270. onToggle(e);
  20271. }));
  20272. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  20273. const { code } = e;
  20274. if (props.triggerKeys.includes(code)) {
  20275. e.preventDefault();
  20276. onToggle(e);
  20277. }
  20278. });
  20279. expose({
  20280. triggerRef: triggerRef2
  20281. });
  20282. return (_ctx, _cache) => {
  20283. return openBlock(), createBlock(unref(ElPopperTrigger), {
  20284. id: unref(id),
  20285. "virtual-ref": _ctx.virtualRef,
  20286. open: unref(open),
  20287. "virtual-triggering": _ctx.virtualTriggering,
  20288. class: normalizeClass(unref(ns).e("trigger")),
  20289. onBlur: unref(onBlur),
  20290. onClick: unref(onClick),
  20291. onContextmenu: unref(onContextMenu),
  20292. onFocus: unref(onFocus),
  20293. onMouseenter: unref(onMouseenter),
  20294. onMouseleave: unref(onMouseleave),
  20295. onKeydown: unref(onKeydown)
  20296. }, {
  20297. default: withCtx(() => [
  20298. renderSlot(_ctx.$slots, "default")
  20299. ]),
  20300. _: 3
  20301. }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
  20302. };
  20303. }
  20304. });
  20305. var ElTooltipTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/trigger.vue"]]);
  20306. const __default__$g = defineComponent({
  20307. name: "ElTooltipContent",
  20308. inheritAttrs: false
  20309. });
  20310. const _sfc_main$q = /* @__PURE__ */ defineComponent({
  20311. ...__default__$g,
  20312. props: useTooltipContentProps,
  20313. setup(__props, { expose }) {
  20314. const props = __props;
  20315. const { selector } = usePopperContainerId();
  20316. const ns = useNamespace("tooltip");
  20317. const contentRef = ref(null);
  20318. const destroyed = ref(false);
  20319. const {
  20320. controlled,
  20321. id,
  20322. open,
  20323. trigger: trigger2,
  20324. onClose,
  20325. onOpen,
  20326. onShow,
  20327. onHide,
  20328. onBeforeShow,
  20329. onBeforeHide
  20330. } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20331. const transitionClass = computed$1(() => {
  20332. return props.transition || `${ns.namespace.value}-fade-in-linear`;
  20333. });
  20334. const persistentRef = computed$1(() => {
  20335. return props.persistent;
  20336. });
  20337. onBeforeUnmount(() => {
  20338. destroyed.value = true;
  20339. });
  20340. const shouldRender = computed$1(() => {
  20341. return unref(persistentRef) ? true : unref(open);
  20342. });
  20343. const shouldShow = computed$1(() => {
  20344. return props.disabled ? false : unref(open);
  20345. });
  20346. const appendTo = computed$1(() => {
  20347. return props.appendTo || selector.value;
  20348. });
  20349. const contentStyle = computed$1(() => {
  20350. var _a2;
  20351. return (_a2 = props.style) != null ? _a2 : {};
  20352. });
  20353. const ariaHidden = computed$1(() => !unref(open));
  20354. const onTransitionLeave = () => {
  20355. onHide();
  20356. };
  20357. const stopWhenControlled = () => {
  20358. if (unref(controlled))
  20359. return true;
  20360. };
  20361. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  20362. if (props.enterable && unref(trigger2) === "hover") {
  20363. onOpen();
  20364. }
  20365. });
  20366. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  20367. if (unref(trigger2) === "hover") {
  20368. onClose();
  20369. }
  20370. });
  20371. const onBeforeEnter = () => {
  20372. var _a2, _b;
  20373. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20374. onBeforeShow == null ? void 0 : onBeforeShow();
  20375. };
  20376. const onBeforeLeave = () => {
  20377. onBeforeHide == null ? void 0 : onBeforeHide();
  20378. };
  20379. const onAfterShow = () => {
  20380. onShow();
  20381. stopHandle = onClickOutside(computed$1(() => {
  20382. var _a2;
  20383. return (_a2 = contentRef.value) == null ? void 0 : _a2.popperContentRef;
  20384. }), () => {
  20385. if (unref(controlled))
  20386. return;
  20387. const $trigger = unref(trigger2);
  20388. if ($trigger !== "hover") {
  20389. onClose();
  20390. }
  20391. });
  20392. };
  20393. const onBlur = () => {
  20394. if (!props.virtualTriggering) {
  20395. onClose();
  20396. }
  20397. };
  20398. let stopHandle;
  20399. watch(() => unref(open), (val) => {
  20400. if (!val) {
  20401. stopHandle == null ? void 0 : stopHandle();
  20402. }
  20403. }, {
  20404. flush: "post"
  20405. });
  20406. watch(() => props.content, () => {
  20407. var _a2, _b;
  20408. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20409. });
  20410. expose({
  20411. contentRef
  20412. });
  20413. return (_ctx, _cache) => {
  20414. return openBlock(), createBlock(Teleport, {
  20415. disabled: !_ctx.teleported,
  20416. to: unref(appendTo)
  20417. }, [
  20418. createVNode(Transition, {
  20419. name: unref(transitionClass),
  20420. onAfterLeave: onTransitionLeave,
  20421. onBeforeEnter,
  20422. onAfterEnter: onAfterShow,
  20423. onBeforeLeave
  20424. }, {
  20425. default: withCtx(() => [
  20426. unref(shouldRender) ? withDirectives((openBlock(), createBlock(unref(ElPopperContent), mergeProps({
  20427. key: 0,
  20428. id: unref(id),
  20429. ref_key: "contentRef",
  20430. ref: contentRef
  20431. }, _ctx.$attrs, {
  20432. "aria-label": _ctx.ariaLabel,
  20433. "aria-hidden": unref(ariaHidden),
  20434. "boundaries-padding": _ctx.boundariesPadding,
  20435. "fallback-placements": _ctx.fallbackPlacements,
  20436. "gpu-acceleration": _ctx.gpuAcceleration,
  20437. offset: _ctx.offset,
  20438. placement: _ctx.placement,
  20439. "popper-options": _ctx.popperOptions,
  20440. strategy: _ctx.strategy,
  20441. effect: _ctx.effect,
  20442. enterable: _ctx.enterable,
  20443. pure: _ctx.pure,
  20444. "popper-class": _ctx.popperClass,
  20445. "popper-style": [_ctx.popperStyle, unref(contentStyle)],
  20446. "reference-el": _ctx.referenceEl,
  20447. "trigger-target-el": _ctx.triggerTargetEl,
  20448. visible: unref(shouldShow),
  20449. "z-index": _ctx.zIndex,
  20450. onMouseenter: unref(onContentEnter),
  20451. onMouseleave: unref(onContentLeave),
  20452. onBlur,
  20453. onClose: unref(onClose)
  20454. }), {
  20455. default: withCtx(() => [
  20456. !destroyed.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20457. ]),
  20458. _: 3
  20459. }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
  20460. [vShow, unref(shouldShow)]
  20461. ]) : createCommentVNode("v-if", true)
  20462. ]),
  20463. _: 3
  20464. }, 8, ["name"])
  20465. ], 8, ["disabled", "to"]);
  20466. };
  20467. }
  20468. });
  20469. var ElTooltipContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/content.vue"]]);
  20470. const _hoisted_1$f = ["innerHTML"];
  20471. const _hoisted_2$9 = { key: 1 };
  20472. const __default__$f = defineComponent({
  20473. name: "ElTooltip"
  20474. });
  20475. const _sfc_main$p = /* @__PURE__ */ defineComponent({
  20476. ...__default__$f,
  20477. props: useTooltipProps,
  20478. emits: tooltipEmits,
  20479. setup(__props, { expose, emit }) {
  20480. const props = __props;
  20481. usePopperContainer();
  20482. const id = useId();
  20483. const popperRef = ref();
  20484. const contentRef = ref();
  20485. const updatePopper = () => {
  20486. var _a2;
  20487. const popperComponent = unref(popperRef);
  20488. if (popperComponent) {
  20489. (_a2 = popperComponent.popperInstanceRef) == null ? void 0 : _a2.update();
  20490. }
  20491. };
  20492. const open = ref(false);
  20493. const toggleReason = ref();
  20494. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  20495. indicator: open,
  20496. toggleReason
  20497. });
  20498. const { onOpen, onClose } = useDelayedToggle({
  20499. showAfter: toRef(props, "showAfter"),
  20500. hideAfter: toRef(props, "hideAfter"),
  20501. autoClose: toRef(props, "autoClose"),
  20502. open: show,
  20503. close: hide
  20504. });
  20505. const controlled = computed$1(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  20506. provide(TOOLTIP_INJECTION_KEY, {
  20507. controlled,
  20508. id,
  20509. open: readonly(open),
  20510. trigger: toRef(props, "trigger"),
  20511. onOpen: (event2) => {
  20512. onOpen(event2);
  20513. },
  20514. onClose: (event2) => {
  20515. onClose(event2);
  20516. },
  20517. onToggle: (event2) => {
  20518. if (unref(open)) {
  20519. onClose(event2);
  20520. } else {
  20521. onOpen(event2);
  20522. }
  20523. },
  20524. onShow: () => {
  20525. emit("show", toggleReason.value);
  20526. },
  20527. onHide: () => {
  20528. emit("hide", toggleReason.value);
  20529. },
  20530. onBeforeShow: () => {
  20531. emit("before-show", toggleReason.value);
  20532. },
  20533. onBeforeHide: () => {
  20534. emit("before-hide", toggleReason.value);
  20535. },
  20536. updatePopper
  20537. });
  20538. watch(() => props.disabled, (disabled) => {
  20539. if (disabled && open.value) {
  20540. open.value = false;
  20541. }
  20542. });
  20543. const isFocusInsideContent = () => {
  20544. var _a2, _b;
  20545. const popperContent = (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.contentRef) == null ? void 0 : _b.popperContentRef;
  20546. return popperContent && popperContent.contains(document.activeElement);
  20547. };
  20548. onDeactivated(() => open.value && hide());
  20549. expose({
  20550. popperRef,
  20551. contentRef,
  20552. isFocusInsideContent,
  20553. updatePopper,
  20554. onOpen,
  20555. onClose,
  20556. hide
  20557. });
  20558. return (_ctx, _cache) => {
  20559. return openBlock(), createBlock(unref(ElPopper), {
  20560. ref_key: "popperRef",
  20561. ref: popperRef,
  20562. role: _ctx.role
  20563. }, {
  20564. default: withCtx(() => [
  20565. createVNode(ElTooltipTrigger, {
  20566. disabled: _ctx.disabled,
  20567. trigger: _ctx.trigger,
  20568. "trigger-keys": _ctx.triggerKeys,
  20569. "virtual-ref": _ctx.virtualRef,
  20570. "virtual-triggering": _ctx.virtualTriggering
  20571. }, {
  20572. default: withCtx(() => [
  20573. _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20574. ]),
  20575. _: 3
  20576. }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
  20577. createVNode(ElTooltipContent, {
  20578. ref_key: "contentRef",
  20579. ref: contentRef,
  20580. "aria-label": _ctx.ariaLabel,
  20581. "boundaries-padding": _ctx.boundariesPadding,
  20582. content: _ctx.content,
  20583. disabled: _ctx.disabled,
  20584. effect: _ctx.effect,
  20585. enterable: _ctx.enterable,
  20586. "fallback-placements": _ctx.fallbackPlacements,
  20587. "hide-after": _ctx.hideAfter,
  20588. "gpu-acceleration": _ctx.gpuAcceleration,
  20589. offset: _ctx.offset,
  20590. persistent: _ctx.persistent,
  20591. "popper-class": _ctx.popperClass,
  20592. "popper-style": _ctx.popperStyle,
  20593. placement: _ctx.placement,
  20594. "popper-options": _ctx.popperOptions,
  20595. pure: _ctx.pure,
  20596. "raw-content": _ctx.rawContent,
  20597. "reference-el": _ctx.referenceEl,
  20598. "trigger-target-el": _ctx.triggerTargetEl,
  20599. "show-after": _ctx.showAfter,
  20600. strategy: _ctx.strategy,
  20601. teleported: _ctx.teleported,
  20602. transition: _ctx.transition,
  20603. "virtual-triggering": _ctx.virtualTriggering,
  20604. "z-index": _ctx.zIndex,
  20605. "append-to": _ctx.appendTo
  20606. }, {
  20607. default: withCtx(() => [
  20608. renderSlot(_ctx.$slots, "content", {}, () => [
  20609. _ctx.rawContent ? (openBlock(), createElementBlock("span", {
  20610. key: 0,
  20611. innerHTML: _ctx.content
  20612. }, null, 8, _hoisted_1$f)) : (openBlock(), createElementBlock("span", _hoisted_2$9, toDisplayString(_ctx.content), 1))
  20613. ]),
  20614. _ctx.showArrow ? (openBlock(), createBlock(unref(ElPopperArrow), {
  20615. key: 0,
  20616. "arrow-offset": _ctx.arrowOffset
  20617. }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true)
  20618. ]),
  20619. _: 3
  20620. }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
  20621. ]),
  20622. _: 3
  20623. }, 8, ["role"]);
  20624. };
  20625. }
  20626. });
  20627. var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/tooltip.vue"]]);
  20628. const ElTooltip = withInstall(Tooltip);
  20629. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  20630. const useButton = (props, emit) => {
  20631. useDeprecated({
  20632. from: "type.text",
  20633. replacement: "link",
  20634. version: "3.0.0",
  20635. scope: "props",
  20636. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  20637. }, computed$1(() => props.type === "text"));
  20638. const buttonGroupContext = inject(buttonGroupContextKey, void 0);
  20639. const globalConfig2 = useGlobalConfig("button");
  20640. const { form } = useFormItem();
  20641. const _size = useFormSize(computed$1(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
  20642. const _disabled = useFormDisabled();
  20643. const _ref = ref();
  20644. const slots = useSlots();
  20645. const _type = computed$1(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
  20646. const autoInsertSpace = computed$1(() => {
  20647. var _a2, _b, _c;
  20648. return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.autoInsertSpace) != null ? _c : false;
  20649. });
  20650. const _props = computed$1(() => {
  20651. if (props.tag === "button") {
  20652. return {
  20653. ariaDisabled: _disabled.value || props.loading,
  20654. disabled: _disabled.value || props.loading,
  20655. autofocus: props.autofocus,
  20656. type: props.nativeType
  20657. };
  20658. }
  20659. return {};
  20660. });
  20661. const shouldAddSpace = computed$1(() => {
  20662. var _a2;
  20663. const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  20664. if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
  20665. const slot = defaultSlot[0];
  20666. if ((slot == null ? void 0 : slot.type) === Text$1) {
  20667. const text = slot.children;
  20668. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  20669. }
  20670. }
  20671. return false;
  20672. });
  20673. const handleClick = (evt) => {
  20674. if (props.nativeType === "reset") {
  20675. form == null ? void 0 : form.resetFields();
  20676. }
  20677. emit("click", evt);
  20678. };
  20679. return {
  20680. _disabled,
  20681. _size,
  20682. _type,
  20683. _ref,
  20684. _props,
  20685. shouldAddSpace,
  20686. handleClick
  20687. };
  20688. };
  20689. const buttonTypes = [
  20690. "default",
  20691. "primary",
  20692. "success",
  20693. "warning",
  20694. "info",
  20695. "danger",
  20696. "text",
  20697. ""
  20698. ];
  20699. const buttonNativeTypes = ["button", "submit", "reset"];
  20700. const buttonProps = buildProps({
  20701. size: useSizeProp,
  20702. disabled: Boolean,
  20703. type: {
  20704. type: String,
  20705. values: buttonTypes,
  20706. default: ""
  20707. },
  20708. icon: {
  20709. type: iconPropType
  20710. },
  20711. nativeType: {
  20712. type: String,
  20713. values: buttonNativeTypes,
  20714. default: "button"
  20715. },
  20716. loading: Boolean,
  20717. loadingIcon: {
  20718. type: iconPropType,
  20719. default: () => loading_default
  20720. },
  20721. plain: Boolean,
  20722. text: Boolean,
  20723. link: Boolean,
  20724. bg: Boolean,
  20725. autofocus: Boolean,
  20726. round: Boolean,
  20727. circle: Boolean,
  20728. color: String,
  20729. dark: Boolean,
  20730. autoInsertSpace: {
  20731. type: Boolean,
  20732. default: void 0
  20733. },
  20734. tag: {
  20735. type: definePropType([String, Object]),
  20736. default: "button"
  20737. }
  20738. });
  20739. const buttonEmits = {
  20740. click: (evt) => evt instanceof MouseEvent
  20741. };
  20742. function bound01$1(n, max2) {
  20743. if (isOnePointZero$1(n)) {
  20744. n = "100%";
  20745. }
  20746. var isPercent = isPercentage$1(n);
  20747. n = max2 === 360 ? n : Math.min(max2, Math.max(0, parseFloat(n)));
  20748. if (isPercent) {
  20749. n = parseInt(String(n * max2), 10) / 100;
  20750. }
  20751. if (Math.abs(n - max2) < 1e-6) {
  20752. return 1;
  20753. }
  20754. if (max2 === 360) {
  20755. n = (n < 0 ? n % max2 + max2 : n % max2) / parseFloat(String(max2));
  20756. } else {
  20757. n = n % max2 / parseFloat(String(max2));
  20758. }
  20759. return n;
  20760. }
  20761. function clamp01(val) {
  20762. return Math.min(1, Math.max(0, val));
  20763. }
  20764. function isOnePointZero$1(n) {
  20765. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  20766. }
  20767. function isPercentage$1(n) {
  20768. return typeof n === "string" && n.indexOf("%") !== -1;
  20769. }
  20770. function boundAlpha(a) {
  20771. a = parseFloat(a);
  20772. if (isNaN(a) || a < 0 || a > 1) {
  20773. a = 1;
  20774. }
  20775. return a;
  20776. }
  20777. function convertToPercentage(n) {
  20778. if (n <= 1) {
  20779. return "".concat(Number(n) * 100, "%");
  20780. }
  20781. return n;
  20782. }
  20783. function pad2(c) {
  20784. return c.length === 1 ? "0" + c : String(c);
  20785. }
  20786. function rgbToRgb(r2, g, b) {
  20787. return {
  20788. r: bound01$1(r2, 255) * 255,
  20789. g: bound01$1(g, 255) * 255,
  20790. b: bound01$1(b, 255) * 255
  20791. };
  20792. }
  20793. function rgbToHsl(r2, g, b) {
  20794. r2 = bound01$1(r2, 255);
  20795. g = bound01$1(g, 255);
  20796. b = bound01$1(b, 255);
  20797. var max2 = Math.max(r2, g, b);
  20798. var min2 = Math.min(r2, g, b);
  20799. var h2 = 0;
  20800. var s = 0;
  20801. var l = (max2 + min2) / 2;
  20802. if (max2 === min2) {
  20803. s = 0;
  20804. h2 = 0;
  20805. } else {
  20806. var d2 = max2 - min2;
  20807. s = l > 0.5 ? d2 / (2 - max2 - min2) : d2 / (max2 + min2);
  20808. switch (max2) {
  20809. case r2:
  20810. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20811. break;
  20812. case g:
  20813. h2 = (b - r2) / d2 + 2;
  20814. break;
  20815. case b:
  20816. h2 = (r2 - g) / d2 + 4;
  20817. break;
  20818. }
  20819. h2 /= 6;
  20820. }
  20821. return { h: h2, s, l };
  20822. }
  20823. function hue2rgb(p, q2, t2) {
  20824. if (t2 < 0) {
  20825. t2 += 1;
  20826. }
  20827. if (t2 > 1) {
  20828. t2 -= 1;
  20829. }
  20830. if (t2 < 1 / 6) {
  20831. return p + (q2 - p) * (6 * t2);
  20832. }
  20833. if (t2 < 1 / 2) {
  20834. return q2;
  20835. }
  20836. if (t2 < 2 / 3) {
  20837. return p + (q2 - p) * (2 / 3 - t2) * 6;
  20838. }
  20839. return p;
  20840. }
  20841. function hslToRgb(h2, s, l) {
  20842. var r2;
  20843. var g;
  20844. var b;
  20845. h2 = bound01$1(h2, 360);
  20846. s = bound01$1(s, 100);
  20847. l = bound01$1(l, 100);
  20848. if (s === 0) {
  20849. g = l;
  20850. b = l;
  20851. r2 = l;
  20852. } else {
  20853. var q2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
  20854. var p = 2 * l - q2;
  20855. r2 = hue2rgb(p, q2, h2 + 1 / 3);
  20856. g = hue2rgb(p, q2, h2);
  20857. b = hue2rgb(p, q2, h2 - 1 / 3);
  20858. }
  20859. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20860. }
  20861. function rgbToHsv(r2, g, b) {
  20862. r2 = bound01$1(r2, 255);
  20863. g = bound01$1(g, 255);
  20864. b = bound01$1(b, 255);
  20865. var max2 = Math.max(r2, g, b);
  20866. var min2 = Math.min(r2, g, b);
  20867. var h2 = 0;
  20868. var v = max2;
  20869. var d2 = max2 - min2;
  20870. var s = max2 === 0 ? 0 : d2 / max2;
  20871. if (max2 === min2) {
  20872. h2 = 0;
  20873. } else {
  20874. switch (max2) {
  20875. case r2:
  20876. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20877. break;
  20878. case g:
  20879. h2 = (b - r2) / d2 + 2;
  20880. break;
  20881. case b:
  20882. h2 = (r2 - g) / d2 + 4;
  20883. break;
  20884. }
  20885. h2 /= 6;
  20886. }
  20887. return { h: h2, s, v };
  20888. }
  20889. function hsvToRgb(h2, s, v) {
  20890. h2 = bound01$1(h2, 360) * 6;
  20891. s = bound01$1(s, 100);
  20892. v = bound01$1(v, 100);
  20893. var i2 = Math.floor(h2);
  20894. var f = h2 - i2;
  20895. var p = v * (1 - s);
  20896. var q2 = v * (1 - f * s);
  20897. var t2 = v * (1 - (1 - f) * s);
  20898. var mod = i2 % 6;
  20899. var r2 = [v, q2, p, p, t2, v][mod];
  20900. var g = [t2, v, v, q2, p, p][mod];
  20901. var b = [p, p, t2, v, v, q2][mod];
  20902. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20903. }
  20904. function rgbToHex(r2, g, b, allow3Char) {
  20905. var hex = [
  20906. pad2(Math.round(r2).toString(16)),
  20907. pad2(Math.round(g).toString(16)),
  20908. pad2(Math.round(b).toString(16))
  20909. ];
  20910. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
  20911. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  20912. }
  20913. return hex.join("");
  20914. }
  20915. function rgbaToHex(r2, g, b, a, allow4Char) {
  20916. var hex = [
  20917. pad2(Math.round(r2).toString(16)),
  20918. pad2(Math.round(g).toString(16)),
  20919. pad2(Math.round(b).toString(16)),
  20920. pad2(convertDecimalToHex(a))
  20921. ];
  20922. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
  20923. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  20924. }
  20925. return hex.join("");
  20926. }
  20927. function convertDecimalToHex(d2) {
  20928. return Math.round(parseFloat(d2) * 255).toString(16);
  20929. }
  20930. function convertHexToDecimal(h2) {
  20931. return parseIntFromHex(h2) / 255;
  20932. }
  20933. function parseIntFromHex(val) {
  20934. return parseInt(val, 16);
  20935. }
  20936. function numberInputToObject(color2) {
  20937. return {
  20938. r: color2 >> 16,
  20939. g: (color2 & 65280) >> 8,
  20940. b: color2 & 255
  20941. };
  20942. }
  20943. var names = {
  20944. aliceblue: "#f0f8ff",
  20945. antiquewhite: "#faebd7",
  20946. aqua: "#00ffff",
  20947. aquamarine: "#7fffd4",
  20948. azure: "#f0ffff",
  20949. beige: "#f5f5dc",
  20950. bisque: "#ffe4c4",
  20951. black: "#000000",
  20952. blanchedalmond: "#ffebcd",
  20953. blue: "#0000ff",
  20954. blueviolet: "#8a2be2",
  20955. brown: "#a52a2a",
  20956. burlywood: "#deb887",
  20957. cadetblue: "#5f9ea0",
  20958. chartreuse: "#7fff00",
  20959. chocolate: "#d2691e",
  20960. coral: "#ff7f50",
  20961. cornflowerblue: "#6495ed",
  20962. cornsilk: "#fff8dc",
  20963. crimson: "#dc143c",
  20964. cyan: "#00ffff",
  20965. darkblue: "#00008b",
  20966. darkcyan: "#008b8b",
  20967. darkgoldenrod: "#b8860b",
  20968. darkgray: "#a9a9a9",
  20969. darkgreen: "#006400",
  20970. darkgrey: "#a9a9a9",
  20971. darkkhaki: "#bdb76b",
  20972. darkmagenta: "#8b008b",
  20973. darkolivegreen: "#556b2f",
  20974. darkorange: "#ff8c00",
  20975. darkorchid: "#9932cc",
  20976. darkred: "#8b0000",
  20977. darksalmon: "#e9967a",
  20978. darkseagreen: "#8fbc8f",
  20979. darkslateblue: "#483d8b",
  20980. darkslategray: "#2f4f4f",
  20981. darkslategrey: "#2f4f4f",
  20982. darkturquoise: "#00ced1",
  20983. darkviolet: "#9400d3",
  20984. deeppink: "#ff1493",
  20985. deepskyblue: "#00bfff",
  20986. dimgray: "#696969",
  20987. dimgrey: "#696969",
  20988. dodgerblue: "#1e90ff",
  20989. firebrick: "#b22222",
  20990. floralwhite: "#fffaf0",
  20991. forestgreen: "#228b22",
  20992. fuchsia: "#ff00ff",
  20993. gainsboro: "#dcdcdc",
  20994. ghostwhite: "#f8f8ff",
  20995. goldenrod: "#daa520",
  20996. gold: "#ffd700",
  20997. gray: "#808080",
  20998. green: "#008000",
  20999. greenyellow: "#adff2f",
  21000. grey: "#808080",
  21001. honeydew: "#f0fff0",
  21002. hotpink: "#ff69b4",
  21003. indianred: "#cd5c5c",
  21004. indigo: "#4b0082",
  21005. ivory: "#fffff0",
  21006. khaki: "#f0e68c",
  21007. lavenderblush: "#fff0f5",
  21008. lavender: "#e6e6fa",
  21009. lawngreen: "#7cfc00",
  21010. lemonchiffon: "#fffacd",
  21011. lightblue: "#add8e6",
  21012. lightcoral: "#f08080",
  21013. lightcyan: "#e0ffff",
  21014. lightgoldenrodyellow: "#fafad2",
  21015. lightgray: "#d3d3d3",
  21016. lightgreen: "#90ee90",
  21017. lightgrey: "#d3d3d3",
  21018. lightpink: "#ffb6c1",
  21019. lightsalmon: "#ffa07a",
  21020. lightseagreen: "#20b2aa",
  21021. lightskyblue: "#87cefa",
  21022. lightslategray: "#778899",
  21023. lightslategrey: "#778899",
  21024. lightsteelblue: "#b0c4de",
  21025. lightyellow: "#ffffe0",
  21026. lime: "#00ff00",
  21027. limegreen: "#32cd32",
  21028. linen: "#faf0e6",
  21029. magenta: "#ff00ff",
  21030. maroon: "#800000",
  21031. mediumaquamarine: "#66cdaa",
  21032. mediumblue: "#0000cd",
  21033. mediumorchid: "#ba55d3",
  21034. mediumpurple: "#9370db",
  21035. mediumseagreen: "#3cb371",
  21036. mediumslateblue: "#7b68ee",
  21037. mediumspringgreen: "#00fa9a",
  21038. mediumturquoise: "#48d1cc",
  21039. mediumvioletred: "#c71585",
  21040. midnightblue: "#191970",
  21041. mintcream: "#f5fffa",
  21042. mistyrose: "#ffe4e1",
  21043. moccasin: "#ffe4b5",
  21044. navajowhite: "#ffdead",
  21045. navy: "#000080",
  21046. oldlace: "#fdf5e6",
  21047. olive: "#808000",
  21048. olivedrab: "#6b8e23",
  21049. orange: "#ffa500",
  21050. orangered: "#ff4500",
  21051. orchid: "#da70d6",
  21052. palegoldenrod: "#eee8aa",
  21053. palegreen: "#98fb98",
  21054. paleturquoise: "#afeeee",
  21055. palevioletred: "#db7093",
  21056. papayawhip: "#ffefd5",
  21057. peachpuff: "#ffdab9",
  21058. peru: "#cd853f",
  21059. pink: "#ffc0cb",
  21060. plum: "#dda0dd",
  21061. powderblue: "#b0e0e6",
  21062. purple: "#800080",
  21063. rebeccapurple: "#663399",
  21064. red: "#ff0000",
  21065. rosybrown: "#bc8f8f",
  21066. royalblue: "#4169e1",
  21067. saddlebrown: "#8b4513",
  21068. salmon: "#fa8072",
  21069. sandybrown: "#f4a460",
  21070. seagreen: "#2e8b57",
  21071. seashell: "#fff5ee",
  21072. sienna: "#a0522d",
  21073. silver: "#c0c0c0",
  21074. skyblue: "#87ceeb",
  21075. slateblue: "#6a5acd",
  21076. slategray: "#708090",
  21077. slategrey: "#708090",
  21078. snow: "#fffafa",
  21079. springgreen: "#00ff7f",
  21080. steelblue: "#4682b4",
  21081. tan: "#d2b48c",
  21082. teal: "#008080",
  21083. thistle: "#d8bfd8",
  21084. tomato: "#ff6347",
  21085. turquoise: "#40e0d0",
  21086. violet: "#ee82ee",
  21087. wheat: "#f5deb3",
  21088. white: "#ffffff",
  21089. whitesmoke: "#f5f5f5",
  21090. yellow: "#ffff00",
  21091. yellowgreen: "#9acd32"
  21092. };
  21093. function inputToRGB(color2) {
  21094. var rgb = { r: 0, g: 0, b: 0 };
  21095. var a = 1;
  21096. var s = null;
  21097. var v = null;
  21098. var l = null;
  21099. var ok = false;
  21100. var format = false;
  21101. if (typeof color2 === "string") {
  21102. color2 = stringInputToObject(color2);
  21103. }
  21104. if (typeof color2 === "object") {
  21105. if (isValidCSSUnit(color2.r) && isValidCSSUnit(color2.g) && isValidCSSUnit(color2.b)) {
  21106. rgb = rgbToRgb(color2.r, color2.g, color2.b);
  21107. ok = true;
  21108. format = String(color2.r).substr(-1) === "%" ? "prgb" : "rgb";
  21109. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.v)) {
  21110. s = convertToPercentage(color2.s);
  21111. v = convertToPercentage(color2.v);
  21112. rgb = hsvToRgb(color2.h, s, v);
  21113. ok = true;
  21114. format = "hsv";
  21115. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.l)) {
  21116. s = convertToPercentage(color2.s);
  21117. l = convertToPercentage(color2.l);
  21118. rgb = hslToRgb(color2.h, s, l);
  21119. ok = true;
  21120. format = "hsl";
  21121. }
  21122. if (Object.prototype.hasOwnProperty.call(color2, "a")) {
  21123. a = color2.a;
  21124. }
  21125. }
  21126. a = boundAlpha(a);
  21127. return {
  21128. ok,
  21129. format: color2.format || format,
  21130. r: Math.min(255, Math.max(rgb.r, 0)),
  21131. g: Math.min(255, Math.max(rgb.g, 0)),
  21132. b: Math.min(255, Math.max(rgb.b, 0)),
  21133. a
  21134. };
  21135. }
  21136. var CSS_INTEGER = "[-\\+]?\\d+%?";
  21137. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  21138. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  21139. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21140. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21141. var matchers = {
  21142. CSS_UNIT: new RegExp(CSS_UNIT),
  21143. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  21144. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  21145. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  21146. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  21147. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  21148. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  21149. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21150. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  21151. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21152. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  21153. };
  21154. function stringInputToObject(color2) {
  21155. color2 = color2.trim().toLowerCase();
  21156. if (color2.length === 0) {
  21157. return false;
  21158. }
  21159. var named = false;
  21160. if (names[color2]) {
  21161. color2 = names[color2];
  21162. named = true;
  21163. } else if (color2 === "transparent") {
  21164. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  21165. }
  21166. var match = matchers.rgb.exec(color2);
  21167. if (match) {
  21168. return { r: match[1], g: match[2], b: match[3] };
  21169. }
  21170. match = matchers.rgba.exec(color2);
  21171. if (match) {
  21172. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  21173. }
  21174. match = matchers.hsl.exec(color2);
  21175. if (match) {
  21176. return { h: match[1], s: match[2], l: match[3] };
  21177. }
  21178. match = matchers.hsla.exec(color2);
  21179. if (match) {
  21180. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  21181. }
  21182. match = matchers.hsv.exec(color2);
  21183. if (match) {
  21184. return { h: match[1], s: match[2], v: match[3] };
  21185. }
  21186. match = matchers.hsva.exec(color2);
  21187. if (match) {
  21188. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  21189. }
  21190. match = matchers.hex8.exec(color2);
  21191. if (match) {
  21192. return {
  21193. r: parseIntFromHex(match[1]),
  21194. g: parseIntFromHex(match[2]),
  21195. b: parseIntFromHex(match[3]),
  21196. a: convertHexToDecimal(match[4]),
  21197. format: named ? "name" : "hex8"
  21198. };
  21199. }
  21200. match = matchers.hex6.exec(color2);
  21201. if (match) {
  21202. return {
  21203. r: parseIntFromHex(match[1]),
  21204. g: parseIntFromHex(match[2]),
  21205. b: parseIntFromHex(match[3]),
  21206. format: named ? "name" : "hex"
  21207. };
  21208. }
  21209. match = matchers.hex4.exec(color2);
  21210. if (match) {
  21211. return {
  21212. r: parseIntFromHex(match[1] + match[1]),
  21213. g: parseIntFromHex(match[2] + match[2]),
  21214. b: parseIntFromHex(match[3] + match[3]),
  21215. a: convertHexToDecimal(match[4] + match[4]),
  21216. format: named ? "name" : "hex8"
  21217. };
  21218. }
  21219. match = matchers.hex3.exec(color2);
  21220. if (match) {
  21221. return {
  21222. r: parseIntFromHex(match[1] + match[1]),
  21223. g: parseIntFromHex(match[2] + match[2]),
  21224. b: parseIntFromHex(match[3] + match[3]),
  21225. format: named ? "name" : "hex"
  21226. };
  21227. }
  21228. return false;
  21229. }
  21230. function isValidCSSUnit(color2) {
  21231. return Boolean(matchers.CSS_UNIT.exec(String(color2)));
  21232. }
  21233. var TinyColor = function() {
  21234. function TinyColor2(color2, opts) {
  21235. if (color2 === void 0) {
  21236. color2 = "";
  21237. }
  21238. if (opts === void 0) {
  21239. opts = {};
  21240. }
  21241. var _a2;
  21242. if (color2 instanceof TinyColor2) {
  21243. return color2;
  21244. }
  21245. if (typeof color2 === "number") {
  21246. color2 = numberInputToObject(color2);
  21247. }
  21248. this.originalInput = color2;
  21249. var rgb = inputToRGB(color2);
  21250. this.originalInput = color2;
  21251. this.r = rgb.r;
  21252. this.g = rgb.g;
  21253. this.b = rgb.b;
  21254. this.a = rgb.a;
  21255. this.roundA = Math.round(100 * this.a) / 100;
  21256. this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb.format;
  21257. this.gradientType = opts.gradientType;
  21258. if (this.r < 1) {
  21259. this.r = Math.round(this.r);
  21260. }
  21261. if (this.g < 1) {
  21262. this.g = Math.round(this.g);
  21263. }
  21264. if (this.b < 1) {
  21265. this.b = Math.round(this.b);
  21266. }
  21267. this.isValid = rgb.ok;
  21268. }
  21269. TinyColor2.prototype.isDark = function() {
  21270. return this.getBrightness() < 128;
  21271. };
  21272. TinyColor2.prototype.isLight = function() {
  21273. return !this.isDark();
  21274. };
  21275. TinyColor2.prototype.getBrightness = function() {
  21276. var rgb = this.toRgb();
  21277. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  21278. };
  21279. TinyColor2.prototype.getLuminance = function() {
  21280. var rgb = this.toRgb();
  21281. var R2;
  21282. var G2;
  21283. var B2;
  21284. var RsRGB = rgb.r / 255;
  21285. var GsRGB = rgb.g / 255;
  21286. var BsRGB = rgb.b / 255;
  21287. if (RsRGB <= 0.03928) {
  21288. R2 = RsRGB / 12.92;
  21289. } else {
  21290. R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
  21291. }
  21292. if (GsRGB <= 0.03928) {
  21293. G2 = GsRGB / 12.92;
  21294. } else {
  21295. G2 = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
  21296. }
  21297. if (BsRGB <= 0.03928) {
  21298. B2 = BsRGB / 12.92;
  21299. } else {
  21300. B2 = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
  21301. }
  21302. return 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B2;
  21303. };
  21304. TinyColor2.prototype.getAlpha = function() {
  21305. return this.a;
  21306. };
  21307. TinyColor2.prototype.setAlpha = function(alpha) {
  21308. this.a = boundAlpha(alpha);
  21309. this.roundA = Math.round(100 * this.a) / 100;
  21310. return this;
  21311. };
  21312. TinyColor2.prototype.isMonochrome = function() {
  21313. var s = this.toHsl().s;
  21314. return s === 0;
  21315. };
  21316. TinyColor2.prototype.toHsv = function() {
  21317. var hsv = rgbToHsv(this.r, this.g, this.b);
  21318. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
  21319. };
  21320. TinyColor2.prototype.toHsvString = function() {
  21321. var hsv = rgbToHsv(this.r, this.g, this.b);
  21322. var h2 = Math.round(hsv.h * 360);
  21323. var s = Math.round(hsv.s * 100);
  21324. var v = Math.round(hsv.v * 100);
  21325. return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  21326. };
  21327. TinyColor2.prototype.toHsl = function() {
  21328. var hsl = rgbToHsl(this.r, this.g, this.b);
  21329. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
  21330. };
  21331. TinyColor2.prototype.toHslString = function() {
  21332. var hsl = rgbToHsl(this.r, this.g, this.b);
  21333. var h2 = Math.round(hsl.h * 360);
  21334. var s = Math.round(hsl.s * 100);
  21335. var l = Math.round(hsl.l * 100);
  21336. return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  21337. };
  21338. TinyColor2.prototype.toHex = function(allow3Char) {
  21339. if (allow3Char === void 0) {
  21340. allow3Char = false;
  21341. }
  21342. return rgbToHex(this.r, this.g, this.b, allow3Char);
  21343. };
  21344. TinyColor2.prototype.toHexString = function(allow3Char) {
  21345. if (allow3Char === void 0) {
  21346. allow3Char = false;
  21347. }
  21348. return "#" + this.toHex(allow3Char);
  21349. };
  21350. TinyColor2.prototype.toHex8 = function(allow4Char) {
  21351. if (allow4Char === void 0) {
  21352. allow4Char = false;
  21353. }
  21354. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  21355. };
  21356. TinyColor2.prototype.toHex8String = function(allow4Char) {
  21357. if (allow4Char === void 0) {
  21358. allow4Char = false;
  21359. }
  21360. return "#" + this.toHex8(allow4Char);
  21361. };
  21362. TinyColor2.prototype.toHexShortString = function(allowShortChar) {
  21363. if (allowShortChar === void 0) {
  21364. allowShortChar = false;
  21365. }
  21366. return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
  21367. };
  21368. TinyColor2.prototype.toRgb = function() {
  21369. return {
  21370. r: Math.round(this.r),
  21371. g: Math.round(this.g),
  21372. b: Math.round(this.b),
  21373. a: this.a
  21374. };
  21375. };
  21376. TinyColor2.prototype.toRgbString = function() {
  21377. var r2 = Math.round(this.r);
  21378. var g = Math.round(this.g);
  21379. var b = Math.round(this.b);
  21380. return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r2, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  21381. };
  21382. TinyColor2.prototype.toPercentageRgb = function() {
  21383. var fmt = function(x) {
  21384. return "".concat(Math.round(bound01$1(x, 255) * 100), "%");
  21385. };
  21386. return {
  21387. r: fmt(this.r),
  21388. g: fmt(this.g),
  21389. b: fmt(this.b),
  21390. a: this.a
  21391. };
  21392. };
  21393. TinyColor2.prototype.toPercentageRgbString = function() {
  21394. var rnd = function(x) {
  21395. return Math.round(bound01$1(x, 255) * 100);
  21396. };
  21397. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  21398. };
  21399. TinyColor2.prototype.toName = function() {
  21400. if (this.a === 0) {
  21401. return "transparent";
  21402. }
  21403. if (this.a < 1) {
  21404. return false;
  21405. }
  21406. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  21407. for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
  21408. var _b = _a2[_i], key = _b[0], value = _b[1];
  21409. if (hex === value) {
  21410. return key;
  21411. }
  21412. }
  21413. return false;
  21414. };
  21415. TinyColor2.prototype.toString = function(format) {
  21416. var formatSet = Boolean(format);
  21417. format = format !== null && format !== void 0 ? format : this.format;
  21418. var formattedString = false;
  21419. var hasAlpha = this.a < 1 && this.a >= 0;
  21420. var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
  21421. if (needsAlphaFormat) {
  21422. if (format === "name" && this.a === 0) {
  21423. return this.toName();
  21424. }
  21425. return this.toRgbString();
  21426. }
  21427. if (format === "rgb") {
  21428. formattedString = this.toRgbString();
  21429. }
  21430. if (format === "prgb") {
  21431. formattedString = this.toPercentageRgbString();
  21432. }
  21433. if (format === "hex" || format === "hex6") {
  21434. formattedString = this.toHexString();
  21435. }
  21436. if (format === "hex3") {
  21437. formattedString = this.toHexString(true);
  21438. }
  21439. if (format === "hex4") {
  21440. formattedString = this.toHex8String(true);
  21441. }
  21442. if (format === "hex8") {
  21443. formattedString = this.toHex8String();
  21444. }
  21445. if (format === "name") {
  21446. formattedString = this.toName();
  21447. }
  21448. if (format === "hsl") {
  21449. formattedString = this.toHslString();
  21450. }
  21451. if (format === "hsv") {
  21452. formattedString = this.toHsvString();
  21453. }
  21454. return formattedString || this.toHexString();
  21455. };
  21456. TinyColor2.prototype.toNumber = function() {
  21457. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  21458. };
  21459. TinyColor2.prototype.clone = function() {
  21460. return new TinyColor2(this.toString());
  21461. };
  21462. TinyColor2.prototype.lighten = function(amount) {
  21463. if (amount === void 0) {
  21464. amount = 10;
  21465. }
  21466. var hsl = this.toHsl();
  21467. hsl.l += amount / 100;
  21468. hsl.l = clamp01(hsl.l);
  21469. return new TinyColor2(hsl);
  21470. };
  21471. TinyColor2.prototype.brighten = function(amount) {
  21472. if (amount === void 0) {
  21473. amount = 10;
  21474. }
  21475. var rgb = this.toRgb();
  21476. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  21477. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  21478. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  21479. return new TinyColor2(rgb);
  21480. };
  21481. TinyColor2.prototype.darken = function(amount) {
  21482. if (amount === void 0) {
  21483. amount = 10;
  21484. }
  21485. var hsl = this.toHsl();
  21486. hsl.l -= amount / 100;
  21487. hsl.l = clamp01(hsl.l);
  21488. return new TinyColor2(hsl);
  21489. };
  21490. TinyColor2.prototype.tint = function(amount) {
  21491. if (amount === void 0) {
  21492. amount = 10;
  21493. }
  21494. return this.mix("white", amount);
  21495. };
  21496. TinyColor2.prototype.shade = function(amount) {
  21497. if (amount === void 0) {
  21498. amount = 10;
  21499. }
  21500. return this.mix("black", amount);
  21501. };
  21502. TinyColor2.prototype.desaturate = function(amount) {
  21503. if (amount === void 0) {
  21504. amount = 10;
  21505. }
  21506. var hsl = this.toHsl();
  21507. hsl.s -= amount / 100;
  21508. hsl.s = clamp01(hsl.s);
  21509. return new TinyColor2(hsl);
  21510. };
  21511. TinyColor2.prototype.saturate = function(amount) {
  21512. if (amount === void 0) {
  21513. amount = 10;
  21514. }
  21515. var hsl = this.toHsl();
  21516. hsl.s += amount / 100;
  21517. hsl.s = clamp01(hsl.s);
  21518. return new TinyColor2(hsl);
  21519. };
  21520. TinyColor2.prototype.greyscale = function() {
  21521. return this.desaturate(100);
  21522. };
  21523. TinyColor2.prototype.spin = function(amount) {
  21524. var hsl = this.toHsl();
  21525. var hue = (hsl.h + amount) % 360;
  21526. hsl.h = hue < 0 ? 360 + hue : hue;
  21527. return new TinyColor2(hsl);
  21528. };
  21529. TinyColor2.prototype.mix = function(color2, amount) {
  21530. if (amount === void 0) {
  21531. amount = 50;
  21532. }
  21533. var rgb1 = this.toRgb();
  21534. var rgb2 = new TinyColor2(color2).toRgb();
  21535. var p = amount / 100;
  21536. var rgba = {
  21537. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  21538. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  21539. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  21540. a: (rgb2.a - rgb1.a) * p + rgb1.a
  21541. };
  21542. return new TinyColor2(rgba);
  21543. };
  21544. TinyColor2.prototype.analogous = function(results, slices) {
  21545. if (results === void 0) {
  21546. results = 6;
  21547. }
  21548. if (slices === void 0) {
  21549. slices = 30;
  21550. }
  21551. var hsl = this.toHsl();
  21552. var part = 360 / slices;
  21553. var ret = [this];
  21554. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
  21555. hsl.h = (hsl.h + part) % 360;
  21556. ret.push(new TinyColor2(hsl));
  21557. }
  21558. return ret;
  21559. };
  21560. TinyColor2.prototype.complement = function() {
  21561. var hsl = this.toHsl();
  21562. hsl.h = (hsl.h + 180) % 360;
  21563. return new TinyColor2(hsl);
  21564. };
  21565. TinyColor2.prototype.monochromatic = function(results) {
  21566. if (results === void 0) {
  21567. results = 6;
  21568. }
  21569. var hsv = this.toHsv();
  21570. var h2 = hsv.h;
  21571. var s = hsv.s;
  21572. var v = hsv.v;
  21573. var res = [];
  21574. var modification = 1 / results;
  21575. while (results--) {
  21576. res.push(new TinyColor2({ h: h2, s, v }));
  21577. v = (v + modification) % 1;
  21578. }
  21579. return res;
  21580. };
  21581. TinyColor2.prototype.splitcomplement = function() {
  21582. var hsl = this.toHsl();
  21583. var h2 = hsl.h;
  21584. return [
  21585. this,
  21586. new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
  21587. new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
  21588. ];
  21589. };
  21590. TinyColor2.prototype.onBackground = function(background) {
  21591. var fg = this.toRgb();
  21592. var bg = new TinyColor2(background).toRgb();
  21593. var alpha = fg.a + bg.a * (1 - fg.a);
  21594. return new TinyColor2({
  21595. r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
  21596. g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
  21597. b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
  21598. a: alpha
  21599. });
  21600. };
  21601. TinyColor2.prototype.triad = function() {
  21602. return this.polyad(3);
  21603. };
  21604. TinyColor2.prototype.tetrad = function() {
  21605. return this.polyad(4);
  21606. };
  21607. TinyColor2.prototype.polyad = function(n) {
  21608. var hsl = this.toHsl();
  21609. var h2 = hsl.h;
  21610. var result = [this];
  21611. var increment = 360 / n;
  21612. for (var i2 = 1; i2 < n; i2++) {
  21613. result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl.s, l: hsl.l }));
  21614. }
  21615. return result;
  21616. };
  21617. TinyColor2.prototype.equals = function(color2) {
  21618. return this.toRgbString() === new TinyColor2(color2).toRgbString();
  21619. };
  21620. return TinyColor2;
  21621. }();
  21622. function darken(color2, amount = 20) {
  21623. return color2.mix("#141414", amount).toString();
  21624. }
  21625. function useButtonCustomStyle(props) {
  21626. const _disabled = useFormDisabled();
  21627. const ns = useNamespace("button");
  21628. return computed$1(() => {
  21629. let styles = {};
  21630. const buttonColor = props.color;
  21631. if (buttonColor) {
  21632. const color2 = new TinyColor(buttonColor);
  21633. const activeBgColor = props.dark ? color2.tint(20).toString() : darken(color2, 20);
  21634. if (props.plain) {
  21635. styles = ns.cssVarBlock({
  21636. "bg-color": props.dark ? darken(color2, 90) : color2.tint(90).toString(),
  21637. "text-color": buttonColor,
  21638. "border-color": props.dark ? darken(color2, 50) : color2.tint(50).toString(),
  21639. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  21640. "hover-bg-color": buttonColor,
  21641. "hover-border-color": buttonColor,
  21642. "active-bg-color": activeBgColor,
  21643. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  21644. "active-border-color": activeBgColor
  21645. });
  21646. if (_disabled.value) {
  21647. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color2, 90) : color2.tint(90).toString();
  21648. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21649. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color2, 80) : color2.tint(80).toString();
  21650. }
  21651. } else {
  21652. const hoverBgColor = props.dark ? darken(color2, 30) : color2.tint(30).toString();
  21653. const textColor = color2.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  21654. styles = ns.cssVarBlock({
  21655. "bg-color": buttonColor,
  21656. "text-color": textColor,
  21657. "border-color": buttonColor,
  21658. "hover-bg-color": hoverBgColor,
  21659. "hover-text-color": textColor,
  21660. "hover-border-color": hoverBgColor,
  21661. "active-bg-color": activeBgColor,
  21662. "active-border-color": activeBgColor
  21663. });
  21664. if (_disabled.value) {
  21665. const disabledButtonColor = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21666. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  21667. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  21668. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  21669. }
  21670. }
  21671. }
  21672. return styles;
  21673. });
  21674. }
  21675. const __default__$e = defineComponent({
  21676. name: "ElButton"
  21677. });
  21678. const _sfc_main$o = /* @__PURE__ */ defineComponent({
  21679. ...__default__$e,
  21680. props: buttonProps,
  21681. emits: buttonEmits,
  21682. setup(__props, { expose, emit }) {
  21683. const props = __props;
  21684. const buttonStyle = useButtonCustomStyle(props);
  21685. const ns = useNamespace("button");
  21686. const { _ref, _size, _type, _disabled, _props, shouldAddSpace, handleClick } = useButton(props, emit);
  21687. expose({
  21688. ref: _ref,
  21689. size: _size,
  21690. type: _type,
  21691. disabled: _disabled,
  21692. shouldAddSpace
  21693. });
  21694. return (_ctx, _cache) => {
  21695. return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
  21696. ref_key: "_ref",
  21697. ref: _ref
  21698. }, unref(_props), {
  21699. class: [
  21700. unref(ns).b(),
  21701. unref(ns).m(unref(_type)),
  21702. unref(ns).m(unref(_size)),
  21703. unref(ns).is("disabled", unref(_disabled)),
  21704. unref(ns).is("loading", _ctx.loading),
  21705. unref(ns).is("plain", _ctx.plain),
  21706. unref(ns).is("round", _ctx.round),
  21707. unref(ns).is("circle", _ctx.circle),
  21708. unref(ns).is("text", _ctx.text),
  21709. unref(ns).is("link", _ctx.link),
  21710. unref(ns).is("has-bg", _ctx.bg)
  21711. ],
  21712. style: unref(buttonStyle),
  21713. onClick: unref(handleClick)
  21714. }), {
  21715. default: withCtx(() => [
  21716. _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  21717. _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
  21718. key: 1,
  21719. class: normalizeClass(unref(ns).is("loading"))
  21720. }, {
  21721. default: withCtx(() => [
  21722. (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
  21723. ]),
  21724. _: 1
  21725. }, 8, ["class"]))
  21726. ], 64)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  21727. default: withCtx(() => [
  21728. _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
  21729. ]),
  21730. _: 3
  21731. })) : createCommentVNode("v-if", true),
  21732. _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
  21733. key: 2,
  21734. class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
  21735. }, [
  21736. renderSlot(_ctx.$slots, "default")
  21737. ], 2)) : createCommentVNode("v-if", true)
  21738. ]),
  21739. _: 3
  21740. }, 16, ["class", "style", "onClick"]);
  21741. };
  21742. }
  21743. });
  21744. var Button$2 = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
  21745. const buttonGroupProps = {
  21746. size: buttonProps.size,
  21747. type: buttonProps.type
  21748. };
  21749. const __default__$d = defineComponent({
  21750. name: "ElButtonGroup"
  21751. });
  21752. const _sfc_main$n = /* @__PURE__ */ defineComponent({
  21753. ...__default__$d,
  21754. props: buttonGroupProps,
  21755. setup(__props) {
  21756. const props = __props;
  21757. provide(buttonGroupContextKey, reactive({
  21758. size: toRef(props, "size"),
  21759. type: toRef(props, "type")
  21760. }));
  21761. const ns = useNamespace("button");
  21762. return (_ctx, _cache) => {
  21763. return openBlock(), createElementBlock("div", {
  21764. class: normalizeClass(`${unref(ns).b("group")}`)
  21765. }, [
  21766. renderSlot(_ctx.$slots, "default")
  21767. ], 2);
  21768. };
  21769. }
  21770. });
  21771. var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
  21772. const ElButton = withInstall(Button$2, {
  21773. ButtonGroup
  21774. });
  21775. const ElButtonGroup = withNoopInstall(ButtonGroup);
  21776. const nodeList = /* @__PURE__ */ new Map();
  21777. let startClick;
  21778. if (isClient) {
  21779. document.addEventListener("mousedown", (e) => startClick = e);
  21780. document.addEventListener("mouseup", (e) => {
  21781. for (const handlers of nodeList.values()) {
  21782. for (const { documentHandler } of handlers) {
  21783. documentHandler(e, startClick);
  21784. }
  21785. }
  21786. });
  21787. }
  21788. function createDocumentHandler(el, binding) {
  21789. let excludes = [];
  21790. if (Array.isArray(binding.arg)) {
  21791. excludes = binding.arg;
  21792. } else if (isElement(binding.arg)) {
  21793. excludes.push(binding.arg);
  21794. }
  21795. return function(mouseup, mousedown) {
  21796. const popperRef = binding.instance.popperRef;
  21797. const mouseUpTarget = mouseup.target;
  21798. const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
  21799. const isBound = !binding || !binding.instance;
  21800. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  21801. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  21802. const isSelf = el === mouseUpTarget;
  21803. const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  21804. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  21805. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
  21806. return;
  21807. }
  21808. binding.value(mouseup, mousedown);
  21809. };
  21810. }
  21811. const ClickOutside = {
  21812. beforeMount(el, binding) {
  21813. if (!nodeList.has(el)) {
  21814. nodeList.set(el, []);
  21815. }
  21816. nodeList.get(el).push({
  21817. documentHandler: createDocumentHandler(el, binding),
  21818. bindingFn: binding.value
  21819. });
  21820. },
  21821. updated(el, binding) {
  21822. if (!nodeList.has(el)) {
  21823. nodeList.set(el, []);
  21824. }
  21825. const handlers = nodeList.get(el);
  21826. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  21827. const newHandler = {
  21828. documentHandler: createDocumentHandler(el, binding),
  21829. bindingFn: binding.value
  21830. };
  21831. if (oldHandlerIndex >= 0) {
  21832. handlers.splice(oldHandlerIndex, 1, newHandler);
  21833. } else {
  21834. handlers.push(newHandler);
  21835. }
  21836. },
  21837. unmounted(el) {
  21838. nodeList.delete(el);
  21839. }
  21840. };
  21841. const REPEAT_INTERVAL = 100;
  21842. const REPEAT_DELAY = 600;
  21843. const vRepeatClick = {
  21844. beforeMount(el, binding) {
  21845. const value = binding.value;
  21846. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$3(value) ? {} : value;
  21847. let intervalId;
  21848. let delayId;
  21849. const handler = () => isFunction$3(value) ? value() : value.handler();
  21850. const clear = () => {
  21851. if (delayId) {
  21852. clearTimeout(delayId);
  21853. delayId = void 0;
  21854. }
  21855. if (intervalId) {
  21856. clearInterval(intervalId);
  21857. intervalId = void 0;
  21858. }
  21859. };
  21860. el.addEventListener("mousedown", (evt) => {
  21861. if (evt.button !== 0)
  21862. return;
  21863. clear();
  21864. handler();
  21865. document.addEventListener("mouseup", () => clear(), {
  21866. once: true
  21867. });
  21868. delayId = setTimeout(() => {
  21869. intervalId = setInterval(() => {
  21870. handler();
  21871. }, interval);
  21872. }, delay);
  21873. });
  21874. }
  21875. };
  21876. const radioPropsBase = buildProps({
  21877. size: useSizeProp,
  21878. disabled: Boolean,
  21879. label: {
  21880. type: [String, Number, Boolean],
  21881. default: ""
  21882. }
  21883. });
  21884. const radioProps = buildProps({
  21885. ...radioPropsBase,
  21886. modelValue: {
  21887. type: [String, Number, Boolean],
  21888. default: ""
  21889. },
  21890. name: {
  21891. type: String,
  21892. default: ""
  21893. },
  21894. border: Boolean
  21895. });
  21896. const radioEmits = {
  21897. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  21898. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  21899. };
  21900. const radioGroupKey = Symbol("radioGroupKey");
  21901. const useRadio = (props, emit) => {
  21902. const radioRef = ref();
  21903. const radioGroup = inject(radioGroupKey, void 0);
  21904. const isGroup = computed$1(() => !!radioGroup);
  21905. const modelValue = computed$1({
  21906. get() {
  21907. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  21908. },
  21909. set(val) {
  21910. if (isGroup.value) {
  21911. radioGroup.changeEvent(val);
  21912. } else {
  21913. emit && emit(UPDATE_MODEL_EVENT, val);
  21914. }
  21915. radioRef.value.checked = props.modelValue === props.label;
  21916. }
  21917. });
  21918. const size = useFormSize(computed$1(() => radioGroup == null ? void 0 : radioGroup.size));
  21919. const disabled = useFormDisabled(computed$1(() => radioGroup == null ? void 0 : radioGroup.disabled));
  21920. const focus = ref(false);
  21921. const tabIndex = computed$1(() => {
  21922. return disabled.value || isGroup.value && modelValue.value !== props.label ? -1 : 0;
  21923. });
  21924. return {
  21925. radioRef,
  21926. isGroup,
  21927. radioGroup,
  21928. focus,
  21929. size,
  21930. disabled,
  21931. tabIndex,
  21932. modelValue
  21933. };
  21934. };
  21935. const _hoisted_1$e = ["value", "name", "disabled"];
  21936. const __default__$c = defineComponent({
  21937. name: "ElRadio"
  21938. });
  21939. const _sfc_main$m = /* @__PURE__ */ defineComponent({
  21940. ...__default__$c,
  21941. props: radioProps,
  21942. emits: radioEmits,
  21943. setup(__props, { emit }) {
  21944. const props = __props;
  21945. const ns = useNamespace("radio");
  21946. const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
  21947. function handleChange() {
  21948. nextTick(() => emit("change", modelValue.value));
  21949. }
  21950. return (_ctx, _cache) => {
  21951. var _a2;
  21952. return openBlock(), createElementBlock("label", {
  21953. class: normalizeClass([
  21954. unref(ns).b(),
  21955. unref(ns).is("disabled", unref(disabled)),
  21956. unref(ns).is("focus", unref(focus)),
  21957. unref(ns).is("bordered", _ctx.border),
  21958. unref(ns).is("checked", unref(modelValue) === _ctx.label),
  21959. unref(ns).m(unref(size))
  21960. ])
  21961. }, [
  21962. createElementVNode("span", {
  21963. class: normalizeClass([
  21964. unref(ns).e("input"),
  21965. unref(ns).is("disabled", unref(disabled)),
  21966. unref(ns).is("checked", unref(modelValue) === _ctx.label)
  21967. ])
  21968. }, [
  21969. withDirectives(createElementVNode("input", {
  21970. ref_key: "radioRef",
  21971. ref: radioRef,
  21972. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  21973. class: normalizeClass(unref(ns).e("original")),
  21974. value: _ctx.label,
  21975. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  21976. disabled: unref(disabled),
  21977. type: "radio",
  21978. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  21979. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  21980. onChange: handleChange
  21981. }, null, 42, _hoisted_1$e), [
  21982. [vModelRadio, unref(modelValue)]
  21983. ]),
  21984. createElementVNode("span", {
  21985. class: normalizeClass(unref(ns).e("inner"))
  21986. }, null, 2)
  21987. ], 2),
  21988. createElementVNode("span", {
  21989. class: normalizeClass(unref(ns).e("label")),
  21990. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  21991. }, ["stop"]))
  21992. }, [
  21993. renderSlot(_ctx.$slots, "default", {}, () => [
  21994. createTextVNode(toDisplayString(_ctx.label), 1)
  21995. ])
  21996. ], 34)
  21997. ], 2);
  21998. };
  21999. }
  22000. });
  22001. var Radio = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio.vue"]]);
  22002. const radioButtonProps = buildProps({
  22003. ...radioPropsBase,
  22004. name: {
  22005. type: String,
  22006. default: ""
  22007. }
  22008. });
  22009. const _hoisted_1$d = ["value", "name", "disabled"];
  22010. const __default__$b = defineComponent({
  22011. name: "ElRadioButton"
  22012. });
  22013. const _sfc_main$l = /* @__PURE__ */ defineComponent({
  22014. ...__default__$b,
  22015. props: radioButtonProps,
  22016. setup(__props) {
  22017. const props = __props;
  22018. const ns = useNamespace("radio");
  22019. const { radioRef, focus, size, disabled, modelValue, radioGroup } = useRadio(props);
  22020. const activeStyle = computed$1(() => {
  22021. return {
  22022. backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  22023. borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  22024. boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  22025. color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
  22026. };
  22027. });
  22028. return (_ctx, _cache) => {
  22029. var _a2;
  22030. return openBlock(), createElementBlock("label", {
  22031. class: normalizeClass([
  22032. unref(ns).b("button"),
  22033. unref(ns).is("active", unref(modelValue) === _ctx.label),
  22034. unref(ns).is("disabled", unref(disabled)),
  22035. unref(ns).is("focus", unref(focus)),
  22036. unref(ns).bm("button", unref(size))
  22037. ])
  22038. }, [
  22039. withDirectives(createElementVNode("input", {
  22040. ref_key: "radioRef",
  22041. ref: radioRef,
  22042. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  22043. class: normalizeClass(unref(ns).be("button", "original-radio")),
  22044. value: _ctx.label,
  22045. type: "radio",
  22046. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  22047. disabled: unref(disabled),
  22048. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  22049. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false)
  22050. }, null, 42, _hoisted_1$d), [
  22051. [vModelRadio, unref(modelValue)]
  22052. ]),
  22053. createElementVNode("span", {
  22054. class: normalizeClass(unref(ns).be("button", "inner")),
  22055. style: normalizeStyle(unref(modelValue) === _ctx.label ? unref(activeStyle) : {}),
  22056. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  22057. }, ["stop"]))
  22058. }, [
  22059. renderSlot(_ctx.$slots, "default", {}, () => [
  22060. createTextVNode(toDisplayString(_ctx.label), 1)
  22061. ])
  22062. ], 38)
  22063. ], 2);
  22064. };
  22065. }
  22066. });
  22067. var RadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-button.vue"]]);
  22068. const radioGroupProps = buildProps({
  22069. id: {
  22070. type: String,
  22071. default: void 0
  22072. },
  22073. size: useSizeProp,
  22074. disabled: Boolean,
  22075. modelValue: {
  22076. type: [String, Number, Boolean],
  22077. default: ""
  22078. },
  22079. fill: {
  22080. type: String,
  22081. default: ""
  22082. },
  22083. label: {
  22084. type: String,
  22085. default: void 0
  22086. },
  22087. textColor: {
  22088. type: String,
  22089. default: ""
  22090. },
  22091. name: {
  22092. type: String,
  22093. default: void 0
  22094. },
  22095. validateEvent: {
  22096. type: Boolean,
  22097. default: true
  22098. }
  22099. });
  22100. const radioGroupEmits = radioEmits;
  22101. const _hoisted_1$c = ["id", "aria-label", "aria-labelledby"];
  22102. const __default__$a = defineComponent({
  22103. name: "ElRadioGroup"
  22104. });
  22105. const _sfc_main$k = /* @__PURE__ */ defineComponent({
  22106. ...__default__$a,
  22107. props: radioGroupProps,
  22108. emits: radioGroupEmits,
  22109. setup(__props, { emit }) {
  22110. const props = __props;
  22111. const ns = useNamespace("radio");
  22112. const radioId = useId();
  22113. const radioGroupRef = ref();
  22114. const { formItem } = useFormItem();
  22115. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
  22116. formItemContext: formItem
  22117. });
  22118. const changeEvent = (value) => {
  22119. emit(UPDATE_MODEL_EVENT, value);
  22120. nextTick(() => emit("change", value));
  22121. };
  22122. onMounted(() => {
  22123. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  22124. const firstLabel = radios[0];
  22125. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
  22126. firstLabel.tabIndex = 0;
  22127. }
  22128. });
  22129. const name = computed$1(() => {
  22130. return props.name || radioId.value;
  22131. });
  22132. provide(radioGroupKey, reactive({
  22133. ...toRefs(props),
  22134. changeEvent,
  22135. name
  22136. }));
  22137. watch(() => props.modelValue, () => {
  22138. if (props.validateEvent) {
  22139. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  22140. }
  22141. });
  22142. return (_ctx, _cache) => {
  22143. return openBlock(), createElementBlock("div", {
  22144. id: unref(groupId),
  22145. ref_key: "radioGroupRef",
  22146. ref: radioGroupRef,
  22147. class: normalizeClass(unref(ns).b("group")),
  22148. role: "radiogroup",
  22149. "aria-label": !unref(isLabeledByFormItem) ? _ctx.label || "radio-group" : void 0,
  22150. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
  22151. }, [
  22152. renderSlot(_ctx.$slots, "default")
  22153. ], 10, _hoisted_1$c);
  22154. };
  22155. }
  22156. });
  22157. var RadioGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-group.vue"]]);
  22158. withInstall(Radio, {
  22159. RadioButton,
  22160. RadioGroup
  22161. });
  22162. const ElRadioGroup = withNoopInstall(RadioGroup);
  22163. const ElRadioButton = withNoopInstall(RadioButton);
  22164. const tagProps = buildProps({
  22165. closable: Boolean,
  22166. type: {
  22167. type: String,
  22168. values: ["success", "info", "warning", "danger", ""],
  22169. default: ""
  22170. },
  22171. hit: Boolean,
  22172. disableTransitions: Boolean,
  22173. color: {
  22174. type: String,
  22175. default: ""
  22176. },
  22177. size: {
  22178. type: String,
  22179. values: componentSizes,
  22180. default: ""
  22181. },
  22182. effect: {
  22183. type: String,
  22184. values: ["dark", "light", "plain"],
  22185. default: "light"
  22186. },
  22187. round: Boolean
  22188. });
  22189. const tagEmits = {
  22190. close: (evt) => evt instanceof MouseEvent,
  22191. click: (evt) => evt instanceof MouseEvent
  22192. };
  22193. const __default__$9 = defineComponent({
  22194. name: "ElTag"
  22195. });
  22196. const _sfc_main$j = /* @__PURE__ */ defineComponent({
  22197. ...__default__$9,
  22198. props: tagProps,
  22199. emits: tagEmits,
  22200. setup(__props, { emit }) {
  22201. const props = __props;
  22202. const tagSize = useFormSize();
  22203. const ns = useNamespace("tag");
  22204. const classes = computed$1(() => {
  22205. const { type: type2, hit, effect, closable, round: round2 } = props;
  22206. return [
  22207. ns.b(),
  22208. ns.is("closable", closable),
  22209. ns.m(type2),
  22210. ns.m(tagSize.value),
  22211. ns.m(effect),
  22212. ns.is("hit", hit),
  22213. ns.is("round", round2)
  22214. ];
  22215. });
  22216. const handleClose = (event2) => {
  22217. emit("close", event2);
  22218. };
  22219. const handleClick = (event2) => {
  22220. emit("click", event2);
  22221. };
  22222. return (_ctx, _cache) => {
  22223. return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
  22224. key: 0,
  22225. class: normalizeClass(unref(classes)),
  22226. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22227. onClick: handleClick
  22228. }, [
  22229. createElementVNode("span", {
  22230. class: normalizeClass(unref(ns).e("content"))
  22231. }, [
  22232. renderSlot(_ctx.$slots, "default")
  22233. ], 2),
  22234. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22235. key: 0,
  22236. class: normalizeClass(unref(ns).e("close")),
  22237. onClick: withModifiers(handleClose, ["stop"])
  22238. }, {
  22239. default: withCtx(() => [
  22240. createVNode(unref(close_default))
  22241. ]),
  22242. _: 1
  22243. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22244. ], 6)) : (openBlock(), createBlock(Transition, {
  22245. key: 1,
  22246. name: `${unref(ns).namespace.value}-zoom-in-center`,
  22247. appear: ""
  22248. }, {
  22249. default: withCtx(() => [
  22250. createElementVNode("span", {
  22251. class: normalizeClass(unref(classes)),
  22252. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22253. onClick: handleClick
  22254. }, [
  22255. createElementVNode("span", {
  22256. class: normalizeClass(unref(ns).e("content"))
  22257. }, [
  22258. renderSlot(_ctx.$slots, "default")
  22259. ], 2),
  22260. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22261. key: 0,
  22262. class: normalizeClass(unref(ns).e("close")),
  22263. onClick: withModifiers(handleClose, ["stop"])
  22264. }, {
  22265. default: withCtx(() => [
  22266. createVNode(unref(close_default))
  22267. ]),
  22268. _: 1
  22269. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22270. ], 6)
  22271. ]),
  22272. _: 3
  22273. }, 8, ["name"]));
  22274. };
  22275. }
  22276. });
  22277. var Tag = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);
  22278. const ElTag = withInstall(Tag);
  22279. const emitChangeFn = (value) => typeof isNumber(value);
  22280. const collapseProps = buildProps({
  22281. accordion: Boolean,
  22282. modelValue: {
  22283. type: definePropType([Array, String, Number]),
  22284. default: () => mutable([])
  22285. }
  22286. });
  22287. const collapseEmits = {
  22288. [UPDATE_MODEL_EVENT]: emitChangeFn,
  22289. [CHANGE_EVENT]: emitChangeFn
  22290. };
  22291. const collapseContextKey = Symbol("collapseContextKey");
  22292. const useCollapse = (props, emit) => {
  22293. const activeNames = ref(castArray(props.modelValue));
  22294. const setActiveNames = (_activeNames) => {
  22295. activeNames.value = _activeNames;
  22296. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  22297. emit(UPDATE_MODEL_EVENT, value);
  22298. emit(CHANGE_EVENT, value);
  22299. };
  22300. const handleItemClick = (name) => {
  22301. if (props.accordion) {
  22302. setActiveNames([activeNames.value[0] === name ? "" : name]);
  22303. } else {
  22304. const _activeNames = [...activeNames.value];
  22305. const index2 = _activeNames.indexOf(name);
  22306. if (index2 > -1) {
  22307. _activeNames.splice(index2, 1);
  22308. } else {
  22309. _activeNames.push(name);
  22310. }
  22311. setActiveNames(_activeNames);
  22312. }
  22313. };
  22314. watch(() => props.modelValue, () => activeNames.value = castArray(props.modelValue), { deep: true });
  22315. provide(collapseContextKey, {
  22316. activeNames,
  22317. handleItemClick
  22318. });
  22319. return {
  22320. activeNames,
  22321. setActiveNames
  22322. };
  22323. };
  22324. const useCollapseDOM = () => {
  22325. const ns = useNamespace("collapse");
  22326. const rootKls = computed$1(() => ns.b());
  22327. return {
  22328. rootKls
  22329. };
  22330. };
  22331. const __default__$8 = defineComponent({
  22332. name: "ElCollapse"
  22333. });
  22334. const _sfc_main$i = /* @__PURE__ */ defineComponent({
  22335. ...__default__$8,
  22336. props: collapseProps,
  22337. emits: collapseEmits,
  22338. setup(__props, { expose, emit }) {
  22339. const props = __props;
  22340. const { activeNames, setActiveNames } = useCollapse(props, emit);
  22341. const { rootKls } = useCollapseDOM();
  22342. expose({
  22343. activeNames,
  22344. setActiveNames
  22345. });
  22346. return (_ctx, _cache) => {
  22347. return openBlock(), createElementBlock("div", {
  22348. class: normalizeClass(unref(rootKls)),
  22349. role: "tablist",
  22350. "aria-multiselectable": "true"
  22351. }, [
  22352. renderSlot(_ctx.$slots, "default")
  22353. ], 2);
  22354. };
  22355. }
  22356. });
  22357. var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);
  22358. const __default__$7 = defineComponent({
  22359. name: "ElCollapseTransition"
  22360. });
  22361. const _sfc_main$h = /* @__PURE__ */ defineComponent({
  22362. ...__default__$7,
  22363. setup(__props) {
  22364. const ns = useNamespace("collapse-transition");
  22365. const on3 = {
  22366. beforeEnter(el) {
  22367. if (!el.dataset)
  22368. el.dataset = {};
  22369. el.dataset.oldPaddingTop = el.style.paddingTop;
  22370. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22371. el.style.maxHeight = 0;
  22372. el.style.paddingTop = 0;
  22373. el.style.paddingBottom = 0;
  22374. },
  22375. enter(el) {
  22376. el.dataset.oldOverflow = el.style.overflow;
  22377. if (el.scrollHeight !== 0) {
  22378. el.style.maxHeight = `${el.scrollHeight}px`;
  22379. el.style.paddingTop = el.dataset.oldPaddingTop;
  22380. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22381. } else {
  22382. el.style.maxHeight = 0;
  22383. el.style.paddingTop = el.dataset.oldPaddingTop;
  22384. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22385. }
  22386. el.style.overflow = "hidden";
  22387. },
  22388. afterEnter(el) {
  22389. el.style.maxHeight = "";
  22390. el.style.overflow = el.dataset.oldOverflow;
  22391. },
  22392. beforeLeave(el) {
  22393. if (!el.dataset)
  22394. el.dataset = {};
  22395. el.dataset.oldPaddingTop = el.style.paddingTop;
  22396. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22397. el.dataset.oldOverflow = el.style.overflow;
  22398. el.style.maxHeight = `${el.scrollHeight}px`;
  22399. el.style.overflow = "hidden";
  22400. },
  22401. leave(el) {
  22402. if (el.scrollHeight !== 0) {
  22403. el.style.maxHeight = 0;
  22404. el.style.paddingTop = 0;
  22405. el.style.paddingBottom = 0;
  22406. }
  22407. },
  22408. afterLeave(el) {
  22409. el.style.maxHeight = "";
  22410. el.style.overflow = el.dataset.oldOverflow;
  22411. el.style.paddingTop = el.dataset.oldPaddingTop;
  22412. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22413. }
  22414. };
  22415. return (_ctx, _cache) => {
  22416. return openBlock(), createBlock(Transition, mergeProps({
  22417. name: unref(ns).b()
  22418. }, toHandlers(on3)), {
  22419. default: withCtx(() => [
  22420. renderSlot(_ctx.$slots, "default")
  22421. ]),
  22422. _: 3
  22423. }, 16, ["name"]);
  22424. };
  22425. }
  22426. });
  22427. var CollapseTransition = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse-transition/src/collapse-transition.vue"]]);
  22428. CollapseTransition.install = (app) => {
  22429. app.component(CollapseTransition.name, CollapseTransition);
  22430. };
  22431. const _CollapseTransition = CollapseTransition;
  22432. const collapseItemProps = buildProps({
  22433. title: {
  22434. type: String,
  22435. default: ""
  22436. },
  22437. name: {
  22438. type: definePropType([String, Number]),
  22439. default: () => generateId()
  22440. },
  22441. disabled: Boolean
  22442. });
  22443. const useCollapseItem = (props) => {
  22444. const collapse = inject(collapseContextKey);
  22445. const focusing = ref(false);
  22446. const isClick = ref(false);
  22447. const id = ref(generateId());
  22448. const isActive = computed$1(() => collapse == null ? void 0 : collapse.activeNames.value.includes(props.name));
  22449. const handleFocus = () => {
  22450. setTimeout(() => {
  22451. if (!isClick.value) {
  22452. focusing.value = true;
  22453. } else {
  22454. isClick.value = false;
  22455. }
  22456. }, 50);
  22457. };
  22458. const handleHeaderClick = () => {
  22459. if (props.disabled)
  22460. return;
  22461. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22462. focusing.value = false;
  22463. isClick.value = true;
  22464. };
  22465. const handleEnterClick = () => {
  22466. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22467. };
  22468. return {
  22469. focusing,
  22470. id,
  22471. isActive,
  22472. handleFocus,
  22473. handleHeaderClick,
  22474. handleEnterClick
  22475. };
  22476. };
  22477. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  22478. const ns = useNamespace("collapse");
  22479. const rootKls = computed$1(() => [
  22480. ns.b("item"),
  22481. ns.is("active", unref(isActive)),
  22482. ns.is("disabled", props.disabled)
  22483. ]);
  22484. const headKls = computed$1(() => [
  22485. ns.be("item", "header"),
  22486. ns.is("active", unref(isActive)),
  22487. { focusing: unref(focusing) && !props.disabled }
  22488. ]);
  22489. const arrowKls = computed$1(() => [
  22490. ns.be("item", "arrow"),
  22491. ns.is("active", unref(isActive))
  22492. ]);
  22493. const itemWrapperKls = computed$1(() => ns.be("item", "wrap"));
  22494. const itemContentKls = computed$1(() => ns.be("item", "content"));
  22495. const scopedContentId = computed$1(() => ns.b(`content-${unref(id)}`));
  22496. const scopedHeadId = computed$1(() => ns.b(`head-${unref(id)}`));
  22497. return {
  22498. arrowKls,
  22499. headKls,
  22500. rootKls,
  22501. itemWrapperKls,
  22502. itemContentKls,
  22503. scopedContentId,
  22504. scopedHeadId
  22505. };
  22506. };
  22507. const _hoisted_1$b = ["aria-expanded", "aria-controls", "aria-describedby"];
  22508. const _hoisted_2$8 = ["id", "tabindex"];
  22509. const _hoisted_3$5 = ["id", "aria-hidden", "aria-labelledby"];
  22510. const __default__$6 = defineComponent({
  22511. name: "ElCollapseItem"
  22512. });
  22513. const _sfc_main$g = /* @__PURE__ */ defineComponent({
  22514. ...__default__$6,
  22515. props: collapseItemProps,
  22516. setup(__props, { expose }) {
  22517. const props = __props;
  22518. const {
  22519. focusing,
  22520. id,
  22521. isActive,
  22522. handleFocus,
  22523. handleHeaderClick,
  22524. handleEnterClick
  22525. } = useCollapseItem(props);
  22526. const {
  22527. arrowKls,
  22528. headKls,
  22529. rootKls,
  22530. itemWrapperKls,
  22531. itemContentKls,
  22532. scopedContentId,
  22533. scopedHeadId
  22534. } = useCollapseItemDOM(props, { focusing, isActive, id });
  22535. expose({
  22536. isActive
  22537. });
  22538. return (_ctx, _cache) => {
  22539. return openBlock(), createElementBlock("div", {
  22540. class: normalizeClass(unref(rootKls))
  22541. }, [
  22542. createElementVNode("div", {
  22543. role: "tab",
  22544. "aria-expanded": unref(isActive),
  22545. "aria-controls": unref(scopedContentId),
  22546. "aria-describedby": unref(scopedContentId)
  22547. }, [
  22548. createElementVNode("div", {
  22549. id: unref(scopedHeadId),
  22550. class: normalizeClass(unref(headKls)),
  22551. role: "button",
  22552. tabindex: _ctx.disabled ? -1 : 0,
  22553. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
  22554. onKeypress: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
  22555. onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  22556. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  22557. }, [
  22558. renderSlot(_ctx.$slots, "title", {}, () => [
  22559. createTextVNode(toDisplayString(_ctx.title), 1)
  22560. ]),
  22561. createVNode(unref(ElIcon), {
  22562. class: normalizeClass(unref(arrowKls))
  22563. }, {
  22564. default: withCtx(() => [
  22565. createVNode(unref(arrow_right_default))
  22566. ]),
  22567. _: 1
  22568. }, 8, ["class"])
  22569. ], 42, _hoisted_2$8)
  22570. ], 8, _hoisted_1$b),
  22571. createVNode(unref(_CollapseTransition), null, {
  22572. default: withCtx(() => [
  22573. withDirectives(createElementVNode("div", {
  22574. id: unref(scopedContentId),
  22575. class: normalizeClass(unref(itemWrapperKls)),
  22576. role: "tabpanel",
  22577. "aria-hidden": !unref(isActive),
  22578. "aria-labelledby": unref(scopedHeadId)
  22579. }, [
  22580. createElementVNode("div", {
  22581. class: normalizeClass(unref(itemContentKls))
  22582. }, [
  22583. renderSlot(_ctx.$slots, "default")
  22584. ], 2)
  22585. ], 10, _hoisted_3$5), [
  22586. [vShow, unref(isActive)]
  22587. ])
  22588. ]),
  22589. _: 3
  22590. })
  22591. ], 2);
  22592. };
  22593. }
  22594. });
  22595. var CollapseItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);
  22596. const ElCollapse = withInstall(Collapse, {
  22597. CollapseItem
  22598. });
  22599. const ElCollapseItem = withNoopInstall(CollapseItem);
  22600. const alphaSliderProps = buildProps({
  22601. color: {
  22602. type: definePropType(Object),
  22603. required: true
  22604. },
  22605. vertical: {
  22606. type: Boolean,
  22607. default: false
  22608. }
  22609. });
  22610. let isDragging = false;
  22611. function draggable(element, options2) {
  22612. if (!isClient)
  22613. return;
  22614. const moveFn = function(event2) {
  22615. var _a2;
  22616. (_a2 = options2.drag) == null ? void 0 : _a2.call(options2, event2);
  22617. };
  22618. const upFn = function(event2) {
  22619. var _a2;
  22620. document.removeEventListener("mousemove", moveFn);
  22621. document.removeEventListener("mouseup", upFn);
  22622. document.removeEventListener("touchmove", moveFn);
  22623. document.removeEventListener("touchend", upFn);
  22624. document.onselectstart = null;
  22625. document.ondragstart = null;
  22626. isDragging = false;
  22627. (_a2 = options2.end) == null ? void 0 : _a2.call(options2, event2);
  22628. };
  22629. const downFn = function(event2) {
  22630. var _a2;
  22631. if (isDragging)
  22632. return;
  22633. event2.preventDefault();
  22634. document.onselectstart = () => false;
  22635. document.ondragstart = () => false;
  22636. document.addEventListener("mousemove", moveFn);
  22637. document.addEventListener("mouseup", upFn);
  22638. document.addEventListener("touchmove", moveFn);
  22639. document.addEventListener("touchend", upFn);
  22640. isDragging = true;
  22641. (_a2 = options2.start) == null ? void 0 : _a2.call(options2, event2);
  22642. };
  22643. element.addEventListener("mousedown", downFn);
  22644. element.addEventListener("touchstart", downFn);
  22645. }
  22646. const useAlphaSlider = (props) => {
  22647. const instance = getCurrentInstance();
  22648. const thumb = shallowRef();
  22649. const bar = shallowRef();
  22650. function handleClick(event2) {
  22651. const target = event2.target;
  22652. if (target !== thumb.value) {
  22653. handleDrag(event2);
  22654. }
  22655. }
  22656. function handleDrag(event2) {
  22657. if (!bar.value || !thumb.value)
  22658. return;
  22659. const el = instance.vnode.el;
  22660. const rect = el.getBoundingClientRect();
  22661. const { clientX, clientY } = getClientXY(event2);
  22662. if (!props.vertical) {
  22663. let left = clientX - rect.left;
  22664. left = Math.max(thumb.value.offsetWidth / 2, left);
  22665. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22666. props.color.set("alpha", Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100));
  22667. } else {
  22668. let top = clientY - rect.top;
  22669. top = Math.max(thumb.value.offsetHeight / 2, top);
  22670. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22671. props.color.set("alpha", Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 100));
  22672. }
  22673. }
  22674. return {
  22675. thumb,
  22676. bar,
  22677. handleDrag,
  22678. handleClick
  22679. };
  22680. };
  22681. const useAlphaSliderDOM = (props, {
  22682. bar,
  22683. thumb,
  22684. handleDrag
  22685. }) => {
  22686. const instance = getCurrentInstance();
  22687. const ns = useNamespace("color-alpha-slider");
  22688. const thumbLeft = ref(0);
  22689. const thumbTop = ref(0);
  22690. const background = ref();
  22691. function getThumbLeft() {
  22692. if (!thumb.value)
  22693. return 0;
  22694. if (props.vertical)
  22695. return 0;
  22696. const el = instance.vnode.el;
  22697. const alpha = props.color.get("alpha");
  22698. if (!el)
  22699. return 0;
  22700. return Math.round(alpha * (el.offsetWidth - thumb.value.offsetWidth / 2) / 100);
  22701. }
  22702. function getThumbTop() {
  22703. if (!thumb.value)
  22704. return 0;
  22705. const el = instance.vnode.el;
  22706. if (!props.vertical)
  22707. return 0;
  22708. const alpha = props.color.get("alpha");
  22709. if (!el)
  22710. return 0;
  22711. return Math.round(alpha * (el.offsetHeight - thumb.value.offsetHeight / 2) / 100);
  22712. }
  22713. function getBackground() {
  22714. if (props.color && props.color.value) {
  22715. const { r: r2, g, b } = props.color.toRgb();
  22716. return `linear-gradient(to right, rgba(${r2}, ${g}, ${b}, 0) 0%, rgba(${r2}, ${g}, ${b}, 1) 100%)`;
  22717. }
  22718. return "";
  22719. }
  22720. function update() {
  22721. thumbLeft.value = getThumbLeft();
  22722. thumbTop.value = getThumbTop();
  22723. background.value = getBackground();
  22724. }
  22725. onMounted(() => {
  22726. if (!bar.value || !thumb.value)
  22727. return;
  22728. const dragConfig = {
  22729. drag: (event2) => {
  22730. handleDrag(event2);
  22731. },
  22732. end: (event2) => {
  22733. handleDrag(event2);
  22734. }
  22735. };
  22736. draggable(bar.value, dragConfig);
  22737. draggable(thumb.value, dragConfig);
  22738. update();
  22739. });
  22740. watch(() => props.color.get("alpha"), () => update());
  22741. watch(() => props.color.value, () => update());
  22742. const rootKls = computed$1(() => [ns.b(), ns.is("vertical", props.vertical)]);
  22743. const barKls = computed$1(() => ns.e("bar"));
  22744. const thumbKls = computed$1(() => ns.e("thumb"));
  22745. const barStyle = computed$1(() => ({ background: background.value }));
  22746. const thumbStyle = computed$1(() => ({
  22747. left: addUnit(thumbLeft.value),
  22748. top: addUnit(thumbTop.value)
  22749. }));
  22750. return { rootKls, barKls, barStyle, thumbKls, thumbStyle, update };
  22751. };
  22752. const COMPONENT_NAME$2 = "ElColorAlphaSlider";
  22753. const __default__$5 = defineComponent({
  22754. name: COMPONENT_NAME$2
  22755. });
  22756. const _sfc_main$f = /* @__PURE__ */ defineComponent({
  22757. ...__default__$5,
  22758. props: alphaSliderProps,
  22759. setup(__props, { expose }) {
  22760. const props = __props;
  22761. const { bar, thumb, handleDrag, handleClick } = useAlphaSlider(props);
  22762. const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useAlphaSliderDOM(props, {
  22763. bar,
  22764. thumb,
  22765. handleDrag
  22766. });
  22767. expose({
  22768. update,
  22769. bar,
  22770. thumb
  22771. });
  22772. return (_ctx, _cache) => {
  22773. return openBlock(), createElementBlock("div", {
  22774. class: normalizeClass(unref(rootKls))
  22775. }, [
  22776. createElementVNode("div", {
  22777. ref_key: "bar",
  22778. ref: bar,
  22779. class: normalizeClass(unref(barKls)),
  22780. style: normalizeStyle(unref(barStyle)),
  22781. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  22782. }, null, 6),
  22783. createElementVNode("div", {
  22784. ref_key: "thumb",
  22785. ref: thumb,
  22786. class: normalizeClass(unref(thumbKls)),
  22787. style: normalizeStyle(unref(thumbStyle))
  22788. }, null, 6)
  22789. ], 2);
  22790. };
  22791. }
  22792. });
  22793. var AlphaSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/alpha-slider.vue"]]);
  22794. const _sfc_main$e = defineComponent({
  22795. name: "ElColorHueSlider",
  22796. props: {
  22797. color: {
  22798. type: Object,
  22799. required: true
  22800. },
  22801. vertical: Boolean
  22802. },
  22803. setup(props) {
  22804. const ns = useNamespace("color-hue-slider");
  22805. const instance = getCurrentInstance();
  22806. const thumb = ref();
  22807. const bar = ref();
  22808. const thumbLeft = ref(0);
  22809. const thumbTop = ref(0);
  22810. const hueValue = computed$1(() => {
  22811. return props.color.get("hue");
  22812. });
  22813. watch(() => hueValue.value, () => {
  22814. update();
  22815. });
  22816. function handleClick(event2) {
  22817. const target = event2.target;
  22818. if (target !== thumb.value) {
  22819. handleDrag(event2);
  22820. }
  22821. }
  22822. function handleDrag(event2) {
  22823. if (!bar.value || !thumb.value)
  22824. return;
  22825. const el = instance.vnode.el;
  22826. const rect = el.getBoundingClientRect();
  22827. const { clientX, clientY } = getClientXY(event2);
  22828. let hue;
  22829. if (!props.vertical) {
  22830. let left = clientX - rect.left;
  22831. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22832. left = Math.max(thumb.value.offsetWidth / 2, left);
  22833. hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
  22834. } else {
  22835. let top = clientY - rect.top;
  22836. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22837. top = Math.max(thumb.value.offsetHeight / 2, top);
  22838. hue = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 360);
  22839. }
  22840. props.color.set("hue", hue);
  22841. }
  22842. function getThumbLeft() {
  22843. if (!thumb.value)
  22844. return 0;
  22845. const el = instance.vnode.el;
  22846. if (props.vertical)
  22847. return 0;
  22848. const hue = props.color.get("hue");
  22849. if (!el)
  22850. return 0;
  22851. return Math.round(hue * (el.offsetWidth - thumb.value.offsetWidth / 2) / 360);
  22852. }
  22853. function getThumbTop() {
  22854. if (!thumb.value)
  22855. return 0;
  22856. const el = instance.vnode.el;
  22857. if (!props.vertical)
  22858. return 0;
  22859. const hue = props.color.get("hue");
  22860. if (!el)
  22861. return 0;
  22862. return Math.round(hue * (el.offsetHeight - thumb.value.offsetHeight / 2) / 360);
  22863. }
  22864. function update() {
  22865. thumbLeft.value = getThumbLeft();
  22866. thumbTop.value = getThumbTop();
  22867. }
  22868. onMounted(() => {
  22869. if (!bar.value || !thumb.value)
  22870. return;
  22871. const dragConfig = {
  22872. drag: (event2) => {
  22873. handleDrag(event2);
  22874. },
  22875. end: (event2) => {
  22876. handleDrag(event2);
  22877. }
  22878. };
  22879. draggable(bar.value, dragConfig);
  22880. draggable(thumb.value, dragConfig);
  22881. update();
  22882. });
  22883. return {
  22884. bar,
  22885. thumb,
  22886. thumbLeft,
  22887. thumbTop,
  22888. hueValue,
  22889. handleClick,
  22890. update,
  22891. ns
  22892. };
  22893. }
  22894. });
  22895. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  22896. return openBlock(), createElementBlock("div", {
  22897. class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
  22898. }, [
  22899. createElementVNode("div", {
  22900. ref: "bar",
  22901. class: normalizeClass(_ctx.ns.e("bar")),
  22902. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  22903. }, null, 2),
  22904. createElementVNode("div", {
  22905. ref: "thumb",
  22906. class: normalizeClass(_ctx.ns.e("thumb")),
  22907. style: normalizeStyle({
  22908. left: _ctx.thumbLeft + "px",
  22909. top: _ctx.thumbTop + "px"
  22910. })
  22911. }, null, 6)
  22912. ], 2);
  22913. }
  22914. var HueSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["render", _sfc_render$6], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/hue-slider.vue"]]);
  22915. const colorPickerProps = buildProps({
  22916. modelValue: String,
  22917. id: String,
  22918. showAlpha: Boolean,
  22919. colorFormat: String,
  22920. disabled: Boolean,
  22921. size: useSizeProp,
  22922. popperClass: {
  22923. type: String,
  22924. default: ""
  22925. },
  22926. label: {
  22927. type: String,
  22928. default: void 0
  22929. },
  22930. tabindex: {
  22931. type: [String, Number],
  22932. default: 0
  22933. },
  22934. predefine: {
  22935. type: definePropType(Array)
  22936. },
  22937. validateEvent: {
  22938. type: Boolean,
  22939. default: true
  22940. }
  22941. });
  22942. const colorPickerEmits = {
  22943. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  22944. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  22945. activeChange: (val) => isString(val) || isNil(val)
  22946. };
  22947. const colorPickerContextKey = Symbol("colorPickerContextKey");
  22948. const hsv2hsl = function(hue, sat, val) {
  22949. return [
  22950. hue,
  22951. sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0,
  22952. hue / 2
  22953. ];
  22954. };
  22955. const isOnePointZero = function(n) {
  22956. return typeof n === "string" && n.includes(".") && Number.parseFloat(n) === 1;
  22957. };
  22958. const isPercentage = function(n) {
  22959. return typeof n === "string" && n.includes("%");
  22960. };
  22961. const bound01 = function(value, max2) {
  22962. if (isOnePointZero(value))
  22963. value = "100%";
  22964. const processPercent = isPercentage(value);
  22965. value = Math.min(max2, Math.max(0, Number.parseFloat(`${value}`)));
  22966. if (processPercent) {
  22967. value = Number.parseInt(`${value * max2}`, 10) / 100;
  22968. }
  22969. if (Math.abs(value - max2) < 1e-6) {
  22970. return 1;
  22971. }
  22972. return value % max2 / Number.parseFloat(max2);
  22973. };
  22974. const INT_HEX_MAP = {
  22975. 10: "A",
  22976. 11: "B",
  22977. 12: "C",
  22978. 13: "D",
  22979. 14: "E",
  22980. 15: "F"
  22981. };
  22982. const hexOne = (value) => {
  22983. value = Math.min(Math.round(value), 255);
  22984. const high = Math.floor(value / 16);
  22985. const low = value % 16;
  22986. return `${INT_HEX_MAP[high] || high}${INT_HEX_MAP[low] || low}`;
  22987. };
  22988. const toHex = function({ r: r2, g, b }) {
  22989. if (Number.isNaN(+r2) || Number.isNaN(+g) || Number.isNaN(+b))
  22990. return "";
  22991. return `#${hexOne(r2)}${hexOne(g)}${hexOne(b)}`;
  22992. };
  22993. const HEX_INT_MAP = {
  22994. A: 10,
  22995. B: 11,
  22996. C: 12,
  22997. D: 13,
  22998. E: 14,
  22999. F: 15
  23000. };
  23001. const parseHexChannel = function(hex) {
  23002. if (hex.length === 2) {
  23003. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  23004. }
  23005. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  23006. };
  23007. const hsl2hsv = function(hue, sat, light) {
  23008. sat = sat / 100;
  23009. light = light / 100;
  23010. let smin = sat;
  23011. const lmin = Math.max(light, 0.01);
  23012. light *= 2;
  23013. sat *= light <= 1 ? light : 2 - light;
  23014. smin *= lmin <= 1 ? lmin : 2 - lmin;
  23015. const v = (light + sat) / 2;
  23016. const sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  23017. return {
  23018. h: hue,
  23019. s: sv * 100,
  23020. v: v * 100
  23021. };
  23022. };
  23023. const rgb2hsv = (r2, g, b) => {
  23024. r2 = bound01(r2, 255);
  23025. g = bound01(g, 255);
  23026. b = bound01(b, 255);
  23027. const max2 = Math.max(r2, g, b);
  23028. const min2 = Math.min(r2, g, b);
  23029. let h2;
  23030. const v = max2;
  23031. const d2 = max2 - min2;
  23032. const s = max2 === 0 ? 0 : d2 / max2;
  23033. if (max2 === min2) {
  23034. h2 = 0;
  23035. } else {
  23036. switch (max2) {
  23037. case r2: {
  23038. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  23039. break;
  23040. }
  23041. case g: {
  23042. h2 = (b - r2) / d2 + 2;
  23043. break;
  23044. }
  23045. case b: {
  23046. h2 = (r2 - g) / d2 + 4;
  23047. break;
  23048. }
  23049. }
  23050. h2 /= 6;
  23051. }
  23052. return { h: h2 * 360, s: s * 100, v: v * 100 };
  23053. };
  23054. const hsv2rgb = function(h2, s, v) {
  23055. h2 = bound01(h2, 360) * 6;
  23056. s = bound01(s, 100);
  23057. v = bound01(v, 100);
  23058. const i2 = Math.floor(h2);
  23059. const f = h2 - i2;
  23060. const p = v * (1 - s);
  23061. const q2 = v * (1 - f * s);
  23062. const t2 = v * (1 - (1 - f) * s);
  23063. const mod = i2 % 6;
  23064. const r2 = [v, q2, p, p, t2, v][mod];
  23065. const g = [t2, v, v, q2, p, p][mod];
  23066. const b = [p, p, t2, v, v, q2][mod];
  23067. return {
  23068. r: Math.round(r2 * 255),
  23069. g: Math.round(g * 255),
  23070. b: Math.round(b * 255)
  23071. };
  23072. };
  23073. class Color$1 {
  23074. constructor(options2 = {}) {
  23075. this._hue = 0;
  23076. this._saturation = 100;
  23077. this._value = 100;
  23078. this._alpha = 100;
  23079. this.enableAlpha = false;
  23080. this.format = "hex";
  23081. this.value = "";
  23082. for (const option in options2) {
  23083. if (hasOwn(options2, option)) {
  23084. this[option] = options2[option];
  23085. }
  23086. }
  23087. if (options2.value) {
  23088. this.fromString(options2.value);
  23089. } else {
  23090. this.doOnChange();
  23091. }
  23092. }
  23093. set(prop, value) {
  23094. if (arguments.length === 1 && typeof prop === "object") {
  23095. for (const p in prop) {
  23096. if (hasOwn(prop, p)) {
  23097. this.set(p, prop[p]);
  23098. }
  23099. }
  23100. return;
  23101. }
  23102. this[`_${prop}`] = value;
  23103. this.doOnChange();
  23104. }
  23105. get(prop) {
  23106. if (prop === "alpha") {
  23107. return Math.floor(this[`_${prop}`]);
  23108. }
  23109. return this[`_${prop}`];
  23110. }
  23111. toRgb() {
  23112. return hsv2rgb(this._hue, this._saturation, this._value);
  23113. }
  23114. fromString(value) {
  23115. if (!value) {
  23116. this._hue = 0;
  23117. this._saturation = 100;
  23118. this._value = 100;
  23119. this.doOnChange();
  23120. return;
  23121. }
  23122. const fromHSV = (h2, s, v) => {
  23123. this._hue = Math.max(0, Math.min(360, h2));
  23124. this._saturation = Math.max(0, Math.min(100, s));
  23125. this._value = Math.max(0, Math.min(100, v));
  23126. this.doOnChange();
  23127. };
  23128. if (value.includes("hsl")) {
  23129. const parts = value.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23130. if (parts.length === 4) {
  23131. this._alpha = Number.parseFloat(parts[3]) * 100;
  23132. } else if (parts.length === 3) {
  23133. this._alpha = 100;
  23134. }
  23135. if (parts.length >= 3) {
  23136. const { h: h2, s, v } = hsl2hsv(parts[0], parts[1], parts[2]);
  23137. fromHSV(h2, s, v);
  23138. }
  23139. } else if (value.includes("hsv")) {
  23140. const parts = value.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23141. if (parts.length === 4) {
  23142. this._alpha = Number.parseFloat(parts[3]) * 100;
  23143. } else if (parts.length === 3) {
  23144. this._alpha = 100;
  23145. }
  23146. if (parts.length >= 3) {
  23147. fromHSV(parts[0], parts[1], parts[2]);
  23148. }
  23149. } else if (value.includes("rgb")) {
  23150. const parts = value.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23151. if (parts.length === 4) {
  23152. this._alpha = Number.parseFloat(parts[3]) * 100;
  23153. } else if (parts.length === 3) {
  23154. this._alpha = 100;
  23155. }
  23156. if (parts.length >= 3) {
  23157. const { h: h2, s, v } = rgb2hsv(parts[0], parts[1], parts[2]);
  23158. fromHSV(h2, s, v);
  23159. }
  23160. } else if (value.includes("#")) {
  23161. const hex = value.replace("#", "").trim();
  23162. if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex))
  23163. return;
  23164. let r2, g, b;
  23165. if (hex.length === 3) {
  23166. r2 = parseHexChannel(hex[0] + hex[0]);
  23167. g = parseHexChannel(hex[1] + hex[1]);
  23168. b = parseHexChannel(hex[2] + hex[2]);
  23169. } else if (hex.length === 6 || hex.length === 8) {
  23170. r2 = parseHexChannel(hex.slice(0, 2));
  23171. g = parseHexChannel(hex.slice(2, 4));
  23172. b = parseHexChannel(hex.slice(4, 6));
  23173. }
  23174. if (hex.length === 8) {
  23175. this._alpha = parseHexChannel(hex.slice(6)) / 255 * 100;
  23176. } else if (hex.length === 3 || hex.length === 6) {
  23177. this._alpha = 100;
  23178. }
  23179. const { h: h2, s, v } = rgb2hsv(r2, g, b);
  23180. fromHSV(h2, s, v);
  23181. }
  23182. }
  23183. compare(color2) {
  23184. return Math.abs(color2._hue - this._hue) < 2 && Math.abs(color2._saturation - this._saturation) < 1 && Math.abs(color2._value - this._value) < 1 && Math.abs(color2._alpha - this._alpha) < 1;
  23185. }
  23186. doOnChange() {
  23187. const { _hue, _saturation, _value, _alpha, format } = this;
  23188. if (this.enableAlpha) {
  23189. switch (format) {
  23190. case "hsl": {
  23191. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23192. this.value = `hsla(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%, ${this.get("alpha") / 100})`;
  23193. break;
  23194. }
  23195. case "hsv": {
  23196. this.value = `hsva(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%, ${this.get("alpha") / 100})`;
  23197. break;
  23198. }
  23199. case "hex": {
  23200. this.value = `${toHex(hsv2rgb(_hue, _saturation, _value))}${hexOne(_alpha * 255 / 100)}`;
  23201. break;
  23202. }
  23203. default: {
  23204. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23205. this.value = `rgba(${r2}, ${g}, ${b}, ${this.get("alpha") / 100})`;
  23206. }
  23207. }
  23208. } else {
  23209. switch (format) {
  23210. case "hsl": {
  23211. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23212. this.value = `hsl(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%)`;
  23213. break;
  23214. }
  23215. case "hsv": {
  23216. this.value = `hsv(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%)`;
  23217. break;
  23218. }
  23219. case "rgb": {
  23220. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23221. this.value = `rgb(${r2}, ${g}, ${b})`;
  23222. break;
  23223. }
  23224. default: {
  23225. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  23226. }
  23227. }
  23228. }
  23229. }
  23230. }
  23231. const _sfc_main$d = defineComponent({
  23232. props: {
  23233. colors: {
  23234. type: Array,
  23235. required: true
  23236. },
  23237. color: {
  23238. type: Object,
  23239. required: true
  23240. }
  23241. },
  23242. setup(props) {
  23243. const ns = useNamespace("color-predefine");
  23244. const { currentColor } = inject(colorPickerContextKey);
  23245. const rgbaColors = ref(parseColors(props.colors, props.color));
  23246. watch(() => currentColor.value, (val) => {
  23247. const color2 = new Color$1();
  23248. color2.fromString(val);
  23249. rgbaColors.value.forEach((item) => {
  23250. item.selected = color2.compare(item);
  23251. });
  23252. });
  23253. watchEffect(() => {
  23254. rgbaColors.value = parseColors(props.colors, props.color);
  23255. });
  23256. function handleSelect(index2) {
  23257. props.color.fromString(props.colors[index2]);
  23258. }
  23259. function parseColors(colors, color2) {
  23260. return colors.map((value) => {
  23261. const c = new Color$1();
  23262. c.enableAlpha = true;
  23263. c.format = "rgba";
  23264. c.fromString(value);
  23265. c.selected = c.value === color2.value;
  23266. return c;
  23267. });
  23268. }
  23269. return {
  23270. rgbaColors,
  23271. handleSelect,
  23272. ns
  23273. };
  23274. }
  23275. });
  23276. const _hoisted_1$a = ["onClick"];
  23277. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  23278. return openBlock(), createElementBlock("div", {
  23279. class: normalizeClass(_ctx.ns.b())
  23280. }, [
  23281. createElementVNode("div", {
  23282. class: normalizeClass(_ctx.ns.e("colors"))
  23283. }, [
  23284. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rgbaColors, (item, index2) => {
  23285. return openBlock(), createElementBlock("div", {
  23286. key: _ctx.colors[index2],
  23287. class: normalizeClass([
  23288. _ctx.ns.e("color-selector"),
  23289. _ctx.ns.is("alpha", item._alpha < 100),
  23290. { selected: item.selected }
  23291. ]),
  23292. onClick: ($event) => _ctx.handleSelect(index2)
  23293. }, [
  23294. createElementVNode("div", {
  23295. style: normalizeStyle({ backgroundColor: item.value })
  23296. }, null, 4)
  23297. ], 10, _hoisted_1$a);
  23298. }), 128))
  23299. ], 2)
  23300. ], 2);
  23301. }
  23302. var Predefine = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$5], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/predefine.vue"]]);
  23303. const _sfc_main$c = defineComponent({
  23304. name: "ElSlPanel",
  23305. props: {
  23306. color: {
  23307. type: Object,
  23308. required: true
  23309. }
  23310. },
  23311. setup(props) {
  23312. const ns = useNamespace("color-svpanel");
  23313. const instance = getCurrentInstance();
  23314. const cursorTop = ref(0);
  23315. const cursorLeft = ref(0);
  23316. const background = ref("hsl(0, 100%, 50%)");
  23317. const colorValue = computed$1(() => {
  23318. const hue = props.color.get("hue");
  23319. const value = props.color.get("value");
  23320. return { hue, value };
  23321. });
  23322. function update() {
  23323. const saturation = props.color.get("saturation");
  23324. const value = props.color.get("value");
  23325. const el = instance.vnode.el;
  23326. const { clientWidth: width2, clientHeight: height2 } = el;
  23327. cursorLeft.value = saturation * width2 / 100;
  23328. cursorTop.value = (100 - value) * height2 / 100;
  23329. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  23330. }
  23331. function handleDrag(event2) {
  23332. const el = instance.vnode.el;
  23333. const rect = el.getBoundingClientRect();
  23334. const { clientX, clientY } = getClientXY(event2);
  23335. let left = clientX - rect.left;
  23336. let top = clientY - rect.top;
  23337. left = Math.max(0, left);
  23338. left = Math.min(left, rect.width);
  23339. top = Math.max(0, top);
  23340. top = Math.min(top, rect.height);
  23341. cursorLeft.value = left;
  23342. cursorTop.value = top;
  23343. props.color.set({
  23344. saturation: left / rect.width * 100,
  23345. value: 100 - top / rect.height * 100
  23346. });
  23347. }
  23348. watch(() => colorValue.value, () => {
  23349. update();
  23350. });
  23351. onMounted(() => {
  23352. draggable(instance.vnode.el, {
  23353. drag: (event2) => {
  23354. handleDrag(event2);
  23355. },
  23356. end: (event2) => {
  23357. handleDrag(event2);
  23358. }
  23359. });
  23360. update();
  23361. });
  23362. return {
  23363. cursorTop,
  23364. cursorLeft,
  23365. background,
  23366. colorValue,
  23367. handleDrag,
  23368. update,
  23369. ns
  23370. };
  23371. }
  23372. });
  23373. const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("div", null, null, -1);
  23374. const _hoisted_2$7 = [
  23375. _hoisted_1$9
  23376. ];
  23377. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  23378. return openBlock(), createElementBlock("div", {
  23379. class: normalizeClass(_ctx.ns.b()),
  23380. style: normalizeStyle({
  23381. backgroundColor: _ctx.background
  23382. })
  23383. }, [
  23384. createElementVNode("div", {
  23385. class: normalizeClass(_ctx.ns.e("white"))
  23386. }, null, 2),
  23387. createElementVNode("div", {
  23388. class: normalizeClass(_ctx.ns.e("black"))
  23389. }, null, 2),
  23390. createElementVNode("div", {
  23391. class: normalizeClass(_ctx.ns.e("cursor")),
  23392. style: normalizeStyle({
  23393. top: _ctx.cursorTop + "px",
  23394. left: _ctx.cursorLeft + "px"
  23395. })
  23396. }, _hoisted_2$7, 6)
  23397. ], 6);
  23398. }
  23399. var SvPanel = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$4], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/sv-panel.vue"]]);
  23400. const _hoisted_1$8 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
  23401. const __default__$4 = defineComponent({
  23402. name: "ElColorPicker"
  23403. });
  23404. const _sfc_main$b = /* @__PURE__ */ defineComponent({
  23405. ...__default__$4,
  23406. props: colorPickerProps,
  23407. emits: colorPickerEmits,
  23408. setup(__props, { expose, emit }) {
  23409. const props = __props;
  23410. const { t: t2 } = useLocale();
  23411. const ns = useNamespace("color");
  23412. const { formItem } = useFormItem();
  23413. const colorSize = useFormSize();
  23414. const colorDisabled = useFormDisabled();
  23415. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
  23416. formItemContext: formItem
  23417. });
  23418. const hue = ref();
  23419. const sv = ref();
  23420. const alpha = ref();
  23421. const popper = ref();
  23422. let shouldActiveChange = true;
  23423. const color2 = reactive(new Color$1({
  23424. enableAlpha: props.showAlpha,
  23425. format: props.colorFormat || "",
  23426. value: props.modelValue
  23427. }));
  23428. const showPicker = ref(false);
  23429. const showPanelColor = ref(false);
  23430. const customInput = ref("");
  23431. const displayedColor = computed$1(() => {
  23432. if (!props.modelValue && !showPanelColor.value) {
  23433. return "transparent";
  23434. }
  23435. return displayedRgb(color2, props.showAlpha);
  23436. });
  23437. const currentColor = computed$1(() => {
  23438. return !props.modelValue && !showPanelColor.value ? "" : color2.value;
  23439. });
  23440. const buttonAriaLabel = computed$1(() => {
  23441. return !isLabeledByFormItem.value ? props.label || t2("el.colorpicker.defaultLabel") : void 0;
  23442. });
  23443. const buttonAriaLabelledby = computed$1(() => {
  23444. return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
  23445. });
  23446. const btnKls = computed$1(() => {
  23447. return [
  23448. ns.b("picker"),
  23449. ns.is("disabled", colorDisabled.value),
  23450. ns.bm("picker", colorSize.value)
  23451. ];
  23452. });
  23453. function displayedRgb(color22, showAlpha) {
  23454. if (!(color22 instanceof Color$1)) {
  23455. throw new TypeError("color should be instance of _color Class");
  23456. }
  23457. const { r: r2, g, b } = color22.toRgb();
  23458. return showAlpha ? `rgba(${r2}, ${g}, ${b}, ${color22.get("alpha") / 100})` : `rgb(${r2}, ${g}, ${b})`;
  23459. }
  23460. function setShowPicker(value) {
  23461. showPicker.value = value;
  23462. }
  23463. const debounceSetShowPicker = debounce$2(setShowPicker, 100);
  23464. function show() {
  23465. if (colorDisabled.value)
  23466. return;
  23467. setShowPicker(true);
  23468. }
  23469. function hide() {
  23470. debounceSetShowPicker(false);
  23471. resetColor();
  23472. }
  23473. function resetColor() {
  23474. nextTick(() => {
  23475. if (props.modelValue) {
  23476. color2.fromString(props.modelValue);
  23477. } else {
  23478. color2.value = "";
  23479. nextTick(() => {
  23480. showPanelColor.value = false;
  23481. });
  23482. }
  23483. });
  23484. }
  23485. function handleTrigger() {
  23486. if (colorDisabled.value)
  23487. return;
  23488. debounceSetShowPicker(!showPicker.value);
  23489. }
  23490. function handleConfirm() {
  23491. color2.fromString(customInput.value);
  23492. }
  23493. function confirmValue() {
  23494. const value = color2.value;
  23495. emit(UPDATE_MODEL_EVENT, value);
  23496. emit("change", value);
  23497. if (props.validateEvent) {
  23498. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23499. }
  23500. debounceSetShowPicker(false);
  23501. nextTick(() => {
  23502. const newColor = new Color$1({
  23503. enableAlpha: props.showAlpha,
  23504. format: props.colorFormat || "",
  23505. value: props.modelValue
  23506. });
  23507. if (!color2.compare(newColor)) {
  23508. resetColor();
  23509. }
  23510. });
  23511. }
  23512. function clear() {
  23513. debounceSetShowPicker(false);
  23514. emit(UPDATE_MODEL_EVENT, null);
  23515. emit("change", null);
  23516. if (props.modelValue !== null && props.validateEvent) {
  23517. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23518. }
  23519. resetColor();
  23520. }
  23521. onMounted(() => {
  23522. if (props.modelValue) {
  23523. customInput.value = currentColor.value;
  23524. }
  23525. });
  23526. watch(() => props.modelValue, (newVal) => {
  23527. if (!newVal) {
  23528. showPanelColor.value = false;
  23529. } else if (newVal && newVal !== color2.value) {
  23530. shouldActiveChange = false;
  23531. color2.fromString(newVal);
  23532. }
  23533. });
  23534. watch(() => currentColor.value, (val) => {
  23535. customInput.value = val;
  23536. shouldActiveChange && emit("activeChange", val);
  23537. shouldActiveChange = true;
  23538. });
  23539. watch(() => color2.value, () => {
  23540. if (!props.modelValue && !showPanelColor.value) {
  23541. showPanelColor.value = true;
  23542. }
  23543. });
  23544. watch(() => showPicker.value, () => {
  23545. nextTick(() => {
  23546. var _a2, _b, _c;
  23547. (_a2 = hue.value) == null ? void 0 : _a2.update();
  23548. (_b = sv.value) == null ? void 0 : _b.update();
  23549. (_c = alpha.value) == null ? void 0 : _c.update();
  23550. });
  23551. });
  23552. provide(colorPickerContextKey, {
  23553. currentColor
  23554. });
  23555. expose({
  23556. color: color2,
  23557. show,
  23558. hide
  23559. });
  23560. return (_ctx, _cache) => {
  23561. return openBlock(), createBlock(unref(ElTooltip), {
  23562. ref_key: "popper",
  23563. ref: popper,
  23564. visible: showPicker.value,
  23565. "show-arrow": false,
  23566. "fallback-placements": ["bottom", "top", "right", "left"],
  23567. offset: 0,
  23568. "gpu-acceleration": false,
  23569. "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
  23570. "stop-popper-mouse-event": false,
  23571. effect: "light",
  23572. trigger: "click",
  23573. transition: `${unref(ns).namespace.value}-zoom-in-top`,
  23574. persistent: ""
  23575. }, {
  23576. content: withCtx(() => [
  23577. withDirectives((openBlock(), createElementBlock("div", null, [
  23578. createElementVNode("div", {
  23579. class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
  23580. }, [
  23581. createVNode(HueSlider, {
  23582. ref_key: "hue",
  23583. ref: hue,
  23584. class: "hue-slider",
  23585. color: unref(color2),
  23586. vertical: ""
  23587. }, null, 8, ["color"]),
  23588. createVNode(SvPanel, {
  23589. ref: "svPanel",
  23590. color: unref(color2)
  23591. }, null, 8, ["color"])
  23592. ], 2),
  23593. _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
  23594. key: 0,
  23595. ref_key: "alpha",
  23596. ref: alpha,
  23597. color: unref(color2)
  23598. }, null, 8, ["color"])) : createCommentVNode("v-if", true),
  23599. _ctx.predefine ? (openBlock(), createBlock(Predefine, {
  23600. key: 1,
  23601. ref: "predefine",
  23602. color: unref(color2),
  23603. colors: _ctx.predefine
  23604. }, null, 8, ["color", "colors"])) : createCommentVNode("v-if", true),
  23605. createElementVNode("div", {
  23606. class: normalizeClass(unref(ns).be("dropdown", "btns"))
  23607. }, [
  23608. createElementVNode("span", {
  23609. class: normalizeClass(unref(ns).be("dropdown", "value"))
  23610. }, [
  23611. createVNode(unref(ElInput), {
  23612. modelValue: customInput.value,
  23613. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  23614. "validate-event": false,
  23615. size: "small",
  23616. onKeyup: withKeys(handleConfirm, ["enter"]),
  23617. onBlur: handleConfirm
  23618. }, null, 8, ["modelValue", "onKeyup"])
  23619. ], 2),
  23620. createVNode(unref(ElButton), {
  23621. class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
  23622. text: "",
  23623. size: "small",
  23624. onClick: clear
  23625. }, {
  23626. default: withCtx(() => [
  23627. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.clear")), 1)
  23628. ]),
  23629. _: 1
  23630. }, 8, ["class"]),
  23631. createVNode(unref(ElButton), {
  23632. plain: "",
  23633. size: "small",
  23634. class: normalizeClass(unref(ns).be("dropdown", "btn")),
  23635. onClick: confirmValue
  23636. }, {
  23637. default: withCtx(() => [
  23638. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.confirm")), 1)
  23639. ]),
  23640. _: 1
  23641. }, 8, ["class"])
  23642. ], 2)
  23643. ])), [
  23644. [unref(ClickOutside), hide]
  23645. ])
  23646. ]),
  23647. default: withCtx(() => [
  23648. createElementVNode("div", {
  23649. id: unref(buttonId),
  23650. class: normalizeClass(unref(btnKls)),
  23651. role: "button",
  23652. "aria-label": unref(buttonAriaLabel),
  23653. "aria-labelledby": unref(buttonAriaLabelledby),
  23654. "aria-description": unref(t2)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
  23655. tabindex: _ctx.tabindex,
  23656. onKeydown: withKeys(handleTrigger, ["enter"])
  23657. }, [
  23658. unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
  23659. key: 0,
  23660. class: normalizeClass(unref(ns).be("picker", "mask"))
  23661. }, null, 2)) : createCommentVNode("v-if", true),
  23662. createElementVNode("div", {
  23663. class: normalizeClass(unref(ns).be("picker", "trigger")),
  23664. onClick: handleTrigger
  23665. }, [
  23666. createElementVNode("span", {
  23667. class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
  23668. }, [
  23669. createElementVNode("span", {
  23670. class: normalizeClass(unref(ns).be("picker", "color-inner")),
  23671. style: normalizeStyle({
  23672. backgroundColor: unref(displayedColor)
  23673. })
  23674. }, [
  23675. withDirectives(createVNode(unref(ElIcon), {
  23676. class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
  23677. }, {
  23678. default: withCtx(() => [
  23679. createVNode(unref(arrow_down_default))
  23680. ]),
  23681. _: 1
  23682. }, 8, ["class"]), [
  23683. [vShow, _ctx.modelValue || showPanelColor.value]
  23684. ]),
  23685. !_ctx.modelValue && !showPanelColor.value ? (openBlock(), createBlock(unref(ElIcon), {
  23686. key: 0,
  23687. class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
  23688. }, {
  23689. default: withCtx(() => [
  23690. createVNode(unref(close_default))
  23691. ]),
  23692. _: 1
  23693. }, 8, ["class"])) : createCommentVNode("v-if", true)
  23694. ], 6)
  23695. ], 2)
  23696. ], 2)
  23697. ], 42, _hoisted_1$8)
  23698. ]),
  23699. _: 1
  23700. }, 8, ["visible", "popper-class", "transition"]);
  23701. };
  23702. }
  23703. });
  23704. var ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/color-picker.vue"]]);
  23705. const ElColorPicker = withInstall(ColorPicker);
  23706. const overlayProps = buildProps({
  23707. mask: {
  23708. type: Boolean,
  23709. default: true
  23710. },
  23711. customMaskEvent: {
  23712. type: Boolean,
  23713. default: false
  23714. },
  23715. overlayClass: {
  23716. type: definePropType([
  23717. String,
  23718. Array,
  23719. Object
  23720. ])
  23721. },
  23722. zIndex: {
  23723. type: definePropType([String, Number])
  23724. }
  23725. });
  23726. const overlayEmits = {
  23727. click: (evt) => evt instanceof MouseEvent
  23728. };
  23729. const BLOCK = "overlay";
  23730. var Overlay = defineComponent({
  23731. name: "ElOverlay",
  23732. props: overlayProps,
  23733. emits: overlayEmits,
  23734. setup(props, { slots, emit }) {
  23735. const ns = useNamespace(BLOCK);
  23736. const onMaskClick = (e) => {
  23737. emit("click", e);
  23738. };
  23739. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  23740. return () => {
  23741. return props.mask ? createVNode("div", {
  23742. class: [ns.b(), props.overlayClass],
  23743. style: {
  23744. zIndex: props.zIndex
  23745. },
  23746. onClick,
  23747. onMousedown,
  23748. onMouseup
  23749. }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : h("div", {
  23750. class: props.overlayClass,
  23751. style: {
  23752. zIndex: props.zIndex,
  23753. position: "fixed",
  23754. top: "0px",
  23755. right: "0px",
  23756. bottom: "0px",
  23757. left: "0px"
  23758. }
  23759. }, [renderSlot(slots, "default")]);
  23760. };
  23761. }
  23762. });
  23763. const ElOverlay = Overlay;
  23764. const dialogInjectionKey = Symbol("dialogInjectionKey");
  23765. const dialogContentProps = buildProps({
  23766. center: {
  23767. type: Boolean,
  23768. default: false
  23769. },
  23770. alignCenter: {
  23771. type: Boolean,
  23772. default: false
  23773. },
  23774. closeIcon: {
  23775. type: iconPropType
  23776. },
  23777. customClass: {
  23778. type: String,
  23779. default: ""
  23780. },
  23781. draggable: {
  23782. type: Boolean,
  23783. default: false
  23784. },
  23785. fullscreen: {
  23786. type: Boolean,
  23787. default: false
  23788. },
  23789. showClose: {
  23790. type: Boolean,
  23791. default: true
  23792. },
  23793. title: {
  23794. type: String,
  23795. default: ""
  23796. }
  23797. });
  23798. const dialogContentEmits = {
  23799. close: () => true
  23800. };
  23801. const _hoisted_1$7 = ["aria-label"];
  23802. const _hoisted_2$6 = ["id"];
  23803. const __default__$3 = defineComponent({ name: "ElDialogContent" });
  23804. const _sfc_main$a = /* @__PURE__ */ defineComponent({
  23805. ...__default__$3,
  23806. props: dialogContentProps,
  23807. emits: dialogContentEmits,
  23808. setup(__props) {
  23809. const props = __props;
  23810. const { t: t2 } = useLocale();
  23811. const { Close } = CloseComponents;
  23812. const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
  23813. const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
  23814. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  23815. const draggable2 = computed$1(() => props.draggable);
  23816. useDraggable(dialogRef, headerRef, draggable2);
  23817. return (_ctx, _cache) => {
  23818. return openBlock(), createElementBlock("div", {
  23819. ref: unref(composedDialogRef),
  23820. class: normalizeClass([
  23821. unref(ns).b(),
  23822. unref(ns).is("fullscreen", _ctx.fullscreen),
  23823. unref(ns).is("draggable", unref(draggable2)),
  23824. unref(ns).is("align-center", _ctx.alignCenter),
  23825. { [unref(ns).m("center")]: _ctx.center },
  23826. _ctx.customClass
  23827. ]),
  23828. style: normalizeStyle(unref(style)),
  23829. tabindex: "-1"
  23830. }, [
  23831. createElementVNode("header", {
  23832. ref_key: "headerRef",
  23833. ref: headerRef,
  23834. class: normalizeClass(unref(ns).e("header"))
  23835. }, [
  23836. renderSlot(_ctx.$slots, "header", {}, () => [
  23837. createElementVNode("span", {
  23838. role: "heading",
  23839. class: normalizeClass(unref(ns).e("title"))
  23840. }, toDisplayString(_ctx.title), 3)
  23841. ]),
  23842. _ctx.showClose ? (openBlock(), createElementBlock("button", {
  23843. key: 0,
  23844. "aria-label": unref(t2)("el.dialog.close"),
  23845. class: normalizeClass(unref(ns).e("headerbtn")),
  23846. type: "button",
  23847. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  23848. }, [
  23849. createVNode(unref(ElIcon), {
  23850. class: normalizeClass(unref(ns).e("close"))
  23851. }, {
  23852. default: withCtx(() => [
  23853. (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
  23854. ]),
  23855. _: 1
  23856. }, 8, ["class"])
  23857. ], 10, _hoisted_1$7)) : createCommentVNode("v-if", true)
  23858. ], 2),
  23859. createElementVNode("div", {
  23860. id: unref(bodyId),
  23861. class: normalizeClass(unref(ns).e("body"))
  23862. }, [
  23863. renderSlot(_ctx.$slots, "default")
  23864. ], 10, _hoisted_2$6),
  23865. _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
  23866. key: 0,
  23867. class: normalizeClass(unref(ns).e("footer"))
  23868. }, [
  23869. renderSlot(_ctx.$slots, "footer")
  23870. ], 2)) : createCommentVNode("v-if", true)
  23871. ], 6);
  23872. };
  23873. }
  23874. });
  23875. var ElDialogContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);
  23876. const dialogProps = buildProps({
  23877. ...dialogContentProps,
  23878. appendToBody: {
  23879. type: Boolean,
  23880. default: false
  23881. },
  23882. beforeClose: {
  23883. type: definePropType(Function)
  23884. },
  23885. destroyOnClose: {
  23886. type: Boolean,
  23887. default: false
  23888. },
  23889. closeOnClickModal: {
  23890. type: Boolean,
  23891. default: true
  23892. },
  23893. closeOnPressEscape: {
  23894. type: Boolean,
  23895. default: true
  23896. },
  23897. lockScroll: {
  23898. type: Boolean,
  23899. default: true
  23900. },
  23901. modal: {
  23902. type: Boolean,
  23903. default: true
  23904. },
  23905. openDelay: {
  23906. type: Number,
  23907. default: 0
  23908. },
  23909. closeDelay: {
  23910. type: Number,
  23911. default: 0
  23912. },
  23913. top: {
  23914. type: String
  23915. },
  23916. modelValue: {
  23917. type: Boolean,
  23918. default: false
  23919. },
  23920. modalClass: String,
  23921. width: {
  23922. type: [String, Number]
  23923. },
  23924. zIndex: {
  23925. type: Number
  23926. },
  23927. trapFocus: {
  23928. type: Boolean,
  23929. default: false
  23930. }
  23931. });
  23932. const dialogEmits = {
  23933. open: () => true,
  23934. opened: () => true,
  23935. close: () => true,
  23936. closed: () => true,
  23937. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  23938. openAutoFocus: () => true,
  23939. closeAutoFocus: () => true
  23940. };
  23941. const useDialog = (props, targetRef) => {
  23942. const instance = getCurrentInstance();
  23943. const emit = instance.emit;
  23944. const { nextZIndex } = useZIndex();
  23945. let lastPosition = "";
  23946. const titleId = useId();
  23947. const bodyId = useId();
  23948. const visible = ref(false);
  23949. const closed = ref(false);
  23950. const rendered = ref(false);
  23951. const zIndex2 = ref(props.zIndex || nextZIndex());
  23952. let openTimer = void 0;
  23953. let closeTimer = void 0;
  23954. const namespace = useGlobalConfig("namespace", defaultNamespace);
  23955. const style = computed$1(() => {
  23956. const style2 = {};
  23957. const varPrefix = `--${namespace.value}-dialog`;
  23958. if (!props.fullscreen) {
  23959. if (props.top) {
  23960. style2[`${varPrefix}-margin-top`] = props.top;
  23961. }
  23962. if (props.width) {
  23963. style2[`${varPrefix}-width`] = addUnit(props.width);
  23964. }
  23965. }
  23966. return style2;
  23967. });
  23968. const overlayDialogStyle = computed$1(() => {
  23969. if (props.alignCenter) {
  23970. return { display: "flex" };
  23971. }
  23972. return {};
  23973. });
  23974. function afterEnter() {
  23975. emit("opened");
  23976. }
  23977. function afterLeave() {
  23978. emit("closed");
  23979. emit(UPDATE_MODEL_EVENT, false);
  23980. if (props.destroyOnClose) {
  23981. rendered.value = false;
  23982. }
  23983. }
  23984. function beforeLeave() {
  23985. emit("close");
  23986. }
  23987. function open() {
  23988. closeTimer == null ? void 0 : closeTimer();
  23989. openTimer == null ? void 0 : openTimer();
  23990. if (props.openDelay && props.openDelay > 0) {
  23991. ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
  23992. } else {
  23993. doOpen();
  23994. }
  23995. }
  23996. function close() {
  23997. openTimer == null ? void 0 : openTimer();
  23998. closeTimer == null ? void 0 : closeTimer();
  23999. if (props.closeDelay && props.closeDelay > 0) {
  24000. ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
  24001. } else {
  24002. doClose();
  24003. }
  24004. }
  24005. function handleClose() {
  24006. function hide(shouldCancel) {
  24007. if (shouldCancel)
  24008. return;
  24009. closed.value = true;
  24010. visible.value = false;
  24011. }
  24012. if (props.beforeClose) {
  24013. props.beforeClose(hide);
  24014. } else {
  24015. close();
  24016. }
  24017. }
  24018. function onModalClick() {
  24019. if (props.closeOnClickModal) {
  24020. handleClose();
  24021. }
  24022. }
  24023. function doOpen() {
  24024. if (!isClient)
  24025. return;
  24026. visible.value = true;
  24027. }
  24028. function doClose() {
  24029. visible.value = false;
  24030. }
  24031. function onOpenAutoFocus() {
  24032. emit("openAutoFocus");
  24033. }
  24034. function onCloseAutoFocus() {
  24035. emit("closeAutoFocus");
  24036. }
  24037. function onFocusoutPrevented(event2) {
  24038. var _a2;
  24039. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
  24040. event2.preventDefault();
  24041. }
  24042. }
  24043. if (props.lockScroll) {
  24044. useLockscreen(visible);
  24045. }
  24046. function onCloseRequested() {
  24047. if (props.closeOnPressEscape) {
  24048. handleClose();
  24049. }
  24050. }
  24051. watch(() => props.modelValue, (val) => {
  24052. if (val) {
  24053. closed.value = false;
  24054. open();
  24055. rendered.value = true;
  24056. zIndex2.value = props.zIndex ? zIndex2.value++ : nextZIndex();
  24057. nextTick(() => {
  24058. emit("open");
  24059. if (targetRef.value) {
  24060. targetRef.value.scrollTop = 0;
  24061. }
  24062. });
  24063. } else {
  24064. if (visible.value) {
  24065. close();
  24066. }
  24067. }
  24068. });
  24069. watch(() => props.fullscreen, (val) => {
  24070. if (!targetRef.value)
  24071. return;
  24072. if (val) {
  24073. lastPosition = targetRef.value.style.transform;
  24074. targetRef.value.style.transform = "";
  24075. } else {
  24076. targetRef.value.style.transform = lastPosition;
  24077. }
  24078. });
  24079. onMounted(() => {
  24080. if (props.modelValue) {
  24081. visible.value = true;
  24082. rendered.value = true;
  24083. open();
  24084. }
  24085. });
  24086. return {
  24087. afterEnter,
  24088. afterLeave,
  24089. beforeLeave,
  24090. handleClose,
  24091. onModalClick,
  24092. close,
  24093. doClose,
  24094. onOpenAutoFocus,
  24095. onCloseAutoFocus,
  24096. onCloseRequested,
  24097. onFocusoutPrevented,
  24098. titleId,
  24099. bodyId,
  24100. closed,
  24101. style,
  24102. overlayDialogStyle,
  24103. rendered,
  24104. visible,
  24105. zIndex: zIndex2
  24106. };
  24107. };
  24108. const _hoisted_1$6 = ["aria-label", "aria-labelledby", "aria-describedby"];
  24109. const __default__$2 = defineComponent({
  24110. name: "ElDialog",
  24111. inheritAttrs: false
  24112. });
  24113. const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  24114. ...__default__$2,
  24115. props: dialogProps,
  24116. emits: dialogEmits,
  24117. setup(__props, { expose }) {
  24118. const props = __props;
  24119. const slots = useSlots();
  24120. useDeprecated({
  24121. scope: "el-dialog",
  24122. from: "the title slot",
  24123. replacement: "the header slot",
  24124. version: "3.0.0",
  24125. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  24126. }, computed$1(() => !!slots.title));
  24127. useDeprecated({
  24128. scope: "el-dialog",
  24129. from: "custom-class",
  24130. replacement: "class",
  24131. version: "2.3.0",
  24132. ref: "https://element-plus.org/en-US/component/dialog.html#attributes",
  24133. type: "Attribute"
  24134. }, computed$1(() => !!props.customClass));
  24135. const ns = useNamespace("dialog");
  24136. const dialogRef = ref();
  24137. const headerRef = ref();
  24138. const dialogContentRef = ref();
  24139. const {
  24140. visible,
  24141. titleId,
  24142. bodyId,
  24143. style,
  24144. overlayDialogStyle,
  24145. rendered,
  24146. zIndex: zIndex2,
  24147. afterEnter,
  24148. afterLeave,
  24149. beforeLeave,
  24150. handleClose,
  24151. onModalClick,
  24152. onOpenAutoFocus,
  24153. onCloseAutoFocus,
  24154. onCloseRequested,
  24155. onFocusoutPrevented
  24156. } = useDialog(props, dialogRef);
  24157. provide(dialogInjectionKey, {
  24158. dialogRef,
  24159. headerRef,
  24160. bodyId,
  24161. ns,
  24162. rendered,
  24163. style
  24164. });
  24165. const overlayEvent = useSameTarget(onModalClick);
  24166. const draggable2 = computed$1(() => props.draggable && !props.fullscreen);
  24167. expose({
  24168. visible,
  24169. dialogContentRef
  24170. });
  24171. return (_ctx, _cache) => {
  24172. return openBlock(), createBlock(Teleport, {
  24173. to: "body",
  24174. disabled: !_ctx.appendToBody
  24175. }, [
  24176. createVNode(Transition, {
  24177. name: "dialog-fade",
  24178. onAfterEnter: unref(afterEnter),
  24179. onAfterLeave: unref(afterLeave),
  24180. onBeforeLeave: unref(beforeLeave),
  24181. persisted: ""
  24182. }, {
  24183. default: withCtx(() => [
  24184. withDirectives(createVNode(unref(ElOverlay), {
  24185. "custom-mask-event": "",
  24186. mask: _ctx.modal,
  24187. "overlay-class": _ctx.modalClass,
  24188. "z-index": unref(zIndex2)
  24189. }, {
  24190. default: withCtx(() => [
  24191. createElementVNode("div", {
  24192. role: "dialog",
  24193. "aria-modal": "true",
  24194. "aria-label": _ctx.title || void 0,
  24195. "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
  24196. "aria-describedby": unref(bodyId),
  24197. class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
  24198. style: normalizeStyle(unref(overlayDialogStyle)),
  24199. onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
  24200. onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
  24201. onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
  24202. }, [
  24203. createVNode(unref(ElFocusTrap), {
  24204. loop: "",
  24205. trapped: unref(visible),
  24206. "focus-start-el": "container",
  24207. onFocusAfterTrapped: unref(onOpenAutoFocus),
  24208. onFocusAfterReleased: unref(onCloseAutoFocus),
  24209. onFocusoutPrevented: unref(onFocusoutPrevented),
  24210. onReleaseRequested: unref(onCloseRequested)
  24211. }, {
  24212. default: withCtx(() => [
  24213. unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
  24214. key: 0,
  24215. ref_key: "dialogContentRef",
  24216. ref: dialogContentRef
  24217. }, _ctx.$attrs, {
  24218. "custom-class": _ctx.customClass,
  24219. center: _ctx.center,
  24220. "align-center": _ctx.alignCenter,
  24221. "close-icon": _ctx.closeIcon,
  24222. draggable: unref(draggable2),
  24223. fullscreen: _ctx.fullscreen,
  24224. "show-close": _ctx.showClose,
  24225. title: _ctx.title,
  24226. onClose: unref(handleClose)
  24227. }), createSlots({
  24228. header: withCtx(() => [
  24229. !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
  24230. key: 0,
  24231. close: unref(handleClose),
  24232. titleId: unref(titleId),
  24233. titleClass: unref(ns).e("title")
  24234. }) : renderSlot(_ctx.$slots, "title", { key: 1 })
  24235. ]),
  24236. default: withCtx(() => [
  24237. renderSlot(_ctx.$slots, "default")
  24238. ]),
  24239. _: 2
  24240. }, [
  24241. _ctx.$slots.footer ? {
  24242. name: "footer",
  24243. fn: withCtx(() => [
  24244. renderSlot(_ctx.$slots, "footer")
  24245. ])
  24246. } : void 0
  24247. ]), 1040, ["custom-class", "center", "align-center", "close-icon", "draggable", "fullscreen", "show-close", "title", "onClose"])) : createCommentVNode("v-if", true)
  24248. ]),
  24249. _: 3
  24250. }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
  24251. ], 46, _hoisted_1$6)
  24252. ]),
  24253. _: 3
  24254. }, 8, ["mask", "overlay-class", "z-index"]), [
  24255. [vShow, unref(visible)]
  24256. ])
  24257. ]),
  24258. _: 3
  24259. }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
  24260. ], 8, ["disabled"]);
  24261. };
  24262. }
  24263. });
  24264. var Dialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);
  24265. const ElDialog = withInstall(Dialog);
  24266. const inputNumberProps = buildProps({
  24267. id: {
  24268. type: String,
  24269. default: void 0
  24270. },
  24271. step: {
  24272. type: Number,
  24273. default: 1
  24274. },
  24275. stepStrictly: Boolean,
  24276. max: {
  24277. type: Number,
  24278. default: Number.POSITIVE_INFINITY
  24279. },
  24280. min: {
  24281. type: Number,
  24282. default: Number.NEGATIVE_INFINITY
  24283. },
  24284. modelValue: Number,
  24285. readonly: Boolean,
  24286. disabled: Boolean,
  24287. size: useSizeProp,
  24288. controls: {
  24289. type: Boolean,
  24290. default: true
  24291. },
  24292. controlsPosition: {
  24293. type: String,
  24294. default: "",
  24295. values: ["", "right"]
  24296. },
  24297. valueOnClear: {
  24298. type: [String, Number, null],
  24299. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  24300. default: null
  24301. },
  24302. name: String,
  24303. label: String,
  24304. placeholder: String,
  24305. precision: {
  24306. type: Number,
  24307. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  24308. },
  24309. validateEvent: {
  24310. type: Boolean,
  24311. default: true
  24312. }
  24313. });
  24314. const inputNumberEmits = {
  24315. [CHANGE_EVENT]: (cur, prev) => prev !== cur,
  24316. blur: (e) => e instanceof FocusEvent,
  24317. focus: (e) => e instanceof FocusEvent,
  24318. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  24319. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  24320. };
  24321. const _hoisted_1$5 = ["aria-label", "onKeydown"];
  24322. const _hoisted_2$5 = ["aria-label", "onKeydown"];
  24323. const __default__$1 = defineComponent({
  24324. name: "ElInputNumber"
  24325. });
  24326. const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  24327. ...__default__$1,
  24328. props: inputNumberProps,
  24329. emits: inputNumberEmits,
  24330. setup(__props, { expose, emit }) {
  24331. const props = __props;
  24332. const { t: t2 } = useLocale();
  24333. const ns = useNamespace("input-number");
  24334. const input = ref();
  24335. const data = reactive({
  24336. currentValue: props.modelValue,
  24337. userInput: null
  24338. });
  24339. const { formItem } = useFormItem();
  24340. const minDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  24341. const maxDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  24342. const numPrecision = computed$1(() => {
  24343. const stepPrecision = getPrecision(props.step);
  24344. if (!isUndefined(props.precision)) {
  24345. if (stepPrecision > props.precision)
  24346. ;
  24347. return props.precision;
  24348. } else {
  24349. return Math.max(getPrecision(props.modelValue), stepPrecision);
  24350. }
  24351. });
  24352. const controlsAtRight = computed$1(() => {
  24353. return props.controls && props.controlsPosition === "right";
  24354. });
  24355. const inputNumberSize = useFormSize();
  24356. const inputNumberDisabled = useFormDisabled();
  24357. const displayValue = computed$1(() => {
  24358. if (data.userInput !== null) {
  24359. return data.userInput;
  24360. }
  24361. let currentValue = data.currentValue;
  24362. if (isNil(currentValue))
  24363. return "";
  24364. if (isNumber(currentValue)) {
  24365. if (Number.isNaN(currentValue))
  24366. return "";
  24367. if (!isUndefined(props.precision)) {
  24368. currentValue = currentValue.toFixed(props.precision);
  24369. }
  24370. }
  24371. return currentValue;
  24372. });
  24373. const toPrecision = (num, pre) => {
  24374. if (isUndefined(pre))
  24375. pre = numPrecision.value;
  24376. if (pre === 0)
  24377. return Math.round(num);
  24378. let snum = String(num);
  24379. const pointPos = snum.indexOf(".");
  24380. if (pointPos === -1)
  24381. return num;
  24382. const nums = snum.replace(".", "").split("");
  24383. const datum = nums[pointPos + pre];
  24384. if (!datum)
  24385. return num;
  24386. const length = snum.length;
  24387. if (snum.charAt(length - 1) === "5") {
  24388. snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  24389. }
  24390. return Number.parseFloat(Number(snum).toFixed(pre));
  24391. };
  24392. const getPrecision = (value) => {
  24393. if (isNil(value))
  24394. return 0;
  24395. const valueString = value.toString();
  24396. const dotPosition = valueString.indexOf(".");
  24397. let precision = 0;
  24398. if (dotPosition !== -1) {
  24399. precision = valueString.length - dotPosition - 1;
  24400. }
  24401. return precision;
  24402. };
  24403. const ensurePrecision = (val, coefficient = 1) => {
  24404. if (!isNumber(val))
  24405. return data.currentValue;
  24406. return toPrecision(val + props.step * coefficient);
  24407. };
  24408. const increase = () => {
  24409. if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
  24410. return;
  24411. const value = Number(displayValue.value) || 0;
  24412. const newVal = ensurePrecision(value);
  24413. setCurrentValue(newVal);
  24414. emit(INPUT_EVENT, data.currentValue);
  24415. };
  24416. const decrease = () => {
  24417. if (props.readonly || inputNumberDisabled.value || minDisabled.value)
  24418. return;
  24419. const value = Number(displayValue.value) || 0;
  24420. const newVal = ensurePrecision(value, -1);
  24421. setCurrentValue(newVal);
  24422. emit(INPUT_EVENT, data.currentValue);
  24423. };
  24424. const verifyValue = (value, update) => {
  24425. const { max: max2, min: min2, step, precision, stepStrictly, valueOnClear } = props;
  24426. let newVal = Number(value);
  24427. if (isNil(value) || Number.isNaN(newVal)) {
  24428. return null;
  24429. }
  24430. if (value === "") {
  24431. if (valueOnClear === null) {
  24432. return null;
  24433. }
  24434. newVal = isString(valueOnClear) ? { min: min2, max: max2 }[valueOnClear] : valueOnClear;
  24435. }
  24436. if (stepStrictly) {
  24437. newVal = toPrecision(Math.round(newVal / step) * step, precision);
  24438. }
  24439. if (!isUndefined(precision)) {
  24440. newVal = toPrecision(newVal, precision);
  24441. }
  24442. if (newVal > max2 || newVal < min2) {
  24443. newVal = newVal > max2 ? max2 : min2;
  24444. update && emit(UPDATE_MODEL_EVENT, newVal);
  24445. }
  24446. return newVal;
  24447. };
  24448. const setCurrentValue = (value, emitChange = true) => {
  24449. var _a2;
  24450. const oldVal = data.currentValue;
  24451. const newVal = verifyValue(value);
  24452. if (!emitChange) {
  24453. emit(UPDATE_MODEL_EVENT, newVal);
  24454. return;
  24455. }
  24456. if (oldVal === newVal)
  24457. return;
  24458. data.userInput = null;
  24459. emit(UPDATE_MODEL_EVENT, newVal);
  24460. emit(CHANGE_EVENT, newVal, oldVal);
  24461. if (props.validateEvent) {
  24462. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  24463. }
  24464. data.currentValue = newVal;
  24465. };
  24466. const handleInput = (value) => {
  24467. data.userInput = value;
  24468. const newVal = value === "" ? null : Number(value);
  24469. emit(INPUT_EVENT, newVal);
  24470. setCurrentValue(newVal, false);
  24471. };
  24472. const handleInputChange = (value) => {
  24473. const newVal = value !== "" ? Number(value) : "";
  24474. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
  24475. setCurrentValue(newVal);
  24476. }
  24477. data.userInput = null;
  24478. };
  24479. const focus = () => {
  24480. var _a2, _b;
  24481. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  24482. };
  24483. const blur = () => {
  24484. var _a2, _b;
  24485. (_b = (_a2 = input.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
  24486. };
  24487. const handleFocus = (event2) => {
  24488. emit("focus", event2);
  24489. };
  24490. const handleBlur = (event2) => {
  24491. var _a2;
  24492. emit("blur", event2);
  24493. if (props.validateEvent) {
  24494. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  24495. }
  24496. };
  24497. watch(() => props.modelValue, (value) => {
  24498. const userInput = verifyValue(data.userInput);
  24499. const newValue = verifyValue(value, true);
  24500. if (!isNumber(userInput) && (!userInput || userInput !== newValue)) {
  24501. data.currentValue = newValue;
  24502. data.userInput = null;
  24503. }
  24504. }, { immediate: true });
  24505. onMounted(() => {
  24506. var _a2;
  24507. const { min: min2, max: max2, modelValue } = props;
  24508. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24509. innerInput.setAttribute("role", "spinbutton");
  24510. if (Number.isFinite(max2)) {
  24511. innerInput.setAttribute("aria-valuemax", String(max2));
  24512. } else {
  24513. innerInput.removeAttribute("aria-valuemax");
  24514. }
  24515. if (Number.isFinite(min2)) {
  24516. innerInput.setAttribute("aria-valuemin", String(min2));
  24517. } else {
  24518. innerInput.removeAttribute("aria-valuemin");
  24519. }
  24520. innerInput.setAttribute("aria-valuenow", String(data.currentValue));
  24521. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  24522. if (!isNumber(modelValue) && modelValue != null) {
  24523. let val = Number(modelValue);
  24524. if (Number.isNaN(val)) {
  24525. val = null;
  24526. }
  24527. emit(UPDATE_MODEL_EVENT, val);
  24528. }
  24529. });
  24530. onUpdated(() => {
  24531. var _a2;
  24532. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24533. innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${data.currentValue}`);
  24534. });
  24535. expose({
  24536. focus,
  24537. blur
  24538. });
  24539. return (_ctx, _cache) => {
  24540. return openBlock(), createElementBlock("div", {
  24541. class: normalizeClass([
  24542. unref(ns).b(),
  24543. unref(ns).m(unref(inputNumberSize)),
  24544. unref(ns).is("disabled", unref(inputNumberDisabled)),
  24545. unref(ns).is("without-controls", !_ctx.controls),
  24546. unref(ns).is("controls-right", unref(controlsAtRight))
  24547. ]),
  24548. onDragstart: _cache[1] || (_cache[1] = withModifiers(() => {
  24549. }, ["prevent"]))
  24550. }, [
  24551. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24552. key: 0,
  24553. role: "button",
  24554. "aria-label": unref(t2)("el.inputNumber.decrease"),
  24555. class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
  24556. onKeydown: withKeys(decrease, ["enter"])
  24557. }, [
  24558. createVNode(unref(ElIcon), null, {
  24559. default: withCtx(() => [
  24560. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))
  24561. ]),
  24562. _: 1
  24563. })
  24564. ], 42, _hoisted_1$5)), [
  24565. [unref(vRepeatClick), decrease]
  24566. ]) : createCommentVNode("v-if", true),
  24567. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24568. key: 1,
  24569. role: "button",
  24570. "aria-label": unref(t2)("el.inputNumber.increase"),
  24571. class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
  24572. onKeydown: withKeys(increase, ["enter"])
  24573. }, [
  24574. createVNode(unref(ElIcon), null, {
  24575. default: withCtx(() => [
  24576. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))
  24577. ]),
  24578. _: 1
  24579. })
  24580. ], 42, _hoisted_2$5)), [
  24581. [unref(vRepeatClick), increase]
  24582. ]) : createCommentVNode("v-if", true),
  24583. createVNode(unref(ElInput), {
  24584. id: _ctx.id,
  24585. ref_key: "input",
  24586. ref: input,
  24587. type: "number",
  24588. step: _ctx.step,
  24589. "model-value": unref(displayValue),
  24590. placeholder: _ctx.placeholder,
  24591. readonly: _ctx.readonly,
  24592. disabled: unref(inputNumberDisabled),
  24593. size: unref(inputNumberSize),
  24594. max: _ctx.max,
  24595. min: _ctx.min,
  24596. name: _ctx.name,
  24597. label: _ctx.label,
  24598. "validate-event": false,
  24599. onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
  24600. }, ["prevent"])),
  24601. onKeydown: [
  24602. withKeys(withModifiers(increase, ["prevent"]), ["up"]),
  24603. withKeys(withModifiers(decrease, ["prevent"]), ["down"])
  24604. ],
  24605. onBlur: handleBlur,
  24606. onFocus: handleFocus,
  24607. onInput: handleInput,
  24608. onChange: handleInputChange
  24609. }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"])
  24610. ], 34);
  24611. };
  24612. }
  24613. });
  24614. var InputNumber = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);
  24615. const ElInputNumber = withInstall(InputNumber);
  24616. const selectGroupKey = Symbol("ElSelectGroup");
  24617. const selectKey = Symbol("ElSelect");
  24618. function useOption(props, states) {
  24619. const select = inject(selectKey);
  24620. const selectGroup = inject(selectGroupKey, { disabled: false });
  24621. const isObject3 = computed$1(() => {
  24622. return Object.prototype.toString.call(props.value).toLowerCase() === "[object object]";
  24623. });
  24624. const itemSelected = computed$1(() => {
  24625. if (!select.props.multiple) {
  24626. return isEqual2(props.value, select.props.modelValue);
  24627. } else {
  24628. return contains(select.props.modelValue, props.value);
  24629. }
  24630. });
  24631. const limitReached = computed$1(() => {
  24632. if (select.props.multiple) {
  24633. const modelValue = select.props.modelValue || [];
  24634. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  24635. } else {
  24636. return false;
  24637. }
  24638. });
  24639. const currentLabel = computed$1(() => {
  24640. return props.label || (isObject3.value ? "" : props.value);
  24641. });
  24642. const currentValue = computed$1(() => {
  24643. return props.value || props.label || "";
  24644. });
  24645. const isDisabled3 = computed$1(() => {
  24646. return props.disabled || states.groupDisabled || limitReached.value;
  24647. });
  24648. const instance = getCurrentInstance();
  24649. const contains = (arr = [], target) => {
  24650. if (!isObject3.value) {
  24651. return arr && arr.includes(target);
  24652. } else {
  24653. const valueKey = select.props.valueKey;
  24654. return arr && arr.some((item) => {
  24655. return toRaw$1(get$2(item, valueKey)) === get$2(target, valueKey);
  24656. });
  24657. }
  24658. };
  24659. const isEqual2 = (a, b) => {
  24660. if (!isObject3.value) {
  24661. return a === b;
  24662. } else {
  24663. const { valueKey } = select.props;
  24664. return get$2(a, valueKey) === get$2(b, valueKey);
  24665. }
  24666. };
  24667. const hoverItem = () => {
  24668. if (!props.disabled && !selectGroup.disabled) {
  24669. select.hoverIndex = select.optionsArray.indexOf(instance.proxy);
  24670. }
  24671. };
  24672. watch(() => currentLabel.value, () => {
  24673. if (!props.created && !select.props.remote)
  24674. select.setSelected();
  24675. });
  24676. watch(() => props.value, (val, oldVal) => {
  24677. const { remote, valueKey } = select.props;
  24678. if (!Object.is(val, oldVal)) {
  24679. select.onOptionDestroy(oldVal, instance.proxy);
  24680. select.onOptionCreate(instance.proxy);
  24681. }
  24682. if (!props.created && !remote) {
  24683. if (valueKey && typeof val === "object" && typeof oldVal === "object" && val[valueKey] === oldVal[valueKey]) {
  24684. return;
  24685. }
  24686. select.setSelected();
  24687. }
  24688. });
  24689. watch(() => selectGroup.disabled, () => {
  24690. states.groupDisabled = selectGroup.disabled;
  24691. }, { immediate: true });
  24692. const { queryChange } = toRaw$1(select);
  24693. watch(queryChange, (changes) => {
  24694. const { query } = unref(changes);
  24695. const regexp = new RegExp(escapeStringRegexp(query), "i");
  24696. states.visible = regexp.test(currentLabel.value) || props.created;
  24697. if (!states.visible) {
  24698. select.filteredOptionsCount--;
  24699. }
  24700. }, { immediate: true });
  24701. return {
  24702. select,
  24703. currentLabel,
  24704. currentValue,
  24705. itemSelected,
  24706. isDisabled: isDisabled3,
  24707. hoverItem
  24708. };
  24709. }
  24710. const _sfc_main$7 = defineComponent({
  24711. name: "ElOption",
  24712. componentName: "ElOption",
  24713. props: {
  24714. value: {
  24715. required: true,
  24716. type: [String, Number, Boolean, Object]
  24717. },
  24718. label: [String, Number],
  24719. created: Boolean,
  24720. disabled: {
  24721. type: Boolean,
  24722. default: false
  24723. }
  24724. },
  24725. setup(props) {
  24726. const ns = useNamespace("select");
  24727. const states = reactive({
  24728. index: -1,
  24729. groupDisabled: false,
  24730. visible: true,
  24731. hitState: false,
  24732. hover: false
  24733. });
  24734. const { currentLabel, itemSelected, isDisabled: isDisabled3, select, hoverItem } = useOption(props, states);
  24735. const { visible, hover } = toRefs(states);
  24736. const vm = getCurrentInstance().proxy;
  24737. select.onOptionCreate(vm);
  24738. onBeforeUnmount(() => {
  24739. const key = vm.value;
  24740. const { selected } = select;
  24741. const selectedOptions = select.props.multiple ? selected : [selected];
  24742. const doesSelected = selectedOptions.some((item) => {
  24743. return item.value === vm.value;
  24744. });
  24745. nextTick(() => {
  24746. if (select.cachedOptions.get(key) === vm && !doesSelected) {
  24747. select.cachedOptions.delete(key);
  24748. }
  24749. });
  24750. select.onOptionDestroy(key, vm);
  24751. });
  24752. function selectOptionClick() {
  24753. if (props.disabled !== true && states.groupDisabled !== true) {
  24754. select.handleOptionSelect(vm, true);
  24755. }
  24756. }
  24757. return {
  24758. ns,
  24759. currentLabel,
  24760. itemSelected,
  24761. isDisabled: isDisabled3,
  24762. select,
  24763. hoverItem,
  24764. visible,
  24765. hover,
  24766. selectOptionClick,
  24767. states
  24768. };
  24769. }
  24770. });
  24771. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  24772. return withDirectives((openBlock(), createElementBlock("li", {
  24773. class: normalizeClass([
  24774. _ctx.ns.be("dropdown", "item"),
  24775. _ctx.ns.is("disabled", _ctx.isDisabled),
  24776. {
  24777. selected: _ctx.itemSelected,
  24778. hover: _ctx.hover
  24779. }
  24780. ]),
  24781. onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  24782. onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  24783. }, [
  24784. renderSlot(_ctx.$slots, "default", {}, () => [
  24785. createElementVNode("span", null, toDisplayString(_ctx.currentLabel), 1)
  24786. ])
  24787. ], 34)), [
  24788. [vShow, _ctx.visible]
  24789. ]);
  24790. }
  24791. var Option = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$3], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);
  24792. const _sfc_main$6 = defineComponent({
  24793. name: "ElSelectDropdown",
  24794. componentName: "ElSelectDropdown",
  24795. setup() {
  24796. const select = inject(selectKey);
  24797. const ns = useNamespace("select");
  24798. const popperClass = computed$1(() => select.props.popperClass);
  24799. const isMultiple = computed$1(() => select.props.multiple);
  24800. const isFitInputWidth = computed$1(() => select.props.fitInputWidth);
  24801. const minWidth = ref("");
  24802. function updateMinWidth() {
  24803. var _a2;
  24804. minWidth.value = `${(_a2 = select.selectWrapper) == null ? void 0 : _a2.offsetWidth}px`;
  24805. }
  24806. onMounted(() => {
  24807. updateMinWidth();
  24808. useResizeObserver(select.selectWrapper, updateMinWidth);
  24809. });
  24810. return {
  24811. ns,
  24812. minWidth,
  24813. popperClass,
  24814. isMultiple,
  24815. isFitInputWidth
  24816. };
  24817. }
  24818. });
  24819. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  24820. return openBlock(), createElementBlock("div", {
  24821. class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
  24822. style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  24823. }, [
  24824. renderSlot(_ctx.$slots, "default")
  24825. ], 6);
  24826. }
  24827. var ElSelectMenu = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$2], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);
  24828. function useSelectStates(props) {
  24829. const { t: t2 } = useLocale();
  24830. return reactive({
  24831. options: /* @__PURE__ */ new Map(),
  24832. cachedOptions: /* @__PURE__ */ new Map(),
  24833. createdLabel: null,
  24834. createdSelected: false,
  24835. selected: props.multiple ? [] : {},
  24836. inputLength: 20,
  24837. inputWidth: 0,
  24838. optionsCount: 0,
  24839. filteredOptionsCount: 0,
  24840. visible: false,
  24841. softFocus: false,
  24842. selectedLabel: "",
  24843. hoverIndex: -1,
  24844. query: "",
  24845. previousQuery: null,
  24846. inputHovering: false,
  24847. cachedPlaceHolder: "",
  24848. currentPlaceholder: t2("el.select.placeholder"),
  24849. menuVisibleOnFocus: false,
  24850. isOnComposition: false,
  24851. isSilentBlur: false,
  24852. prefixWidth: 11,
  24853. tagInMultiLine: false,
  24854. mouseEnter: false
  24855. });
  24856. }
  24857. const useSelect = (props, states, ctx) => {
  24858. const { t: t2 } = useLocale();
  24859. const ns = useNamespace("select");
  24860. useDeprecated({
  24861. from: "suffixTransition",
  24862. replacement: "override style scheme",
  24863. version: "2.3.0",
  24864. scope: "props",
  24865. ref: "https://element-plus.org/en-US/component/select.html#select-attributes"
  24866. }, computed$1(() => props.suffixTransition === false));
  24867. const reference = ref(null);
  24868. const input = ref(null);
  24869. const iOSInput = ref(null);
  24870. const tooltipRef = ref(null);
  24871. const tags = ref(null);
  24872. const selectWrapper = ref(null);
  24873. const scrollbar = ref(null);
  24874. const hoverOption = ref(-1);
  24875. const queryChange = shallowRef({ query: "" });
  24876. const groupQueryChange = shallowRef("");
  24877. const optionList = ref([]);
  24878. let originClientHeight = 0;
  24879. const { form, formItem } = useFormItem();
  24880. const readonly2 = computed$1(() => !props.filterable || props.multiple || !states.visible);
  24881. const selectDisabled = computed$1(() => props.disabled || (form == null ? void 0 : form.disabled));
  24882. const showClose = computed$1(() => {
  24883. const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : props.modelValue !== void 0 && props.modelValue !== null && props.modelValue !== "";
  24884. const criteria = props.clearable && !selectDisabled.value && states.inputHovering && hasValue;
  24885. return criteria;
  24886. });
  24887. const iconComponent = computed$1(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  24888. const iconReverse = computed$1(() => ns.is("reverse", iconComponent.value && states.visible && props.suffixTransition));
  24889. const debounce$12 = computed$1(() => props.remote ? 300 : 0);
  24890. const emptyText = computed$1(() => {
  24891. if (props.loading) {
  24892. return props.loadingText || t2("el.select.loading");
  24893. } else {
  24894. if (props.remote && states.query === "" && states.options.size === 0)
  24895. return false;
  24896. if (props.filterable && states.query && states.options.size > 0 && states.filteredOptionsCount === 0) {
  24897. return props.noMatchText || t2("el.select.noMatch");
  24898. }
  24899. if (states.options.size === 0) {
  24900. return props.noDataText || t2("el.select.noData");
  24901. }
  24902. }
  24903. return null;
  24904. });
  24905. const optionsArray = computed$1(() => {
  24906. const list = Array.from(states.options.values());
  24907. const newList = [];
  24908. optionList.value.forEach((item) => {
  24909. const index2 = list.findIndex((i2) => i2.currentLabel === item);
  24910. if (index2 > -1) {
  24911. newList.push(list[index2]);
  24912. }
  24913. });
  24914. return newList.length ? newList : list;
  24915. });
  24916. const cachedOptionsArray = computed$1(() => Array.from(states.cachedOptions.values()));
  24917. const showNewOption = computed$1(() => {
  24918. const hasExistingOption = optionsArray.value.filter((option) => {
  24919. return !option.created;
  24920. }).some((option) => {
  24921. return option.currentLabel === states.query;
  24922. });
  24923. return props.filterable && props.allowCreate && states.query !== "" && !hasExistingOption;
  24924. });
  24925. const selectSize = useFormSize();
  24926. const collapseTagSize = computed$1(() => ["small"].includes(selectSize.value) ? "small" : "default");
  24927. const dropMenuVisible = computed$1({
  24928. get() {
  24929. return states.visible && emptyText.value !== false;
  24930. },
  24931. set(val) {
  24932. states.visible = val;
  24933. }
  24934. });
  24935. watch([() => selectDisabled.value, () => selectSize.value, () => form == null ? void 0 : form.size], () => {
  24936. nextTick(() => {
  24937. resetInputHeight();
  24938. });
  24939. });
  24940. watch(() => props.placeholder, (val) => {
  24941. states.cachedPlaceHolder = states.currentPlaceholder = val;
  24942. });
  24943. watch(() => props.modelValue, (val, oldVal) => {
  24944. if (props.multiple) {
  24945. resetInputHeight();
  24946. if (val && val.length > 0 || input.value && states.query !== "") {
  24947. states.currentPlaceholder = "";
  24948. } else {
  24949. states.currentPlaceholder = states.cachedPlaceHolder;
  24950. }
  24951. if (props.filterable && !props.reserveKeyword) {
  24952. states.query = "";
  24953. handleQueryChange(states.query);
  24954. }
  24955. }
  24956. setSelected();
  24957. if (props.filterable && !props.multiple) {
  24958. states.inputLength = 20;
  24959. }
  24960. if (!isEqual(val, oldVal) && props.validateEvent) {
  24961. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  24962. }
  24963. }, {
  24964. flush: "post",
  24965. deep: true
  24966. });
  24967. watch(() => states.visible, (val) => {
  24968. var _a2, _b, _c, _d, _e;
  24969. if (!val) {
  24970. if (props.filterable) {
  24971. if (isFunction$3(props.filterMethod)) {
  24972. props.filterMethod("");
  24973. }
  24974. if (isFunction$3(props.remoteMethod)) {
  24975. props.remoteMethod("");
  24976. }
  24977. }
  24978. input.value && input.value.blur();
  24979. states.query = "";
  24980. states.previousQuery = null;
  24981. states.selectedLabel = "";
  24982. states.inputLength = 20;
  24983. states.menuVisibleOnFocus = false;
  24984. resetHoverIndex();
  24985. nextTick(() => {
  24986. if (input.value && input.value.value === "" && states.selected.length === 0) {
  24987. states.currentPlaceholder = states.cachedPlaceHolder;
  24988. }
  24989. });
  24990. if (!props.multiple) {
  24991. if (states.selected) {
  24992. if (props.filterable && props.allowCreate && states.createdSelected && states.createdLabel) {
  24993. states.selectedLabel = states.createdLabel;
  24994. } else {
  24995. states.selectedLabel = states.selected.currentLabel;
  24996. }
  24997. if (props.filterable)
  24998. states.query = states.selectedLabel;
  24999. }
  25000. if (props.filterable) {
  25001. states.currentPlaceholder = states.cachedPlaceHolder;
  25002. }
  25003. }
  25004. } else {
  25005. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25006. if (props.filterable) {
  25007. states.filteredOptionsCount = states.optionsCount;
  25008. states.query = props.remote ? "" : states.selectedLabel;
  25009. (_d = (_c = iOSInput.value) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
  25010. if (props.multiple) {
  25011. (_e = input.value) == null ? void 0 : _e.focus();
  25012. } else {
  25013. if (states.selectedLabel) {
  25014. states.currentPlaceholder = `${states.selectedLabel}`;
  25015. states.selectedLabel = "";
  25016. }
  25017. }
  25018. handleQueryChange(states.query);
  25019. if (!props.multiple && !props.remote) {
  25020. queryChange.value.query = "";
  25021. triggerRef(queryChange);
  25022. triggerRef(groupQueryChange);
  25023. }
  25024. }
  25025. }
  25026. ctx.emit("visible-change", val);
  25027. });
  25028. watch(() => states.options.entries(), () => {
  25029. var _a2, _b, _c;
  25030. if (!isClient)
  25031. return;
  25032. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25033. if (props.multiple) {
  25034. resetInputHeight();
  25035. }
  25036. const inputs = ((_c = selectWrapper.value) == null ? void 0 : _c.querySelectorAll("input")) || [];
  25037. if (!Array.from(inputs).includes(document.activeElement)) {
  25038. setSelected();
  25039. }
  25040. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  25041. checkDefaultFirstOption();
  25042. }
  25043. }, {
  25044. flush: "post"
  25045. });
  25046. watch(() => states.hoverIndex, (val) => {
  25047. if (isNumber(val) && val > -1) {
  25048. hoverOption.value = optionsArray.value[val] || {};
  25049. } else {
  25050. hoverOption.value = {};
  25051. }
  25052. optionsArray.value.forEach((option) => {
  25053. option.hover = hoverOption.value === option;
  25054. });
  25055. });
  25056. const resetInputHeight = () => {
  25057. nextTick(() => {
  25058. var _a2, _b;
  25059. if (!reference.value)
  25060. return;
  25061. const input2 = reference.value.$el.querySelector("input");
  25062. originClientHeight = originClientHeight || (input2.clientHeight > 0 ? input2.clientHeight + 2 : 0);
  25063. const _tags = tags.value;
  25064. const gotSize = getComponentSize(selectSize.value || (form == null ? void 0 : form.size));
  25065. const sizeInMap = selectSize.value || gotSize === originClientHeight || originClientHeight <= 0 ? gotSize : originClientHeight;
  25066. const isElHidden = input2.offsetParent === null;
  25067. !isElHidden && (input2.style.height = `${(states.selected.length === 0 ? sizeInMap : Math.max(_tags ? _tags.clientHeight + (_tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap)) - 2}px`);
  25068. states.tagInMultiLine = Number.parseFloat(input2.style.height) >= sizeInMap;
  25069. if (states.visible && emptyText.value !== false) {
  25070. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25071. }
  25072. });
  25073. };
  25074. const handleQueryChange = async (val) => {
  25075. if (states.previousQuery === val || states.isOnComposition)
  25076. return;
  25077. if (states.previousQuery === null && (isFunction$3(props.filterMethod) || isFunction$3(props.remoteMethod))) {
  25078. states.previousQuery = val;
  25079. return;
  25080. }
  25081. states.previousQuery = val;
  25082. nextTick(() => {
  25083. var _a2, _b;
  25084. if (states.visible)
  25085. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25086. });
  25087. states.hoverIndex = -1;
  25088. if (props.multiple && props.filterable) {
  25089. nextTick(() => {
  25090. const length = input.value.value.length * 15 + 20;
  25091. states.inputLength = props.collapseTags ? Math.min(50, length) : length;
  25092. managePlaceholder();
  25093. resetInputHeight();
  25094. });
  25095. }
  25096. if (props.remote && isFunction$3(props.remoteMethod)) {
  25097. states.hoverIndex = -1;
  25098. props.remoteMethod(val);
  25099. } else if (isFunction$3(props.filterMethod)) {
  25100. props.filterMethod(val);
  25101. triggerRef(groupQueryChange);
  25102. } else {
  25103. states.filteredOptionsCount = states.optionsCount;
  25104. queryChange.value.query = val;
  25105. triggerRef(queryChange);
  25106. triggerRef(groupQueryChange);
  25107. }
  25108. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  25109. await nextTick();
  25110. checkDefaultFirstOption();
  25111. }
  25112. };
  25113. const managePlaceholder = () => {
  25114. if (states.currentPlaceholder !== "") {
  25115. states.currentPlaceholder = input.value.value ? "" : states.cachedPlaceHolder;
  25116. }
  25117. };
  25118. const checkDefaultFirstOption = () => {
  25119. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  25120. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  25121. const firstOriginOption = optionsInDropdown[0];
  25122. states.hoverIndex = getValueIndex(optionsArray.value, userCreatedOption || firstOriginOption);
  25123. };
  25124. const setSelected = () => {
  25125. var _a2;
  25126. if (!props.multiple) {
  25127. const option = getOption(props.modelValue);
  25128. if ((_a2 = option.props) == null ? void 0 : _a2.created) {
  25129. states.createdLabel = option.props.value;
  25130. states.createdSelected = true;
  25131. } else {
  25132. states.createdSelected = false;
  25133. }
  25134. states.selectedLabel = option.currentLabel;
  25135. states.selected = option;
  25136. if (props.filterable)
  25137. states.query = states.selectedLabel;
  25138. return;
  25139. } else {
  25140. states.selectedLabel = "";
  25141. }
  25142. const result = [];
  25143. if (Array.isArray(props.modelValue)) {
  25144. props.modelValue.forEach((value) => {
  25145. result.push(getOption(value));
  25146. });
  25147. }
  25148. states.selected = result;
  25149. nextTick(() => {
  25150. resetInputHeight();
  25151. });
  25152. };
  25153. const getOption = (value) => {
  25154. let option;
  25155. const isObjectValue = toRawType(value).toLowerCase() === "object";
  25156. const isNull = toRawType(value).toLowerCase() === "null";
  25157. const isUndefined2 = toRawType(value).toLowerCase() === "undefined";
  25158. for (let i2 = states.cachedOptions.size - 1; i2 >= 0; i2--) {
  25159. const cachedOption = cachedOptionsArray.value[i2];
  25160. const isEqualValue = isObjectValue ? get$2(cachedOption.value, props.valueKey) === get$2(value, props.valueKey) : cachedOption.value === value;
  25161. if (isEqualValue) {
  25162. option = {
  25163. value,
  25164. currentLabel: cachedOption.currentLabel,
  25165. isDisabled: cachedOption.isDisabled
  25166. };
  25167. break;
  25168. }
  25169. }
  25170. if (option)
  25171. return option;
  25172. const label2 = isObjectValue ? value.label : !isNull && !isUndefined2 ? value : "";
  25173. const newOption = {
  25174. value,
  25175. currentLabel: label2
  25176. };
  25177. if (props.multiple) {
  25178. newOption.hitState = false;
  25179. }
  25180. return newOption;
  25181. };
  25182. const resetHoverIndex = () => {
  25183. setTimeout(() => {
  25184. const valueKey = props.valueKey;
  25185. if (!props.multiple) {
  25186. states.hoverIndex = optionsArray.value.findIndex((item) => {
  25187. return getValueKey(item) === getValueKey(states.selected);
  25188. });
  25189. } else {
  25190. if (states.selected.length > 0) {
  25191. states.hoverIndex = Math.min.apply(null, states.selected.map((selected) => {
  25192. return optionsArray.value.findIndex((item) => {
  25193. return get$2(item, valueKey) === get$2(selected, valueKey);
  25194. });
  25195. }));
  25196. } else {
  25197. states.hoverIndex = -1;
  25198. }
  25199. }
  25200. }, 300);
  25201. };
  25202. const handleResize = () => {
  25203. var _a2, _b;
  25204. resetInputWidth();
  25205. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25206. if (props.multiple)
  25207. resetInputHeight();
  25208. };
  25209. const resetInputWidth = () => {
  25210. var _a2;
  25211. states.inputWidth = (_a2 = reference.value) == null ? void 0 : _a2.$el.offsetWidth;
  25212. };
  25213. const onInputChange = () => {
  25214. if (props.filterable && states.query !== states.selectedLabel) {
  25215. states.query = states.selectedLabel;
  25216. handleQueryChange(states.query);
  25217. }
  25218. };
  25219. const debouncedOnInputChange = debounce$2(() => {
  25220. onInputChange();
  25221. }, debounce$12.value);
  25222. const debouncedQueryChange = debounce$2((e) => {
  25223. handleQueryChange(e.target.value);
  25224. }, debounce$12.value);
  25225. const emitChange = (val) => {
  25226. if (!isEqual(props.modelValue, val)) {
  25227. ctx.emit(CHANGE_EVENT, val);
  25228. }
  25229. };
  25230. const deletePrevTag = (e) => {
  25231. if (e.code === EVENT_CODE.delete)
  25232. return;
  25233. if (e.target.value.length <= 0 && !toggleLastOptionHitState()) {
  25234. const value = props.modelValue.slice();
  25235. value.pop();
  25236. ctx.emit(UPDATE_MODEL_EVENT, value);
  25237. emitChange(value);
  25238. }
  25239. if (e.target.value.length === 1 && props.modelValue.length === 0) {
  25240. states.currentPlaceholder = states.cachedPlaceHolder;
  25241. }
  25242. };
  25243. const deleteTag = (event2, tag) => {
  25244. const index2 = states.selected.indexOf(tag);
  25245. if (index2 > -1 && !selectDisabled.value) {
  25246. const value = props.modelValue.slice();
  25247. value.splice(index2, 1);
  25248. ctx.emit(UPDATE_MODEL_EVENT, value);
  25249. emitChange(value);
  25250. ctx.emit("remove-tag", tag.value);
  25251. }
  25252. event2.stopPropagation();
  25253. };
  25254. const deleteSelected = (event2) => {
  25255. event2.stopPropagation();
  25256. const value = props.multiple ? [] : "";
  25257. if (!isString(value)) {
  25258. for (const item of states.selected) {
  25259. if (item.isDisabled)
  25260. value.push(item.value);
  25261. }
  25262. }
  25263. ctx.emit(UPDATE_MODEL_EVENT, value);
  25264. emitChange(value);
  25265. states.hoverIndex = -1;
  25266. states.visible = false;
  25267. ctx.emit("clear");
  25268. };
  25269. const handleOptionSelect = (option, byClick) => {
  25270. var _a2;
  25271. if (props.multiple) {
  25272. const value = (props.modelValue || []).slice();
  25273. const optionIndex = getValueIndex(value, option.value);
  25274. if (optionIndex > -1) {
  25275. value.splice(optionIndex, 1);
  25276. } else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
  25277. value.push(option.value);
  25278. }
  25279. ctx.emit(UPDATE_MODEL_EVENT, value);
  25280. emitChange(value);
  25281. if (option.created) {
  25282. states.query = "";
  25283. handleQueryChange("");
  25284. states.inputLength = 20;
  25285. }
  25286. if (props.filterable)
  25287. (_a2 = input.value) == null ? void 0 : _a2.focus();
  25288. } else {
  25289. ctx.emit(UPDATE_MODEL_EVENT, option.value);
  25290. emitChange(option.value);
  25291. states.visible = false;
  25292. }
  25293. states.isSilentBlur = byClick;
  25294. setSoftFocus();
  25295. if (states.visible)
  25296. return;
  25297. nextTick(() => {
  25298. scrollToOption(option);
  25299. });
  25300. };
  25301. const getValueIndex = (arr = [], value) => {
  25302. if (!isObject$5(value))
  25303. return arr.indexOf(value);
  25304. const valueKey = props.valueKey;
  25305. let index2 = -1;
  25306. arr.some((item, i2) => {
  25307. if (toRaw$1(get$2(item, valueKey)) === get$2(value, valueKey)) {
  25308. index2 = i2;
  25309. return true;
  25310. }
  25311. return false;
  25312. });
  25313. return index2;
  25314. };
  25315. const setSoftFocus = () => {
  25316. states.softFocus = true;
  25317. const _input = input.value || reference.value;
  25318. if (_input) {
  25319. _input == null ? void 0 : _input.focus();
  25320. }
  25321. };
  25322. const scrollToOption = (option) => {
  25323. var _a2, _b, _c, _d, _e;
  25324. const targetOption = Array.isArray(option) ? option[0] : option;
  25325. let target = null;
  25326. if (targetOption == null ? void 0 : targetOption.value) {
  25327. const options2 = optionsArray.value.filter((item) => item.value === targetOption.value);
  25328. if (options2.length > 0) {
  25329. target = options2[0].$el;
  25330. }
  25331. }
  25332. if (tooltipRef.value && target) {
  25333. const menu = (_d = (_c = (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${ns.be("dropdown", "wrap")}`);
  25334. if (menu) {
  25335. scrollIntoView(menu, target);
  25336. }
  25337. }
  25338. (_e = scrollbar.value) == null ? void 0 : _e.handleScroll();
  25339. };
  25340. const onOptionCreate = (vm) => {
  25341. states.optionsCount++;
  25342. states.filteredOptionsCount++;
  25343. states.options.set(vm.value, vm);
  25344. states.cachedOptions.set(vm.value, vm);
  25345. };
  25346. const onOptionDestroy = (key, vm) => {
  25347. if (states.options.get(key) === vm) {
  25348. states.optionsCount--;
  25349. states.filteredOptionsCount--;
  25350. states.options.delete(key);
  25351. }
  25352. };
  25353. const resetInputState = (e) => {
  25354. if (e.code !== EVENT_CODE.backspace)
  25355. toggleLastOptionHitState(false);
  25356. states.inputLength = input.value.value.length * 15 + 20;
  25357. resetInputHeight();
  25358. };
  25359. const toggleLastOptionHitState = (hit) => {
  25360. if (!Array.isArray(states.selected))
  25361. return;
  25362. const option = states.selected[states.selected.length - 1];
  25363. if (!option)
  25364. return;
  25365. if (hit === true || hit === false) {
  25366. option.hitState = hit;
  25367. return hit;
  25368. }
  25369. option.hitState = !option.hitState;
  25370. return option.hitState;
  25371. };
  25372. const handleComposition = (event2) => {
  25373. const text = event2.target.value;
  25374. if (event2.type === "compositionend") {
  25375. states.isOnComposition = false;
  25376. nextTick(() => handleQueryChange(text));
  25377. } else {
  25378. const lastCharacter = text[text.length - 1] || "";
  25379. states.isOnComposition = !isKorean(lastCharacter);
  25380. }
  25381. };
  25382. const handleMenuEnter = () => {
  25383. nextTick(() => scrollToOption(states.selected));
  25384. };
  25385. const handleFocus = (event2) => {
  25386. if (!states.softFocus) {
  25387. if (props.automaticDropdown || props.filterable) {
  25388. if (props.filterable && !states.visible) {
  25389. states.menuVisibleOnFocus = true;
  25390. }
  25391. states.visible = true;
  25392. }
  25393. ctx.emit("focus", event2);
  25394. } else {
  25395. states.softFocus = false;
  25396. }
  25397. };
  25398. const blur = () => {
  25399. var _a2, _b, _c;
  25400. states.visible = false;
  25401. (_a2 = reference.value) == null ? void 0 : _a2.blur();
  25402. (_c = (_b = iOSInput.value) == null ? void 0 : _b.blur) == null ? void 0 : _c.call(_b);
  25403. };
  25404. const handleBlur = (event2) => {
  25405. nextTick(() => {
  25406. if (states.isSilentBlur) {
  25407. states.isSilentBlur = false;
  25408. } else {
  25409. ctx.emit("blur", event2);
  25410. }
  25411. });
  25412. states.softFocus = false;
  25413. };
  25414. const handleClearClick = (event2) => {
  25415. deleteSelected(event2);
  25416. };
  25417. const handleClose = () => {
  25418. states.visible = false;
  25419. };
  25420. const handleKeydownEscape = (event2) => {
  25421. if (states.visible) {
  25422. event2.preventDefault();
  25423. event2.stopPropagation();
  25424. states.visible = false;
  25425. }
  25426. };
  25427. const toggleMenu = (e) => {
  25428. var _a2;
  25429. if (e && !states.mouseEnter) {
  25430. return;
  25431. }
  25432. if (!selectDisabled.value) {
  25433. if (states.menuVisibleOnFocus) {
  25434. states.menuVisibleOnFocus = false;
  25435. } else {
  25436. if (!tooltipRef.value || !tooltipRef.value.isFocusInsideContent()) {
  25437. states.visible = !states.visible;
  25438. }
  25439. }
  25440. if (states.visible) {
  25441. (_a2 = input.value || reference.value) == null ? void 0 : _a2.focus();
  25442. }
  25443. }
  25444. };
  25445. const selectOption = () => {
  25446. if (!states.visible) {
  25447. toggleMenu();
  25448. } else {
  25449. if (optionsArray.value[states.hoverIndex]) {
  25450. handleOptionSelect(optionsArray.value[states.hoverIndex], void 0);
  25451. }
  25452. }
  25453. };
  25454. const getValueKey = (item) => {
  25455. return isObject$5(item.value) ? get$2(item.value, props.valueKey) : item.value;
  25456. };
  25457. const optionsAllDisabled = computed$1(() => optionsArray.value.filter((option) => option.visible).every((option) => option.disabled));
  25458. const showTagList = computed$1(() => states.selected.slice(0, props.maxCollapseTags));
  25459. const collapseTagList = computed$1(() => states.selected.slice(props.maxCollapseTags));
  25460. const navigateOptions = (direction) => {
  25461. if (!states.visible) {
  25462. states.visible = true;
  25463. return;
  25464. }
  25465. if (states.options.size === 0 || states.filteredOptionsCount === 0)
  25466. return;
  25467. if (states.isOnComposition)
  25468. return;
  25469. if (!optionsAllDisabled.value) {
  25470. if (direction === "next") {
  25471. states.hoverIndex++;
  25472. if (states.hoverIndex === states.options.size) {
  25473. states.hoverIndex = 0;
  25474. }
  25475. } else if (direction === "prev") {
  25476. states.hoverIndex--;
  25477. if (states.hoverIndex < 0) {
  25478. states.hoverIndex = states.options.size - 1;
  25479. }
  25480. }
  25481. const option = optionsArray.value[states.hoverIndex];
  25482. if (option.disabled === true || option.states.groupDisabled === true || !option.visible) {
  25483. navigateOptions(direction);
  25484. }
  25485. nextTick(() => scrollToOption(hoverOption.value));
  25486. }
  25487. };
  25488. const handleMouseEnter = () => {
  25489. states.mouseEnter = true;
  25490. };
  25491. const handleMouseLeave = () => {
  25492. states.mouseEnter = false;
  25493. };
  25494. return {
  25495. optionList,
  25496. optionsArray,
  25497. selectSize,
  25498. handleResize,
  25499. debouncedOnInputChange,
  25500. debouncedQueryChange,
  25501. deletePrevTag,
  25502. deleteTag,
  25503. deleteSelected,
  25504. handleOptionSelect,
  25505. scrollToOption,
  25506. readonly: readonly2,
  25507. resetInputHeight,
  25508. showClose,
  25509. iconComponent,
  25510. iconReverse,
  25511. showNewOption,
  25512. collapseTagSize,
  25513. setSelected,
  25514. managePlaceholder,
  25515. selectDisabled,
  25516. emptyText,
  25517. toggleLastOptionHitState,
  25518. resetInputState,
  25519. handleComposition,
  25520. onOptionCreate,
  25521. onOptionDestroy,
  25522. handleMenuEnter,
  25523. handleFocus,
  25524. blur,
  25525. handleBlur,
  25526. handleClearClick,
  25527. handleClose,
  25528. handleKeydownEscape,
  25529. toggleMenu,
  25530. selectOption,
  25531. getValueKey,
  25532. navigateOptions,
  25533. dropMenuVisible,
  25534. queryChange,
  25535. groupQueryChange,
  25536. showTagList,
  25537. collapseTagList,
  25538. reference,
  25539. input,
  25540. iOSInput,
  25541. tooltipRef,
  25542. tags,
  25543. selectWrapper,
  25544. scrollbar,
  25545. handleMouseEnter,
  25546. handleMouseLeave
  25547. };
  25548. };
  25549. var ElOptions = defineComponent({
  25550. name: "ElOptions",
  25551. emits: ["update-options"],
  25552. setup(_, { slots, emit }) {
  25553. let cachedOptions = [];
  25554. function isSameOptions(a, b) {
  25555. if (a.length !== b.length)
  25556. return false;
  25557. for (const [index2] of a.entries()) {
  25558. if (a[index2] != b[index2]) {
  25559. return false;
  25560. }
  25561. }
  25562. return true;
  25563. }
  25564. return () => {
  25565. var _a2, _b;
  25566. const children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  25567. const filteredOptions = [];
  25568. function filterOptions(children2) {
  25569. if (!Array.isArray(children2))
  25570. return;
  25571. children2.forEach((item) => {
  25572. var _a22, _b2, _c, _d;
  25573. const name = (_a22 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a22.name;
  25574. if (name === "ElOptionGroup") {
  25575. filterOptions(!isString(item.children) && !Array.isArray(item.children) && isFunction$3((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children);
  25576. } else if (name === "ElOption") {
  25577. filteredOptions.push((_d = item.props) == null ? void 0 : _d.label);
  25578. } else if (Array.isArray(item.children)) {
  25579. filterOptions(item.children);
  25580. }
  25581. });
  25582. }
  25583. if (children.length) {
  25584. filterOptions((_b = children[0]) == null ? void 0 : _b.children);
  25585. }
  25586. if (!isSameOptions(filteredOptions, cachedOptions)) {
  25587. cachedOptions = filteredOptions;
  25588. emit("update-options", filteredOptions);
  25589. }
  25590. return children;
  25591. };
  25592. }
  25593. });
  25594. const COMPONENT_NAME$1 = "ElSelect";
  25595. const _sfc_main$5 = defineComponent({
  25596. name: COMPONENT_NAME$1,
  25597. componentName: COMPONENT_NAME$1,
  25598. components: {
  25599. ElInput,
  25600. ElSelectMenu,
  25601. ElOption: Option,
  25602. ElOptions,
  25603. ElTag,
  25604. ElScrollbar,
  25605. ElTooltip,
  25606. ElIcon
  25607. },
  25608. directives: { ClickOutside },
  25609. props: {
  25610. name: String,
  25611. id: String,
  25612. modelValue: {
  25613. type: [Array, String, Number, Boolean, Object],
  25614. default: void 0
  25615. },
  25616. autocomplete: {
  25617. type: String,
  25618. default: "off"
  25619. },
  25620. automaticDropdown: Boolean,
  25621. size: {
  25622. type: String,
  25623. validator: isValidComponentSize
  25624. },
  25625. effect: {
  25626. type: String,
  25627. default: "light"
  25628. },
  25629. disabled: Boolean,
  25630. clearable: Boolean,
  25631. filterable: Boolean,
  25632. allowCreate: Boolean,
  25633. loading: Boolean,
  25634. popperClass: {
  25635. type: String,
  25636. default: ""
  25637. },
  25638. popperOptions: {
  25639. type: Object,
  25640. default: () => ({})
  25641. },
  25642. remote: Boolean,
  25643. loadingText: String,
  25644. noMatchText: String,
  25645. noDataText: String,
  25646. remoteMethod: Function,
  25647. filterMethod: Function,
  25648. multiple: Boolean,
  25649. multipleLimit: {
  25650. type: Number,
  25651. default: 0
  25652. },
  25653. placeholder: {
  25654. type: String
  25655. },
  25656. defaultFirstOption: Boolean,
  25657. reserveKeyword: {
  25658. type: Boolean,
  25659. default: true
  25660. },
  25661. valueKey: {
  25662. type: String,
  25663. default: "value"
  25664. },
  25665. collapseTags: Boolean,
  25666. collapseTagsTooltip: {
  25667. type: Boolean,
  25668. default: false
  25669. },
  25670. maxCollapseTags: {
  25671. type: Number,
  25672. default: 1
  25673. },
  25674. teleported: useTooltipContentProps.teleported,
  25675. persistent: {
  25676. type: Boolean,
  25677. default: true
  25678. },
  25679. clearIcon: {
  25680. type: iconPropType,
  25681. default: circle_close_default
  25682. },
  25683. fitInputWidth: {
  25684. type: Boolean,
  25685. default: false
  25686. },
  25687. suffixIcon: {
  25688. type: iconPropType,
  25689. default: arrow_down_default
  25690. },
  25691. tagType: { ...tagProps.type, default: "info" },
  25692. validateEvent: {
  25693. type: Boolean,
  25694. default: true
  25695. },
  25696. remoteShowSuffix: {
  25697. type: Boolean,
  25698. default: false
  25699. },
  25700. suffixTransition: {
  25701. type: Boolean,
  25702. default: true
  25703. },
  25704. placement: {
  25705. type: String,
  25706. values: Ee,
  25707. default: "bottom-start"
  25708. }
  25709. },
  25710. emits: [
  25711. UPDATE_MODEL_EVENT,
  25712. CHANGE_EVENT,
  25713. "remove-tag",
  25714. "clear",
  25715. "visible-change",
  25716. "focus",
  25717. "blur"
  25718. ],
  25719. setup(props, ctx) {
  25720. const nsSelect = useNamespace("select");
  25721. const nsInput = useNamespace("input");
  25722. const { t: t2 } = useLocale();
  25723. const states = useSelectStates(props);
  25724. const {
  25725. optionList,
  25726. optionsArray,
  25727. selectSize,
  25728. readonly: readonly2,
  25729. handleResize,
  25730. collapseTagSize,
  25731. debouncedOnInputChange,
  25732. debouncedQueryChange,
  25733. deletePrevTag,
  25734. deleteTag,
  25735. deleteSelected,
  25736. handleOptionSelect,
  25737. scrollToOption,
  25738. setSelected,
  25739. resetInputHeight,
  25740. managePlaceholder,
  25741. showClose,
  25742. selectDisabled,
  25743. iconComponent,
  25744. iconReverse,
  25745. showNewOption,
  25746. emptyText,
  25747. toggleLastOptionHitState,
  25748. resetInputState,
  25749. handleComposition,
  25750. onOptionCreate,
  25751. onOptionDestroy,
  25752. handleMenuEnter,
  25753. handleFocus,
  25754. blur,
  25755. handleBlur,
  25756. handleClearClick,
  25757. handleClose,
  25758. handleKeydownEscape,
  25759. toggleMenu,
  25760. selectOption,
  25761. getValueKey,
  25762. navigateOptions,
  25763. dropMenuVisible,
  25764. reference,
  25765. input,
  25766. iOSInput,
  25767. tooltipRef,
  25768. tags,
  25769. selectWrapper,
  25770. scrollbar,
  25771. queryChange,
  25772. groupQueryChange,
  25773. handleMouseEnter,
  25774. handleMouseLeave,
  25775. showTagList,
  25776. collapseTagList
  25777. } = useSelect(props, states, ctx);
  25778. const { focus } = useFocus(reference);
  25779. const {
  25780. inputWidth,
  25781. selected,
  25782. inputLength,
  25783. filteredOptionsCount,
  25784. visible,
  25785. softFocus,
  25786. selectedLabel,
  25787. hoverIndex,
  25788. query,
  25789. inputHovering,
  25790. currentPlaceholder,
  25791. menuVisibleOnFocus,
  25792. isOnComposition,
  25793. isSilentBlur,
  25794. options: options2,
  25795. cachedOptions,
  25796. optionsCount,
  25797. prefixWidth,
  25798. tagInMultiLine
  25799. } = toRefs(states);
  25800. const wrapperKls = computed$1(() => {
  25801. const classList = [nsSelect.b()];
  25802. const _selectSize = unref(selectSize);
  25803. if (_selectSize) {
  25804. classList.push(nsSelect.m(_selectSize));
  25805. }
  25806. if (props.disabled) {
  25807. classList.push(nsSelect.m("disabled"));
  25808. }
  25809. return classList;
  25810. });
  25811. const selectTagsStyle = computed$1(() => ({
  25812. maxWidth: `${unref(inputWidth) - 32}px`,
  25813. width: "100%"
  25814. }));
  25815. const tagTextStyle = computed$1(() => {
  25816. const maxWidth = unref(inputWidth) > 123 ? unref(inputWidth) - 123 : unref(inputWidth) - 75;
  25817. return { maxWidth: `${maxWidth}px` };
  25818. });
  25819. provide(selectKey, reactive({
  25820. props,
  25821. options: options2,
  25822. optionsArray,
  25823. cachedOptions,
  25824. optionsCount,
  25825. filteredOptionsCount,
  25826. hoverIndex,
  25827. handleOptionSelect,
  25828. onOptionCreate,
  25829. onOptionDestroy,
  25830. selectWrapper,
  25831. selected,
  25832. setSelected,
  25833. queryChange,
  25834. groupQueryChange
  25835. }));
  25836. onMounted(() => {
  25837. states.cachedPlaceHolder = currentPlaceholder.value = props.placeholder || (() => t2("el.select.placeholder"));
  25838. if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
  25839. currentPlaceholder.value = "";
  25840. }
  25841. useResizeObserver(selectWrapper, handleResize);
  25842. if (props.remote && props.multiple) {
  25843. resetInputHeight();
  25844. }
  25845. nextTick(() => {
  25846. const refEl = reference.value && reference.value.$el;
  25847. if (!refEl)
  25848. return;
  25849. inputWidth.value = refEl.getBoundingClientRect().width;
  25850. if (ctx.slots.prefix) {
  25851. const prefix = refEl.querySelector(`.${nsInput.e("prefix")}`);
  25852. prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 5, 30);
  25853. }
  25854. });
  25855. setSelected();
  25856. });
  25857. if (props.multiple && !Array.isArray(props.modelValue)) {
  25858. ctx.emit(UPDATE_MODEL_EVENT, []);
  25859. }
  25860. if (!props.multiple && Array.isArray(props.modelValue)) {
  25861. ctx.emit(UPDATE_MODEL_EVENT, "");
  25862. }
  25863. const popperPaneRef = computed$1(() => {
  25864. var _a2, _b;
  25865. return (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef;
  25866. });
  25867. const onOptionsRendered = (v) => {
  25868. optionList.value = v;
  25869. };
  25870. return {
  25871. isIOS,
  25872. onOptionsRendered,
  25873. tagInMultiLine,
  25874. prefixWidth,
  25875. selectSize,
  25876. readonly: readonly2,
  25877. handleResize,
  25878. collapseTagSize,
  25879. debouncedOnInputChange,
  25880. debouncedQueryChange,
  25881. deletePrevTag,
  25882. deleteTag,
  25883. deleteSelected,
  25884. handleOptionSelect,
  25885. scrollToOption,
  25886. inputWidth,
  25887. selected,
  25888. inputLength,
  25889. filteredOptionsCount,
  25890. visible,
  25891. softFocus,
  25892. selectedLabel,
  25893. hoverIndex,
  25894. query,
  25895. inputHovering,
  25896. currentPlaceholder,
  25897. menuVisibleOnFocus,
  25898. isOnComposition,
  25899. isSilentBlur,
  25900. options: options2,
  25901. resetInputHeight,
  25902. managePlaceholder,
  25903. showClose,
  25904. selectDisabled,
  25905. iconComponent,
  25906. iconReverse,
  25907. showNewOption,
  25908. emptyText,
  25909. toggleLastOptionHitState,
  25910. resetInputState,
  25911. handleComposition,
  25912. handleMenuEnter,
  25913. handleFocus,
  25914. blur,
  25915. handleBlur,
  25916. handleClearClick,
  25917. handleClose,
  25918. handleKeydownEscape,
  25919. toggleMenu,
  25920. selectOption,
  25921. getValueKey,
  25922. navigateOptions,
  25923. dropMenuVisible,
  25924. focus,
  25925. reference,
  25926. input,
  25927. iOSInput,
  25928. tooltipRef,
  25929. popperPaneRef,
  25930. tags,
  25931. selectWrapper,
  25932. scrollbar,
  25933. wrapperKls,
  25934. selectTagsStyle,
  25935. nsSelect,
  25936. tagTextStyle,
  25937. handleMouseEnter,
  25938. handleMouseLeave,
  25939. showTagList,
  25940. collapseTagList
  25941. };
  25942. }
  25943. });
  25944. const _hoisted_1$4 = ["disabled", "autocomplete"];
  25945. const _hoisted_2$4 = ["disabled"];
  25946. const _hoisted_3$4 = { style: { "height": "100%", "display": "flex", "justify-content": "center", "align-items": "center" } };
  25947. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  25948. const _component_el_tag = resolveComponent("el-tag");
  25949. const _component_el_tooltip = resolveComponent("el-tooltip");
  25950. const _component_el_icon = resolveComponent("el-icon");
  25951. const _component_el_input = resolveComponent("el-input");
  25952. const _component_el_option = resolveComponent("el-option");
  25953. const _component_el_options = resolveComponent("el-options");
  25954. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  25955. const _component_el_select_menu = resolveComponent("el-select-menu");
  25956. const _directive_click_outside = resolveDirective("click-outside");
  25957. return withDirectives((openBlock(), createElementBlock("div", {
  25958. ref: "selectWrapper",
  25959. class: normalizeClass(_ctx.wrapperKls),
  25960. onMouseenter: _cache[21] || (_cache[21] = (...args) => _ctx.handleMouseEnter && _ctx.handleMouseEnter(...args)),
  25961. onMouseleave: _cache[22] || (_cache[22] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args)),
  25962. onClick: _cache[23] || (_cache[23] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  25963. }, [
  25964. createVNode(_component_el_tooltip, {
  25965. ref: "tooltipRef",
  25966. visible: _ctx.dropMenuVisible,
  25967. placement: _ctx.placement,
  25968. teleported: _ctx.teleported,
  25969. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  25970. "popper-options": _ctx.popperOptions,
  25971. "fallback-placements": ["bottom-start", "top-start", "right", "left"],
  25972. effect: _ctx.effect,
  25973. pure: "",
  25974. trigger: "click",
  25975. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  25976. "stop-popper-mouse-event": false,
  25977. "gpu-acceleration": false,
  25978. persistent: _ctx.persistent,
  25979. onShow: _ctx.handleMenuEnter
  25980. }, {
  25981. default: withCtx(() => [
  25982. createElementVNode("div", {
  25983. class: "select-trigger",
  25984. onMouseenter: _cache[19] || (_cache[19] = ($event) => _ctx.inputHovering = true),
  25985. onMouseleave: _cache[20] || (_cache[20] = ($event) => _ctx.inputHovering = false)
  25986. }, [
  25987. _ctx.multiple ? (openBlock(), createElementBlock("div", {
  25988. key: 0,
  25989. ref: "tags",
  25990. class: normalizeClass([
  25991. _ctx.nsSelect.e("tags"),
  25992. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  25993. ]),
  25994. style: normalizeStyle(_ctx.selectTagsStyle)
  25995. }, [
  25996. _ctx.collapseTags && _ctx.selected.length ? (openBlock(), createBlock(Transition, {
  25997. key: 0,
  25998. onAfterLeave: _ctx.resetInputHeight
  25999. }, {
  26000. default: withCtx(() => [
  26001. createElementVNode("span", {
  26002. class: normalizeClass([
  26003. _ctx.nsSelect.b("tags-wrapper"),
  26004. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  26005. ])
  26006. }, [
  26007. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  26008. return openBlock(), createBlock(_component_el_tag, {
  26009. key: _ctx.getValueKey(item),
  26010. closable: !_ctx.selectDisabled && !item.isDisabled,
  26011. size: _ctx.collapseTagSize,
  26012. hit: item.hitState,
  26013. type: _ctx.tagType,
  26014. "disable-transitions": "",
  26015. onClose: ($event) => _ctx.deleteTag($event, item)
  26016. }, {
  26017. default: withCtx(() => [
  26018. createElementVNode("span", {
  26019. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26020. style: normalizeStyle(_ctx.tagTextStyle)
  26021. }, toDisplayString(item.currentLabel), 7)
  26022. ]),
  26023. _: 2
  26024. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  26025. }), 128)),
  26026. _ctx.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tag, {
  26027. key: 0,
  26028. closable: false,
  26029. size: _ctx.collapseTagSize,
  26030. type: _ctx.tagType,
  26031. "disable-transitions": ""
  26032. }, {
  26033. default: withCtx(() => [
  26034. _ctx.collapseTagsTooltip ? (openBlock(), createBlock(_component_el_tooltip, {
  26035. key: 0,
  26036. disabled: _ctx.dropMenuVisible,
  26037. "fallback-placements": ["bottom", "top", "right", "left"],
  26038. effect: _ctx.effect,
  26039. placement: "bottom",
  26040. teleported: _ctx.teleported
  26041. }, {
  26042. default: withCtx(() => [
  26043. createElementVNode("span", {
  26044. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  26045. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3)
  26046. ]),
  26047. content: withCtx(() => [
  26048. createElementVNode("div", {
  26049. class: normalizeClass(_ctx.nsSelect.e("collapse-tags"))
  26050. }, [
  26051. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
  26052. return openBlock(), createElementBlock("div", {
  26053. key: _ctx.getValueKey(item),
  26054. class: normalizeClass(_ctx.nsSelect.e("collapse-tag"))
  26055. }, [
  26056. createVNode(_component_el_tag, {
  26057. class: "in-tooltip",
  26058. closable: !_ctx.selectDisabled && !item.isDisabled,
  26059. size: _ctx.collapseTagSize,
  26060. hit: item.hitState,
  26061. type: _ctx.tagType,
  26062. "disable-transitions": "",
  26063. style: { margin: "2px" },
  26064. onClose: ($event) => _ctx.deleteTag($event, item)
  26065. }, {
  26066. default: withCtx(() => [
  26067. createElementVNode("span", {
  26068. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26069. style: normalizeStyle({
  26070. maxWidth: _ctx.inputWidth - 75 + "px"
  26071. })
  26072. }, toDisplayString(item.currentLabel), 7)
  26073. ]),
  26074. _: 2
  26075. }, 1032, ["closable", "size", "hit", "type", "onClose"])
  26076. ], 2);
  26077. }), 128))
  26078. ], 2)
  26079. ]),
  26080. _: 1
  26081. }, 8, ["disabled", "effect", "teleported"])) : (openBlock(), createElementBlock("span", {
  26082. key: 1,
  26083. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  26084. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3))
  26085. ]),
  26086. _: 1
  26087. }, 8, ["size", "type"])) : createCommentVNode("v-if", true)
  26088. ], 2)
  26089. ]),
  26090. _: 1
  26091. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26092. !_ctx.collapseTags ? (openBlock(), createBlock(Transition, {
  26093. key: 1,
  26094. onAfterLeave: _ctx.resetInputHeight
  26095. }, {
  26096. default: withCtx(() => [
  26097. createElementVNode("span", {
  26098. class: normalizeClass([
  26099. _ctx.nsSelect.b("tags-wrapper"),
  26100. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  26101. ])
  26102. }, [
  26103. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selected, (item) => {
  26104. return openBlock(), createBlock(_component_el_tag, {
  26105. key: _ctx.getValueKey(item),
  26106. closable: !_ctx.selectDisabled && !item.isDisabled,
  26107. size: _ctx.collapseTagSize,
  26108. hit: item.hitState,
  26109. type: _ctx.tagType,
  26110. "disable-transitions": "",
  26111. onClose: ($event) => _ctx.deleteTag($event, item)
  26112. }, {
  26113. default: withCtx(() => [
  26114. createElementVNode("span", {
  26115. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26116. style: normalizeStyle({ maxWidth: _ctx.inputWidth - 75 + "px" })
  26117. }, toDisplayString(item.currentLabel), 7)
  26118. ]),
  26119. _: 2
  26120. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  26121. }), 128))
  26122. ], 2)
  26123. ]),
  26124. _: 1
  26125. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26126. _ctx.filterable ? withDirectives((openBlock(), createElementBlock("input", {
  26127. key: 2,
  26128. ref: "input",
  26129. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.query = $event),
  26130. type: "text",
  26131. class: normalizeClass([
  26132. _ctx.nsSelect.e("input"),
  26133. _ctx.nsSelect.is(_ctx.selectSize),
  26134. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  26135. ]),
  26136. disabled: _ctx.selectDisabled,
  26137. autocomplete: _ctx.autocomplete,
  26138. style: normalizeStyle({
  26139. marginLeft: _ctx.prefixWidth && !_ctx.selected.length || _ctx.tagInMultiLine ? `${_ctx.prefixWidth}px` : "",
  26140. flexGrow: 1,
  26141. width: `${_ctx.inputLength / (_ctx.inputWidth - 32)}%`,
  26142. maxWidth: `${_ctx.inputWidth - 42}px`
  26143. }),
  26144. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  26145. onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  26146. onKeyup: _cache[3] || (_cache[3] = (...args) => _ctx.managePlaceholder && _ctx.managePlaceholder(...args)),
  26147. onKeydown: [
  26148. _cache[4] || (_cache[4] = (...args) => _ctx.resetInputState && _ctx.resetInputState(...args)),
  26149. _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["prevent"]), ["down"])),
  26150. _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["prevent"]), ["up"])),
  26151. _cache[7] || (_cache[7] = withKeys((...args) => _ctx.handleKeydownEscape && _ctx.handleKeydownEscape(...args), ["esc"])),
  26152. _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.selectOption && _ctx.selectOption(...args), ["stop", "prevent"]), ["enter"])),
  26153. _cache[9] || (_cache[9] = withKeys((...args) => _ctx.deletePrevTag && _ctx.deletePrevTag(...args), ["delete"])),
  26154. _cache[10] || (_cache[10] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26155. ],
  26156. onCompositionstart: _cache[11] || (_cache[11] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26157. onCompositionupdate: _cache[12] || (_cache[12] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26158. onCompositionend: _cache[13] || (_cache[13] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26159. onInput: _cache[14] || (_cache[14] = (...args) => _ctx.debouncedQueryChange && _ctx.debouncedQueryChange(...args))
  26160. }, null, 46, _hoisted_1$4)), [
  26161. [vModelText, _ctx.query]
  26162. ]) : createCommentVNode("v-if", true)
  26163. ], 6)) : createCommentVNode("v-if", true),
  26164. createCommentVNode(" fix: https://github.com/element-plus/element-plus/issues/11415 "),
  26165. _ctx.isIOS && !_ctx.multiple && _ctx.filterable && _ctx.readonly ? (openBlock(), createElementBlock("input", {
  26166. key: 1,
  26167. ref: "iOSInput",
  26168. class: normalizeClass([
  26169. _ctx.nsSelect.e("input"),
  26170. _ctx.nsSelect.is(_ctx.selectSize),
  26171. _ctx.nsSelect.em("input", "iOS")
  26172. ]),
  26173. disabled: _ctx.selectDisabled,
  26174. type: "text"
  26175. }, null, 10, _hoisted_2$4)) : createCommentVNode("v-if", true),
  26176. createVNode(_component_el_input, {
  26177. id: _ctx.id,
  26178. ref: "reference",
  26179. modelValue: _ctx.selectedLabel,
  26180. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.selectedLabel = $event),
  26181. type: "text",
  26182. placeholder: typeof _ctx.currentPlaceholder === "function" ? _ctx.currentPlaceholder() : _ctx.currentPlaceholder,
  26183. name: _ctx.name,
  26184. autocomplete: _ctx.autocomplete,
  26185. size: _ctx.selectSize,
  26186. disabled: _ctx.selectDisabled,
  26187. readonly: _ctx.readonly,
  26188. "validate-event": false,
  26189. class: normalizeClass([_ctx.nsSelect.is("focus", _ctx.visible)]),
  26190. tabindex: _ctx.multiple && _ctx.filterable ? -1 : void 0,
  26191. onFocus: _ctx.handleFocus,
  26192. onBlur: _ctx.handleBlur,
  26193. onInput: _ctx.debouncedOnInputChange,
  26194. onPaste: _ctx.debouncedOnInputChange,
  26195. onCompositionstart: _ctx.handleComposition,
  26196. onCompositionupdate: _ctx.handleComposition,
  26197. onCompositionend: _ctx.handleComposition,
  26198. onKeydown: [
  26199. _cache[16] || (_cache[16] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"])),
  26200. _cache[17] || (_cache[17] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"])),
  26201. withKeys(withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
  26202. withKeys(_ctx.handleKeydownEscape, ["esc"]),
  26203. _cache[18] || (_cache[18] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26204. ]
  26205. }, createSlots({
  26206. suffix: withCtx(() => [
  26207. _ctx.iconComponent && !_ctx.showClose ? (openBlock(), createBlock(_component_el_icon, {
  26208. key: 0,
  26209. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
  26210. }, {
  26211. default: withCtx(() => [
  26212. (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
  26213. ]),
  26214. _: 1
  26215. }, 8, ["class"])) : createCommentVNode("v-if", true),
  26216. _ctx.showClose && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  26217. key: 1,
  26218. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon")]),
  26219. onClick: _ctx.handleClearClick
  26220. }, {
  26221. default: withCtx(() => [
  26222. (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
  26223. ]),
  26224. _: 1
  26225. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  26226. ]),
  26227. _: 2
  26228. }, [
  26229. _ctx.$slots.prefix ? {
  26230. name: "prefix",
  26231. fn: withCtx(() => [
  26232. createElementVNode("div", _hoisted_3$4, [
  26233. renderSlot(_ctx.$slots, "prefix")
  26234. ])
  26235. ])
  26236. } : void 0
  26237. ]), 1032, ["id", "modelValue", "placeholder", "name", "autocomplete", "size", "disabled", "readonly", "class", "tabindex", "onFocus", "onBlur", "onInput", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown"])
  26238. ], 32)
  26239. ]),
  26240. content: withCtx(() => [
  26241. createVNode(_component_el_select_menu, null, {
  26242. default: withCtx(() => [
  26243. withDirectives(createVNode(_component_el_scrollbar, {
  26244. ref: "scrollbar",
  26245. tag: "ul",
  26246. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  26247. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  26248. class: normalizeClass([
  26249. _ctx.nsSelect.is("empty", !_ctx.allowCreate && Boolean(_ctx.query) && _ctx.filteredOptionsCount === 0)
  26250. ])
  26251. }, {
  26252. default: withCtx(() => [
  26253. _ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
  26254. key: 0,
  26255. value: _ctx.query,
  26256. created: true
  26257. }, null, 8, ["value"])) : createCommentVNode("v-if", true),
  26258. createVNode(_component_el_options, { onUpdateOptions: _ctx.onOptionsRendered }, {
  26259. default: withCtx(() => [
  26260. renderSlot(_ctx.$slots, "default")
  26261. ]),
  26262. _: 3
  26263. }, 8, ["onUpdateOptions"])
  26264. ]),
  26265. _: 3
  26266. }, 8, ["wrap-class", "view-class", "class"]), [
  26267. [vShow, _ctx.options.size > 0 && !_ctx.loading]
  26268. ]),
  26269. _ctx.emptyText && (!_ctx.allowCreate || _ctx.loading || _ctx.allowCreate && _ctx.options.size === 0) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  26270. _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }) : (openBlock(), createElementBlock("p", {
  26271. key: 1,
  26272. class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  26273. }, toDisplayString(_ctx.emptyText), 3))
  26274. ], 64)) : createCommentVNode("v-if", true)
  26275. ]),
  26276. _: 3
  26277. })
  26278. ]),
  26279. _: 3
  26280. }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "effect", "transition", "persistent", "onShow"])
  26281. ], 34)), [
  26282. [_directive_click_outside, _ctx.handleClose, _ctx.popperPaneRef]
  26283. ]);
  26284. }
  26285. var Select = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["render", _sfc_render$1], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);
  26286. const _sfc_main$4 = defineComponent({
  26287. name: "ElOptionGroup",
  26288. componentName: "ElOptionGroup",
  26289. props: {
  26290. label: String,
  26291. disabled: {
  26292. type: Boolean,
  26293. default: false
  26294. }
  26295. },
  26296. setup(props) {
  26297. const ns = useNamespace("select");
  26298. const visible = ref(true);
  26299. const instance = getCurrentInstance();
  26300. const children = ref([]);
  26301. provide(selectGroupKey, reactive({
  26302. ...toRefs(props)
  26303. }));
  26304. const select = inject(selectKey);
  26305. onMounted(() => {
  26306. children.value = flattedChildren(instance.subTree);
  26307. });
  26308. const flattedChildren = (node) => {
  26309. const children2 = [];
  26310. if (Array.isArray(node.children)) {
  26311. node.children.forEach((child) => {
  26312. var _a2;
  26313. if (child.type && child.type.name === "ElOption" && child.component && child.component.proxy) {
  26314. children2.push(child.component.proxy);
  26315. } else if ((_a2 = child.children) == null ? void 0 : _a2.length) {
  26316. children2.push(...flattedChildren(child));
  26317. }
  26318. });
  26319. }
  26320. return children2;
  26321. };
  26322. const { groupQueryChange } = toRaw$1(select);
  26323. watch(groupQueryChange, () => {
  26324. visible.value = children.value.some((option) => option.visible === true);
  26325. }, { flush: "post" });
  26326. return {
  26327. visible,
  26328. ns
  26329. };
  26330. }
  26331. });
  26332. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  26333. return withDirectives((openBlock(), createElementBlock("ul", {
  26334. class: normalizeClass(_ctx.ns.be("group", "wrap"))
  26335. }, [
  26336. createElementVNode("li", {
  26337. class: normalizeClass(_ctx.ns.be("group", "title"))
  26338. }, toDisplayString(_ctx.label), 3),
  26339. createElementVNode("li", null, [
  26340. createElementVNode("ul", {
  26341. class: normalizeClass(_ctx.ns.b("group"))
  26342. }, [
  26343. renderSlot(_ctx.$slots, "default")
  26344. ], 2)
  26345. ])
  26346. ], 2)), [
  26347. [vShow, _ctx.visible]
  26348. ]);
  26349. }
  26350. var OptionGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);
  26351. const ElSelect = withInstall(Select, {
  26352. Option,
  26353. OptionGroup
  26354. });
  26355. const ElOption = withNoopInstall(Option);
  26356. withNoopInstall(OptionGroup);
  26357. const switchProps = buildProps({
  26358. modelValue: {
  26359. type: [Boolean, String, Number],
  26360. default: false
  26361. },
  26362. value: {
  26363. type: [Boolean, String, Number],
  26364. default: false
  26365. },
  26366. disabled: {
  26367. type: Boolean,
  26368. default: false
  26369. },
  26370. width: {
  26371. type: [String, Number],
  26372. default: ""
  26373. },
  26374. inlinePrompt: {
  26375. type: Boolean,
  26376. default: false
  26377. },
  26378. activeIcon: {
  26379. type: iconPropType
  26380. },
  26381. inactiveIcon: {
  26382. type: iconPropType
  26383. },
  26384. activeText: {
  26385. type: String,
  26386. default: ""
  26387. },
  26388. inactiveText: {
  26389. type: String,
  26390. default: ""
  26391. },
  26392. activeColor: {
  26393. type: String,
  26394. default: ""
  26395. },
  26396. inactiveColor: {
  26397. type: String,
  26398. default: ""
  26399. },
  26400. borderColor: {
  26401. type: String,
  26402. default: ""
  26403. },
  26404. activeValue: {
  26405. type: [Boolean, String, Number],
  26406. default: true
  26407. },
  26408. inactiveValue: {
  26409. type: [Boolean, String, Number],
  26410. default: false
  26411. },
  26412. name: {
  26413. type: String,
  26414. default: ""
  26415. },
  26416. validateEvent: {
  26417. type: Boolean,
  26418. default: true
  26419. },
  26420. id: String,
  26421. loading: {
  26422. type: Boolean,
  26423. default: false
  26424. },
  26425. beforeChange: {
  26426. type: definePropType(Function)
  26427. },
  26428. size: {
  26429. type: String,
  26430. validator: isValidComponentSize
  26431. },
  26432. tabindex: {
  26433. type: [String, Number]
  26434. }
  26435. });
  26436. const switchEmits = {
  26437. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26438. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26439. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  26440. };
  26441. const _hoisted_1$3 = ["onClick"];
  26442. const _hoisted_2$3 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
  26443. const _hoisted_3$3 = ["aria-hidden"];
  26444. const _hoisted_4$3 = ["aria-hidden"];
  26445. const _hoisted_5$3 = ["aria-hidden"];
  26446. const COMPONENT_NAME = "ElSwitch";
  26447. const __default__ = defineComponent({
  26448. name: COMPONENT_NAME
  26449. });
  26450. const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  26451. ...__default__,
  26452. props: switchProps,
  26453. emits: switchEmits,
  26454. setup(__props, { expose, emit }) {
  26455. const props = __props;
  26456. const vm = getCurrentInstance();
  26457. const { formItem } = useFormItem();
  26458. const switchSize = useFormSize();
  26459. const ns = useNamespace("switch");
  26460. useDeprecated({
  26461. from: '"value"',
  26462. replacement: '"model-value" or "v-model"',
  26463. scope: COMPONENT_NAME,
  26464. version: "2.3.0",
  26465. ref: "https://element-plus.org/en-US/component/switch.html#attributes",
  26466. type: "Attribute"
  26467. }, computed$1(() => {
  26468. var _a2;
  26469. return !!((_a2 = vm.vnode.props) == null ? void 0 : _a2.value);
  26470. }));
  26471. const { inputId } = useFormItemInputId(props, {
  26472. formItemContext: formItem
  26473. });
  26474. const switchDisabled = useFormDisabled(computed$1(() => props.loading));
  26475. const isControlled = ref(props.modelValue !== false);
  26476. const input = ref();
  26477. const core = ref();
  26478. const switchKls = computed$1(() => [
  26479. ns.b(),
  26480. ns.m(switchSize.value),
  26481. ns.is("disabled", switchDisabled.value),
  26482. ns.is("checked", checked.value)
  26483. ]);
  26484. const coreStyle = computed$1(() => ({
  26485. width: addUnit(props.width)
  26486. }));
  26487. watch(() => props.modelValue, () => {
  26488. isControlled.value = true;
  26489. });
  26490. watch(() => props.value, () => {
  26491. isControlled.value = false;
  26492. });
  26493. const actualValue = computed$1(() => {
  26494. return isControlled.value ? props.modelValue : props.value;
  26495. });
  26496. const checked = computed$1(() => actualValue.value === props.activeValue);
  26497. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  26498. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  26499. emit(CHANGE_EVENT, props.inactiveValue);
  26500. emit(INPUT_EVENT, props.inactiveValue);
  26501. }
  26502. watch(checked, (val) => {
  26503. var _a2;
  26504. input.value.checked = val;
  26505. if (props.validateEvent) {
  26506. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  26507. }
  26508. });
  26509. const handleChange = () => {
  26510. const val = checked.value ? props.inactiveValue : props.activeValue;
  26511. emit(UPDATE_MODEL_EVENT, val);
  26512. emit(CHANGE_EVENT, val);
  26513. emit(INPUT_EVENT, val);
  26514. nextTick(() => {
  26515. input.value.checked = checked.value;
  26516. });
  26517. };
  26518. const switchValue = () => {
  26519. if (switchDisabled.value)
  26520. return;
  26521. const { beforeChange } = props;
  26522. if (!beforeChange) {
  26523. handleChange();
  26524. return;
  26525. }
  26526. const shouldChange = beforeChange();
  26527. const isPromiseOrBool = [
  26528. isPromise$2(shouldChange),
  26529. isBoolean(shouldChange)
  26530. ].includes(true);
  26531. if (!isPromiseOrBool) {
  26532. throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
  26533. }
  26534. if (isPromise$2(shouldChange)) {
  26535. shouldChange.then((result) => {
  26536. if (result) {
  26537. handleChange();
  26538. }
  26539. }).catch((e) => {
  26540. });
  26541. } else if (shouldChange) {
  26542. handleChange();
  26543. }
  26544. };
  26545. const styles = computed$1(() => {
  26546. return ns.cssVarBlock({
  26547. ...props.activeColor ? { "on-color": props.activeColor } : null,
  26548. ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
  26549. ...props.borderColor ? { "border-color": props.borderColor } : null
  26550. });
  26551. });
  26552. const focus = () => {
  26553. var _a2, _b;
  26554. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  26555. };
  26556. onMounted(() => {
  26557. input.value.checked = checked.value;
  26558. });
  26559. expose({
  26560. focus,
  26561. checked
  26562. });
  26563. return (_ctx, _cache) => {
  26564. return openBlock(), createElementBlock("div", {
  26565. class: normalizeClass(unref(switchKls)),
  26566. style: normalizeStyle(unref(styles)),
  26567. onClick: withModifiers(switchValue, ["prevent"])
  26568. }, [
  26569. createElementVNode("input", {
  26570. id: unref(inputId),
  26571. ref_key: "input",
  26572. ref: input,
  26573. class: normalizeClass(unref(ns).e("input")),
  26574. type: "checkbox",
  26575. role: "switch",
  26576. "aria-checked": unref(checked),
  26577. "aria-disabled": unref(switchDisabled),
  26578. name: _ctx.name,
  26579. "true-value": _ctx.activeValue,
  26580. "false-value": _ctx.inactiveValue,
  26581. disabled: unref(switchDisabled),
  26582. tabindex: _ctx.tabindex,
  26583. onChange: handleChange,
  26584. onKeydown: withKeys(switchValue, ["enter"])
  26585. }, null, 42, _hoisted_2$3),
  26586. !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
  26587. key: 0,
  26588. class: normalizeClass([
  26589. unref(ns).e("label"),
  26590. unref(ns).em("label", "left"),
  26591. unref(ns).is("active", !unref(checked))
  26592. ])
  26593. }, [
  26594. _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26595. default: withCtx(() => [
  26596. (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
  26597. ]),
  26598. _: 1
  26599. })) : createCommentVNode("v-if", true),
  26600. !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26601. key: 1,
  26602. "aria-hidden": unref(checked)
  26603. }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3$3)) : createCommentVNode("v-if", true)
  26604. ], 2)) : createCommentVNode("v-if", true),
  26605. createElementVNode("span", {
  26606. ref_key: "core",
  26607. ref: core,
  26608. class: normalizeClass(unref(ns).e("core")),
  26609. style: normalizeStyle(unref(coreStyle))
  26610. }, [
  26611. _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
  26612. key: 0,
  26613. class: normalizeClass(unref(ns).e("inner"))
  26614. }, [
  26615. _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
  26616. key: 0,
  26617. class: normalizeClass(unref(ns).is("icon"))
  26618. }, {
  26619. default: withCtx(() => [
  26620. (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
  26621. ]),
  26622. _: 1
  26623. }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26624. key: 1,
  26625. class: normalizeClass(unref(ns).is("text")),
  26626. "aria-hidden": !unref(checked)
  26627. }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4$3)) : createCommentVNode("v-if", true)
  26628. ], 2)) : createCommentVNode("v-if", true),
  26629. createElementVNode("div", {
  26630. class: normalizeClass(unref(ns).e("action"))
  26631. }, [
  26632. _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
  26633. key: 0,
  26634. class: normalizeClass(unref(ns).is("loading"))
  26635. }, {
  26636. default: withCtx(() => [
  26637. createVNode(unref(loading_default))
  26638. ]),
  26639. _: 1
  26640. }, 8, ["class"])) : createCommentVNode("v-if", true)
  26641. ], 2)
  26642. ], 6),
  26643. !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
  26644. key: 1,
  26645. class: normalizeClass([
  26646. unref(ns).e("label"),
  26647. unref(ns).em("label", "right"),
  26648. unref(ns).is("active", unref(checked))
  26649. ])
  26650. }, [
  26651. _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26652. default: withCtx(() => [
  26653. (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
  26654. ]),
  26655. _: 1
  26656. })) : createCommentVNode("v-if", true),
  26657. !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
  26658. key: 1,
  26659. "aria-hidden": !unref(checked)
  26660. }, toDisplayString(_ctx.activeText), 9, _hoisted_5$3)) : createCommentVNode("v-if", true)
  26661. ], 2)) : createCommentVNode("v-if", true)
  26662. ], 14, _hoisted_1$3);
  26663. };
  26664. }
  26665. });
  26666. var Switch = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);
  26667. const ElSwitch = withInstall(Switch);
  26668. /*! Element Plus v2.3.4 */
  26669. var zhCn = {
  26670. name: "zh-cn",
  26671. el: {
  26672. colorpicker: {
  26673. confirm: "\u786E\u5B9A",
  26674. clear: "\u6E05\u7A7A"
  26675. },
  26676. datepicker: {
  26677. now: "\u6B64\u523B",
  26678. today: "\u4ECA\u5929",
  26679. cancel: "\u53D6\u6D88",
  26680. clear: "\u6E05\u7A7A",
  26681. confirm: "\u786E\u5B9A",
  26682. selectDate: "\u9009\u62E9\u65E5\u671F",
  26683. selectTime: "\u9009\u62E9\u65F6\u95F4",
  26684. startDate: "\u5F00\u59CB\u65E5\u671F",
  26685. startTime: "\u5F00\u59CB\u65F6\u95F4",
  26686. endDate: "\u7ED3\u675F\u65E5\u671F",
  26687. endTime: "\u7ED3\u675F\u65F6\u95F4",
  26688. prevYear: "\u524D\u4E00\u5E74",
  26689. nextYear: "\u540E\u4E00\u5E74",
  26690. prevMonth: "\u4E0A\u4E2A\u6708",
  26691. nextMonth: "\u4E0B\u4E2A\u6708",
  26692. year: "\u5E74",
  26693. month1: "1 \u6708",
  26694. month2: "2 \u6708",
  26695. month3: "3 \u6708",
  26696. month4: "4 \u6708",
  26697. month5: "5 \u6708",
  26698. month6: "6 \u6708",
  26699. month7: "7 \u6708",
  26700. month8: "8 \u6708",
  26701. month9: "9 \u6708",
  26702. month10: "10 \u6708",
  26703. month11: "11 \u6708",
  26704. month12: "12 \u6708",
  26705. weeks: {
  26706. sun: "\u65E5",
  26707. mon: "\u4E00",
  26708. tue: "\u4E8C",
  26709. wed: "\u4E09",
  26710. thu: "\u56DB",
  26711. fri: "\u4E94",
  26712. sat: "\u516D"
  26713. },
  26714. months: {
  26715. jan: "\u4E00\u6708",
  26716. feb: "\u4E8C\u6708",
  26717. mar: "\u4E09\u6708",
  26718. apr: "\u56DB\u6708",
  26719. may: "\u4E94\u6708",
  26720. jun: "\u516D\u6708",
  26721. jul: "\u4E03\u6708",
  26722. aug: "\u516B\u6708",
  26723. sep: "\u4E5D\u6708",
  26724. oct: "\u5341\u6708",
  26725. nov: "\u5341\u4E00\u6708",
  26726. dec: "\u5341\u4E8C\u6708"
  26727. }
  26728. },
  26729. select: {
  26730. loading: "\u52A0\u8F7D\u4E2D",
  26731. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26732. noData: "\u65E0\u6570\u636E",
  26733. placeholder: "\u8BF7\u9009\u62E9"
  26734. },
  26735. cascader: {
  26736. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26737. loading: "\u52A0\u8F7D\u4E2D",
  26738. placeholder: "\u8BF7\u9009\u62E9",
  26739. noData: "\u6682\u65E0\u6570\u636E"
  26740. },
  26741. pagination: {
  26742. goto: "\u524D\u5F80",
  26743. pagesize: "\u6761/\u9875",
  26744. total: "\u5171 {total} \u6761",
  26745. pageClassifier: "\u9875",
  26746. page: "\u9875",
  26747. prev: "\u4E0A\u4E00\u9875",
  26748. next: "\u4E0B\u4E00\u9875",
  26749. currentPage: "\u7B2C {pager} \u9875",
  26750. prevPages: "\u5411\u524D {pager} \u9875",
  26751. nextPages: "\u5411\u540E {pager} \u9875",
  26752. deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
  26753. },
  26754. messagebox: {
  26755. title: "\u63D0\u793A",
  26756. confirm: "\u786E\u5B9A",
  26757. cancel: "\u53D6\u6D88",
  26758. error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
  26759. },
  26760. upload: {
  26761. deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
  26762. delete: "\u5220\u9664",
  26763. preview: "\u67E5\u770B\u56FE\u7247",
  26764. continue: "\u7EE7\u7EED\u4E0A\u4F20"
  26765. },
  26766. table: {
  26767. emptyText: "\u6682\u65E0\u6570\u636E",
  26768. confirmFilter: "\u7B5B\u9009",
  26769. resetFilter: "\u91CD\u7F6E",
  26770. clearFilter: "\u5168\u90E8",
  26771. sumText: "\u5408\u8BA1"
  26772. },
  26773. tree: {
  26774. emptyText: "\u6682\u65E0\u6570\u636E"
  26775. },
  26776. transfer: {
  26777. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26778. noData: "\u65E0\u6570\u636E",
  26779. titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
  26780. filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
  26781. noCheckedFormat: "\u5171 {total} \u9879",
  26782. hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
  26783. },
  26784. image: {
  26785. error: "\u52A0\u8F7D\u5931\u8D25"
  26786. },
  26787. pageHeader: {
  26788. title: "\u8FD4\u56DE"
  26789. },
  26790. popconfirm: {
  26791. confirmButtonText: "\u786E\u5B9A",
  26792. cancelButtonText: "\u53D6\u6D88"
  26793. }
  26794. }
  26795. };
  26796. /*! Element Plus v2.3.4 */
  26797. var en = {
  26798. name: "en",
  26799. el: {
  26800. colorpicker: {
  26801. confirm: "OK",
  26802. clear: "Clear",
  26803. defaultLabel: "color picker",
  26804. description: "current color is {color}. press enter to select a new color."
  26805. },
  26806. datepicker: {
  26807. now: "Now",
  26808. today: "Today",
  26809. cancel: "Cancel",
  26810. clear: "Clear",
  26811. confirm: "OK",
  26812. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  26813. monthTablePrompt: "Use the arrow keys and enter to select the month",
  26814. yearTablePrompt: "Use the arrow keys and enter to select the year",
  26815. selectedDate: "Selected date",
  26816. selectDate: "Select date",
  26817. selectTime: "Select time",
  26818. startDate: "Start Date",
  26819. startTime: "Start Time",
  26820. endDate: "End Date",
  26821. endTime: "End Time",
  26822. prevYear: "Previous Year",
  26823. nextYear: "Next Year",
  26824. prevMonth: "Previous Month",
  26825. nextMonth: "Next Month",
  26826. year: "",
  26827. month1: "January",
  26828. month2: "February",
  26829. month3: "March",
  26830. month4: "April",
  26831. month5: "May",
  26832. month6: "June",
  26833. month7: "July",
  26834. month8: "August",
  26835. month9: "September",
  26836. month10: "October",
  26837. month11: "November",
  26838. month12: "December",
  26839. week: "week",
  26840. weeks: {
  26841. sun: "Sun",
  26842. mon: "Mon",
  26843. tue: "Tue",
  26844. wed: "Wed",
  26845. thu: "Thu",
  26846. fri: "Fri",
  26847. sat: "Sat"
  26848. },
  26849. weeksFull: {
  26850. sun: "Sunday",
  26851. mon: "Monday",
  26852. tue: "Tuesday",
  26853. wed: "Wednesday",
  26854. thu: "Thursday",
  26855. fri: "Friday",
  26856. sat: "Saturday"
  26857. },
  26858. months: {
  26859. jan: "Jan",
  26860. feb: "Feb",
  26861. mar: "Mar",
  26862. apr: "Apr",
  26863. may: "May",
  26864. jun: "Jun",
  26865. jul: "Jul",
  26866. aug: "Aug",
  26867. sep: "Sep",
  26868. oct: "Oct",
  26869. nov: "Nov",
  26870. dec: "Dec"
  26871. }
  26872. },
  26873. inputNumber: {
  26874. decrease: "decrease number",
  26875. increase: "increase number"
  26876. },
  26877. select: {
  26878. loading: "Loading",
  26879. noMatch: "No matching data",
  26880. noData: "No data",
  26881. placeholder: "Select"
  26882. },
  26883. dropdown: {
  26884. toggleDropdown: "Toggle Dropdown"
  26885. },
  26886. cascader: {
  26887. noMatch: "No matching data",
  26888. loading: "Loading",
  26889. placeholder: "Select",
  26890. noData: "No data"
  26891. },
  26892. pagination: {
  26893. goto: "Go to",
  26894. pagesize: "/page",
  26895. total: "Total {total}",
  26896. pageClassifier: "",
  26897. page: "Page",
  26898. prev: "Go to previous page",
  26899. next: "Go to next page",
  26900. currentPage: "page {pager}",
  26901. prevPages: "Previous {pager} pages",
  26902. nextPages: "Next {pager} pages",
  26903. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  26904. },
  26905. dialog: {
  26906. close: "Close this dialog"
  26907. },
  26908. drawer: {
  26909. close: "Close this dialog"
  26910. },
  26911. messagebox: {
  26912. title: "Message",
  26913. confirm: "OK",
  26914. cancel: "Cancel",
  26915. error: "Illegal input",
  26916. close: "Close this dialog"
  26917. },
  26918. upload: {
  26919. deleteTip: "press delete to remove",
  26920. delete: "Delete",
  26921. preview: "Preview",
  26922. continue: "Continue"
  26923. },
  26924. slider: {
  26925. defaultLabel: "slider between {min} and {max}",
  26926. defaultRangeStartLabel: "pick start value",
  26927. defaultRangeEndLabel: "pick end value"
  26928. },
  26929. table: {
  26930. emptyText: "No Data",
  26931. confirmFilter: "Confirm",
  26932. resetFilter: "Reset",
  26933. clearFilter: "All",
  26934. sumText: "Sum"
  26935. },
  26936. tree: {
  26937. emptyText: "No Data"
  26938. },
  26939. transfer: {
  26940. noMatch: "No matching data",
  26941. noData: "No data",
  26942. titles: ["List 1", "List 2"],
  26943. filterPlaceholder: "Enter keyword",
  26944. noCheckedFormat: "{total} items",
  26945. hasCheckedFormat: "{checked}/{total} checked"
  26946. },
  26947. image: {
  26948. error: "FAILED"
  26949. },
  26950. pageHeader: {
  26951. title: "Back"
  26952. },
  26953. popconfirm: {
  26954. confirmButtonText: "Yes",
  26955. cancelButtonText: "No"
  26956. }
  26957. }
  26958. };
  26959. var jquery = { exports: {} };
  26960. /*!
  26961. * jQuery JavaScript Library v3.7.0
  26962. * https://jquery.com/
  26963. *
  26964. * Copyright OpenJS Foundation and other contributors
  26965. * Released under the MIT license
  26966. * https://jquery.org/license
  26967. *
  26968. * Date: 2023-05-11T18:29Z
  26969. */
  26970. (function(module2) {
  26971. (function(global2, factory3) {
  26972. {
  26973. module2.exports = global2.document ? factory3(global2, true) : function(w) {
  26974. if (!w.document) {
  26975. throw new Error("jQuery requires a window with a document");
  26976. }
  26977. return factory3(w);
  26978. };
  26979. }
  26980. })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
  26981. var arr = [];
  26982. var getProto = Object.getPrototypeOf;
  26983. var slice = arr.slice;
  26984. var flat2 = arr.flat ? function(array) {
  26985. return arr.flat.call(array);
  26986. } : function(array) {
  26987. return arr.concat.apply([], array);
  26988. };
  26989. var push = arr.push;
  26990. var indexOf = arr.indexOf;
  26991. var class2type = {};
  26992. var toString2 = class2type.toString;
  26993. var hasOwn2 = class2type.hasOwnProperty;
  26994. var fnToString = hasOwn2.toString;
  26995. var ObjectFunctionString = fnToString.call(Object);
  26996. var support = {};
  26997. var isFunction2 = function isFunction3(obj) {
  26998. return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
  26999. };
  27000. var isWindow = function isWindow2(obj) {
  27001. return obj != null && obj === obj.window;
  27002. };
  27003. var document2 = window2.document;
  27004. var preservedScriptAttributes = {
  27005. type: true,
  27006. src: true,
  27007. nonce: true,
  27008. noModule: true
  27009. };
  27010. function DOMEval(code, node, doc) {
  27011. doc = doc || document2;
  27012. var i2, val, script = doc.createElement("script");
  27013. script.text = code;
  27014. if (node) {
  27015. for (i2 in preservedScriptAttributes) {
  27016. val = node[i2] || node.getAttribute && node.getAttribute(i2);
  27017. if (val) {
  27018. script.setAttribute(i2, val);
  27019. }
  27020. }
  27021. }
  27022. doc.head.appendChild(script).parentNode.removeChild(script);
  27023. }
  27024. function toType(obj) {
  27025. if (obj == null) {
  27026. return obj + "";
  27027. }
  27028. return typeof obj === "object" || typeof obj === "function" ? class2type[toString2.call(obj)] || "object" : typeof obj;
  27029. }
  27030. var version2 = "3.7.0", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
  27031. return new jQuery.fn.init(selector, context);
  27032. };
  27033. jQuery.fn = jQuery.prototype = {
  27034. jquery: version2,
  27035. constructor: jQuery,
  27036. length: 0,
  27037. toArray: function() {
  27038. return slice.call(this);
  27039. },
  27040. get: function(num) {
  27041. if (num == null) {
  27042. return slice.call(this);
  27043. }
  27044. return num < 0 ? this[num + this.length] : this[num];
  27045. },
  27046. pushStack: function(elems) {
  27047. var ret = jQuery.merge(this.constructor(), elems);
  27048. ret.prevObject = this;
  27049. return ret;
  27050. },
  27051. each: function(callback2) {
  27052. return jQuery.each(this, callback2);
  27053. },
  27054. map: function(callback2) {
  27055. return this.pushStack(jQuery.map(this, function(elem, i2) {
  27056. return callback2.call(elem, i2, elem);
  27057. }));
  27058. },
  27059. slice: function() {
  27060. return this.pushStack(slice.apply(this, arguments));
  27061. },
  27062. first: function() {
  27063. return this.eq(0);
  27064. },
  27065. last: function() {
  27066. return this.eq(-1);
  27067. },
  27068. even: function() {
  27069. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27070. return (i2 + 1) % 2;
  27071. }));
  27072. },
  27073. odd: function() {
  27074. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27075. return i2 % 2;
  27076. }));
  27077. },
  27078. eq: function(i2) {
  27079. var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
  27080. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  27081. },
  27082. end: function() {
  27083. return this.prevObject || this.constructor();
  27084. },
  27085. push,
  27086. sort: arr.sort,
  27087. splice: arr.splice
  27088. };
  27089. jQuery.extend = jQuery.fn.extend = function() {
  27090. var options2, name, src, copy2, copyIsArray, clone, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
  27091. if (typeof target === "boolean") {
  27092. deep = target;
  27093. target = arguments[i2] || {};
  27094. i2++;
  27095. }
  27096. if (typeof target !== "object" && !isFunction2(target)) {
  27097. target = {};
  27098. }
  27099. if (i2 === length) {
  27100. target = this;
  27101. i2--;
  27102. }
  27103. for (; i2 < length; i2++) {
  27104. if ((options2 = arguments[i2]) != null) {
  27105. for (name in options2) {
  27106. copy2 = options2[name];
  27107. if (name === "__proto__" || target === copy2) {
  27108. continue;
  27109. }
  27110. if (deep && copy2 && (jQuery.isPlainObject(copy2) || (copyIsArray = Array.isArray(copy2)))) {
  27111. src = target[name];
  27112. if (copyIsArray && !Array.isArray(src)) {
  27113. clone = [];
  27114. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  27115. clone = {};
  27116. } else {
  27117. clone = src;
  27118. }
  27119. copyIsArray = false;
  27120. target[name] = jQuery.extend(deep, clone, copy2);
  27121. } else if (copy2 !== void 0) {
  27122. target[name] = copy2;
  27123. }
  27124. }
  27125. }
  27126. }
  27127. return target;
  27128. };
  27129. jQuery.extend({
  27130. expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
  27131. isReady: true,
  27132. error: function(msg) {
  27133. throw new Error(msg);
  27134. },
  27135. noop: function() {
  27136. },
  27137. isPlainObject: function(obj) {
  27138. var proto, Ctor;
  27139. if (!obj || toString2.call(obj) !== "[object Object]") {
  27140. return false;
  27141. }
  27142. proto = getProto(obj);
  27143. if (!proto) {
  27144. return true;
  27145. }
  27146. Ctor = hasOwn2.call(proto, "constructor") && proto.constructor;
  27147. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  27148. },
  27149. isEmptyObject: function(obj) {
  27150. var name;
  27151. for (name in obj) {
  27152. return false;
  27153. }
  27154. return true;
  27155. },
  27156. globalEval: function(code, options2, doc) {
  27157. DOMEval(code, { nonce: options2 && options2.nonce }, doc);
  27158. },
  27159. each: function(obj, callback2) {
  27160. var length, i2 = 0;
  27161. if (isArrayLike2(obj)) {
  27162. length = obj.length;
  27163. for (; i2 < length; i2++) {
  27164. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27165. break;
  27166. }
  27167. }
  27168. } else {
  27169. for (i2 in obj) {
  27170. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27171. break;
  27172. }
  27173. }
  27174. }
  27175. return obj;
  27176. },
  27177. text: function(elem) {
  27178. var node, ret = "", i2 = 0, nodeType = elem.nodeType;
  27179. if (!nodeType) {
  27180. while (node = elem[i2++]) {
  27181. ret += jQuery.text(node);
  27182. }
  27183. } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  27184. return elem.textContent;
  27185. } else if (nodeType === 3 || nodeType === 4) {
  27186. return elem.nodeValue;
  27187. }
  27188. return ret;
  27189. },
  27190. makeArray: function(arr2, results) {
  27191. var ret = results || [];
  27192. if (arr2 != null) {
  27193. if (isArrayLike2(Object(arr2))) {
  27194. jQuery.merge(
  27195. ret,
  27196. typeof arr2 === "string" ? [arr2] : arr2
  27197. );
  27198. } else {
  27199. push.call(ret, arr2);
  27200. }
  27201. }
  27202. return ret;
  27203. },
  27204. inArray: function(elem, arr2, i2) {
  27205. return arr2 == null ? -1 : indexOf.call(arr2, elem, i2);
  27206. },
  27207. isXMLDoc: function(elem) {
  27208. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  27209. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  27210. },
  27211. merge: function(first, second) {
  27212. var len = +second.length, j = 0, i2 = first.length;
  27213. for (; j < len; j++) {
  27214. first[i2++] = second[j];
  27215. }
  27216. first.length = i2;
  27217. return first;
  27218. },
  27219. grep: function(elems, callback2, invert) {
  27220. var callbackInverse, matches = [], i2 = 0, length = elems.length, callbackExpect = !invert;
  27221. for (; i2 < length; i2++) {
  27222. callbackInverse = !callback2(elems[i2], i2);
  27223. if (callbackInverse !== callbackExpect) {
  27224. matches.push(elems[i2]);
  27225. }
  27226. }
  27227. return matches;
  27228. },
  27229. map: function(elems, callback2, arg) {
  27230. var length, value, i2 = 0, ret = [];
  27231. if (isArrayLike2(elems)) {
  27232. length = elems.length;
  27233. for (; i2 < length; i2++) {
  27234. value = callback2(elems[i2], i2, arg);
  27235. if (value != null) {
  27236. ret.push(value);
  27237. }
  27238. }
  27239. } else {
  27240. for (i2 in elems) {
  27241. value = callback2(elems[i2], i2, arg);
  27242. if (value != null) {
  27243. ret.push(value);
  27244. }
  27245. }
  27246. }
  27247. return flat2(ret);
  27248. },
  27249. guid: 1,
  27250. support
  27251. });
  27252. if (typeof Symbol === "function") {
  27253. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  27254. }
  27255. jQuery.each(
  27256. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  27257. function(_i, name) {
  27258. class2type["[object " + name + "]"] = name.toLowerCase();
  27259. }
  27260. );
  27261. function isArrayLike2(obj) {
  27262. var length = !!obj && "length" in obj && obj.length, type2 = toType(obj);
  27263. if (isFunction2(obj) || isWindow(obj)) {
  27264. return false;
  27265. }
  27266. return type2 === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  27267. }
  27268. function nodeName(elem, name) {
  27269. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  27270. }
  27271. var pop = arr.pop;
  27272. var sort = arr.sort;
  27273. var splice2 = arr.splice;
  27274. var whitespace = "[\\x20\\t\\r\\n\\f]";
  27275. var rtrimCSS = new RegExp(
  27276. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  27277. "g"
  27278. );
  27279. jQuery.contains = function(a, b) {
  27280. var bup = b && b.parentNode;
  27281. return a === bup || !!(bup && bup.nodeType === 1 && (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  27282. };
  27283. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  27284. function fcssescape(ch, asCodePoint) {
  27285. if (asCodePoint) {
  27286. if (ch === "\0") {
  27287. return "\uFFFD";
  27288. }
  27289. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  27290. }
  27291. return "\\" + ch;
  27292. }
  27293. jQuery.escapeSelector = function(sel) {
  27294. return (sel + "").replace(rcssescape, fcssescape);
  27295. };
  27296. var preferredDoc = document2, pushNative = push;
  27297. (function() {
  27298. var i2, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
  27299. if (a === b) {
  27300. hasDuplicate = true;
  27301. }
  27302. return 0;
  27303. }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
  27304. ID: new RegExp("^#(" + identifier + ")"),
  27305. CLASS: new RegExp("^\\.(" + identifier + ")"),
  27306. TAG: new RegExp("^(" + identifier + "|[*])"),
  27307. ATTR: new RegExp("^" + attributes),
  27308. PSEUDO: new RegExp("^" + pseudos),
  27309. CHILD: new RegExp(
  27310. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  27311. "i"
  27312. ),
  27313. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  27314. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  27315. }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape2, nonHex) {
  27316. var high = "0x" + escape2.slice(1) - 65536;
  27317. if (nonHex) {
  27318. return nonHex;
  27319. }
  27320. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  27321. }, unloadHandler = function() {
  27322. setDocument();
  27323. }, inDisabledFieldset = addCombinator(
  27324. function(elem) {
  27325. return elem.disabled === true && nodeName(elem, "fieldset");
  27326. },
  27327. { dir: "parentNode", next: "legend" }
  27328. );
  27329. function safeActiveElement() {
  27330. try {
  27331. return document3.activeElement;
  27332. } catch (err) {
  27333. }
  27334. }
  27335. try {
  27336. push2.apply(
  27337. arr = slice.call(preferredDoc.childNodes),
  27338. preferredDoc.childNodes
  27339. );
  27340. arr[preferredDoc.childNodes.length].nodeType;
  27341. } catch (e) {
  27342. push2 = {
  27343. apply: function(target, els) {
  27344. pushNative.apply(target, slice.call(els));
  27345. },
  27346. call: function(target) {
  27347. pushNative.apply(target, slice.call(arguments, 1));
  27348. }
  27349. };
  27350. }
  27351. function find2(selector, context, results, seed) {
  27352. var m, i3, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  27353. results = results || [];
  27354. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  27355. return results;
  27356. }
  27357. if (!seed) {
  27358. setDocument(context);
  27359. context = context || document3;
  27360. if (documentIsHTML) {
  27361. if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
  27362. if (m = match[1]) {
  27363. if (nodeType === 9) {
  27364. if (elem = context.getElementById(m)) {
  27365. if (elem.id === m) {
  27366. push2.call(results, elem);
  27367. return results;
  27368. }
  27369. } else {
  27370. return results;
  27371. }
  27372. } else {
  27373. if (newContext && (elem = newContext.getElementById(m)) && find2.contains(context, elem) && elem.id === m) {
  27374. push2.call(results, elem);
  27375. return results;
  27376. }
  27377. }
  27378. } else if (match[2]) {
  27379. push2.apply(results, context.getElementsByTagName(selector));
  27380. return results;
  27381. } else if ((m = match[3]) && context.getElementsByClassName) {
  27382. push2.apply(results, context.getElementsByClassName(m));
  27383. return results;
  27384. }
  27385. }
  27386. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  27387. newSelector = selector;
  27388. newContext = context;
  27389. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  27390. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  27391. if (newContext != context || !support.scope) {
  27392. if (nid = context.getAttribute("id")) {
  27393. nid = jQuery.escapeSelector(nid);
  27394. } else {
  27395. context.setAttribute("id", nid = expando);
  27396. }
  27397. }
  27398. groups = tokenize(selector);
  27399. i3 = groups.length;
  27400. while (i3--) {
  27401. groups[i3] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i3]);
  27402. }
  27403. newSelector = groups.join(",");
  27404. }
  27405. try {
  27406. push2.apply(
  27407. results,
  27408. newContext.querySelectorAll(newSelector)
  27409. );
  27410. return results;
  27411. } catch (qsaError) {
  27412. nonnativeSelectorCache(selector, true);
  27413. } finally {
  27414. if (nid === expando) {
  27415. context.removeAttribute("id");
  27416. }
  27417. }
  27418. }
  27419. }
  27420. }
  27421. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  27422. }
  27423. function createCache() {
  27424. var keys3 = [];
  27425. function cache(key, value) {
  27426. if (keys3.push(key + " ") > Expr.cacheLength) {
  27427. delete cache[keys3.shift()];
  27428. }
  27429. return cache[key + " "] = value;
  27430. }
  27431. return cache;
  27432. }
  27433. function markFunction(fn2) {
  27434. fn2[expando] = true;
  27435. return fn2;
  27436. }
  27437. function assert(fn2) {
  27438. var el = document3.createElement("fieldset");
  27439. try {
  27440. return !!fn2(el);
  27441. } catch (e) {
  27442. return false;
  27443. } finally {
  27444. if (el.parentNode) {
  27445. el.parentNode.removeChild(el);
  27446. }
  27447. el = null;
  27448. }
  27449. }
  27450. function createInputPseudo(type2) {
  27451. return function(elem) {
  27452. return nodeName(elem, "input") && elem.type === type2;
  27453. };
  27454. }
  27455. function createButtonPseudo(type2) {
  27456. return function(elem) {
  27457. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type2;
  27458. };
  27459. }
  27460. function createDisabledPseudo(disabled) {
  27461. return function(elem) {
  27462. if ("form" in elem) {
  27463. if (elem.parentNode && elem.disabled === false) {
  27464. if ("label" in elem) {
  27465. if ("label" in elem.parentNode) {
  27466. return elem.parentNode.disabled === disabled;
  27467. } else {
  27468. return elem.disabled === disabled;
  27469. }
  27470. }
  27471. return elem.isDisabled === disabled || elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  27472. }
  27473. return elem.disabled === disabled;
  27474. } else if ("label" in elem) {
  27475. return elem.disabled === disabled;
  27476. }
  27477. return false;
  27478. };
  27479. }
  27480. function createPositionalPseudo(fn2) {
  27481. return markFunction(function(argument) {
  27482. argument = +argument;
  27483. return markFunction(function(seed, matches2) {
  27484. var j, matchIndexes = fn2([], seed.length, argument), i3 = matchIndexes.length;
  27485. while (i3--) {
  27486. if (seed[j = matchIndexes[i3]]) {
  27487. seed[j] = !(matches2[j] = seed[j]);
  27488. }
  27489. }
  27490. });
  27491. });
  27492. }
  27493. function testContext(context) {
  27494. return context && typeof context.getElementsByTagName !== "undefined" && context;
  27495. }
  27496. function setDocument(node) {
  27497. var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
  27498. if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
  27499. return document3;
  27500. }
  27501. document3 = doc;
  27502. documentElement2 = document3.documentElement;
  27503. documentIsHTML = !jQuery.isXMLDoc(document3);
  27504. matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
  27505. if (preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
  27506. subWindow.addEventListener("unload", unloadHandler);
  27507. }
  27508. support.getById = assert(function(el) {
  27509. documentElement2.appendChild(el).id = jQuery.expando;
  27510. return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
  27511. });
  27512. support.disconnectedMatch = assert(function(el) {
  27513. return matches.call(el, "*");
  27514. });
  27515. support.scope = assert(function() {
  27516. return document3.querySelectorAll(":scope");
  27517. });
  27518. support.cssHas = assert(function() {
  27519. try {
  27520. document3.querySelector(":has(*,:jqfake)");
  27521. return false;
  27522. } catch (e) {
  27523. return true;
  27524. }
  27525. });
  27526. if (support.getById) {
  27527. Expr.filter.ID = function(id) {
  27528. var attrId = id.replace(runescape, funescape);
  27529. return function(elem) {
  27530. return elem.getAttribute("id") === attrId;
  27531. };
  27532. };
  27533. Expr.find.ID = function(id, context) {
  27534. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27535. var elem = context.getElementById(id);
  27536. return elem ? [elem] : [];
  27537. }
  27538. };
  27539. } else {
  27540. Expr.filter.ID = function(id) {
  27541. var attrId = id.replace(runescape, funescape);
  27542. return function(elem) {
  27543. var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  27544. return node2 && node2.value === attrId;
  27545. };
  27546. };
  27547. Expr.find.ID = function(id, context) {
  27548. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27549. var node2, i3, elems, elem = context.getElementById(id);
  27550. if (elem) {
  27551. node2 = elem.getAttributeNode("id");
  27552. if (node2 && node2.value === id) {
  27553. return [elem];
  27554. }
  27555. elems = context.getElementsByName(id);
  27556. i3 = 0;
  27557. while (elem = elems[i3++]) {
  27558. node2 = elem.getAttributeNode("id");
  27559. if (node2 && node2.value === id) {
  27560. return [elem];
  27561. }
  27562. }
  27563. }
  27564. return [];
  27565. }
  27566. };
  27567. }
  27568. Expr.find.TAG = function(tag, context) {
  27569. if (typeof context.getElementsByTagName !== "undefined") {
  27570. return context.getElementsByTagName(tag);
  27571. } else {
  27572. return context.querySelectorAll(tag);
  27573. }
  27574. };
  27575. Expr.find.CLASS = function(className, context) {
  27576. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  27577. return context.getElementsByClassName(className);
  27578. }
  27579. };
  27580. rbuggyQSA = [];
  27581. assert(function(el) {
  27582. var input;
  27583. documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
  27584. if (!el.querySelectorAll("[selected]").length) {
  27585. rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
  27586. }
  27587. if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
  27588. rbuggyQSA.push("~=");
  27589. }
  27590. if (!el.querySelectorAll("a#" + expando + "+*").length) {
  27591. rbuggyQSA.push(".#.+[+~]");
  27592. }
  27593. if (!el.querySelectorAll(":checked").length) {
  27594. rbuggyQSA.push(":checked");
  27595. }
  27596. input = document3.createElement("input");
  27597. input.setAttribute("type", "hidden");
  27598. el.appendChild(input).setAttribute("name", "D");
  27599. documentElement2.appendChild(el).disabled = true;
  27600. if (el.querySelectorAll(":disabled").length !== 2) {
  27601. rbuggyQSA.push(":enabled", ":disabled");
  27602. }
  27603. input = document3.createElement("input");
  27604. input.setAttribute("name", "");
  27605. el.appendChild(input);
  27606. if (!el.querySelectorAll("[name='']").length) {
  27607. rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
  27608. }
  27609. });
  27610. if (!support.cssHas) {
  27611. rbuggyQSA.push(":has");
  27612. }
  27613. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  27614. sortOrder = function(a, b) {
  27615. if (a === b) {
  27616. hasDuplicate = true;
  27617. return 0;
  27618. }
  27619. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  27620. if (compare) {
  27621. return compare;
  27622. }
  27623. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
  27624. if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
  27625. if (a === document3 || a.ownerDocument == preferredDoc && find2.contains(preferredDoc, a)) {
  27626. return -1;
  27627. }
  27628. if (b === document3 || b.ownerDocument == preferredDoc && find2.contains(preferredDoc, b)) {
  27629. return 1;
  27630. }
  27631. return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  27632. }
  27633. return compare & 4 ? -1 : 1;
  27634. };
  27635. return document3;
  27636. }
  27637. find2.matches = function(expr, elements) {
  27638. return find2(expr, null, null, elements);
  27639. };
  27640. find2.matchesSelector = function(elem, expr) {
  27641. setDocument(elem);
  27642. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  27643. try {
  27644. var ret = matches.call(elem, expr);
  27645. if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
  27646. return ret;
  27647. }
  27648. } catch (e) {
  27649. nonnativeSelectorCache(expr, true);
  27650. }
  27651. }
  27652. return find2(expr, document3, null, [elem]).length > 0;
  27653. };
  27654. find2.contains = function(context, elem) {
  27655. if ((context.ownerDocument || context) != document3) {
  27656. setDocument(context);
  27657. }
  27658. return jQuery.contains(context, elem);
  27659. };
  27660. find2.attr = function(elem, name) {
  27661. if ((elem.ownerDocument || elem) != document3) {
  27662. setDocument(elem);
  27663. }
  27664. var fn2 = Expr.attrHandle[name.toLowerCase()], val = fn2 && hasOwn2.call(Expr.attrHandle, name.toLowerCase()) ? fn2(elem, name, !documentIsHTML) : void 0;
  27665. if (val !== void 0) {
  27666. return val;
  27667. }
  27668. return elem.getAttribute(name);
  27669. };
  27670. find2.error = function(msg) {
  27671. throw new Error("Syntax error, unrecognized expression: " + msg);
  27672. };
  27673. jQuery.uniqueSort = function(results) {
  27674. var elem, duplicates = [], j = 0, i3 = 0;
  27675. hasDuplicate = !support.sortStable;
  27676. sortInput = !support.sortStable && slice.call(results, 0);
  27677. sort.call(results, sortOrder);
  27678. if (hasDuplicate) {
  27679. while (elem = results[i3++]) {
  27680. if (elem === results[i3]) {
  27681. j = duplicates.push(i3);
  27682. }
  27683. }
  27684. while (j--) {
  27685. splice2.call(results, duplicates[j], 1);
  27686. }
  27687. }
  27688. sortInput = null;
  27689. return results;
  27690. };
  27691. jQuery.fn.uniqueSort = function() {
  27692. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  27693. };
  27694. Expr = jQuery.expr = {
  27695. cacheLength: 50,
  27696. createPseudo: markFunction,
  27697. match: matchExpr,
  27698. attrHandle: {},
  27699. find: {},
  27700. relative: {
  27701. ">": { dir: "parentNode", first: true },
  27702. " ": { dir: "parentNode" },
  27703. "+": { dir: "previousSibling", first: true },
  27704. "~": { dir: "previousSibling" }
  27705. },
  27706. preFilter: {
  27707. ATTR: function(match) {
  27708. match[1] = match[1].replace(runescape, funescape);
  27709. match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
  27710. if (match[2] === "~=") {
  27711. match[3] = " " + match[3] + " ";
  27712. }
  27713. return match.slice(0, 4);
  27714. },
  27715. CHILD: function(match) {
  27716. match[1] = match[1].toLowerCase();
  27717. if (match[1].slice(0, 3) === "nth") {
  27718. if (!match[3]) {
  27719. find2.error(match[0]);
  27720. }
  27721. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  27722. match[5] = +(match[7] + match[8] || match[3] === "odd");
  27723. } else if (match[3]) {
  27724. find2.error(match[0]);
  27725. }
  27726. return match;
  27727. },
  27728. PSEUDO: function(match) {
  27729. var excess, unquoted = !match[6] && match[2];
  27730. if (matchExpr.CHILD.test(match[0])) {
  27731. return null;
  27732. }
  27733. if (match[3]) {
  27734. match[2] = match[4] || match[5] || "";
  27735. } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  27736. match[0] = match[0].slice(0, excess);
  27737. match[2] = unquoted.slice(0, excess);
  27738. }
  27739. return match.slice(0, 3);
  27740. }
  27741. },
  27742. filter: {
  27743. TAG: function(nodeNameSelector) {
  27744. var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
  27745. return nodeNameSelector === "*" ? function() {
  27746. return true;
  27747. } : function(elem) {
  27748. return nodeName(elem, expectedNodeName);
  27749. };
  27750. },
  27751. CLASS: function(className) {
  27752. var pattern = classCache[className + " "];
  27753. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  27754. return pattern.test(
  27755. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  27756. );
  27757. });
  27758. },
  27759. ATTR: function(name, operator, check) {
  27760. return function(elem) {
  27761. var result = find2.attr(elem, name);
  27762. if (result == null) {
  27763. return operator === "!=";
  27764. }
  27765. if (!operator) {
  27766. return true;
  27767. }
  27768. result += "";
  27769. if (operator === "=") {
  27770. return result === check;
  27771. }
  27772. if (operator === "!=") {
  27773. return result !== check;
  27774. }
  27775. if (operator === "^=") {
  27776. return check && result.indexOf(check) === 0;
  27777. }
  27778. if (operator === "*=") {
  27779. return check && result.indexOf(check) > -1;
  27780. }
  27781. if (operator === "$=") {
  27782. return check && result.slice(-check.length) === check;
  27783. }
  27784. if (operator === "~=") {
  27785. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  27786. }
  27787. if (operator === "|=") {
  27788. return result === check || result.slice(0, check.length + 1) === check + "-";
  27789. }
  27790. return false;
  27791. };
  27792. },
  27793. CHILD: function(type2, what, _argument, first, last) {
  27794. var simple = type2.slice(0, 3) !== "nth", forward = type2.slice(-4) !== "last", ofType = what === "of-type";
  27795. return first === 1 && last === 0 ? function(elem) {
  27796. return !!elem.parentNode;
  27797. } : function(elem, _context, xml) {
  27798. var cache, outerCache, node, nodeIndex, start2, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  27799. if (parent) {
  27800. if (simple) {
  27801. while (dir2) {
  27802. node = elem;
  27803. while (node = node[dir2]) {
  27804. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  27805. return false;
  27806. }
  27807. }
  27808. start2 = dir2 = type2 === "only" && !start2 && "nextSibling";
  27809. }
  27810. return true;
  27811. }
  27812. start2 = [forward ? parent.firstChild : parent.lastChild];
  27813. if (forward && useCache) {
  27814. outerCache = parent[expando] || (parent[expando] = {});
  27815. cache = outerCache[type2] || [];
  27816. nodeIndex = cache[0] === dirruns && cache[1];
  27817. diff = nodeIndex && cache[2];
  27818. node = nodeIndex && parent.childNodes[nodeIndex];
  27819. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27820. if (node.nodeType === 1 && ++diff && node === elem) {
  27821. outerCache[type2] = [dirruns, nodeIndex, diff];
  27822. break;
  27823. }
  27824. }
  27825. } else {
  27826. if (useCache) {
  27827. outerCache = elem[expando] || (elem[expando] = {});
  27828. cache = outerCache[type2] || [];
  27829. nodeIndex = cache[0] === dirruns && cache[1];
  27830. diff = nodeIndex;
  27831. }
  27832. if (diff === false) {
  27833. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27834. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  27835. if (useCache) {
  27836. outerCache = node[expando] || (node[expando] = {});
  27837. outerCache[type2] = [dirruns, diff];
  27838. }
  27839. if (node === elem) {
  27840. break;
  27841. }
  27842. }
  27843. }
  27844. }
  27845. }
  27846. diff -= last;
  27847. return diff === first || diff % first === 0 && diff / first >= 0;
  27848. }
  27849. };
  27850. },
  27851. PSEUDO: function(pseudo, argument) {
  27852. var args, fn2 = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find2.error("unsupported pseudo: " + pseudo);
  27853. if (fn2[expando]) {
  27854. return fn2(argument);
  27855. }
  27856. if (fn2.length > 1) {
  27857. args = [pseudo, pseudo, "", argument];
  27858. return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
  27859. var idx, matched = fn2(seed, argument), i3 = matched.length;
  27860. while (i3--) {
  27861. idx = indexOf.call(seed, matched[i3]);
  27862. seed[idx] = !(matches2[idx] = matched[i3]);
  27863. }
  27864. }) : function(elem) {
  27865. return fn2(elem, 0, args);
  27866. };
  27867. }
  27868. return fn2;
  27869. }
  27870. },
  27871. pseudos: {
  27872. not: markFunction(function(selector) {
  27873. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  27874. return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
  27875. var elem, unmatched = matcher(seed, null, xml, []), i3 = seed.length;
  27876. while (i3--) {
  27877. if (elem = unmatched[i3]) {
  27878. seed[i3] = !(matches2[i3] = elem);
  27879. }
  27880. }
  27881. }) : function(elem, _context, xml) {
  27882. input[0] = elem;
  27883. matcher(input, null, xml, results);
  27884. input[0] = null;
  27885. return !results.pop();
  27886. };
  27887. }),
  27888. has: markFunction(function(selector) {
  27889. return function(elem) {
  27890. return find2(selector, elem).length > 0;
  27891. };
  27892. }),
  27893. contains: markFunction(function(text) {
  27894. text = text.replace(runescape, funescape);
  27895. return function(elem) {
  27896. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  27897. };
  27898. }),
  27899. lang: markFunction(function(lang) {
  27900. if (!ridentifier.test(lang || "")) {
  27901. find2.error("unsupported lang: " + lang);
  27902. }
  27903. lang = lang.replace(runescape, funescape).toLowerCase();
  27904. return function(elem) {
  27905. var elemLang;
  27906. do {
  27907. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  27908. elemLang = elemLang.toLowerCase();
  27909. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  27910. }
  27911. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  27912. return false;
  27913. };
  27914. }),
  27915. target: function(elem) {
  27916. var hash = window2.location && window2.location.hash;
  27917. return hash && hash.slice(1) === elem.id;
  27918. },
  27919. root: function(elem) {
  27920. return elem === documentElement2;
  27921. },
  27922. focus: function(elem) {
  27923. return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  27924. },
  27925. enabled: createDisabledPseudo(false),
  27926. disabled: createDisabledPseudo(true),
  27927. checked: function(elem) {
  27928. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  27929. },
  27930. selected: function(elem) {
  27931. if (elem.parentNode) {
  27932. elem.parentNode.selectedIndex;
  27933. }
  27934. return elem.selected === true;
  27935. },
  27936. empty: function(elem) {
  27937. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  27938. if (elem.nodeType < 6) {
  27939. return false;
  27940. }
  27941. }
  27942. return true;
  27943. },
  27944. parent: function(elem) {
  27945. return !Expr.pseudos.empty(elem);
  27946. },
  27947. header: function(elem) {
  27948. return rheader.test(elem.nodeName);
  27949. },
  27950. input: function(elem) {
  27951. return rinputs.test(elem.nodeName);
  27952. },
  27953. button: function(elem) {
  27954. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  27955. },
  27956. text: function(elem) {
  27957. var attr;
  27958. return nodeName(elem, "input") && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
  27959. },
  27960. first: createPositionalPseudo(function() {
  27961. return [0];
  27962. }),
  27963. last: createPositionalPseudo(function(_matchIndexes, length) {
  27964. return [length - 1];
  27965. }),
  27966. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  27967. return [argument < 0 ? argument + length : argument];
  27968. }),
  27969. even: createPositionalPseudo(function(matchIndexes, length) {
  27970. var i3 = 0;
  27971. for (; i3 < length; i3 += 2) {
  27972. matchIndexes.push(i3);
  27973. }
  27974. return matchIndexes;
  27975. }),
  27976. odd: createPositionalPseudo(function(matchIndexes, length) {
  27977. var i3 = 1;
  27978. for (; i3 < length; i3 += 2) {
  27979. matchIndexes.push(i3);
  27980. }
  27981. return matchIndexes;
  27982. }),
  27983. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27984. var i3;
  27985. if (argument < 0) {
  27986. i3 = argument + length;
  27987. } else if (argument > length) {
  27988. i3 = length;
  27989. } else {
  27990. i3 = argument;
  27991. }
  27992. for (; --i3 >= 0; ) {
  27993. matchIndexes.push(i3);
  27994. }
  27995. return matchIndexes;
  27996. }),
  27997. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27998. var i3 = argument < 0 ? argument + length : argument;
  27999. for (; ++i3 < length; ) {
  28000. matchIndexes.push(i3);
  28001. }
  28002. return matchIndexes;
  28003. })
  28004. }
  28005. };
  28006. Expr.pseudos.nth = Expr.pseudos.eq;
  28007. for (i2 in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  28008. Expr.pseudos[i2] = createInputPseudo(i2);
  28009. }
  28010. for (i2 in { submit: true, reset: true }) {
  28011. Expr.pseudos[i2] = createButtonPseudo(i2);
  28012. }
  28013. function setFilters() {
  28014. }
  28015. setFilters.prototype = Expr.filters = Expr.pseudos;
  28016. Expr.setFilters = new setFilters();
  28017. function tokenize(selector, parseOnly) {
  28018. var matched, match, tokens, type2, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  28019. if (cached) {
  28020. return parseOnly ? 0 : cached.slice(0);
  28021. }
  28022. soFar = selector;
  28023. groups = [];
  28024. preFilters = Expr.preFilter;
  28025. while (soFar) {
  28026. if (!matched || (match = rcomma.exec(soFar))) {
  28027. if (match) {
  28028. soFar = soFar.slice(match[0].length) || soFar;
  28029. }
  28030. groups.push(tokens = []);
  28031. }
  28032. matched = false;
  28033. if (match = rleadingCombinator.exec(soFar)) {
  28034. matched = match.shift();
  28035. tokens.push({
  28036. value: matched,
  28037. type: match[0].replace(rtrimCSS, " ")
  28038. });
  28039. soFar = soFar.slice(matched.length);
  28040. }
  28041. for (type2 in Expr.filter) {
  28042. if ((match = matchExpr[type2].exec(soFar)) && (!preFilters[type2] || (match = preFilters[type2](match)))) {
  28043. matched = match.shift();
  28044. tokens.push({
  28045. value: matched,
  28046. type: type2,
  28047. matches: match
  28048. });
  28049. soFar = soFar.slice(matched.length);
  28050. }
  28051. }
  28052. if (!matched) {
  28053. break;
  28054. }
  28055. }
  28056. if (parseOnly) {
  28057. return soFar.length;
  28058. }
  28059. return soFar ? find2.error(selector) : tokenCache(selector, groups).slice(0);
  28060. }
  28061. function toSelector(tokens) {
  28062. var i3 = 0, len = tokens.length, selector = "";
  28063. for (; i3 < len; i3++) {
  28064. selector += tokens[i3].value;
  28065. }
  28066. return selector;
  28067. }
  28068. function addCombinator(matcher, combinator, base2) {
  28069. var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base2 && key === "parentNode", doneName = done++;
  28070. return combinator.first ? function(elem, context, xml) {
  28071. while (elem = elem[dir2]) {
  28072. if (elem.nodeType === 1 || checkNonElements) {
  28073. return matcher(elem, context, xml);
  28074. }
  28075. }
  28076. return false;
  28077. } : function(elem, context, xml) {
  28078. var oldCache, outerCache, newCache = [dirruns, doneName];
  28079. if (xml) {
  28080. while (elem = elem[dir2]) {
  28081. if (elem.nodeType === 1 || checkNonElements) {
  28082. if (matcher(elem, context, xml)) {
  28083. return true;
  28084. }
  28085. }
  28086. }
  28087. } else {
  28088. while (elem = elem[dir2]) {
  28089. if (elem.nodeType === 1 || checkNonElements) {
  28090. outerCache = elem[expando] || (elem[expando] = {});
  28091. if (skip && nodeName(elem, skip)) {
  28092. elem = elem[dir2] || elem;
  28093. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  28094. return newCache[2] = oldCache[2];
  28095. } else {
  28096. outerCache[key] = newCache;
  28097. if (newCache[2] = matcher(elem, context, xml)) {
  28098. return true;
  28099. }
  28100. }
  28101. }
  28102. }
  28103. }
  28104. return false;
  28105. };
  28106. }
  28107. function elementMatcher(matchers2) {
  28108. return matchers2.length > 1 ? function(elem, context, xml) {
  28109. var i3 = matchers2.length;
  28110. while (i3--) {
  28111. if (!matchers2[i3](elem, context, xml)) {
  28112. return false;
  28113. }
  28114. }
  28115. return true;
  28116. } : matchers2[0];
  28117. }
  28118. function multipleContexts(selector, contexts, results) {
  28119. var i3 = 0, len = contexts.length;
  28120. for (; i3 < len; i3++) {
  28121. find2(selector, contexts[i3], results);
  28122. }
  28123. return results;
  28124. }
  28125. function condense(unmatched, map, filter, context, xml) {
  28126. var elem, newUnmatched = [], i3 = 0, len = unmatched.length, mapped = map != null;
  28127. for (; i3 < len; i3++) {
  28128. if (elem = unmatched[i3]) {
  28129. if (!filter || filter(elem, context, xml)) {
  28130. newUnmatched.push(elem);
  28131. if (mapped) {
  28132. map.push(i3);
  28133. }
  28134. }
  28135. }
  28136. }
  28137. return newUnmatched;
  28138. }
  28139. function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
  28140. if (postFilter && !postFilter[expando]) {
  28141. postFilter = setMatcher(postFilter);
  28142. }
  28143. if (postFinder && !postFinder[expando]) {
  28144. postFinder = setMatcher(postFinder, postSelector);
  28145. }
  28146. return markFunction(function(seed, results, context, xml) {
  28147. var temp, i3, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  28148. selector || "*",
  28149. context.nodeType ? [context] : context,
  28150. []
  28151. ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
  28152. if (matcher) {
  28153. matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results;
  28154. matcher(matcherIn, matcherOut, context, xml);
  28155. } else {
  28156. matcherOut = matcherIn;
  28157. }
  28158. if (postFilter) {
  28159. temp = condense(matcherOut, postMap);
  28160. postFilter(temp, [], context, xml);
  28161. i3 = temp.length;
  28162. while (i3--) {
  28163. if (elem = temp[i3]) {
  28164. matcherOut[postMap[i3]] = !(matcherIn[postMap[i3]] = elem);
  28165. }
  28166. }
  28167. }
  28168. if (seed) {
  28169. if (postFinder || preFilter) {
  28170. if (postFinder) {
  28171. temp = [];
  28172. i3 = matcherOut.length;
  28173. while (i3--) {
  28174. if (elem = matcherOut[i3]) {
  28175. temp.push(matcherIn[i3] = elem);
  28176. }
  28177. }
  28178. postFinder(null, matcherOut = [], temp, xml);
  28179. }
  28180. i3 = matcherOut.length;
  28181. while (i3--) {
  28182. if ((elem = matcherOut[i3]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i3]) > -1) {
  28183. seed[temp] = !(results[temp] = elem);
  28184. }
  28185. }
  28186. }
  28187. } else {
  28188. matcherOut = condense(
  28189. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  28190. );
  28191. if (postFinder) {
  28192. postFinder(null, results, matcherOut, xml);
  28193. } else {
  28194. push2.apply(results, matcherOut);
  28195. }
  28196. }
  28197. });
  28198. }
  28199. function matcherFromTokens(tokens) {
  28200. var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i3 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  28201. return elem === checkContext;
  28202. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  28203. return indexOf.call(checkContext, elem) > -1;
  28204. }, implicitRelative, true), matchers2 = [function(elem, context, xml) {
  28205. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  28206. checkContext = null;
  28207. return ret;
  28208. }];
  28209. for (; i3 < len; i3++) {
  28210. if (matcher = Expr.relative[tokens[i3].type]) {
  28211. matchers2 = [addCombinator(elementMatcher(matchers2), matcher)];
  28212. } else {
  28213. matcher = Expr.filter[tokens[i3].type].apply(null, tokens[i3].matches);
  28214. if (matcher[expando]) {
  28215. j = ++i3;
  28216. for (; j < len; j++) {
  28217. if (Expr.relative[tokens[j].type]) {
  28218. break;
  28219. }
  28220. }
  28221. return setMatcher(
  28222. i3 > 1 && elementMatcher(matchers2),
  28223. i3 > 1 && toSelector(
  28224. tokens.slice(0, i3 - 1).concat({ value: tokens[i3 - 2].type === " " ? "*" : "" })
  28225. ).replace(rtrimCSS, "$1"),
  28226. matcher,
  28227. i3 < j && matcherFromTokens(tokens.slice(i3, j)),
  28228. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  28229. j < len && toSelector(tokens)
  28230. );
  28231. }
  28232. matchers2.push(matcher);
  28233. }
  28234. }
  28235. return elementMatcher(matchers2);
  28236. }
  28237. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  28238. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  28239. var elem, j, matcher, matchedCount = 0, i3 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
  28240. if (outermost) {
  28241. outermostContext = context == document3 || context || outermost;
  28242. }
  28243. for (; i3 !== len && (elem = elems[i3]) != null; i3++) {
  28244. if (byElement && elem) {
  28245. j = 0;
  28246. if (!context && elem.ownerDocument != document3) {
  28247. setDocument(elem);
  28248. xml = !documentIsHTML;
  28249. }
  28250. while (matcher = elementMatchers[j++]) {
  28251. if (matcher(elem, context || document3, xml)) {
  28252. push2.call(results, elem);
  28253. break;
  28254. }
  28255. }
  28256. if (outermost) {
  28257. dirruns = dirrunsUnique;
  28258. }
  28259. }
  28260. if (bySet) {
  28261. if (elem = !matcher && elem) {
  28262. matchedCount--;
  28263. }
  28264. if (seed) {
  28265. unmatched.push(elem);
  28266. }
  28267. }
  28268. }
  28269. matchedCount += i3;
  28270. if (bySet && i3 !== matchedCount) {
  28271. j = 0;
  28272. while (matcher = setMatchers[j++]) {
  28273. matcher(unmatched, setMatched, context, xml);
  28274. }
  28275. if (seed) {
  28276. if (matchedCount > 0) {
  28277. while (i3--) {
  28278. if (!(unmatched[i3] || setMatched[i3])) {
  28279. setMatched[i3] = pop.call(results);
  28280. }
  28281. }
  28282. }
  28283. setMatched = condense(setMatched);
  28284. }
  28285. push2.apply(results, setMatched);
  28286. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  28287. jQuery.uniqueSort(results);
  28288. }
  28289. }
  28290. if (outermost) {
  28291. dirruns = dirrunsUnique;
  28292. outermostContext = contextBackup;
  28293. }
  28294. return unmatched;
  28295. };
  28296. return bySet ? markFunction(superMatcher) : superMatcher;
  28297. }
  28298. function compile(selector, match) {
  28299. var i3, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  28300. if (!cached) {
  28301. if (!match) {
  28302. match = tokenize(selector);
  28303. }
  28304. i3 = match.length;
  28305. while (i3--) {
  28306. cached = matcherFromTokens(match[i3]);
  28307. if (cached[expando]) {
  28308. setMatchers.push(cached);
  28309. } else {
  28310. elementMatchers.push(cached);
  28311. }
  28312. }
  28313. cached = compilerCache(
  28314. selector,
  28315. matcherFromGroupMatchers(elementMatchers, setMatchers)
  28316. );
  28317. cached.selector = selector;
  28318. }
  28319. return cached;
  28320. }
  28321. function select(selector, context, results, seed) {
  28322. var i3, tokens, token, type2, find3, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  28323. results = results || [];
  28324. if (match.length === 1) {
  28325. tokens = match[0] = match[0].slice(0);
  28326. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
  28327. context = (Expr.find.ID(
  28328. token.matches[0].replace(runescape, funescape),
  28329. context
  28330. ) || [])[0];
  28331. if (!context) {
  28332. return results;
  28333. } else if (compiled) {
  28334. context = context.parentNode;
  28335. }
  28336. selector = selector.slice(tokens.shift().value.length);
  28337. }
  28338. i3 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  28339. while (i3--) {
  28340. token = tokens[i3];
  28341. if (Expr.relative[type2 = token.type]) {
  28342. break;
  28343. }
  28344. if (find3 = Expr.find[type2]) {
  28345. if (seed = find3(
  28346. token.matches[0].replace(runescape, funescape),
  28347. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  28348. )) {
  28349. tokens.splice(i3, 1);
  28350. selector = seed.length && toSelector(tokens);
  28351. if (!selector) {
  28352. push2.apply(results, seed);
  28353. return results;
  28354. }
  28355. break;
  28356. }
  28357. }
  28358. }
  28359. }
  28360. (compiled || compile(selector, match))(
  28361. seed,
  28362. context,
  28363. !documentIsHTML,
  28364. results,
  28365. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  28366. );
  28367. return results;
  28368. }
  28369. support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
  28370. setDocument();
  28371. support.sortDetached = assert(function(el) {
  28372. return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
  28373. });
  28374. jQuery.find = find2;
  28375. jQuery.expr[":"] = jQuery.expr.pseudos;
  28376. jQuery.unique = jQuery.uniqueSort;
  28377. find2.compile = compile;
  28378. find2.select = select;
  28379. find2.setDocument = setDocument;
  28380. find2.escape = jQuery.escapeSelector;
  28381. find2.getText = jQuery.text;
  28382. find2.isXML = jQuery.isXMLDoc;
  28383. find2.selectors = jQuery.expr;
  28384. find2.support = jQuery.support;
  28385. find2.uniqueSort = jQuery.uniqueSort;
  28386. })();
  28387. var dir = function(elem, dir2, until) {
  28388. var matched = [], truncate = until !== void 0;
  28389. while ((elem = elem[dir2]) && elem.nodeType !== 9) {
  28390. if (elem.nodeType === 1) {
  28391. if (truncate && jQuery(elem).is(until)) {
  28392. break;
  28393. }
  28394. matched.push(elem);
  28395. }
  28396. }
  28397. return matched;
  28398. };
  28399. var siblings = function(n, elem) {
  28400. var matched = [];
  28401. for (; n; n = n.nextSibling) {
  28402. if (n.nodeType === 1 && n !== elem) {
  28403. matched.push(n);
  28404. }
  28405. }
  28406. return matched;
  28407. };
  28408. var rneedsContext = jQuery.expr.match.needsContext;
  28409. var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
  28410. function winnow(elements, qualifier, not) {
  28411. if (isFunction2(qualifier)) {
  28412. return jQuery.grep(elements, function(elem, i2) {
  28413. return !!qualifier.call(elem, i2, elem) !== not;
  28414. });
  28415. }
  28416. if (qualifier.nodeType) {
  28417. return jQuery.grep(elements, function(elem) {
  28418. return elem === qualifier !== not;
  28419. });
  28420. }
  28421. if (typeof qualifier !== "string") {
  28422. return jQuery.grep(elements, function(elem) {
  28423. return indexOf.call(qualifier, elem) > -1 !== not;
  28424. });
  28425. }
  28426. return jQuery.filter(qualifier, elements, not);
  28427. }
  28428. jQuery.filter = function(expr, elems, not) {
  28429. var elem = elems[0];
  28430. if (not) {
  28431. expr = ":not(" + expr + ")";
  28432. }
  28433. if (elems.length === 1 && elem.nodeType === 1) {
  28434. return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
  28435. }
  28436. return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
  28437. return elem2.nodeType === 1;
  28438. }));
  28439. };
  28440. jQuery.fn.extend({
  28441. find: function(selector) {
  28442. var i2, ret, len = this.length, self2 = this;
  28443. if (typeof selector !== "string") {
  28444. return this.pushStack(jQuery(selector).filter(function() {
  28445. for (i2 = 0; i2 < len; i2++) {
  28446. if (jQuery.contains(self2[i2], this)) {
  28447. return true;
  28448. }
  28449. }
  28450. }));
  28451. }
  28452. ret = this.pushStack([]);
  28453. for (i2 = 0; i2 < len; i2++) {
  28454. jQuery.find(selector, self2[i2], ret);
  28455. }
  28456. return len > 1 ? jQuery.uniqueSort(ret) : ret;
  28457. },
  28458. filter: function(selector) {
  28459. return this.pushStack(winnow(this, selector || [], false));
  28460. },
  28461. not: function(selector) {
  28462. return this.pushStack(winnow(this, selector || [], true));
  28463. },
  28464. is: function(selector) {
  28465. return !!winnow(
  28466. this,
  28467. typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
  28468. false
  28469. ).length;
  28470. }
  28471. });
  28472. var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root2) {
  28473. var match, elem;
  28474. if (!selector) {
  28475. return this;
  28476. }
  28477. root2 = root2 || rootjQuery;
  28478. if (typeof selector === "string") {
  28479. if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
  28480. match = [null, selector, null];
  28481. } else {
  28482. match = rquickExpr.exec(selector);
  28483. }
  28484. if (match && (match[1] || !context)) {
  28485. if (match[1]) {
  28486. context = context instanceof jQuery ? context[0] : context;
  28487. jQuery.merge(this, jQuery.parseHTML(
  28488. match[1],
  28489. context && context.nodeType ? context.ownerDocument || context : document2,
  28490. true
  28491. ));
  28492. if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
  28493. for (match in context) {
  28494. if (isFunction2(this[match])) {
  28495. this[match](context[match]);
  28496. } else {
  28497. this.attr(match, context[match]);
  28498. }
  28499. }
  28500. }
  28501. return this;
  28502. } else {
  28503. elem = document2.getElementById(match[2]);
  28504. if (elem) {
  28505. this[0] = elem;
  28506. this.length = 1;
  28507. }
  28508. return this;
  28509. }
  28510. } else if (!context || context.jquery) {
  28511. return (context || root2).find(selector);
  28512. } else {
  28513. return this.constructor(context).find(selector);
  28514. }
  28515. } else if (selector.nodeType) {
  28516. this[0] = selector;
  28517. this.length = 1;
  28518. return this;
  28519. } else if (isFunction2(selector)) {
  28520. return root2.ready !== void 0 ? root2.ready(selector) : selector(jQuery);
  28521. }
  28522. return jQuery.makeArray(selector, this);
  28523. };
  28524. init.prototype = jQuery.fn;
  28525. rootjQuery = jQuery(document2);
  28526. var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
  28527. children: true,
  28528. contents: true,
  28529. next: true,
  28530. prev: true
  28531. };
  28532. jQuery.fn.extend({
  28533. has: function(target) {
  28534. var targets = jQuery(target, this), l = targets.length;
  28535. return this.filter(function() {
  28536. var i2 = 0;
  28537. for (; i2 < l; i2++) {
  28538. if (jQuery.contains(this, targets[i2])) {
  28539. return true;
  28540. }
  28541. }
  28542. });
  28543. },
  28544. closest: function(selectors, context) {
  28545. var cur, i2 = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
  28546. if (!rneedsContext.test(selectors)) {
  28547. for (; i2 < l; i2++) {
  28548. for (cur = this[i2]; cur && cur !== context; cur = cur.parentNode) {
  28549. if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
  28550. matched.push(cur);
  28551. break;
  28552. }
  28553. }
  28554. }
  28555. }
  28556. return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
  28557. },
  28558. index: function(elem) {
  28559. if (!elem) {
  28560. return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
  28561. }
  28562. if (typeof elem === "string") {
  28563. return indexOf.call(jQuery(elem), this[0]);
  28564. }
  28565. return indexOf.call(
  28566. this,
  28567. elem.jquery ? elem[0] : elem
  28568. );
  28569. },
  28570. add: function(selector, context) {
  28571. return this.pushStack(
  28572. jQuery.uniqueSort(
  28573. jQuery.merge(this.get(), jQuery(selector, context))
  28574. )
  28575. );
  28576. },
  28577. addBack: function(selector) {
  28578. return this.add(
  28579. selector == null ? this.prevObject : this.prevObject.filter(selector)
  28580. );
  28581. }
  28582. });
  28583. function sibling(cur, dir2) {
  28584. while ((cur = cur[dir2]) && cur.nodeType !== 1) {
  28585. }
  28586. return cur;
  28587. }
  28588. jQuery.each({
  28589. parent: function(elem) {
  28590. var parent = elem.parentNode;
  28591. return parent && parent.nodeType !== 11 ? parent : null;
  28592. },
  28593. parents: function(elem) {
  28594. return dir(elem, "parentNode");
  28595. },
  28596. parentsUntil: function(elem, _i, until) {
  28597. return dir(elem, "parentNode", until);
  28598. },
  28599. next: function(elem) {
  28600. return sibling(elem, "nextSibling");
  28601. },
  28602. prev: function(elem) {
  28603. return sibling(elem, "previousSibling");
  28604. },
  28605. nextAll: function(elem) {
  28606. return dir(elem, "nextSibling");
  28607. },
  28608. prevAll: function(elem) {
  28609. return dir(elem, "previousSibling");
  28610. },
  28611. nextUntil: function(elem, _i, until) {
  28612. return dir(elem, "nextSibling", until);
  28613. },
  28614. prevUntil: function(elem, _i, until) {
  28615. return dir(elem, "previousSibling", until);
  28616. },
  28617. siblings: function(elem) {
  28618. return siblings((elem.parentNode || {}).firstChild, elem);
  28619. },
  28620. children: function(elem) {
  28621. return siblings(elem.firstChild);
  28622. },
  28623. contents: function(elem) {
  28624. if (elem.contentDocument != null && getProto(elem.contentDocument)) {
  28625. return elem.contentDocument;
  28626. }
  28627. if (nodeName(elem, "template")) {
  28628. elem = elem.content || elem;
  28629. }
  28630. return jQuery.merge([], elem.childNodes);
  28631. }
  28632. }, function(name, fn2) {
  28633. jQuery.fn[name] = function(until, selector) {
  28634. var matched = jQuery.map(this, fn2, until);
  28635. if (name.slice(-5) !== "Until") {
  28636. selector = until;
  28637. }
  28638. if (selector && typeof selector === "string") {
  28639. matched = jQuery.filter(selector, matched);
  28640. }
  28641. if (this.length > 1) {
  28642. if (!guaranteedUnique[name]) {
  28643. jQuery.uniqueSort(matched);
  28644. }
  28645. if (rparentsprev.test(name)) {
  28646. matched.reverse();
  28647. }
  28648. }
  28649. return this.pushStack(matched);
  28650. };
  28651. });
  28652. var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
  28653. function createOptions(options2) {
  28654. var object = {};
  28655. jQuery.each(options2.match(rnothtmlwhite) || [], function(_, flag) {
  28656. object[flag] = true;
  28657. });
  28658. return object;
  28659. }
  28660. jQuery.Callbacks = function(options2) {
  28661. options2 = typeof options2 === "string" ? createOptions(options2) : jQuery.extend({}, options2);
  28662. var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
  28663. locked = locked || options2.once;
  28664. fired = firing = true;
  28665. for (; queue.length; firingIndex = -1) {
  28666. memory = queue.shift();
  28667. while (++firingIndex < list.length) {
  28668. if (list[firingIndex].apply(memory[0], memory[1]) === false && options2.stopOnFalse) {
  28669. firingIndex = list.length;
  28670. memory = false;
  28671. }
  28672. }
  28673. }
  28674. if (!options2.memory) {
  28675. memory = false;
  28676. }
  28677. firing = false;
  28678. if (locked) {
  28679. if (memory) {
  28680. list = [];
  28681. } else {
  28682. list = "";
  28683. }
  28684. }
  28685. }, self2 = {
  28686. add: function() {
  28687. if (list) {
  28688. if (memory && !firing) {
  28689. firingIndex = list.length - 1;
  28690. queue.push(memory);
  28691. }
  28692. (function add(args) {
  28693. jQuery.each(args, function(_, arg) {
  28694. if (isFunction2(arg)) {
  28695. if (!options2.unique || !self2.has(arg)) {
  28696. list.push(arg);
  28697. }
  28698. } else if (arg && arg.length && toType(arg) !== "string") {
  28699. add(arg);
  28700. }
  28701. });
  28702. })(arguments);
  28703. if (memory && !firing) {
  28704. fire();
  28705. }
  28706. }
  28707. return this;
  28708. },
  28709. remove: function() {
  28710. jQuery.each(arguments, function(_, arg) {
  28711. var index2;
  28712. while ((index2 = jQuery.inArray(arg, list, index2)) > -1) {
  28713. list.splice(index2, 1);
  28714. if (index2 <= firingIndex) {
  28715. firingIndex--;
  28716. }
  28717. }
  28718. });
  28719. return this;
  28720. },
  28721. has: function(fn2) {
  28722. return fn2 ? jQuery.inArray(fn2, list) > -1 : list.length > 0;
  28723. },
  28724. empty: function() {
  28725. if (list) {
  28726. list = [];
  28727. }
  28728. return this;
  28729. },
  28730. disable: function() {
  28731. locked = queue = [];
  28732. list = memory = "";
  28733. return this;
  28734. },
  28735. disabled: function() {
  28736. return !list;
  28737. },
  28738. lock: function() {
  28739. locked = queue = [];
  28740. if (!memory && !firing) {
  28741. list = memory = "";
  28742. }
  28743. return this;
  28744. },
  28745. locked: function() {
  28746. return !!locked;
  28747. },
  28748. fireWith: function(context, args) {
  28749. if (!locked) {
  28750. args = args || [];
  28751. args = [context, args.slice ? args.slice() : args];
  28752. queue.push(args);
  28753. if (!firing) {
  28754. fire();
  28755. }
  28756. }
  28757. return this;
  28758. },
  28759. fire: function() {
  28760. self2.fireWith(this, arguments);
  28761. return this;
  28762. },
  28763. fired: function() {
  28764. return !!fired;
  28765. }
  28766. };
  28767. return self2;
  28768. };
  28769. function Identity(v) {
  28770. return v;
  28771. }
  28772. function Thrower(ex) {
  28773. throw ex;
  28774. }
  28775. function adoptValue(value, resolve2, reject2, noValue) {
  28776. var method;
  28777. try {
  28778. if (value && isFunction2(method = value.promise)) {
  28779. method.call(value).done(resolve2).fail(reject2);
  28780. } else if (value && isFunction2(method = value.then)) {
  28781. method.call(value, resolve2, reject2);
  28782. } else {
  28783. resolve2.apply(void 0, [value].slice(noValue));
  28784. }
  28785. } catch (value2) {
  28786. reject2.apply(void 0, [value2]);
  28787. }
  28788. }
  28789. jQuery.extend({
  28790. Deferred: function(func) {
  28791. var tuples = [
  28792. [
  28793. "notify",
  28794. "progress",
  28795. jQuery.Callbacks("memory"),
  28796. jQuery.Callbacks("memory"),
  28797. 2
  28798. ],
  28799. [
  28800. "resolve",
  28801. "done",
  28802. jQuery.Callbacks("once memory"),
  28803. jQuery.Callbacks("once memory"),
  28804. 0,
  28805. "resolved"
  28806. ],
  28807. [
  28808. "reject",
  28809. "fail",
  28810. jQuery.Callbacks("once memory"),
  28811. jQuery.Callbacks("once memory"),
  28812. 1,
  28813. "rejected"
  28814. ]
  28815. ], state = "pending", promise = {
  28816. state: function() {
  28817. return state;
  28818. },
  28819. always: function() {
  28820. deferred.done(arguments).fail(arguments);
  28821. return this;
  28822. },
  28823. "catch": function(fn2) {
  28824. return promise.then(null, fn2);
  28825. },
  28826. pipe: function() {
  28827. var fns = arguments;
  28828. return jQuery.Deferred(function(newDefer) {
  28829. jQuery.each(tuples, function(_i, tuple2) {
  28830. var fn2 = isFunction2(fns[tuple2[4]]) && fns[tuple2[4]];
  28831. deferred[tuple2[1]](function() {
  28832. var returned = fn2 && fn2.apply(this, arguments);
  28833. if (returned && isFunction2(returned.promise)) {
  28834. returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
  28835. } else {
  28836. newDefer[tuple2[0] + "With"](
  28837. this,
  28838. fn2 ? [returned] : arguments
  28839. );
  28840. }
  28841. });
  28842. });
  28843. fns = null;
  28844. }).promise();
  28845. },
  28846. then: function(onFulfilled, onRejected, onProgress) {
  28847. var maxDepth = 0;
  28848. function resolve2(depth, deferred2, handler, special) {
  28849. return function() {
  28850. var that = this, args = arguments, mightThrow = function() {
  28851. var returned, then;
  28852. if (depth < maxDepth) {
  28853. return;
  28854. }
  28855. returned = handler.apply(that, args);
  28856. if (returned === deferred2.promise()) {
  28857. throw new TypeError("Thenable self-resolution");
  28858. }
  28859. then = returned && (typeof returned === "object" || typeof returned === "function") && returned.then;
  28860. if (isFunction2(then)) {
  28861. if (special) {
  28862. then.call(
  28863. returned,
  28864. resolve2(maxDepth, deferred2, Identity, special),
  28865. resolve2(maxDepth, deferred2, Thrower, special)
  28866. );
  28867. } else {
  28868. maxDepth++;
  28869. then.call(
  28870. returned,
  28871. resolve2(maxDepth, deferred2, Identity, special),
  28872. resolve2(maxDepth, deferred2, Thrower, special),
  28873. resolve2(
  28874. maxDepth,
  28875. deferred2,
  28876. Identity,
  28877. deferred2.notifyWith
  28878. )
  28879. );
  28880. }
  28881. } else {
  28882. if (handler !== Identity) {
  28883. that = void 0;
  28884. args = [returned];
  28885. }
  28886. (special || deferred2.resolveWith)(that, args);
  28887. }
  28888. }, process2 = special ? mightThrow : function() {
  28889. try {
  28890. mightThrow();
  28891. } catch (e) {
  28892. if (jQuery.Deferred.exceptionHook) {
  28893. jQuery.Deferred.exceptionHook(
  28894. e,
  28895. process2.error
  28896. );
  28897. }
  28898. if (depth + 1 >= maxDepth) {
  28899. if (handler !== Thrower) {
  28900. that = void 0;
  28901. args = [e];
  28902. }
  28903. deferred2.rejectWith(that, args);
  28904. }
  28905. }
  28906. };
  28907. if (depth) {
  28908. process2();
  28909. } else {
  28910. if (jQuery.Deferred.getErrorHook) {
  28911. process2.error = jQuery.Deferred.getErrorHook();
  28912. } else if (jQuery.Deferred.getStackHook) {
  28913. process2.error = jQuery.Deferred.getStackHook();
  28914. }
  28915. window2.setTimeout(process2);
  28916. }
  28917. };
  28918. }
  28919. return jQuery.Deferred(function(newDefer) {
  28920. tuples[0][3].add(
  28921. resolve2(
  28922. 0,
  28923. newDefer,
  28924. isFunction2(onProgress) ? onProgress : Identity,
  28925. newDefer.notifyWith
  28926. )
  28927. );
  28928. tuples[1][3].add(
  28929. resolve2(
  28930. 0,
  28931. newDefer,
  28932. isFunction2(onFulfilled) ? onFulfilled : Identity
  28933. )
  28934. );
  28935. tuples[2][3].add(
  28936. resolve2(
  28937. 0,
  28938. newDefer,
  28939. isFunction2(onRejected) ? onRejected : Thrower
  28940. )
  28941. );
  28942. }).promise();
  28943. },
  28944. promise: function(obj) {
  28945. return obj != null ? jQuery.extend(obj, promise) : promise;
  28946. }
  28947. }, deferred = {};
  28948. jQuery.each(tuples, function(i2, tuple2) {
  28949. var list = tuple2[2], stateString = tuple2[5];
  28950. promise[tuple2[1]] = list.add;
  28951. if (stateString) {
  28952. list.add(
  28953. function() {
  28954. state = stateString;
  28955. },
  28956. tuples[3 - i2][2].disable,
  28957. tuples[3 - i2][3].disable,
  28958. tuples[0][2].lock,
  28959. tuples[0][3].lock
  28960. );
  28961. }
  28962. list.add(tuple2[3].fire);
  28963. deferred[tuple2[0]] = function() {
  28964. deferred[tuple2[0] + "With"](this === deferred ? void 0 : this, arguments);
  28965. return this;
  28966. };
  28967. deferred[tuple2[0] + "With"] = list.fireWith;
  28968. });
  28969. promise.promise(deferred);
  28970. if (func) {
  28971. func.call(deferred, deferred);
  28972. }
  28973. return deferred;
  28974. },
  28975. when: function(singleValue) {
  28976. var remaining = arguments.length, i2 = remaining, resolveContexts = Array(i2), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i3) {
  28977. return function(value) {
  28978. resolveContexts[i3] = this;
  28979. resolveValues[i3] = arguments.length > 1 ? slice.call(arguments) : value;
  28980. if (!--remaining) {
  28981. primary.resolveWith(resolveContexts, resolveValues);
  28982. }
  28983. };
  28984. };
  28985. if (remaining <= 1) {
  28986. adoptValue(
  28987. singleValue,
  28988. primary.done(updateFunc(i2)).resolve,
  28989. primary.reject,
  28990. !remaining
  28991. );
  28992. if (primary.state() === "pending" || isFunction2(resolveValues[i2] && resolveValues[i2].then)) {
  28993. return primary.then();
  28994. }
  28995. }
  28996. while (i2--) {
  28997. adoptValue(resolveValues[i2], updateFunc(i2), primary.reject);
  28998. }
  28999. return primary.promise();
  29000. }
  29001. });
  29002. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  29003. jQuery.Deferred.exceptionHook = function(error, asyncError) {
  29004. if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
  29005. window2.console.warn(
  29006. "jQuery.Deferred exception: " + error.message,
  29007. error.stack,
  29008. asyncError
  29009. );
  29010. }
  29011. };
  29012. jQuery.readyException = function(error) {
  29013. window2.setTimeout(function() {
  29014. throw error;
  29015. });
  29016. };
  29017. var readyList = jQuery.Deferred();
  29018. jQuery.fn.ready = function(fn2) {
  29019. readyList.then(fn2).catch(function(error) {
  29020. jQuery.readyException(error);
  29021. });
  29022. return this;
  29023. };
  29024. jQuery.extend({
  29025. isReady: false,
  29026. readyWait: 1,
  29027. ready: function(wait) {
  29028. if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
  29029. return;
  29030. }
  29031. jQuery.isReady = true;
  29032. if (wait !== true && --jQuery.readyWait > 0) {
  29033. return;
  29034. }
  29035. readyList.resolveWith(document2, [jQuery]);
  29036. }
  29037. });
  29038. jQuery.ready.then = readyList.then;
  29039. function completed() {
  29040. document2.removeEventListener("DOMContentLoaded", completed);
  29041. window2.removeEventListener("load", completed);
  29042. jQuery.ready();
  29043. }
  29044. if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
  29045. window2.setTimeout(jQuery.ready);
  29046. } else {
  29047. document2.addEventListener("DOMContentLoaded", completed);
  29048. window2.addEventListener("load", completed);
  29049. }
  29050. var access = function(elems, fn2, key, value, chainable, emptyGet, raw) {
  29051. var i2 = 0, len = elems.length, bulk = key == null;
  29052. if (toType(key) === "object") {
  29053. chainable = true;
  29054. for (i2 in key) {
  29055. access(elems, fn2, i2, key[i2], true, emptyGet, raw);
  29056. }
  29057. } else if (value !== void 0) {
  29058. chainable = true;
  29059. if (!isFunction2(value)) {
  29060. raw = true;
  29061. }
  29062. if (bulk) {
  29063. if (raw) {
  29064. fn2.call(elems, value);
  29065. fn2 = null;
  29066. } else {
  29067. bulk = fn2;
  29068. fn2 = function(elem, _key, value2) {
  29069. return bulk.call(jQuery(elem), value2);
  29070. };
  29071. }
  29072. }
  29073. if (fn2) {
  29074. for (; i2 < len; i2++) {
  29075. fn2(
  29076. elems[i2],
  29077. key,
  29078. raw ? value : value.call(elems[i2], i2, fn2(elems[i2], key))
  29079. );
  29080. }
  29081. }
  29082. }
  29083. if (chainable) {
  29084. return elems;
  29085. }
  29086. if (bulk) {
  29087. return fn2.call(elems);
  29088. }
  29089. return len ? fn2(elems[0], key) : emptyGet;
  29090. };
  29091. var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
  29092. function fcamelCase(_all, letter) {
  29093. return letter.toUpperCase();
  29094. }
  29095. function camelCase3(string) {
  29096. return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  29097. }
  29098. var acceptData = function(owner) {
  29099. return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
  29100. };
  29101. function Data() {
  29102. this.expando = jQuery.expando + Data.uid++;
  29103. }
  29104. Data.uid = 1;
  29105. Data.prototype = {
  29106. cache: function(owner) {
  29107. var value = owner[this.expando];
  29108. if (!value) {
  29109. value = {};
  29110. if (acceptData(owner)) {
  29111. if (owner.nodeType) {
  29112. owner[this.expando] = value;
  29113. } else {
  29114. Object.defineProperty(owner, this.expando, {
  29115. value,
  29116. configurable: true
  29117. });
  29118. }
  29119. }
  29120. }
  29121. return value;
  29122. },
  29123. set: function(owner, data, value) {
  29124. var prop, cache = this.cache(owner);
  29125. if (typeof data === "string") {
  29126. cache[camelCase3(data)] = value;
  29127. } else {
  29128. for (prop in data) {
  29129. cache[camelCase3(prop)] = data[prop];
  29130. }
  29131. }
  29132. return cache;
  29133. },
  29134. get: function(owner, key) {
  29135. return key === void 0 ? this.cache(owner) : owner[this.expando] && owner[this.expando][camelCase3(key)];
  29136. },
  29137. access: function(owner, key, value) {
  29138. if (key === void 0 || key && typeof key === "string" && value === void 0) {
  29139. return this.get(owner, key);
  29140. }
  29141. this.set(owner, key, value);
  29142. return value !== void 0 ? value : key;
  29143. },
  29144. remove: function(owner, key) {
  29145. var i2, cache = owner[this.expando];
  29146. if (cache === void 0) {
  29147. return;
  29148. }
  29149. if (key !== void 0) {
  29150. if (Array.isArray(key)) {
  29151. key = key.map(camelCase3);
  29152. } else {
  29153. key = camelCase3(key);
  29154. key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
  29155. }
  29156. i2 = key.length;
  29157. while (i2--) {
  29158. delete cache[key[i2]];
  29159. }
  29160. }
  29161. if (key === void 0 || jQuery.isEmptyObject(cache)) {
  29162. if (owner.nodeType) {
  29163. owner[this.expando] = void 0;
  29164. } else {
  29165. delete owner[this.expando];
  29166. }
  29167. }
  29168. },
  29169. hasData: function(owner) {
  29170. var cache = owner[this.expando];
  29171. return cache !== void 0 && !jQuery.isEmptyObject(cache);
  29172. }
  29173. };
  29174. var dataPriv = new Data();
  29175. var dataUser = new Data();
  29176. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
  29177. function getData(data) {
  29178. if (data === "true") {
  29179. return true;
  29180. }
  29181. if (data === "false") {
  29182. return false;
  29183. }
  29184. if (data === "null") {
  29185. return null;
  29186. }
  29187. if (data === +data + "") {
  29188. return +data;
  29189. }
  29190. if (rbrace.test(data)) {
  29191. return JSON.parse(data);
  29192. }
  29193. return data;
  29194. }
  29195. function dataAttr(elem, key, data) {
  29196. var name;
  29197. if (data === void 0 && elem.nodeType === 1) {
  29198. name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
  29199. data = elem.getAttribute(name);
  29200. if (typeof data === "string") {
  29201. try {
  29202. data = getData(data);
  29203. } catch (e) {
  29204. }
  29205. dataUser.set(elem, key, data);
  29206. } else {
  29207. data = void 0;
  29208. }
  29209. }
  29210. return data;
  29211. }
  29212. jQuery.extend({
  29213. hasData: function(elem) {
  29214. return dataUser.hasData(elem) || dataPriv.hasData(elem);
  29215. },
  29216. data: function(elem, name, data) {
  29217. return dataUser.access(elem, name, data);
  29218. },
  29219. removeData: function(elem, name) {
  29220. dataUser.remove(elem, name);
  29221. },
  29222. _data: function(elem, name, data) {
  29223. return dataPriv.access(elem, name, data);
  29224. },
  29225. _removeData: function(elem, name) {
  29226. dataPriv.remove(elem, name);
  29227. }
  29228. });
  29229. jQuery.fn.extend({
  29230. data: function(key, value) {
  29231. var i2, name, data, elem = this[0], attrs = elem && elem.attributes;
  29232. if (key === void 0) {
  29233. if (this.length) {
  29234. data = dataUser.get(elem);
  29235. if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
  29236. i2 = attrs.length;
  29237. while (i2--) {
  29238. if (attrs[i2]) {
  29239. name = attrs[i2].name;
  29240. if (name.indexOf("data-") === 0) {
  29241. name = camelCase3(name.slice(5));
  29242. dataAttr(elem, name, data[name]);
  29243. }
  29244. }
  29245. }
  29246. dataPriv.set(elem, "hasDataAttrs", true);
  29247. }
  29248. }
  29249. return data;
  29250. }
  29251. if (typeof key === "object") {
  29252. return this.each(function() {
  29253. dataUser.set(this, key);
  29254. });
  29255. }
  29256. return access(this, function(value2) {
  29257. var data2;
  29258. if (elem && value2 === void 0) {
  29259. data2 = dataUser.get(elem, key);
  29260. if (data2 !== void 0) {
  29261. return data2;
  29262. }
  29263. data2 = dataAttr(elem, key);
  29264. if (data2 !== void 0) {
  29265. return data2;
  29266. }
  29267. return;
  29268. }
  29269. this.each(function() {
  29270. dataUser.set(this, key, value2);
  29271. });
  29272. }, null, value, arguments.length > 1, null, true);
  29273. },
  29274. removeData: function(key) {
  29275. return this.each(function() {
  29276. dataUser.remove(this, key);
  29277. });
  29278. }
  29279. });
  29280. jQuery.extend({
  29281. queue: function(elem, type2, data) {
  29282. var queue;
  29283. if (elem) {
  29284. type2 = (type2 || "fx") + "queue";
  29285. queue = dataPriv.get(elem, type2);
  29286. if (data) {
  29287. if (!queue || Array.isArray(data)) {
  29288. queue = dataPriv.access(elem, type2, jQuery.makeArray(data));
  29289. } else {
  29290. queue.push(data);
  29291. }
  29292. }
  29293. return queue || [];
  29294. }
  29295. },
  29296. dequeue: function(elem, type2) {
  29297. type2 = type2 || "fx";
  29298. var queue = jQuery.queue(elem, type2), startLength = queue.length, fn2 = queue.shift(), hooks3 = jQuery._queueHooks(elem, type2), next = function() {
  29299. jQuery.dequeue(elem, type2);
  29300. };
  29301. if (fn2 === "inprogress") {
  29302. fn2 = queue.shift();
  29303. startLength--;
  29304. }
  29305. if (fn2) {
  29306. if (type2 === "fx") {
  29307. queue.unshift("inprogress");
  29308. }
  29309. delete hooks3.stop;
  29310. fn2.call(elem, next, hooks3);
  29311. }
  29312. if (!startLength && hooks3) {
  29313. hooks3.empty.fire();
  29314. }
  29315. },
  29316. _queueHooks: function(elem, type2) {
  29317. var key = type2 + "queueHooks";
  29318. return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
  29319. empty: jQuery.Callbacks("once memory").add(function() {
  29320. dataPriv.remove(elem, [type2 + "queue", key]);
  29321. })
  29322. });
  29323. }
  29324. });
  29325. jQuery.fn.extend({
  29326. queue: function(type2, data) {
  29327. var setter = 2;
  29328. if (typeof type2 !== "string") {
  29329. data = type2;
  29330. type2 = "fx";
  29331. setter--;
  29332. }
  29333. if (arguments.length < setter) {
  29334. return jQuery.queue(this[0], type2);
  29335. }
  29336. return data === void 0 ? this : this.each(function() {
  29337. var queue = jQuery.queue(this, type2, data);
  29338. jQuery._queueHooks(this, type2);
  29339. if (type2 === "fx" && queue[0] !== "inprogress") {
  29340. jQuery.dequeue(this, type2);
  29341. }
  29342. });
  29343. },
  29344. dequeue: function(type2) {
  29345. return this.each(function() {
  29346. jQuery.dequeue(this, type2);
  29347. });
  29348. },
  29349. clearQueue: function(type2) {
  29350. return this.queue(type2 || "fx", []);
  29351. },
  29352. promise: function(type2, obj) {
  29353. var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i2 = this.length, resolve2 = function() {
  29354. if (!--count) {
  29355. defer.resolveWith(elements, [elements]);
  29356. }
  29357. };
  29358. if (typeof type2 !== "string") {
  29359. obj = type2;
  29360. type2 = void 0;
  29361. }
  29362. type2 = type2 || "fx";
  29363. while (i2--) {
  29364. tmp = dataPriv.get(elements[i2], type2 + "queueHooks");
  29365. if (tmp && tmp.empty) {
  29366. count++;
  29367. tmp.empty.add(resolve2);
  29368. }
  29369. }
  29370. resolve2();
  29371. return defer.promise(obj);
  29372. }
  29373. });
  29374. var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
  29375. var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
  29376. var cssExpand = ["Top", "Right", "Bottom", "Left"];
  29377. var documentElement = document2.documentElement;
  29378. var isAttached = function(elem) {
  29379. return jQuery.contains(elem.ownerDocument, elem);
  29380. }, composed = { composed: true };
  29381. if (documentElement.getRootNode) {
  29382. isAttached = function(elem) {
  29383. return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
  29384. };
  29385. }
  29386. var isHiddenWithinTree = function(elem, el) {
  29387. elem = el || elem;
  29388. return elem.style.display === "none" || elem.style.display === "" && isAttached(elem) && jQuery.css(elem, "display") === "none";
  29389. };
  29390. function adjustCSS(elem, prop, valueParts, tween) {
  29391. var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
  29392. return tween.cur();
  29393. } : function() {
  29394. return jQuery.css(elem, prop, "");
  29395. }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
  29396. if (initialInUnit && initialInUnit[3] !== unit) {
  29397. initial = initial / 2;
  29398. unit = unit || initialInUnit[3];
  29399. initialInUnit = +initial || 1;
  29400. while (maxIterations--) {
  29401. jQuery.style(elem, prop, initialInUnit + unit);
  29402. if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
  29403. maxIterations = 0;
  29404. }
  29405. initialInUnit = initialInUnit / scale;
  29406. }
  29407. initialInUnit = initialInUnit * 2;
  29408. jQuery.style(elem, prop, initialInUnit + unit);
  29409. valueParts = valueParts || [];
  29410. }
  29411. if (valueParts) {
  29412. initialInUnit = +initialInUnit || +initial || 0;
  29413. adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
  29414. if (tween) {
  29415. tween.unit = unit;
  29416. tween.start = initialInUnit;
  29417. tween.end = adjusted;
  29418. }
  29419. }
  29420. return adjusted;
  29421. }
  29422. var defaultDisplayMap = {};
  29423. function getDefaultDisplay(elem) {
  29424. var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
  29425. if (display) {
  29426. return display;
  29427. }
  29428. temp = doc.body.appendChild(doc.createElement(nodeName2));
  29429. display = jQuery.css(temp, "display");
  29430. temp.parentNode.removeChild(temp);
  29431. if (display === "none") {
  29432. display = "block";
  29433. }
  29434. defaultDisplayMap[nodeName2] = display;
  29435. return display;
  29436. }
  29437. function showHide(elements, show) {
  29438. var display, elem, values3 = [], index2 = 0, length = elements.length;
  29439. for (; index2 < length; index2++) {
  29440. elem = elements[index2];
  29441. if (!elem.style) {
  29442. continue;
  29443. }
  29444. display = elem.style.display;
  29445. if (show) {
  29446. if (display === "none") {
  29447. values3[index2] = dataPriv.get(elem, "display") || null;
  29448. if (!values3[index2]) {
  29449. elem.style.display = "";
  29450. }
  29451. }
  29452. if (elem.style.display === "" && isHiddenWithinTree(elem)) {
  29453. values3[index2] = getDefaultDisplay(elem);
  29454. }
  29455. } else {
  29456. if (display !== "none") {
  29457. values3[index2] = "none";
  29458. dataPriv.set(elem, "display", display);
  29459. }
  29460. }
  29461. }
  29462. for (index2 = 0; index2 < length; index2++) {
  29463. if (values3[index2] != null) {
  29464. elements[index2].style.display = values3[index2];
  29465. }
  29466. }
  29467. return elements;
  29468. }
  29469. jQuery.fn.extend({
  29470. show: function() {
  29471. return showHide(this, true);
  29472. },
  29473. hide: function() {
  29474. return showHide(this);
  29475. },
  29476. toggle: function(state) {
  29477. if (typeof state === "boolean") {
  29478. return state ? this.show() : this.hide();
  29479. }
  29480. return this.each(function() {
  29481. if (isHiddenWithinTree(this)) {
  29482. jQuery(this).show();
  29483. } else {
  29484. jQuery(this).hide();
  29485. }
  29486. });
  29487. }
  29488. });
  29489. var rcheckableType = /^(?:checkbox|radio)$/i;
  29490. var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
  29491. var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
  29492. (function() {
  29493. var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
  29494. input.setAttribute("type", "radio");
  29495. input.setAttribute("checked", "checked");
  29496. input.setAttribute("name", "t");
  29497. div.appendChild(input);
  29498. support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
  29499. div.innerHTML = "<textarea>x</textarea>";
  29500. support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
  29501. div.innerHTML = "<option></option>";
  29502. support.option = !!div.lastChild;
  29503. })();
  29504. var wrapMap = {
  29505. thead: [1, "<table>", "</table>"],
  29506. col: [2, "<table><colgroup>", "</colgroup></table>"],
  29507. tr: [2, "<table><tbody>", "</tbody></table>"],
  29508. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  29509. _default: [0, "", ""]
  29510. };
  29511. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  29512. wrapMap.th = wrapMap.td;
  29513. if (!support.option) {
  29514. wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
  29515. }
  29516. function getAll(context, tag) {
  29517. var ret;
  29518. if (typeof context.getElementsByTagName !== "undefined") {
  29519. ret = context.getElementsByTagName(tag || "*");
  29520. } else if (typeof context.querySelectorAll !== "undefined") {
  29521. ret = context.querySelectorAll(tag || "*");
  29522. } else {
  29523. ret = [];
  29524. }
  29525. if (tag === void 0 || tag && nodeName(context, tag)) {
  29526. return jQuery.merge([context], ret);
  29527. }
  29528. return ret;
  29529. }
  29530. function setGlobalEval(elems, refElements) {
  29531. var i2 = 0, l = elems.length;
  29532. for (; i2 < l; i2++) {
  29533. dataPriv.set(
  29534. elems[i2],
  29535. "globalEval",
  29536. !refElements || dataPriv.get(refElements[i2], "globalEval")
  29537. );
  29538. }
  29539. }
  29540. var rhtml = /<|&#?\w+;/;
  29541. function buildFragment(elems, context, scripts, selection, ignored) {
  29542. var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i2 = 0, l = elems.length;
  29543. for (; i2 < l; i2++) {
  29544. elem = elems[i2];
  29545. if (elem || elem === 0) {
  29546. if (toType(elem) === "object") {
  29547. jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
  29548. } else if (!rhtml.test(elem)) {
  29549. nodes.push(context.createTextNode(elem));
  29550. } else {
  29551. tmp = tmp || fragment.appendChild(context.createElement("div"));
  29552. tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
  29553. wrap = wrapMap[tag] || wrapMap._default;
  29554. tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
  29555. j = wrap[0];
  29556. while (j--) {
  29557. tmp = tmp.lastChild;
  29558. }
  29559. jQuery.merge(nodes, tmp.childNodes);
  29560. tmp = fragment.firstChild;
  29561. tmp.textContent = "";
  29562. }
  29563. }
  29564. }
  29565. fragment.textContent = "";
  29566. i2 = 0;
  29567. while (elem = nodes[i2++]) {
  29568. if (selection && jQuery.inArray(elem, selection) > -1) {
  29569. if (ignored) {
  29570. ignored.push(elem);
  29571. }
  29572. continue;
  29573. }
  29574. attached = isAttached(elem);
  29575. tmp = getAll(fragment.appendChild(elem), "script");
  29576. if (attached) {
  29577. setGlobalEval(tmp);
  29578. }
  29579. if (scripts) {
  29580. j = 0;
  29581. while (elem = tmp[j++]) {
  29582. if (rscriptType.test(elem.type || "")) {
  29583. scripts.push(elem);
  29584. }
  29585. }
  29586. }
  29587. }
  29588. return fragment;
  29589. }
  29590. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  29591. function returnTrue() {
  29592. return true;
  29593. }
  29594. function returnFalse() {
  29595. return false;
  29596. }
  29597. function on3(elem, types, selector, data, fn2, one3) {
  29598. var origFn, type2;
  29599. if (typeof types === "object") {
  29600. if (typeof selector !== "string") {
  29601. data = data || selector;
  29602. selector = void 0;
  29603. }
  29604. for (type2 in types) {
  29605. on3(elem, type2, selector, data, types[type2], one3);
  29606. }
  29607. return elem;
  29608. }
  29609. if (data == null && fn2 == null) {
  29610. fn2 = selector;
  29611. data = selector = void 0;
  29612. } else if (fn2 == null) {
  29613. if (typeof selector === "string") {
  29614. fn2 = data;
  29615. data = void 0;
  29616. } else {
  29617. fn2 = data;
  29618. data = selector;
  29619. selector = void 0;
  29620. }
  29621. }
  29622. if (fn2 === false) {
  29623. fn2 = returnFalse;
  29624. } else if (!fn2) {
  29625. return elem;
  29626. }
  29627. if (one3 === 1) {
  29628. origFn = fn2;
  29629. fn2 = function(event2) {
  29630. jQuery().off(event2);
  29631. return origFn.apply(this, arguments);
  29632. };
  29633. fn2.guid = origFn.guid || (origFn.guid = jQuery.guid++);
  29634. }
  29635. return elem.each(function() {
  29636. jQuery.event.add(this, types, fn2, data, selector);
  29637. });
  29638. }
  29639. jQuery.event = {
  29640. global: {},
  29641. add: function(elem, types, handler, data, selector) {
  29642. var handleObjIn, eventHandle, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.get(elem);
  29643. if (!acceptData(elem)) {
  29644. return;
  29645. }
  29646. if (handler.handler) {
  29647. handleObjIn = handler;
  29648. handler = handleObjIn.handler;
  29649. selector = handleObjIn.selector;
  29650. }
  29651. if (selector) {
  29652. jQuery.find.matchesSelector(documentElement, selector);
  29653. }
  29654. if (!handler.guid) {
  29655. handler.guid = jQuery.guid++;
  29656. }
  29657. if (!(events = elemData.events)) {
  29658. events = elemData.events = /* @__PURE__ */ Object.create(null);
  29659. }
  29660. if (!(eventHandle = elemData.handle)) {
  29661. eventHandle = elemData.handle = function(e) {
  29662. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
  29663. };
  29664. }
  29665. types = (types || "").match(rnothtmlwhite) || [""];
  29666. t2 = types.length;
  29667. while (t2--) {
  29668. tmp = rtypenamespace.exec(types[t2]) || [];
  29669. type2 = origType = tmp[1];
  29670. namespaces = (tmp[2] || "").split(".").sort();
  29671. if (!type2) {
  29672. continue;
  29673. }
  29674. special = jQuery.event.special[type2] || {};
  29675. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29676. special = jQuery.event.special[type2] || {};
  29677. handleObj = jQuery.extend({
  29678. type: type2,
  29679. origType,
  29680. data,
  29681. handler,
  29682. guid: handler.guid,
  29683. selector,
  29684. needsContext: selector && jQuery.expr.match.needsContext.test(selector),
  29685. namespace: namespaces.join(".")
  29686. }, handleObjIn);
  29687. if (!(handlers = events[type2])) {
  29688. handlers = events[type2] = [];
  29689. handlers.delegateCount = 0;
  29690. if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
  29691. if (elem.addEventListener) {
  29692. elem.addEventListener(type2, eventHandle);
  29693. }
  29694. }
  29695. }
  29696. if (special.add) {
  29697. special.add.call(elem, handleObj);
  29698. if (!handleObj.handler.guid) {
  29699. handleObj.handler.guid = handler.guid;
  29700. }
  29701. }
  29702. if (selector) {
  29703. handlers.splice(handlers.delegateCount++, 0, handleObj);
  29704. } else {
  29705. handlers.push(handleObj);
  29706. }
  29707. jQuery.event.global[type2] = true;
  29708. }
  29709. },
  29710. remove: function(elem, types, handler, selector, mappedTypes) {
  29711. var j, origCount, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
  29712. if (!elemData || !(events = elemData.events)) {
  29713. return;
  29714. }
  29715. types = (types || "").match(rnothtmlwhite) || [""];
  29716. t2 = types.length;
  29717. while (t2--) {
  29718. tmp = rtypenamespace.exec(types[t2]) || [];
  29719. type2 = origType = tmp[1];
  29720. namespaces = (tmp[2] || "").split(".").sort();
  29721. if (!type2) {
  29722. for (type2 in events) {
  29723. jQuery.event.remove(elem, type2 + types[t2], handler, selector, true);
  29724. }
  29725. continue;
  29726. }
  29727. special = jQuery.event.special[type2] || {};
  29728. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29729. handlers = events[type2] || [];
  29730. tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
  29731. origCount = j = handlers.length;
  29732. while (j--) {
  29733. handleObj = handlers[j];
  29734. if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
  29735. handlers.splice(j, 1);
  29736. if (handleObj.selector) {
  29737. handlers.delegateCount--;
  29738. }
  29739. if (special.remove) {
  29740. special.remove.call(elem, handleObj);
  29741. }
  29742. }
  29743. }
  29744. if (origCount && !handlers.length) {
  29745. if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
  29746. jQuery.removeEvent(elem, type2, elemData.handle);
  29747. }
  29748. delete events[type2];
  29749. }
  29750. }
  29751. if (jQuery.isEmptyObject(events)) {
  29752. dataPriv.remove(elem, "handle events");
  29753. }
  29754. },
  29755. dispatch: function(nativeEvent) {
  29756. var i2, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event2 = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event2.type] || [], special = jQuery.event.special[event2.type] || {};
  29757. args[0] = event2;
  29758. for (i2 = 1; i2 < arguments.length; i2++) {
  29759. args[i2] = arguments[i2];
  29760. }
  29761. event2.delegateTarget = this;
  29762. if (special.preDispatch && special.preDispatch.call(this, event2) === false) {
  29763. return;
  29764. }
  29765. handlerQueue = jQuery.event.handlers.call(this, event2, handlers);
  29766. i2 = 0;
  29767. while ((matched = handlerQueue[i2++]) && !event2.isPropagationStopped()) {
  29768. event2.currentTarget = matched.elem;
  29769. j = 0;
  29770. while ((handleObj = matched.handlers[j++]) && !event2.isImmediatePropagationStopped()) {
  29771. if (!event2.rnamespace || handleObj.namespace === false || event2.rnamespace.test(handleObj.namespace)) {
  29772. event2.handleObj = handleObj;
  29773. event2.data = handleObj.data;
  29774. ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
  29775. if (ret !== void 0) {
  29776. if ((event2.result = ret) === false) {
  29777. event2.preventDefault();
  29778. event2.stopPropagation();
  29779. }
  29780. }
  29781. }
  29782. }
  29783. }
  29784. if (special.postDispatch) {
  29785. special.postDispatch.call(this, event2);
  29786. }
  29787. return event2.result;
  29788. },
  29789. handlers: function(event2, handlers) {
  29790. var i2, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event2.target;
  29791. if (delegateCount && cur.nodeType && !(event2.type === "click" && event2.button >= 1)) {
  29792. for (; cur !== this; cur = cur.parentNode || this) {
  29793. if (cur.nodeType === 1 && !(event2.type === "click" && cur.disabled === true)) {
  29794. matchedHandlers = [];
  29795. matchedSelectors = {};
  29796. for (i2 = 0; i2 < delegateCount; i2++) {
  29797. handleObj = handlers[i2];
  29798. sel = handleObj.selector + " ";
  29799. if (matchedSelectors[sel] === void 0) {
  29800. matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
  29801. }
  29802. if (matchedSelectors[sel]) {
  29803. matchedHandlers.push(handleObj);
  29804. }
  29805. }
  29806. if (matchedHandlers.length) {
  29807. handlerQueue.push({ elem: cur, handlers: matchedHandlers });
  29808. }
  29809. }
  29810. }
  29811. }
  29812. cur = this;
  29813. if (delegateCount < handlers.length) {
  29814. handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
  29815. }
  29816. return handlerQueue;
  29817. },
  29818. addProp: function(name, hook3) {
  29819. Object.defineProperty(jQuery.Event.prototype, name, {
  29820. enumerable: true,
  29821. configurable: true,
  29822. get: isFunction2(hook3) ? function() {
  29823. if (this.originalEvent) {
  29824. return hook3(this.originalEvent);
  29825. }
  29826. } : function() {
  29827. if (this.originalEvent) {
  29828. return this.originalEvent[name];
  29829. }
  29830. },
  29831. set: function(value) {
  29832. Object.defineProperty(this, name, {
  29833. enumerable: true,
  29834. configurable: true,
  29835. writable: true,
  29836. value
  29837. });
  29838. }
  29839. });
  29840. },
  29841. fix: function(originalEvent) {
  29842. return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
  29843. },
  29844. special: {
  29845. load: {
  29846. noBubble: true
  29847. },
  29848. click: {
  29849. setup: function(data) {
  29850. var el = this || data;
  29851. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29852. leverageNative(el, "click", true);
  29853. }
  29854. return false;
  29855. },
  29856. trigger: function(data) {
  29857. var el = this || data;
  29858. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29859. leverageNative(el, "click");
  29860. }
  29861. return true;
  29862. },
  29863. _default: function(event2) {
  29864. var target = event2.target;
  29865. return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
  29866. }
  29867. },
  29868. beforeunload: {
  29869. postDispatch: function(event2) {
  29870. if (event2.result !== void 0 && event2.originalEvent) {
  29871. event2.originalEvent.returnValue = event2.result;
  29872. }
  29873. }
  29874. }
  29875. }
  29876. };
  29877. function leverageNative(el, type2, isSetup) {
  29878. if (!isSetup) {
  29879. if (dataPriv.get(el, type2) === void 0) {
  29880. jQuery.event.add(el, type2, returnTrue);
  29881. }
  29882. return;
  29883. }
  29884. dataPriv.set(el, type2, false);
  29885. jQuery.event.add(el, type2, {
  29886. namespace: false,
  29887. handler: function(event2) {
  29888. var result, saved = dataPriv.get(this, type2);
  29889. if (event2.isTrigger & 1 && this[type2]) {
  29890. if (!saved) {
  29891. saved = slice.call(arguments);
  29892. dataPriv.set(this, type2, saved);
  29893. this[type2]();
  29894. result = dataPriv.get(this, type2);
  29895. dataPriv.set(this, type2, false);
  29896. if (saved !== result) {
  29897. event2.stopImmediatePropagation();
  29898. event2.preventDefault();
  29899. return result;
  29900. }
  29901. } else if ((jQuery.event.special[type2] || {}).delegateType) {
  29902. event2.stopPropagation();
  29903. }
  29904. } else if (saved) {
  29905. dataPriv.set(this, type2, jQuery.event.trigger(
  29906. saved[0],
  29907. saved.slice(1),
  29908. this
  29909. ));
  29910. event2.stopPropagation();
  29911. event2.isImmediatePropagationStopped = returnTrue;
  29912. }
  29913. }
  29914. });
  29915. }
  29916. jQuery.removeEvent = function(elem, type2, handle) {
  29917. if (elem.removeEventListener) {
  29918. elem.removeEventListener(type2, handle);
  29919. }
  29920. };
  29921. jQuery.Event = function(src, props) {
  29922. if (!(this instanceof jQuery.Event)) {
  29923. return new jQuery.Event(src, props);
  29924. }
  29925. if (src && src.type) {
  29926. this.originalEvent = src;
  29927. this.type = src.type;
  29928. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && src.returnValue === false ? returnTrue : returnFalse;
  29929. this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
  29930. this.currentTarget = src.currentTarget;
  29931. this.relatedTarget = src.relatedTarget;
  29932. } else {
  29933. this.type = src;
  29934. }
  29935. if (props) {
  29936. jQuery.extend(this, props);
  29937. }
  29938. this.timeStamp = src && src.timeStamp || Date.now();
  29939. this[jQuery.expando] = true;
  29940. };
  29941. jQuery.Event.prototype = {
  29942. constructor: jQuery.Event,
  29943. isDefaultPrevented: returnFalse,
  29944. isPropagationStopped: returnFalse,
  29945. isImmediatePropagationStopped: returnFalse,
  29946. isSimulated: false,
  29947. preventDefault: function() {
  29948. var e = this.originalEvent;
  29949. this.isDefaultPrevented = returnTrue;
  29950. if (e && !this.isSimulated) {
  29951. e.preventDefault();
  29952. }
  29953. },
  29954. stopPropagation: function() {
  29955. var e = this.originalEvent;
  29956. this.isPropagationStopped = returnTrue;
  29957. if (e && !this.isSimulated) {
  29958. e.stopPropagation();
  29959. }
  29960. },
  29961. stopImmediatePropagation: function() {
  29962. var e = this.originalEvent;
  29963. this.isImmediatePropagationStopped = returnTrue;
  29964. if (e && !this.isSimulated) {
  29965. e.stopImmediatePropagation();
  29966. }
  29967. this.stopPropagation();
  29968. }
  29969. };
  29970. jQuery.each({
  29971. altKey: true,
  29972. bubbles: true,
  29973. cancelable: true,
  29974. changedTouches: true,
  29975. ctrlKey: true,
  29976. detail: true,
  29977. eventPhase: true,
  29978. metaKey: true,
  29979. pageX: true,
  29980. pageY: true,
  29981. shiftKey: true,
  29982. view: true,
  29983. "char": true,
  29984. code: true,
  29985. charCode: true,
  29986. key: true,
  29987. keyCode: true,
  29988. button: true,
  29989. buttons: true,
  29990. clientX: true,
  29991. clientY: true,
  29992. offsetX: true,
  29993. offsetY: true,
  29994. pointerId: true,
  29995. pointerType: true,
  29996. screenX: true,
  29997. screenY: true,
  29998. targetTouches: true,
  29999. toElement: true,
  30000. touches: true,
  30001. which: true
  30002. }, jQuery.event.addProp);
  30003. jQuery.each({ focus: "focusin", blur: "focusout" }, function(type2, delegateType) {
  30004. function focusMappedHandler(nativeEvent) {
  30005. if (document2.documentMode) {
  30006. var handle = dataPriv.get(this, "handle"), event2 = jQuery.event.fix(nativeEvent);
  30007. event2.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  30008. event2.isSimulated = true;
  30009. handle(nativeEvent);
  30010. if (event2.target === event2.currentTarget) {
  30011. handle(event2);
  30012. }
  30013. } else {
  30014. jQuery.event.simulate(
  30015. delegateType,
  30016. nativeEvent.target,
  30017. jQuery.event.fix(nativeEvent)
  30018. );
  30019. }
  30020. }
  30021. jQuery.event.special[type2] = {
  30022. setup: function() {
  30023. var attaches;
  30024. leverageNative(this, type2, true);
  30025. if (document2.documentMode) {
  30026. attaches = dataPriv.get(this, delegateType);
  30027. if (!attaches) {
  30028. this.addEventListener(delegateType, focusMappedHandler);
  30029. }
  30030. dataPriv.set(this, delegateType, (attaches || 0) + 1);
  30031. } else {
  30032. return false;
  30033. }
  30034. },
  30035. trigger: function() {
  30036. leverageNative(this, type2);
  30037. return true;
  30038. },
  30039. teardown: function() {
  30040. var attaches;
  30041. if (document2.documentMode) {
  30042. attaches = dataPriv.get(this, delegateType) - 1;
  30043. if (!attaches) {
  30044. this.removeEventListener(delegateType, focusMappedHandler);
  30045. dataPriv.remove(this, delegateType);
  30046. } else {
  30047. dataPriv.set(this, delegateType, attaches);
  30048. }
  30049. } else {
  30050. return false;
  30051. }
  30052. },
  30053. _default: function(event2) {
  30054. return dataPriv.get(event2.target, type2);
  30055. },
  30056. delegateType
  30057. };
  30058. jQuery.event.special[delegateType] = {
  30059. setup: function() {
  30060. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
  30061. if (!attaches) {
  30062. if (document2.documentMode) {
  30063. this.addEventListener(delegateType, focusMappedHandler);
  30064. } else {
  30065. doc.addEventListener(type2, focusMappedHandler, true);
  30066. }
  30067. }
  30068. dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
  30069. },
  30070. teardown: function() {
  30071. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
  30072. if (!attaches) {
  30073. if (document2.documentMode) {
  30074. this.removeEventListener(delegateType, focusMappedHandler);
  30075. } else {
  30076. doc.removeEventListener(type2, focusMappedHandler, true);
  30077. }
  30078. dataPriv.remove(dataHolder, delegateType);
  30079. } else {
  30080. dataPriv.set(dataHolder, delegateType, attaches);
  30081. }
  30082. }
  30083. };
  30084. });
  30085. jQuery.each({
  30086. mouseenter: "mouseover",
  30087. mouseleave: "mouseout",
  30088. pointerenter: "pointerover",
  30089. pointerleave: "pointerout"
  30090. }, function(orig, fix) {
  30091. jQuery.event.special[orig] = {
  30092. delegateType: fix,
  30093. bindType: fix,
  30094. handle: function(event2) {
  30095. var ret, target = this, related = event2.relatedTarget, handleObj = event2.handleObj;
  30096. if (!related || related !== target && !jQuery.contains(target, related)) {
  30097. event2.type = handleObj.origType;
  30098. ret = handleObj.handler.apply(this, arguments);
  30099. event2.type = fix;
  30100. }
  30101. return ret;
  30102. }
  30103. };
  30104. });
  30105. jQuery.fn.extend({
  30106. on: function(types, selector, data, fn2) {
  30107. return on3(this, types, selector, data, fn2);
  30108. },
  30109. one: function(types, selector, data, fn2) {
  30110. return on3(this, types, selector, data, fn2, 1);
  30111. },
  30112. off: function(types, selector, fn2) {
  30113. var handleObj, type2;
  30114. if (types && types.preventDefault && types.handleObj) {
  30115. handleObj = types.handleObj;
  30116. jQuery(types.delegateTarget).off(
  30117. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  30118. handleObj.selector,
  30119. handleObj.handler
  30120. );
  30121. return this;
  30122. }
  30123. if (typeof types === "object") {
  30124. for (type2 in types) {
  30125. this.off(type2, selector, types[type2]);
  30126. }
  30127. return this;
  30128. }
  30129. if (selector === false || typeof selector === "function") {
  30130. fn2 = selector;
  30131. selector = void 0;
  30132. }
  30133. if (fn2 === false) {
  30134. fn2 = returnFalse;
  30135. }
  30136. return this.each(function() {
  30137. jQuery.event.remove(this, types, fn2, selector);
  30138. });
  30139. }
  30140. });
  30141. var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  30142. function manipulationTarget(elem, content) {
  30143. if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
  30144. return jQuery(elem).children("tbody")[0] || elem;
  30145. }
  30146. return elem;
  30147. }
  30148. function disableScript(elem) {
  30149. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  30150. return elem;
  30151. }
  30152. function restoreScript(elem) {
  30153. if ((elem.type || "").slice(0, 5) === "true/") {
  30154. elem.type = elem.type.slice(5);
  30155. } else {
  30156. elem.removeAttribute("type");
  30157. }
  30158. return elem;
  30159. }
  30160. function cloneCopyEvent(src, dest) {
  30161. var i2, l, type2, pdataOld, udataOld, udataCur, events;
  30162. if (dest.nodeType !== 1) {
  30163. return;
  30164. }
  30165. if (dataPriv.hasData(src)) {
  30166. pdataOld = dataPriv.get(src);
  30167. events = pdataOld.events;
  30168. if (events) {
  30169. dataPriv.remove(dest, "handle events");
  30170. for (type2 in events) {
  30171. for (i2 = 0, l = events[type2].length; i2 < l; i2++) {
  30172. jQuery.event.add(dest, type2, events[type2][i2]);
  30173. }
  30174. }
  30175. }
  30176. }
  30177. if (dataUser.hasData(src)) {
  30178. udataOld = dataUser.access(src);
  30179. udataCur = jQuery.extend({}, udataOld);
  30180. dataUser.set(dest, udataCur);
  30181. }
  30182. }
  30183. function fixInput(src, dest) {
  30184. var nodeName2 = dest.nodeName.toLowerCase();
  30185. if (nodeName2 === "input" && rcheckableType.test(src.type)) {
  30186. dest.checked = src.checked;
  30187. } else if (nodeName2 === "input" || nodeName2 === "textarea") {
  30188. dest.defaultValue = src.defaultValue;
  30189. }
  30190. }
  30191. function domManip(collection, args, callback2, ignored) {
  30192. args = flat2(args);
  30193. var fragment, first, scripts, hasScripts, node, doc, i2 = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction2(value);
  30194. if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
  30195. return collection.each(function(index2) {
  30196. var self2 = collection.eq(index2);
  30197. if (valueIsFunction) {
  30198. args[0] = value.call(this, index2, self2.html());
  30199. }
  30200. domManip(self2, args, callback2, ignored);
  30201. });
  30202. }
  30203. if (l) {
  30204. fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
  30205. first = fragment.firstChild;
  30206. if (fragment.childNodes.length === 1) {
  30207. fragment = first;
  30208. }
  30209. if (first || ignored) {
  30210. scripts = jQuery.map(getAll(fragment, "script"), disableScript);
  30211. hasScripts = scripts.length;
  30212. for (; i2 < l; i2++) {
  30213. node = fragment;
  30214. if (i2 !== iNoClone) {
  30215. node = jQuery.clone(node, true, true);
  30216. if (hasScripts) {
  30217. jQuery.merge(scripts, getAll(node, "script"));
  30218. }
  30219. }
  30220. callback2.call(collection[i2], node, i2);
  30221. }
  30222. if (hasScripts) {
  30223. doc = scripts[scripts.length - 1].ownerDocument;
  30224. jQuery.map(scripts, restoreScript);
  30225. for (i2 = 0; i2 < hasScripts; i2++) {
  30226. node = scripts[i2];
  30227. if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
  30228. if (node.src && (node.type || "").toLowerCase() !== "module") {
  30229. if (jQuery._evalUrl && !node.noModule) {
  30230. jQuery._evalUrl(node.src, {
  30231. nonce: node.nonce || node.getAttribute("nonce")
  30232. }, doc);
  30233. }
  30234. } else {
  30235. DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
  30236. }
  30237. }
  30238. }
  30239. }
  30240. }
  30241. }
  30242. return collection;
  30243. }
  30244. function remove2(elem, selector, keepData) {
  30245. var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i2 = 0;
  30246. for (; (node = nodes[i2]) != null; i2++) {
  30247. if (!keepData && node.nodeType === 1) {
  30248. jQuery.cleanData(getAll(node));
  30249. }
  30250. if (node.parentNode) {
  30251. if (keepData && isAttached(node)) {
  30252. setGlobalEval(getAll(node, "script"));
  30253. }
  30254. node.parentNode.removeChild(node);
  30255. }
  30256. }
  30257. return elem;
  30258. }
  30259. jQuery.extend({
  30260. htmlPrefilter: function(html) {
  30261. return html;
  30262. },
  30263. clone: function(elem, dataAndEvents, deepDataAndEvents) {
  30264. var i2, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
  30265. if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  30266. destElements = getAll(clone);
  30267. srcElements = getAll(elem);
  30268. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30269. fixInput(srcElements[i2], destElements[i2]);
  30270. }
  30271. }
  30272. if (dataAndEvents) {
  30273. if (deepDataAndEvents) {
  30274. srcElements = srcElements || getAll(elem);
  30275. destElements = destElements || getAll(clone);
  30276. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30277. cloneCopyEvent(srcElements[i2], destElements[i2]);
  30278. }
  30279. } else {
  30280. cloneCopyEvent(elem, clone);
  30281. }
  30282. }
  30283. destElements = getAll(clone, "script");
  30284. if (destElements.length > 0) {
  30285. setGlobalEval(destElements, !inPage && getAll(elem, "script"));
  30286. }
  30287. return clone;
  30288. },
  30289. cleanData: function(elems) {
  30290. var data, elem, type2, special = jQuery.event.special, i2 = 0;
  30291. for (; (elem = elems[i2]) !== void 0; i2++) {
  30292. if (acceptData(elem)) {
  30293. if (data = elem[dataPriv.expando]) {
  30294. if (data.events) {
  30295. for (type2 in data.events) {
  30296. if (special[type2]) {
  30297. jQuery.event.remove(elem, type2);
  30298. } else {
  30299. jQuery.removeEvent(elem, type2, data.handle);
  30300. }
  30301. }
  30302. }
  30303. elem[dataPriv.expando] = void 0;
  30304. }
  30305. if (elem[dataUser.expando]) {
  30306. elem[dataUser.expando] = void 0;
  30307. }
  30308. }
  30309. }
  30310. }
  30311. });
  30312. jQuery.fn.extend({
  30313. detach: function(selector) {
  30314. return remove2(this, selector, true);
  30315. },
  30316. remove: function(selector) {
  30317. return remove2(this, selector);
  30318. },
  30319. text: function(value) {
  30320. return access(this, function(value2) {
  30321. return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
  30322. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30323. this.textContent = value2;
  30324. }
  30325. });
  30326. }, null, value, arguments.length);
  30327. },
  30328. append: function() {
  30329. return domManip(this, arguments, function(elem) {
  30330. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30331. var target = manipulationTarget(this, elem);
  30332. target.appendChild(elem);
  30333. }
  30334. });
  30335. },
  30336. prepend: function() {
  30337. return domManip(this, arguments, function(elem) {
  30338. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30339. var target = manipulationTarget(this, elem);
  30340. target.insertBefore(elem, target.firstChild);
  30341. }
  30342. });
  30343. },
  30344. before: function() {
  30345. return domManip(this, arguments, function(elem) {
  30346. if (this.parentNode) {
  30347. this.parentNode.insertBefore(elem, this);
  30348. }
  30349. });
  30350. },
  30351. after: function() {
  30352. return domManip(this, arguments, function(elem) {
  30353. if (this.parentNode) {
  30354. this.parentNode.insertBefore(elem, this.nextSibling);
  30355. }
  30356. });
  30357. },
  30358. empty: function() {
  30359. var elem, i2 = 0;
  30360. for (; (elem = this[i2]) != null; i2++) {
  30361. if (elem.nodeType === 1) {
  30362. jQuery.cleanData(getAll(elem, false));
  30363. elem.textContent = "";
  30364. }
  30365. }
  30366. return this;
  30367. },
  30368. clone: function(dataAndEvents, deepDataAndEvents) {
  30369. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  30370. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  30371. return this.map(function() {
  30372. return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
  30373. });
  30374. },
  30375. html: function(value) {
  30376. return access(this, function(value2) {
  30377. var elem = this[0] || {}, i2 = 0, l = this.length;
  30378. if (value2 === void 0 && elem.nodeType === 1) {
  30379. return elem.innerHTML;
  30380. }
  30381. if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
  30382. value2 = jQuery.htmlPrefilter(value2);
  30383. try {
  30384. for (; i2 < l; i2++) {
  30385. elem = this[i2] || {};
  30386. if (elem.nodeType === 1) {
  30387. jQuery.cleanData(getAll(elem, false));
  30388. elem.innerHTML = value2;
  30389. }
  30390. }
  30391. elem = 0;
  30392. } catch (e) {
  30393. }
  30394. }
  30395. if (elem) {
  30396. this.empty().append(value2);
  30397. }
  30398. }, null, value, arguments.length);
  30399. },
  30400. replaceWith: function() {
  30401. var ignored = [];
  30402. return domManip(this, arguments, function(elem) {
  30403. var parent = this.parentNode;
  30404. if (jQuery.inArray(this, ignored) < 0) {
  30405. jQuery.cleanData(getAll(this));
  30406. if (parent) {
  30407. parent.replaceChild(elem, this);
  30408. }
  30409. }
  30410. }, ignored);
  30411. }
  30412. });
  30413. jQuery.each({
  30414. appendTo: "append",
  30415. prependTo: "prepend",
  30416. insertBefore: "before",
  30417. insertAfter: "after",
  30418. replaceAll: "replaceWith"
  30419. }, function(name, original) {
  30420. jQuery.fn[name] = function(selector) {
  30421. var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i2 = 0;
  30422. for (; i2 <= last; i2++) {
  30423. elems = i2 === last ? this : this.clone(true);
  30424. jQuery(insert[i2])[original](elems);
  30425. push.apply(ret, elems.get());
  30426. }
  30427. return this.pushStack(ret);
  30428. };
  30429. });
  30430. var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
  30431. var rcustomProp = /^--/;
  30432. var getStyles = function(elem) {
  30433. var view = elem.ownerDocument.defaultView;
  30434. if (!view || !view.opener) {
  30435. view = window2;
  30436. }
  30437. return view.getComputedStyle(elem);
  30438. };
  30439. var swap = function(elem, options2, callback2) {
  30440. var ret, name, old = {};
  30441. for (name in options2) {
  30442. old[name] = elem.style[name];
  30443. elem.style[name] = options2[name];
  30444. }
  30445. ret = callback2.call(elem);
  30446. for (name in options2) {
  30447. elem.style[name] = old[name];
  30448. }
  30449. return ret;
  30450. };
  30451. var rboxStyle = new RegExp(cssExpand.join("|"), "i");
  30452. (function() {
  30453. function computeStyleTests() {
  30454. if (!div) {
  30455. return;
  30456. }
  30457. container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
  30458. div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
  30459. documentElement.appendChild(container).appendChild(div);
  30460. var divStyle = window2.getComputedStyle(div);
  30461. pixelPositionVal = divStyle.top !== "1%";
  30462. reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
  30463. div.style.right = "60%";
  30464. pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
  30465. boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
  30466. div.style.position = "absolute";
  30467. scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
  30468. documentElement.removeChild(container);
  30469. div = null;
  30470. }
  30471. function roundPixelMeasures(measure) {
  30472. return Math.round(parseFloat(measure));
  30473. }
  30474. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
  30475. if (!div.style) {
  30476. return;
  30477. }
  30478. div.style.backgroundClip = "content-box";
  30479. div.cloneNode(true).style.backgroundClip = "";
  30480. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  30481. jQuery.extend(support, {
  30482. boxSizingReliable: function() {
  30483. computeStyleTests();
  30484. return boxSizingReliableVal;
  30485. },
  30486. pixelBoxStyles: function() {
  30487. computeStyleTests();
  30488. return pixelBoxStylesVal;
  30489. },
  30490. pixelPosition: function() {
  30491. computeStyleTests();
  30492. return pixelPositionVal;
  30493. },
  30494. reliableMarginLeft: function() {
  30495. computeStyleTests();
  30496. return reliableMarginLeftVal;
  30497. },
  30498. scrollboxSize: function() {
  30499. computeStyleTests();
  30500. return scrollboxSizeVal;
  30501. },
  30502. reliableTrDimensions: function() {
  30503. var table, tr, trChild, trStyle;
  30504. if (reliableTrDimensionsVal == null) {
  30505. table = document2.createElement("table");
  30506. tr = document2.createElement("tr");
  30507. trChild = document2.createElement("div");
  30508. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  30509. tr.style.cssText = "border:1px solid";
  30510. tr.style.height = "1px";
  30511. trChild.style.height = "9px";
  30512. trChild.style.display = "block";
  30513. documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
  30514. trStyle = window2.getComputedStyle(tr);
  30515. reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
  30516. documentElement.removeChild(table);
  30517. }
  30518. return reliableTrDimensionsVal;
  30519. }
  30520. });
  30521. })();
  30522. function curCSS(elem, name, computed2) {
  30523. var width2, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
  30524. computed2 = computed2 || getStyles(elem);
  30525. if (computed2) {
  30526. ret = computed2.getPropertyValue(name) || computed2[name];
  30527. if (isCustomProp && ret) {
  30528. ret = ret.replace(rtrimCSS, "$1") || void 0;
  30529. }
  30530. if (ret === "" && !isAttached(elem)) {
  30531. ret = jQuery.style(elem, name);
  30532. }
  30533. if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
  30534. width2 = style.width;
  30535. minWidth = style.minWidth;
  30536. maxWidth = style.maxWidth;
  30537. style.minWidth = style.maxWidth = style.width = ret;
  30538. ret = computed2.width;
  30539. style.width = width2;
  30540. style.minWidth = minWidth;
  30541. style.maxWidth = maxWidth;
  30542. }
  30543. }
  30544. return ret !== void 0 ? ret + "" : ret;
  30545. }
  30546. function addGetHookIf(conditionFn, hookFn) {
  30547. return {
  30548. get: function() {
  30549. if (conditionFn()) {
  30550. delete this.get;
  30551. return;
  30552. }
  30553. return (this.get = hookFn).apply(this, arguments);
  30554. }
  30555. };
  30556. }
  30557. var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
  30558. function vendorPropName(name) {
  30559. var capName = name[0].toUpperCase() + name.slice(1), i2 = cssPrefixes.length;
  30560. while (i2--) {
  30561. name = cssPrefixes[i2] + capName;
  30562. if (name in emptyStyle) {
  30563. return name;
  30564. }
  30565. }
  30566. }
  30567. function finalPropName(name) {
  30568. var final = jQuery.cssProps[name] || vendorProps[name];
  30569. if (final) {
  30570. return final;
  30571. }
  30572. if (name in emptyStyle) {
  30573. return name;
  30574. }
  30575. return vendorProps[name] = vendorPropName(name) || name;
  30576. }
  30577. var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
  30578. letterSpacing: "0",
  30579. fontWeight: "400"
  30580. };
  30581. function setPositiveNumber(_elem, value, subtract) {
  30582. var matches = rcssNum.exec(value);
  30583. return matches ? Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value;
  30584. }
  30585. function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
  30586. var i2 = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
  30587. if (box === (isBorderBox ? "border" : "content")) {
  30588. return 0;
  30589. }
  30590. for (; i2 < 4; i2 += 2) {
  30591. if (box === "margin") {
  30592. marginDelta += jQuery.css(elem, box + cssExpand[i2], true, styles);
  30593. }
  30594. if (!isBorderBox) {
  30595. delta += jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30596. if (box !== "padding") {
  30597. delta += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30598. } else {
  30599. extra += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30600. }
  30601. } else {
  30602. if (box === "content") {
  30603. delta -= jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30604. }
  30605. if (box !== "margin") {
  30606. delta -= jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30607. }
  30608. }
  30609. }
  30610. if (!isBorderBox && computedVal >= 0) {
  30611. delta += Math.max(0, Math.ceil(
  30612. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
  30613. )) || 0;
  30614. }
  30615. return delta + marginDelta;
  30616. }
  30617. function getWidthOrHeight(elem, dimension, extra) {
  30618. var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
  30619. if (rnumnonpx.test(val)) {
  30620. if (!extra) {
  30621. return val;
  30622. }
  30623. val = "auto";
  30624. }
  30625. if ((!support.boxSizingReliable() && isBorderBox || !support.reliableTrDimensions() && nodeName(elem, "tr") || val === "auto" || !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && elem.getClientRects().length) {
  30626. isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
  30627. valueIsBorderBox = offsetProp in elem;
  30628. if (valueIsBorderBox) {
  30629. val = elem[offsetProp];
  30630. }
  30631. }
  30632. val = parseFloat(val) || 0;
  30633. return val + boxModelAdjustment(
  30634. elem,
  30635. dimension,
  30636. extra || (isBorderBox ? "border" : "content"),
  30637. valueIsBorderBox,
  30638. styles,
  30639. val
  30640. ) + "px";
  30641. }
  30642. jQuery.extend({
  30643. cssHooks: {
  30644. opacity: {
  30645. get: function(elem, computed2) {
  30646. if (computed2) {
  30647. var ret = curCSS(elem, "opacity");
  30648. return ret === "" ? "1" : ret;
  30649. }
  30650. }
  30651. }
  30652. },
  30653. cssNumber: {
  30654. animationIterationCount: true,
  30655. aspectRatio: true,
  30656. borderImageSlice: true,
  30657. columnCount: true,
  30658. flexGrow: true,
  30659. flexShrink: true,
  30660. fontWeight: true,
  30661. gridArea: true,
  30662. gridColumn: true,
  30663. gridColumnEnd: true,
  30664. gridColumnStart: true,
  30665. gridRow: true,
  30666. gridRowEnd: true,
  30667. gridRowStart: true,
  30668. lineHeight: true,
  30669. opacity: true,
  30670. order: true,
  30671. orphans: true,
  30672. scale: true,
  30673. widows: true,
  30674. zIndex: true,
  30675. zoom: true,
  30676. fillOpacity: true,
  30677. floodOpacity: true,
  30678. stopOpacity: true,
  30679. strokeMiterlimit: true,
  30680. strokeOpacity: true
  30681. },
  30682. cssProps: {},
  30683. style: function(elem, name, value, extra) {
  30684. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
  30685. return;
  30686. }
  30687. var ret, type2, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name), style = elem.style;
  30688. if (!isCustomProp) {
  30689. name = finalPropName(origName);
  30690. }
  30691. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30692. if (value !== void 0) {
  30693. type2 = typeof value;
  30694. if (type2 === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
  30695. value = adjustCSS(elem, name, ret);
  30696. type2 = "number";
  30697. }
  30698. if (value == null || value !== value) {
  30699. return;
  30700. }
  30701. if (type2 === "number" && !isCustomProp) {
  30702. value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
  30703. }
  30704. if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
  30705. style[name] = "inherit";
  30706. }
  30707. if (!hooks3 || !("set" in hooks3) || (value = hooks3.set(elem, value, extra)) !== void 0) {
  30708. if (isCustomProp) {
  30709. style.setProperty(name, value);
  30710. } else {
  30711. style[name] = value;
  30712. }
  30713. }
  30714. } else {
  30715. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, false, extra)) !== void 0) {
  30716. return ret;
  30717. }
  30718. return style[name];
  30719. }
  30720. },
  30721. css: function(elem, name, extra, styles) {
  30722. var val, num, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name);
  30723. if (!isCustomProp) {
  30724. name = finalPropName(origName);
  30725. }
  30726. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30727. if (hooks3 && "get" in hooks3) {
  30728. val = hooks3.get(elem, true, extra);
  30729. }
  30730. if (val === void 0) {
  30731. val = curCSS(elem, name, styles);
  30732. }
  30733. if (val === "normal" && name in cssNormalTransform) {
  30734. val = cssNormalTransform[name];
  30735. }
  30736. if (extra === "" || extra) {
  30737. num = parseFloat(val);
  30738. return extra === true || isFinite(num) ? num || 0 : val;
  30739. }
  30740. return val;
  30741. }
  30742. });
  30743. jQuery.each(["height", "width"], function(_i, dimension) {
  30744. jQuery.cssHooks[dimension] = {
  30745. get: function(elem, computed2, extra) {
  30746. if (computed2) {
  30747. return rdisplayswap.test(jQuery.css(elem, "display")) && (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
  30748. return getWidthOrHeight(elem, dimension, extra);
  30749. }) : getWidthOrHeight(elem, dimension, extra);
  30750. }
  30751. },
  30752. set: function(elem, value, extra) {
  30753. var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
  30754. elem,
  30755. dimension,
  30756. extra,
  30757. isBorderBox,
  30758. styles
  30759. ) : 0;
  30760. if (isBorderBox && scrollboxSizeBuggy) {
  30761. subtract -= Math.ceil(
  30762. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
  30763. );
  30764. }
  30765. if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
  30766. elem.style[dimension] = value;
  30767. value = jQuery.css(elem, dimension);
  30768. }
  30769. return setPositiveNumber(elem, value, subtract);
  30770. }
  30771. };
  30772. });
  30773. jQuery.cssHooks.marginLeft = addGetHookIf(
  30774. support.reliableMarginLeft,
  30775. function(elem, computed2) {
  30776. if (computed2) {
  30777. return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
  30778. return elem.getBoundingClientRect().left;
  30779. })) + "px";
  30780. }
  30781. }
  30782. );
  30783. jQuery.each({
  30784. margin: "",
  30785. padding: "",
  30786. border: "Width"
  30787. }, function(prefix, suffix) {
  30788. jQuery.cssHooks[prefix + suffix] = {
  30789. expand: function(value) {
  30790. var i2 = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
  30791. for (; i2 < 4; i2++) {
  30792. expanded[prefix + cssExpand[i2] + suffix] = parts[i2] || parts[i2 - 2] || parts[0];
  30793. }
  30794. return expanded;
  30795. }
  30796. };
  30797. if (prefix !== "margin") {
  30798. jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
  30799. }
  30800. });
  30801. jQuery.fn.extend({
  30802. css: function(name, value) {
  30803. return access(this, function(elem, name2, value2) {
  30804. var styles, len, map = {}, i2 = 0;
  30805. if (Array.isArray(name2)) {
  30806. styles = getStyles(elem);
  30807. len = name2.length;
  30808. for (; i2 < len; i2++) {
  30809. map[name2[i2]] = jQuery.css(elem, name2[i2], false, styles);
  30810. }
  30811. return map;
  30812. }
  30813. return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
  30814. }, name, value, arguments.length > 1);
  30815. }
  30816. });
  30817. function Tween(elem, options2, prop, end, easing) {
  30818. return new Tween.prototype.init(elem, options2, prop, end, easing);
  30819. }
  30820. jQuery.Tween = Tween;
  30821. Tween.prototype = {
  30822. constructor: Tween,
  30823. init: function(elem, options2, prop, end, easing, unit) {
  30824. this.elem = elem;
  30825. this.prop = prop;
  30826. this.easing = easing || jQuery.easing._default;
  30827. this.options = options2;
  30828. this.start = this.now = this.cur();
  30829. this.end = end;
  30830. this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
  30831. },
  30832. cur: function() {
  30833. var hooks3 = Tween.propHooks[this.prop];
  30834. return hooks3 && hooks3.get ? hooks3.get(this) : Tween.propHooks._default.get(this);
  30835. },
  30836. run: function(percent) {
  30837. var eased, hooks3 = Tween.propHooks[this.prop];
  30838. if (this.options.duration) {
  30839. this.pos = eased = jQuery.easing[this.easing](
  30840. percent,
  30841. this.options.duration * percent,
  30842. 0,
  30843. 1,
  30844. this.options.duration
  30845. );
  30846. } else {
  30847. this.pos = eased = percent;
  30848. }
  30849. this.now = (this.end - this.start) * eased + this.start;
  30850. if (this.options.step) {
  30851. this.options.step.call(this.elem, this.now, this);
  30852. }
  30853. if (hooks3 && hooks3.set) {
  30854. hooks3.set(this);
  30855. } else {
  30856. Tween.propHooks._default.set(this);
  30857. }
  30858. return this;
  30859. }
  30860. };
  30861. Tween.prototype.init.prototype = Tween.prototype;
  30862. Tween.propHooks = {
  30863. _default: {
  30864. get: function(tween) {
  30865. var result;
  30866. if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
  30867. return tween.elem[tween.prop];
  30868. }
  30869. result = jQuery.css(tween.elem, tween.prop, "");
  30870. return !result || result === "auto" ? 0 : result;
  30871. },
  30872. set: function(tween) {
  30873. if (jQuery.fx.step[tween.prop]) {
  30874. jQuery.fx.step[tween.prop](tween);
  30875. } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
  30876. jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
  30877. } else {
  30878. tween.elem[tween.prop] = tween.now;
  30879. }
  30880. }
  30881. }
  30882. };
  30883. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  30884. set: function(tween) {
  30885. if (tween.elem.nodeType && tween.elem.parentNode) {
  30886. tween.elem[tween.prop] = tween.now;
  30887. }
  30888. }
  30889. };
  30890. jQuery.easing = {
  30891. linear: function(p) {
  30892. return p;
  30893. },
  30894. swing: function(p) {
  30895. return 0.5 - Math.cos(p * Math.PI) / 2;
  30896. },
  30897. _default: "swing"
  30898. };
  30899. jQuery.fx = Tween.prototype.init;
  30900. jQuery.fx.step = {};
  30901. var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
  30902. function schedule() {
  30903. if (inProgress) {
  30904. if (document2.hidden === false && window2.requestAnimationFrame) {
  30905. window2.requestAnimationFrame(schedule);
  30906. } else {
  30907. window2.setTimeout(schedule, jQuery.fx.interval);
  30908. }
  30909. jQuery.fx.tick();
  30910. }
  30911. }
  30912. function createFxNow() {
  30913. window2.setTimeout(function() {
  30914. fxNow = void 0;
  30915. });
  30916. return fxNow = Date.now();
  30917. }
  30918. function genFx(type2, includeWidth) {
  30919. var which, i2 = 0, attrs = { height: type2 };
  30920. includeWidth = includeWidth ? 1 : 0;
  30921. for (; i2 < 4; i2 += 2 - includeWidth) {
  30922. which = cssExpand[i2];
  30923. attrs["margin" + which] = attrs["padding" + which] = type2;
  30924. }
  30925. if (includeWidth) {
  30926. attrs.opacity = attrs.width = type2;
  30927. }
  30928. return attrs;
  30929. }
  30930. function createTween(value, prop, animation) {
  30931. var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index2 = 0, length = collection.length;
  30932. for (; index2 < length; index2++) {
  30933. if (tween = collection[index2].call(animation, prop, value)) {
  30934. return tween;
  30935. }
  30936. }
  30937. }
  30938. function defaultPrefilter(elem, props, opts) {
  30939. var prop, value, toggle, hooks3, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
  30940. if (!opts.queue) {
  30941. hooks3 = jQuery._queueHooks(elem, "fx");
  30942. if (hooks3.unqueued == null) {
  30943. hooks3.unqueued = 0;
  30944. oldfire = hooks3.empty.fire;
  30945. hooks3.empty.fire = function() {
  30946. if (!hooks3.unqueued) {
  30947. oldfire();
  30948. }
  30949. };
  30950. }
  30951. hooks3.unqueued++;
  30952. anim.always(function() {
  30953. anim.always(function() {
  30954. hooks3.unqueued--;
  30955. if (!jQuery.queue(elem, "fx").length) {
  30956. hooks3.empty.fire();
  30957. }
  30958. });
  30959. });
  30960. }
  30961. for (prop in props) {
  30962. value = props[prop];
  30963. if (rfxtypes.test(value)) {
  30964. delete props[prop];
  30965. toggle = toggle || value === "toggle";
  30966. if (value === (hidden ? "hide" : "show")) {
  30967. if (value === "show" && dataShow && dataShow[prop] !== void 0) {
  30968. hidden = true;
  30969. } else {
  30970. continue;
  30971. }
  30972. }
  30973. orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
  30974. }
  30975. }
  30976. propTween = !jQuery.isEmptyObject(props);
  30977. if (!propTween && jQuery.isEmptyObject(orig)) {
  30978. return;
  30979. }
  30980. if (isBox && elem.nodeType === 1) {
  30981. opts.overflow = [style.overflow, style.overflowX, style.overflowY];
  30982. restoreDisplay = dataShow && dataShow.display;
  30983. if (restoreDisplay == null) {
  30984. restoreDisplay = dataPriv.get(elem, "display");
  30985. }
  30986. display = jQuery.css(elem, "display");
  30987. if (display === "none") {
  30988. if (restoreDisplay) {
  30989. display = restoreDisplay;
  30990. } else {
  30991. showHide([elem], true);
  30992. restoreDisplay = elem.style.display || restoreDisplay;
  30993. display = jQuery.css(elem, "display");
  30994. showHide([elem]);
  30995. }
  30996. }
  30997. if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
  30998. if (jQuery.css(elem, "float") === "none") {
  30999. if (!propTween) {
  31000. anim.done(function() {
  31001. style.display = restoreDisplay;
  31002. });
  31003. if (restoreDisplay == null) {
  31004. display = style.display;
  31005. restoreDisplay = display === "none" ? "" : display;
  31006. }
  31007. }
  31008. style.display = "inline-block";
  31009. }
  31010. }
  31011. }
  31012. if (opts.overflow) {
  31013. style.overflow = "hidden";
  31014. anim.always(function() {
  31015. style.overflow = opts.overflow[0];
  31016. style.overflowX = opts.overflow[1];
  31017. style.overflowY = opts.overflow[2];
  31018. });
  31019. }
  31020. propTween = false;
  31021. for (prop in orig) {
  31022. if (!propTween) {
  31023. if (dataShow) {
  31024. if ("hidden" in dataShow) {
  31025. hidden = dataShow.hidden;
  31026. }
  31027. } else {
  31028. dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
  31029. }
  31030. if (toggle) {
  31031. dataShow.hidden = !hidden;
  31032. }
  31033. if (hidden) {
  31034. showHide([elem], true);
  31035. }
  31036. anim.done(function() {
  31037. if (!hidden) {
  31038. showHide([elem]);
  31039. }
  31040. dataPriv.remove(elem, "fxshow");
  31041. for (prop in orig) {
  31042. jQuery.style(elem, prop, orig[prop]);
  31043. }
  31044. });
  31045. }
  31046. propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
  31047. if (!(prop in dataShow)) {
  31048. dataShow[prop] = propTween.start;
  31049. if (hidden) {
  31050. propTween.end = propTween.start;
  31051. propTween.start = 0;
  31052. }
  31053. }
  31054. }
  31055. }
  31056. function propFilter(props, specialEasing) {
  31057. var index2, name, easing, value, hooks3;
  31058. for (index2 in props) {
  31059. name = camelCase3(index2);
  31060. easing = specialEasing[name];
  31061. value = props[index2];
  31062. if (Array.isArray(value)) {
  31063. easing = value[1];
  31064. value = props[index2] = value[0];
  31065. }
  31066. if (index2 !== name) {
  31067. props[name] = value;
  31068. delete props[index2];
  31069. }
  31070. hooks3 = jQuery.cssHooks[name];
  31071. if (hooks3 && "expand" in hooks3) {
  31072. value = hooks3.expand(value);
  31073. delete props[name];
  31074. for (index2 in value) {
  31075. if (!(index2 in props)) {
  31076. props[index2] = value[index2];
  31077. specialEasing[index2] = easing;
  31078. }
  31079. }
  31080. } else {
  31081. specialEasing[name] = easing;
  31082. }
  31083. }
  31084. }
  31085. function Animation(elem, properties, options2) {
  31086. var result, stopped, index2 = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
  31087. delete tick.elem;
  31088. }), tick = function() {
  31089. if (stopped) {
  31090. return false;
  31091. }
  31092. var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index3 = 0, length2 = animation.tweens.length;
  31093. for (; index3 < length2; index3++) {
  31094. animation.tweens[index3].run(percent);
  31095. }
  31096. deferred.notifyWith(elem, [animation, percent, remaining]);
  31097. if (percent < 1 && length2) {
  31098. return remaining;
  31099. }
  31100. if (!length2) {
  31101. deferred.notifyWith(elem, [animation, 1, 0]);
  31102. }
  31103. deferred.resolveWith(elem, [animation]);
  31104. return false;
  31105. }, animation = deferred.promise({
  31106. elem,
  31107. props: jQuery.extend({}, properties),
  31108. opts: jQuery.extend(true, {
  31109. specialEasing: {},
  31110. easing: jQuery.easing._default
  31111. }, options2),
  31112. originalProperties: properties,
  31113. originalOptions: options2,
  31114. startTime: fxNow || createFxNow(),
  31115. duration: options2.duration,
  31116. tweens: [],
  31117. createTween: function(prop, end) {
  31118. var tween = jQuery.Tween(
  31119. elem,
  31120. animation.opts,
  31121. prop,
  31122. end,
  31123. animation.opts.specialEasing[prop] || animation.opts.easing
  31124. );
  31125. animation.tweens.push(tween);
  31126. return tween;
  31127. },
  31128. stop: function(gotoEnd) {
  31129. var index3 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
  31130. if (stopped) {
  31131. return this;
  31132. }
  31133. stopped = true;
  31134. for (; index3 < length2; index3++) {
  31135. animation.tweens[index3].run(1);
  31136. }
  31137. if (gotoEnd) {
  31138. deferred.notifyWith(elem, [animation, 1, 0]);
  31139. deferred.resolveWith(elem, [animation, gotoEnd]);
  31140. } else {
  31141. deferred.rejectWith(elem, [animation, gotoEnd]);
  31142. }
  31143. return this;
  31144. }
  31145. }), props = animation.props;
  31146. propFilter(props, animation.opts.specialEasing);
  31147. for (; index2 < length; index2++) {
  31148. result = Animation.prefilters[index2].call(animation, elem, props, animation.opts);
  31149. if (result) {
  31150. if (isFunction2(result.stop)) {
  31151. jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
  31152. }
  31153. return result;
  31154. }
  31155. }
  31156. jQuery.map(props, createTween, animation);
  31157. if (isFunction2(animation.opts.start)) {
  31158. animation.opts.start.call(elem, animation);
  31159. }
  31160. animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
  31161. jQuery.fx.timer(
  31162. jQuery.extend(tick, {
  31163. elem,
  31164. anim: animation,
  31165. queue: animation.opts.queue
  31166. })
  31167. );
  31168. return animation;
  31169. }
  31170. jQuery.Animation = jQuery.extend(Animation, {
  31171. tweeners: {
  31172. "*": [function(prop, value) {
  31173. var tween = this.createTween(prop, value);
  31174. adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
  31175. return tween;
  31176. }]
  31177. },
  31178. tweener: function(props, callback2) {
  31179. if (isFunction2(props)) {
  31180. callback2 = props;
  31181. props = ["*"];
  31182. } else {
  31183. props = props.match(rnothtmlwhite);
  31184. }
  31185. var prop, index2 = 0, length = props.length;
  31186. for (; index2 < length; index2++) {
  31187. prop = props[index2];
  31188. Animation.tweeners[prop] = Animation.tweeners[prop] || [];
  31189. Animation.tweeners[prop].unshift(callback2);
  31190. }
  31191. },
  31192. prefilters: [defaultPrefilter],
  31193. prefilter: function(callback2, prepend) {
  31194. if (prepend) {
  31195. Animation.prefilters.unshift(callback2);
  31196. } else {
  31197. Animation.prefilters.push(callback2);
  31198. }
  31199. }
  31200. });
  31201. jQuery.speed = function(speed, easing, fn2) {
  31202. var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  31203. complete: fn2 || !fn2 && easing || isFunction2(speed) && speed,
  31204. duration: speed,
  31205. easing: fn2 && easing || easing && !isFunction2(easing) && easing
  31206. };
  31207. if (jQuery.fx.off) {
  31208. opt.duration = 0;
  31209. } else {
  31210. if (typeof opt.duration !== "number") {
  31211. if (opt.duration in jQuery.fx.speeds) {
  31212. opt.duration = jQuery.fx.speeds[opt.duration];
  31213. } else {
  31214. opt.duration = jQuery.fx.speeds._default;
  31215. }
  31216. }
  31217. }
  31218. if (opt.queue == null || opt.queue === true) {
  31219. opt.queue = "fx";
  31220. }
  31221. opt.old = opt.complete;
  31222. opt.complete = function() {
  31223. if (isFunction2(opt.old)) {
  31224. opt.old.call(this);
  31225. }
  31226. if (opt.queue) {
  31227. jQuery.dequeue(this, opt.queue);
  31228. }
  31229. };
  31230. return opt;
  31231. };
  31232. jQuery.fn.extend({
  31233. fadeTo: function(speed, to, easing, callback2) {
  31234. return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback2);
  31235. },
  31236. animate: function(prop, speed, easing, callback2) {
  31237. var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback2), doAnimation = function() {
  31238. var anim = Animation(this, jQuery.extend({}, prop), optall);
  31239. if (empty || dataPriv.get(this, "finish")) {
  31240. anim.stop(true);
  31241. }
  31242. };
  31243. doAnimation.finish = doAnimation;
  31244. return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
  31245. },
  31246. stop: function(type2, clearQueue, gotoEnd) {
  31247. var stopQueue = function(hooks3) {
  31248. var stop = hooks3.stop;
  31249. delete hooks3.stop;
  31250. stop(gotoEnd);
  31251. };
  31252. if (typeof type2 !== "string") {
  31253. gotoEnd = clearQueue;
  31254. clearQueue = type2;
  31255. type2 = void 0;
  31256. }
  31257. if (clearQueue) {
  31258. this.queue(type2 || "fx", []);
  31259. }
  31260. return this.each(function() {
  31261. var dequeue3 = true, index2 = type2 != null && type2 + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
  31262. if (index2) {
  31263. if (data[index2] && data[index2].stop) {
  31264. stopQueue(data[index2]);
  31265. }
  31266. } else {
  31267. for (index2 in data) {
  31268. if (data[index2] && data[index2].stop && rrun.test(index2)) {
  31269. stopQueue(data[index2]);
  31270. }
  31271. }
  31272. }
  31273. for (index2 = timers.length; index2--; ) {
  31274. if (timers[index2].elem === this && (type2 == null || timers[index2].queue === type2)) {
  31275. timers[index2].anim.stop(gotoEnd);
  31276. dequeue3 = false;
  31277. timers.splice(index2, 1);
  31278. }
  31279. }
  31280. if (dequeue3 || !gotoEnd) {
  31281. jQuery.dequeue(this, type2);
  31282. }
  31283. });
  31284. },
  31285. finish: function(type2) {
  31286. if (type2 !== false) {
  31287. type2 = type2 || "fx";
  31288. }
  31289. return this.each(function() {
  31290. var index2, data = dataPriv.get(this), queue = data[type2 + "queue"], hooks3 = data[type2 + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
  31291. data.finish = true;
  31292. jQuery.queue(this, type2, []);
  31293. if (hooks3 && hooks3.stop) {
  31294. hooks3.stop.call(this, true);
  31295. }
  31296. for (index2 = timers.length; index2--; ) {
  31297. if (timers[index2].elem === this && timers[index2].queue === type2) {
  31298. timers[index2].anim.stop(true);
  31299. timers.splice(index2, 1);
  31300. }
  31301. }
  31302. for (index2 = 0; index2 < length; index2++) {
  31303. if (queue[index2] && queue[index2].finish) {
  31304. queue[index2].finish.call(this);
  31305. }
  31306. }
  31307. delete data.finish;
  31308. });
  31309. }
  31310. });
  31311. jQuery.each(["toggle", "show", "hide"], function(_i, name) {
  31312. var cssFn = jQuery.fn[name];
  31313. jQuery.fn[name] = function(speed, easing, callback2) {
  31314. return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback2);
  31315. };
  31316. });
  31317. jQuery.each({
  31318. slideDown: genFx("show"),
  31319. slideUp: genFx("hide"),
  31320. slideToggle: genFx("toggle"),
  31321. fadeIn: { opacity: "show" },
  31322. fadeOut: { opacity: "hide" },
  31323. fadeToggle: { opacity: "toggle" }
  31324. }, function(name, props) {
  31325. jQuery.fn[name] = function(speed, easing, callback2) {
  31326. return this.animate(props, speed, easing, callback2);
  31327. };
  31328. });
  31329. jQuery.timers = [];
  31330. jQuery.fx.tick = function() {
  31331. var timer, i2 = 0, timers = jQuery.timers;
  31332. fxNow = Date.now();
  31333. for (; i2 < timers.length; i2++) {
  31334. timer = timers[i2];
  31335. if (!timer() && timers[i2] === timer) {
  31336. timers.splice(i2--, 1);
  31337. }
  31338. }
  31339. if (!timers.length) {
  31340. jQuery.fx.stop();
  31341. }
  31342. fxNow = void 0;
  31343. };
  31344. jQuery.fx.timer = function(timer) {
  31345. jQuery.timers.push(timer);
  31346. jQuery.fx.start();
  31347. };
  31348. jQuery.fx.interval = 13;
  31349. jQuery.fx.start = function() {
  31350. if (inProgress) {
  31351. return;
  31352. }
  31353. inProgress = true;
  31354. schedule();
  31355. };
  31356. jQuery.fx.stop = function() {
  31357. inProgress = null;
  31358. };
  31359. jQuery.fx.speeds = {
  31360. slow: 600,
  31361. fast: 200,
  31362. _default: 400
  31363. };
  31364. jQuery.fn.delay = function(time, type2) {
  31365. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  31366. type2 = type2 || "fx";
  31367. return this.queue(type2, function(next, hooks3) {
  31368. var timeout = window2.setTimeout(next, time);
  31369. hooks3.stop = function() {
  31370. window2.clearTimeout(timeout);
  31371. };
  31372. });
  31373. };
  31374. (function() {
  31375. var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
  31376. input.type = "checkbox";
  31377. support.checkOn = input.value !== "";
  31378. support.optSelected = opt.selected;
  31379. input = document2.createElement("input");
  31380. input.value = "t";
  31381. input.type = "radio";
  31382. support.radioValue = input.value === "t";
  31383. })();
  31384. var boolHook, attrHandle = jQuery.expr.attrHandle;
  31385. jQuery.fn.extend({
  31386. attr: function(name, value) {
  31387. return access(this, jQuery.attr, name, value, arguments.length > 1);
  31388. },
  31389. removeAttr: function(name) {
  31390. return this.each(function() {
  31391. jQuery.removeAttr(this, name);
  31392. });
  31393. }
  31394. });
  31395. jQuery.extend({
  31396. attr: function(elem, name, value) {
  31397. var ret, hooks3, nType = elem.nodeType;
  31398. if (nType === 3 || nType === 8 || nType === 2) {
  31399. return;
  31400. }
  31401. if (typeof elem.getAttribute === "undefined") {
  31402. return jQuery.prop(elem, name, value);
  31403. }
  31404. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31405. hooks3 = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
  31406. }
  31407. if (value !== void 0) {
  31408. if (value === null) {
  31409. jQuery.removeAttr(elem, name);
  31410. return;
  31411. }
  31412. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31413. return ret;
  31414. }
  31415. elem.setAttribute(name, value + "");
  31416. return value;
  31417. }
  31418. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31419. return ret;
  31420. }
  31421. ret = jQuery.find.attr(elem, name);
  31422. return ret == null ? void 0 : ret;
  31423. },
  31424. attrHooks: {
  31425. type: {
  31426. set: function(elem, value) {
  31427. if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
  31428. var val = elem.value;
  31429. elem.setAttribute("type", value);
  31430. if (val) {
  31431. elem.value = val;
  31432. }
  31433. return value;
  31434. }
  31435. }
  31436. }
  31437. },
  31438. removeAttr: function(elem, value) {
  31439. var name, i2 = 0, attrNames = value && value.match(rnothtmlwhite);
  31440. if (attrNames && elem.nodeType === 1) {
  31441. while (name = attrNames[i2++]) {
  31442. elem.removeAttribute(name);
  31443. }
  31444. }
  31445. }
  31446. });
  31447. boolHook = {
  31448. set: function(elem, value, name) {
  31449. if (value === false) {
  31450. jQuery.removeAttr(elem, name);
  31451. } else {
  31452. elem.setAttribute(name, name);
  31453. }
  31454. return name;
  31455. }
  31456. };
  31457. jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
  31458. var getter = attrHandle[name] || jQuery.find.attr;
  31459. attrHandle[name] = function(elem, name2, isXML) {
  31460. var ret, handle, lowercaseName = name2.toLowerCase();
  31461. if (!isXML) {
  31462. handle = attrHandle[lowercaseName];
  31463. attrHandle[lowercaseName] = ret;
  31464. ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
  31465. attrHandle[lowercaseName] = handle;
  31466. }
  31467. return ret;
  31468. };
  31469. });
  31470. var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
  31471. jQuery.fn.extend({
  31472. prop: function(name, value) {
  31473. return access(this, jQuery.prop, name, value, arguments.length > 1);
  31474. },
  31475. removeProp: function(name) {
  31476. return this.each(function() {
  31477. delete this[jQuery.propFix[name] || name];
  31478. });
  31479. }
  31480. });
  31481. jQuery.extend({
  31482. prop: function(elem, name, value) {
  31483. var ret, hooks3, nType = elem.nodeType;
  31484. if (nType === 3 || nType === 8 || nType === 2) {
  31485. return;
  31486. }
  31487. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31488. name = jQuery.propFix[name] || name;
  31489. hooks3 = jQuery.propHooks[name];
  31490. }
  31491. if (value !== void 0) {
  31492. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31493. return ret;
  31494. }
  31495. return elem[name] = value;
  31496. }
  31497. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31498. return ret;
  31499. }
  31500. return elem[name];
  31501. },
  31502. propHooks: {
  31503. tabIndex: {
  31504. get: function(elem) {
  31505. var tabindex = jQuery.find.attr(elem, "tabindex");
  31506. if (tabindex) {
  31507. return parseInt(tabindex, 10);
  31508. }
  31509. if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
  31510. return 0;
  31511. }
  31512. return -1;
  31513. }
  31514. }
  31515. },
  31516. propFix: {
  31517. "for": "htmlFor",
  31518. "class": "className"
  31519. }
  31520. });
  31521. if (!support.optSelected) {
  31522. jQuery.propHooks.selected = {
  31523. get: function(elem) {
  31524. var parent = elem.parentNode;
  31525. if (parent && parent.parentNode) {
  31526. parent.parentNode.selectedIndex;
  31527. }
  31528. return null;
  31529. },
  31530. set: function(elem) {
  31531. var parent = elem.parentNode;
  31532. if (parent) {
  31533. parent.selectedIndex;
  31534. if (parent.parentNode) {
  31535. parent.parentNode.selectedIndex;
  31536. }
  31537. }
  31538. }
  31539. };
  31540. }
  31541. jQuery.each([
  31542. "tabIndex",
  31543. "readOnly",
  31544. "maxLength",
  31545. "cellSpacing",
  31546. "cellPadding",
  31547. "rowSpan",
  31548. "colSpan",
  31549. "useMap",
  31550. "frameBorder",
  31551. "contentEditable"
  31552. ], function() {
  31553. jQuery.propFix[this.toLowerCase()] = this;
  31554. });
  31555. function stripAndCollapse(value) {
  31556. var tokens = value.match(rnothtmlwhite) || [];
  31557. return tokens.join(" ");
  31558. }
  31559. function getClass2(elem) {
  31560. return elem.getAttribute && elem.getAttribute("class") || "";
  31561. }
  31562. function classesToArray(value) {
  31563. if (Array.isArray(value)) {
  31564. return value;
  31565. }
  31566. if (typeof value === "string") {
  31567. return value.match(rnothtmlwhite) || [];
  31568. }
  31569. return [];
  31570. }
  31571. jQuery.fn.extend({
  31572. addClass: function(value) {
  31573. var classNames, cur, curValue, className, i2, finalValue;
  31574. if (isFunction2(value)) {
  31575. return this.each(function(j) {
  31576. jQuery(this).addClass(value.call(this, j, getClass2(this)));
  31577. });
  31578. }
  31579. classNames = classesToArray(value);
  31580. if (classNames.length) {
  31581. return this.each(function() {
  31582. curValue = getClass2(this);
  31583. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31584. if (cur) {
  31585. for (i2 = 0; i2 < classNames.length; i2++) {
  31586. className = classNames[i2];
  31587. if (cur.indexOf(" " + className + " ") < 0) {
  31588. cur += className + " ";
  31589. }
  31590. }
  31591. finalValue = stripAndCollapse(cur);
  31592. if (curValue !== finalValue) {
  31593. this.setAttribute("class", finalValue);
  31594. }
  31595. }
  31596. });
  31597. }
  31598. return this;
  31599. },
  31600. removeClass: function(value) {
  31601. var classNames, cur, curValue, className, i2, finalValue;
  31602. if (isFunction2(value)) {
  31603. return this.each(function(j) {
  31604. jQuery(this).removeClass(value.call(this, j, getClass2(this)));
  31605. });
  31606. }
  31607. if (!arguments.length) {
  31608. return this.attr("class", "");
  31609. }
  31610. classNames = classesToArray(value);
  31611. if (classNames.length) {
  31612. return this.each(function() {
  31613. curValue = getClass2(this);
  31614. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31615. if (cur) {
  31616. for (i2 = 0; i2 < classNames.length; i2++) {
  31617. className = classNames[i2];
  31618. while (cur.indexOf(" " + className + " ") > -1) {
  31619. cur = cur.replace(" " + className + " ", " ");
  31620. }
  31621. }
  31622. finalValue = stripAndCollapse(cur);
  31623. if (curValue !== finalValue) {
  31624. this.setAttribute("class", finalValue);
  31625. }
  31626. }
  31627. });
  31628. }
  31629. return this;
  31630. },
  31631. toggleClass: function(value, stateVal) {
  31632. var classNames, className, i2, self2, type2 = typeof value, isValidValue = type2 === "string" || Array.isArray(value);
  31633. if (isFunction2(value)) {
  31634. return this.each(function(i3) {
  31635. jQuery(this).toggleClass(
  31636. value.call(this, i3, getClass2(this), stateVal),
  31637. stateVal
  31638. );
  31639. });
  31640. }
  31641. if (typeof stateVal === "boolean" && isValidValue) {
  31642. return stateVal ? this.addClass(value) : this.removeClass(value);
  31643. }
  31644. classNames = classesToArray(value);
  31645. return this.each(function() {
  31646. if (isValidValue) {
  31647. self2 = jQuery(this);
  31648. for (i2 = 0; i2 < classNames.length; i2++) {
  31649. className = classNames[i2];
  31650. if (self2.hasClass(className)) {
  31651. self2.removeClass(className);
  31652. } else {
  31653. self2.addClass(className);
  31654. }
  31655. }
  31656. } else if (value === void 0 || type2 === "boolean") {
  31657. className = getClass2(this);
  31658. if (className) {
  31659. dataPriv.set(this, "__className__", className);
  31660. }
  31661. if (this.setAttribute) {
  31662. this.setAttribute(
  31663. "class",
  31664. className || value === false ? "" : dataPriv.get(this, "__className__") || ""
  31665. );
  31666. }
  31667. }
  31668. });
  31669. },
  31670. hasClass: function(selector) {
  31671. var className, elem, i2 = 0;
  31672. className = " " + selector + " ";
  31673. while (elem = this[i2++]) {
  31674. if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass2(elem)) + " ").indexOf(className) > -1) {
  31675. return true;
  31676. }
  31677. }
  31678. return false;
  31679. }
  31680. });
  31681. var rreturn = /\r/g;
  31682. jQuery.fn.extend({
  31683. val: function(value) {
  31684. var hooks3, ret, valueIsFunction, elem = this[0];
  31685. if (!arguments.length) {
  31686. if (elem) {
  31687. hooks3 = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  31688. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, "value")) !== void 0) {
  31689. return ret;
  31690. }
  31691. ret = elem.value;
  31692. if (typeof ret === "string") {
  31693. return ret.replace(rreturn, "");
  31694. }
  31695. return ret == null ? "" : ret;
  31696. }
  31697. return;
  31698. }
  31699. valueIsFunction = isFunction2(value);
  31700. return this.each(function(i2) {
  31701. var val;
  31702. if (this.nodeType !== 1) {
  31703. return;
  31704. }
  31705. if (valueIsFunction) {
  31706. val = value.call(this, i2, jQuery(this).val());
  31707. } else {
  31708. val = value;
  31709. }
  31710. if (val == null) {
  31711. val = "";
  31712. } else if (typeof val === "number") {
  31713. val += "";
  31714. } else if (Array.isArray(val)) {
  31715. val = jQuery.map(val, function(value2) {
  31716. return value2 == null ? "" : value2 + "";
  31717. });
  31718. }
  31719. hooks3 = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
  31720. if (!hooks3 || !("set" in hooks3) || hooks3.set(this, val, "value") === void 0) {
  31721. this.value = val;
  31722. }
  31723. });
  31724. }
  31725. });
  31726. jQuery.extend({
  31727. valHooks: {
  31728. option: {
  31729. get: function(elem) {
  31730. var val = jQuery.find.attr(elem, "value");
  31731. return val != null ? val : stripAndCollapse(jQuery.text(elem));
  31732. }
  31733. },
  31734. select: {
  31735. get: function(elem) {
  31736. var value, option, i2, options2 = elem.options, index2 = elem.selectedIndex, one3 = elem.type === "select-one", values3 = one3 ? null : [], max2 = one3 ? index2 + 1 : options2.length;
  31737. if (index2 < 0) {
  31738. i2 = max2;
  31739. } else {
  31740. i2 = one3 ? index2 : 0;
  31741. }
  31742. for (; i2 < max2; i2++) {
  31743. option = options2[i2];
  31744. if ((option.selected || i2 === index2) && !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
  31745. value = jQuery(option).val();
  31746. if (one3) {
  31747. return value;
  31748. }
  31749. values3.push(value);
  31750. }
  31751. }
  31752. return values3;
  31753. },
  31754. set: function(elem, value) {
  31755. var optionSet, option, options2 = elem.options, values3 = jQuery.makeArray(value), i2 = options2.length;
  31756. while (i2--) {
  31757. option = options2[i2];
  31758. if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values3) > -1) {
  31759. optionSet = true;
  31760. }
  31761. }
  31762. if (!optionSet) {
  31763. elem.selectedIndex = -1;
  31764. }
  31765. return values3;
  31766. }
  31767. }
  31768. }
  31769. });
  31770. jQuery.each(["radio", "checkbox"], function() {
  31771. jQuery.valHooks[this] = {
  31772. set: function(elem, value) {
  31773. if (Array.isArray(value)) {
  31774. return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
  31775. }
  31776. }
  31777. };
  31778. if (!support.checkOn) {
  31779. jQuery.valHooks[this].get = function(elem) {
  31780. return elem.getAttribute("value") === null ? "on" : elem.value;
  31781. };
  31782. }
  31783. });
  31784. var location = window2.location;
  31785. var nonce = { guid: Date.now() };
  31786. var rquery = /\?/;
  31787. jQuery.parseXML = function(data) {
  31788. var xml, parserErrorElem;
  31789. if (!data || typeof data !== "string") {
  31790. return null;
  31791. }
  31792. try {
  31793. xml = new window2.DOMParser().parseFromString(data, "text/xml");
  31794. } catch (e) {
  31795. }
  31796. parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
  31797. if (!xml || parserErrorElem) {
  31798. jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
  31799. return el.textContent;
  31800. }).join("\n") : data));
  31801. }
  31802. return xml;
  31803. };
  31804. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
  31805. e.stopPropagation();
  31806. };
  31807. jQuery.extend(jQuery.event, {
  31808. trigger: function(event2, data, elem, onlyHandlers) {
  31809. var i2, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type2 = hasOwn2.call(event2, "type") ? event2.type : event2, namespaces = hasOwn2.call(event2, "namespace") ? event2.namespace.split(".") : [];
  31810. cur = lastElement = tmp = elem = elem || document2;
  31811. if (elem.nodeType === 3 || elem.nodeType === 8) {
  31812. return;
  31813. }
  31814. if (rfocusMorph.test(type2 + jQuery.event.triggered)) {
  31815. return;
  31816. }
  31817. if (type2.indexOf(".") > -1) {
  31818. namespaces = type2.split(".");
  31819. type2 = namespaces.shift();
  31820. namespaces.sort();
  31821. }
  31822. ontype = type2.indexOf(":") < 0 && "on" + type2;
  31823. event2 = event2[jQuery.expando] ? event2 : new jQuery.Event(type2, typeof event2 === "object" && event2);
  31824. event2.isTrigger = onlyHandlers ? 2 : 3;
  31825. event2.namespace = namespaces.join(".");
  31826. event2.rnamespace = event2.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
  31827. event2.result = void 0;
  31828. if (!event2.target) {
  31829. event2.target = elem;
  31830. }
  31831. data = data == null ? [event2] : jQuery.makeArray(data, [event2]);
  31832. special = jQuery.event.special[type2] || {};
  31833. if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
  31834. return;
  31835. }
  31836. if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
  31837. bubbleType = special.delegateType || type2;
  31838. if (!rfocusMorph.test(bubbleType + type2)) {
  31839. cur = cur.parentNode;
  31840. }
  31841. for (; cur; cur = cur.parentNode) {
  31842. eventPath.push(cur);
  31843. tmp = cur;
  31844. }
  31845. if (tmp === (elem.ownerDocument || document2)) {
  31846. eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
  31847. }
  31848. }
  31849. i2 = 0;
  31850. while ((cur = eventPath[i2++]) && !event2.isPropagationStopped()) {
  31851. lastElement = cur;
  31852. event2.type = i2 > 1 ? bubbleType : special.bindType || type2;
  31853. handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event2.type] && dataPriv.get(cur, "handle");
  31854. if (handle) {
  31855. handle.apply(cur, data);
  31856. }
  31857. handle = ontype && cur[ontype];
  31858. if (handle && handle.apply && acceptData(cur)) {
  31859. event2.result = handle.apply(cur, data);
  31860. if (event2.result === false) {
  31861. event2.preventDefault();
  31862. }
  31863. }
  31864. }
  31865. event2.type = type2;
  31866. if (!onlyHandlers && !event2.isDefaultPrevented()) {
  31867. if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
  31868. if (ontype && isFunction2(elem[type2]) && !isWindow(elem)) {
  31869. tmp = elem[ontype];
  31870. if (tmp) {
  31871. elem[ontype] = null;
  31872. }
  31873. jQuery.event.triggered = type2;
  31874. if (event2.isPropagationStopped()) {
  31875. lastElement.addEventListener(type2, stopPropagationCallback);
  31876. }
  31877. elem[type2]();
  31878. if (event2.isPropagationStopped()) {
  31879. lastElement.removeEventListener(type2, stopPropagationCallback);
  31880. }
  31881. jQuery.event.triggered = void 0;
  31882. if (tmp) {
  31883. elem[ontype] = tmp;
  31884. }
  31885. }
  31886. }
  31887. }
  31888. return event2.result;
  31889. },
  31890. simulate: function(type2, elem, event2) {
  31891. var e = jQuery.extend(
  31892. new jQuery.Event(),
  31893. event2,
  31894. {
  31895. type: type2,
  31896. isSimulated: true
  31897. }
  31898. );
  31899. jQuery.event.trigger(e, null, elem);
  31900. }
  31901. });
  31902. jQuery.fn.extend({
  31903. trigger: function(type2, data) {
  31904. return this.each(function() {
  31905. jQuery.event.trigger(type2, data, this);
  31906. });
  31907. },
  31908. triggerHandler: function(type2, data) {
  31909. var elem = this[0];
  31910. if (elem) {
  31911. return jQuery.event.trigger(type2, data, elem, true);
  31912. }
  31913. }
  31914. });
  31915. var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
  31916. function buildParams(prefix, obj, traditional, add) {
  31917. var name;
  31918. if (Array.isArray(obj)) {
  31919. jQuery.each(obj, function(i2, v) {
  31920. if (traditional || rbracket.test(prefix)) {
  31921. add(prefix, v);
  31922. } else {
  31923. buildParams(
  31924. prefix + "[" + (typeof v === "object" && v != null ? i2 : "") + "]",
  31925. v,
  31926. traditional,
  31927. add
  31928. );
  31929. }
  31930. });
  31931. } else if (!traditional && toType(obj) === "object") {
  31932. for (name in obj) {
  31933. buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
  31934. }
  31935. } else {
  31936. add(prefix, obj);
  31937. }
  31938. }
  31939. jQuery.param = function(a, traditional) {
  31940. var prefix, s = [], add = function(key, valueOrFunction) {
  31941. var value = isFunction2(valueOrFunction) ? valueOrFunction() : valueOrFunction;
  31942. s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
  31943. };
  31944. if (a == null) {
  31945. return "";
  31946. }
  31947. if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
  31948. jQuery.each(a, function() {
  31949. add(this.name, this.value);
  31950. });
  31951. } else {
  31952. for (prefix in a) {
  31953. buildParams(prefix, a[prefix], traditional, add);
  31954. }
  31955. }
  31956. return s.join("&");
  31957. };
  31958. jQuery.fn.extend({
  31959. serialize: function() {
  31960. return jQuery.param(this.serializeArray());
  31961. },
  31962. serializeArray: function() {
  31963. return this.map(function() {
  31964. var elements = jQuery.prop(this, "elements");
  31965. return elements ? jQuery.makeArray(elements) : this;
  31966. }).filter(function() {
  31967. var type2 = this.type;
  31968. return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type2) && (this.checked || !rcheckableType.test(type2));
  31969. }).map(function(_i, elem) {
  31970. var val = jQuery(this).val();
  31971. if (val == null) {
  31972. return null;
  31973. }
  31974. if (Array.isArray(val)) {
  31975. return jQuery.map(val, function(val2) {
  31976. return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
  31977. });
  31978. }
  31979. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  31980. }).get();
  31981. }
  31982. });
  31983. var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
  31984. originAnchor.href = location.href;
  31985. function addToPrefiltersOrTransports(structure) {
  31986. return function(dataTypeExpression, func) {
  31987. if (typeof dataTypeExpression !== "string") {
  31988. func = dataTypeExpression;
  31989. dataTypeExpression = "*";
  31990. }
  31991. var dataType, i2 = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
  31992. if (isFunction2(func)) {
  31993. while (dataType = dataTypes[i2++]) {
  31994. if (dataType[0] === "+") {
  31995. dataType = dataType.slice(1) || "*";
  31996. (structure[dataType] = structure[dataType] || []).unshift(func);
  31997. } else {
  31998. (structure[dataType] = structure[dataType] || []).push(func);
  31999. }
  32000. }
  32001. }
  32002. };
  32003. }
  32004. function inspectPrefiltersOrTransports(structure, options2, originalOptions, jqXHR) {
  32005. var inspected = {}, seekingTransport = structure === transports;
  32006. function inspect(dataType) {
  32007. var selected;
  32008. inspected[dataType] = true;
  32009. jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
  32010. var dataTypeOrTransport = prefilterOrFactory(options2, originalOptions, jqXHR);
  32011. if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
  32012. options2.dataTypes.unshift(dataTypeOrTransport);
  32013. inspect(dataTypeOrTransport);
  32014. return false;
  32015. } else if (seekingTransport) {
  32016. return !(selected = dataTypeOrTransport);
  32017. }
  32018. });
  32019. return selected;
  32020. }
  32021. return inspect(options2.dataTypes[0]) || !inspected["*"] && inspect("*");
  32022. }
  32023. function ajaxExtend(target, src) {
  32024. var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
  32025. for (key in src) {
  32026. if (src[key] !== void 0) {
  32027. (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
  32028. }
  32029. }
  32030. if (deep) {
  32031. jQuery.extend(true, target, deep);
  32032. }
  32033. return target;
  32034. }
  32035. function ajaxHandleResponses(s, jqXHR, responses) {
  32036. var ct2, type2, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
  32037. while (dataTypes[0] === "*") {
  32038. dataTypes.shift();
  32039. if (ct2 === void 0) {
  32040. ct2 = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  32041. }
  32042. }
  32043. if (ct2) {
  32044. for (type2 in contents) {
  32045. if (contents[type2] && contents[type2].test(ct2)) {
  32046. dataTypes.unshift(type2);
  32047. break;
  32048. }
  32049. }
  32050. }
  32051. if (dataTypes[0] in responses) {
  32052. finalDataType = dataTypes[0];
  32053. } else {
  32054. for (type2 in responses) {
  32055. if (!dataTypes[0] || s.converters[type2 + " " + dataTypes[0]]) {
  32056. finalDataType = type2;
  32057. break;
  32058. }
  32059. if (!firstDataType) {
  32060. firstDataType = type2;
  32061. }
  32062. }
  32063. finalDataType = finalDataType || firstDataType;
  32064. }
  32065. if (finalDataType) {
  32066. if (finalDataType !== dataTypes[0]) {
  32067. dataTypes.unshift(finalDataType);
  32068. }
  32069. return responses[finalDataType];
  32070. }
  32071. }
  32072. function ajaxConvert(s, response, jqXHR, isSuccess) {
  32073. var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
  32074. if (dataTypes[1]) {
  32075. for (conv in s.converters) {
  32076. converters[conv.toLowerCase()] = s.converters[conv];
  32077. }
  32078. }
  32079. current = dataTypes.shift();
  32080. while (current) {
  32081. if (s.responseFields[current]) {
  32082. jqXHR[s.responseFields[current]] = response;
  32083. }
  32084. if (!prev && isSuccess && s.dataFilter) {
  32085. response = s.dataFilter(response, s.dataType);
  32086. }
  32087. prev = current;
  32088. current = dataTypes.shift();
  32089. if (current) {
  32090. if (current === "*") {
  32091. current = prev;
  32092. } else if (prev !== "*" && prev !== current) {
  32093. conv = converters[prev + " " + current] || converters["* " + current];
  32094. if (!conv) {
  32095. for (conv2 in converters) {
  32096. tmp = conv2.split(" ");
  32097. if (tmp[1] === current) {
  32098. conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
  32099. if (conv) {
  32100. if (conv === true) {
  32101. conv = converters[conv2];
  32102. } else if (converters[conv2] !== true) {
  32103. current = tmp[0];
  32104. dataTypes.unshift(tmp[1]);
  32105. }
  32106. break;
  32107. }
  32108. }
  32109. }
  32110. }
  32111. if (conv !== true) {
  32112. if (conv && s.throws) {
  32113. response = conv(response);
  32114. } else {
  32115. try {
  32116. response = conv(response);
  32117. } catch (e) {
  32118. return {
  32119. state: "parsererror",
  32120. error: conv ? e : "No conversion from " + prev + " to " + current
  32121. };
  32122. }
  32123. }
  32124. }
  32125. }
  32126. }
  32127. }
  32128. return { state: "success", data: response };
  32129. }
  32130. jQuery.extend({
  32131. active: 0,
  32132. lastModified: {},
  32133. etag: {},
  32134. ajaxSettings: {
  32135. url: location.href,
  32136. type: "GET",
  32137. isLocal: rlocalProtocol.test(location.protocol),
  32138. global: true,
  32139. processData: true,
  32140. async: true,
  32141. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  32142. accepts: {
  32143. "*": allTypes,
  32144. text: "text/plain",
  32145. html: "text/html",
  32146. xml: "application/xml, text/xml",
  32147. json: "application/json, text/javascript"
  32148. },
  32149. contents: {
  32150. xml: /\bxml\b/,
  32151. html: /\bhtml/,
  32152. json: /\bjson\b/
  32153. },
  32154. responseFields: {
  32155. xml: "responseXML",
  32156. text: "responseText",
  32157. json: "responseJSON"
  32158. },
  32159. converters: {
  32160. "* text": String,
  32161. "text html": true,
  32162. "text json": JSON.parse,
  32163. "text xml": jQuery.parseXML
  32164. },
  32165. flatOptions: {
  32166. url: true,
  32167. context: true
  32168. }
  32169. },
  32170. ajaxSetup: function(target, settings) {
  32171. return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
  32172. },
  32173. ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
  32174. ajaxTransport: addToPrefiltersOrTransports(transports),
  32175. ajax: function(url, options2) {
  32176. if (typeof url === "object") {
  32177. options2 = url;
  32178. url = void 0;
  32179. }
  32180. options2 = options2 || {};
  32181. var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i2, uncached, s = jQuery.ajaxSetup({}, options2), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
  32182. readyState: 0,
  32183. getResponseHeader: function(key) {
  32184. var match;
  32185. if (completed2) {
  32186. if (!responseHeaders) {
  32187. responseHeaders = {};
  32188. while (match = rheaders.exec(responseHeadersString)) {
  32189. responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
  32190. }
  32191. }
  32192. match = responseHeaders[key.toLowerCase() + " "];
  32193. }
  32194. return match == null ? null : match.join(", ");
  32195. },
  32196. getAllResponseHeaders: function() {
  32197. return completed2 ? responseHeadersString : null;
  32198. },
  32199. setRequestHeader: function(name, value) {
  32200. if (completed2 == null) {
  32201. name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
  32202. requestHeaders[name] = value;
  32203. }
  32204. return this;
  32205. },
  32206. overrideMimeType: function(type2) {
  32207. if (completed2 == null) {
  32208. s.mimeType = type2;
  32209. }
  32210. return this;
  32211. },
  32212. statusCode: function(map) {
  32213. var code;
  32214. if (map) {
  32215. if (completed2) {
  32216. jqXHR.always(map[jqXHR.status]);
  32217. } else {
  32218. for (code in map) {
  32219. statusCode[code] = [statusCode[code], map[code]];
  32220. }
  32221. }
  32222. }
  32223. return this;
  32224. },
  32225. abort: function(statusText) {
  32226. var finalText = statusText || strAbort;
  32227. if (transport) {
  32228. transport.abort(finalText);
  32229. }
  32230. done(0, finalText);
  32231. return this;
  32232. }
  32233. };
  32234. deferred.promise(jqXHR);
  32235. s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//");
  32236. s.type = options2.method || options2.type || s.method || s.type;
  32237. s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
  32238. if (s.crossDomain == null) {
  32239. urlAnchor = document2.createElement("a");
  32240. try {
  32241. urlAnchor.href = s.url;
  32242. urlAnchor.href = urlAnchor.href;
  32243. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
  32244. } catch (e) {
  32245. s.crossDomain = true;
  32246. }
  32247. }
  32248. if (s.data && s.processData && typeof s.data !== "string") {
  32249. s.data = jQuery.param(s.data, s.traditional);
  32250. }
  32251. inspectPrefiltersOrTransports(prefilters, s, options2, jqXHR);
  32252. if (completed2) {
  32253. return jqXHR;
  32254. }
  32255. fireGlobals = jQuery.event && s.global;
  32256. if (fireGlobals && jQuery.active++ === 0) {
  32257. jQuery.event.trigger("ajaxStart");
  32258. }
  32259. s.type = s.type.toUpperCase();
  32260. s.hasContent = !rnoContent.test(s.type);
  32261. cacheURL = s.url.replace(rhash, "");
  32262. if (!s.hasContent) {
  32263. uncached = s.url.slice(cacheURL.length);
  32264. if (s.data && (s.processData || typeof s.data === "string")) {
  32265. cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
  32266. delete s.data;
  32267. }
  32268. if (s.cache === false) {
  32269. cacheURL = cacheURL.replace(rantiCache, "$1");
  32270. uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
  32271. }
  32272. s.url = cacheURL + uncached;
  32273. } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
  32274. s.data = s.data.replace(r20, "+");
  32275. }
  32276. if (s.ifModified) {
  32277. if (jQuery.lastModified[cacheURL]) {
  32278. jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
  32279. }
  32280. if (jQuery.etag[cacheURL]) {
  32281. jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
  32282. }
  32283. }
  32284. if (s.data && s.hasContent && s.contentType !== false || options2.contentType) {
  32285. jqXHR.setRequestHeader("Content-Type", s.contentType);
  32286. }
  32287. jqXHR.setRequestHeader(
  32288. "Accept",
  32289. s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
  32290. );
  32291. for (i2 in s.headers) {
  32292. jqXHR.setRequestHeader(i2, s.headers[i2]);
  32293. }
  32294. if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
  32295. return jqXHR.abort();
  32296. }
  32297. strAbort = "abort";
  32298. completeDeferred.add(s.complete);
  32299. jqXHR.done(s.success);
  32300. jqXHR.fail(s.error);
  32301. transport = inspectPrefiltersOrTransports(transports, s, options2, jqXHR);
  32302. if (!transport) {
  32303. done(-1, "No Transport");
  32304. } else {
  32305. jqXHR.readyState = 1;
  32306. if (fireGlobals) {
  32307. globalEventContext.trigger("ajaxSend", [jqXHR, s]);
  32308. }
  32309. if (completed2) {
  32310. return jqXHR;
  32311. }
  32312. if (s.async && s.timeout > 0) {
  32313. timeoutTimer = window2.setTimeout(function() {
  32314. jqXHR.abort("timeout");
  32315. }, s.timeout);
  32316. }
  32317. try {
  32318. completed2 = false;
  32319. transport.send(requestHeaders, done);
  32320. } catch (e) {
  32321. if (completed2) {
  32322. throw e;
  32323. }
  32324. done(-1, e);
  32325. }
  32326. }
  32327. function done(status, nativeStatusText, responses, headers) {
  32328. var isSuccess, success, error, response, modified, statusText = nativeStatusText;
  32329. if (completed2) {
  32330. return;
  32331. }
  32332. completed2 = true;
  32333. if (timeoutTimer) {
  32334. window2.clearTimeout(timeoutTimer);
  32335. }
  32336. transport = void 0;
  32337. responseHeadersString = headers || "";
  32338. jqXHR.readyState = status > 0 ? 4 : 0;
  32339. isSuccess = status >= 200 && status < 300 || status === 304;
  32340. if (responses) {
  32341. response = ajaxHandleResponses(s, jqXHR, responses);
  32342. }
  32343. if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
  32344. s.converters["text script"] = function() {
  32345. };
  32346. }
  32347. response = ajaxConvert(s, response, jqXHR, isSuccess);
  32348. if (isSuccess) {
  32349. if (s.ifModified) {
  32350. modified = jqXHR.getResponseHeader("Last-Modified");
  32351. if (modified) {
  32352. jQuery.lastModified[cacheURL] = modified;
  32353. }
  32354. modified = jqXHR.getResponseHeader("etag");
  32355. if (modified) {
  32356. jQuery.etag[cacheURL] = modified;
  32357. }
  32358. }
  32359. if (status === 204 || s.type === "HEAD") {
  32360. statusText = "nocontent";
  32361. } else if (status === 304) {
  32362. statusText = "notmodified";
  32363. } else {
  32364. statusText = response.state;
  32365. success = response.data;
  32366. error = response.error;
  32367. isSuccess = !error;
  32368. }
  32369. } else {
  32370. error = statusText;
  32371. if (status || !statusText) {
  32372. statusText = "error";
  32373. if (status < 0) {
  32374. status = 0;
  32375. }
  32376. }
  32377. }
  32378. jqXHR.status = status;
  32379. jqXHR.statusText = (nativeStatusText || statusText) + "";
  32380. if (isSuccess) {
  32381. deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
  32382. } else {
  32383. deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
  32384. }
  32385. jqXHR.statusCode(statusCode);
  32386. statusCode = void 0;
  32387. if (fireGlobals) {
  32388. globalEventContext.trigger(
  32389. isSuccess ? "ajaxSuccess" : "ajaxError",
  32390. [jqXHR, s, isSuccess ? success : error]
  32391. );
  32392. }
  32393. completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
  32394. if (fireGlobals) {
  32395. globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
  32396. if (!--jQuery.active) {
  32397. jQuery.event.trigger("ajaxStop");
  32398. }
  32399. }
  32400. }
  32401. return jqXHR;
  32402. },
  32403. getJSON: function(url, data, callback2) {
  32404. return jQuery.get(url, data, callback2, "json");
  32405. },
  32406. getScript: function(url, callback2) {
  32407. return jQuery.get(url, void 0, callback2, "script");
  32408. }
  32409. });
  32410. jQuery.each(["get", "post"], function(_i, method) {
  32411. jQuery[method] = function(url, data, callback2, type2) {
  32412. if (isFunction2(data)) {
  32413. type2 = type2 || callback2;
  32414. callback2 = data;
  32415. data = void 0;
  32416. }
  32417. return jQuery.ajax(jQuery.extend({
  32418. url,
  32419. type: method,
  32420. dataType: type2,
  32421. data,
  32422. success: callback2
  32423. }, jQuery.isPlainObject(url) && url));
  32424. };
  32425. });
  32426. jQuery.ajaxPrefilter(function(s) {
  32427. var i2;
  32428. for (i2 in s.headers) {
  32429. if (i2.toLowerCase() === "content-type") {
  32430. s.contentType = s.headers[i2] || "";
  32431. }
  32432. }
  32433. });
  32434. jQuery._evalUrl = function(url, options2, doc) {
  32435. return jQuery.ajax({
  32436. url,
  32437. type: "GET",
  32438. dataType: "script",
  32439. cache: true,
  32440. async: false,
  32441. global: false,
  32442. converters: {
  32443. "text script": function() {
  32444. }
  32445. },
  32446. dataFilter: function(response) {
  32447. jQuery.globalEval(response, options2, doc);
  32448. }
  32449. });
  32450. };
  32451. jQuery.fn.extend({
  32452. wrapAll: function(html) {
  32453. var wrap;
  32454. if (this[0]) {
  32455. if (isFunction2(html)) {
  32456. html = html.call(this[0]);
  32457. }
  32458. wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
  32459. if (this[0].parentNode) {
  32460. wrap.insertBefore(this[0]);
  32461. }
  32462. wrap.map(function() {
  32463. var elem = this;
  32464. while (elem.firstElementChild) {
  32465. elem = elem.firstElementChild;
  32466. }
  32467. return elem;
  32468. }).append(this);
  32469. }
  32470. return this;
  32471. },
  32472. wrapInner: function(html) {
  32473. if (isFunction2(html)) {
  32474. return this.each(function(i2) {
  32475. jQuery(this).wrapInner(html.call(this, i2));
  32476. });
  32477. }
  32478. return this.each(function() {
  32479. var self2 = jQuery(this), contents = self2.contents();
  32480. if (contents.length) {
  32481. contents.wrapAll(html);
  32482. } else {
  32483. self2.append(html);
  32484. }
  32485. });
  32486. },
  32487. wrap: function(html) {
  32488. var htmlIsFunction = isFunction2(html);
  32489. return this.each(function(i2) {
  32490. jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i2) : html);
  32491. });
  32492. },
  32493. unwrap: function(selector) {
  32494. this.parent(selector).not("body").each(function() {
  32495. jQuery(this).replaceWith(this.childNodes);
  32496. });
  32497. return this;
  32498. }
  32499. });
  32500. jQuery.expr.pseudos.hidden = function(elem) {
  32501. return !jQuery.expr.pseudos.visible(elem);
  32502. };
  32503. jQuery.expr.pseudos.visible = function(elem) {
  32504. return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
  32505. };
  32506. jQuery.ajaxSettings.xhr = function() {
  32507. try {
  32508. return new window2.XMLHttpRequest();
  32509. } catch (e) {
  32510. }
  32511. };
  32512. var xhrSuccessStatus = {
  32513. 0: 200,
  32514. 1223: 204
  32515. }, xhrSupported = jQuery.ajaxSettings.xhr();
  32516. support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
  32517. support.ajax = xhrSupported = !!xhrSupported;
  32518. jQuery.ajaxTransport(function(options2) {
  32519. var callback2, errorCallback;
  32520. if (support.cors || xhrSupported && !options2.crossDomain) {
  32521. return {
  32522. send: function(headers, complete) {
  32523. var i2, xhr = options2.xhr();
  32524. xhr.open(
  32525. options2.type,
  32526. options2.url,
  32527. options2.async,
  32528. options2.username,
  32529. options2.password
  32530. );
  32531. if (options2.xhrFields) {
  32532. for (i2 in options2.xhrFields) {
  32533. xhr[i2] = options2.xhrFields[i2];
  32534. }
  32535. }
  32536. if (options2.mimeType && xhr.overrideMimeType) {
  32537. xhr.overrideMimeType(options2.mimeType);
  32538. }
  32539. if (!options2.crossDomain && !headers["X-Requested-With"]) {
  32540. headers["X-Requested-With"] = "XMLHttpRequest";
  32541. }
  32542. for (i2 in headers) {
  32543. xhr.setRequestHeader(i2, headers[i2]);
  32544. }
  32545. callback2 = function(type2) {
  32546. return function() {
  32547. if (callback2) {
  32548. callback2 = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
  32549. if (type2 === "abort") {
  32550. xhr.abort();
  32551. } else if (type2 === "error") {
  32552. if (typeof xhr.status !== "number") {
  32553. complete(0, "error");
  32554. } else {
  32555. complete(
  32556. xhr.status,
  32557. xhr.statusText
  32558. );
  32559. }
  32560. } else {
  32561. complete(
  32562. xhrSuccessStatus[xhr.status] || xhr.status,
  32563. xhr.statusText,
  32564. (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
  32565. xhr.getAllResponseHeaders()
  32566. );
  32567. }
  32568. }
  32569. };
  32570. };
  32571. xhr.onload = callback2();
  32572. errorCallback = xhr.onerror = xhr.ontimeout = callback2("error");
  32573. if (xhr.onabort !== void 0) {
  32574. xhr.onabort = errorCallback;
  32575. } else {
  32576. xhr.onreadystatechange = function() {
  32577. if (xhr.readyState === 4) {
  32578. window2.setTimeout(function() {
  32579. if (callback2) {
  32580. errorCallback();
  32581. }
  32582. });
  32583. }
  32584. };
  32585. }
  32586. callback2 = callback2("abort");
  32587. try {
  32588. xhr.send(options2.hasContent && options2.data || null);
  32589. } catch (e) {
  32590. if (callback2) {
  32591. throw e;
  32592. }
  32593. }
  32594. },
  32595. abort: function() {
  32596. if (callback2) {
  32597. callback2();
  32598. }
  32599. }
  32600. };
  32601. }
  32602. });
  32603. jQuery.ajaxPrefilter(function(s) {
  32604. if (s.crossDomain) {
  32605. s.contents.script = false;
  32606. }
  32607. });
  32608. jQuery.ajaxSetup({
  32609. accepts: {
  32610. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  32611. },
  32612. contents: {
  32613. script: /\b(?:java|ecma)script\b/
  32614. },
  32615. converters: {
  32616. "text script": function(text) {
  32617. jQuery.globalEval(text);
  32618. return text;
  32619. }
  32620. }
  32621. });
  32622. jQuery.ajaxPrefilter("script", function(s) {
  32623. if (s.cache === void 0) {
  32624. s.cache = false;
  32625. }
  32626. if (s.crossDomain) {
  32627. s.type = "GET";
  32628. }
  32629. });
  32630. jQuery.ajaxTransport("script", function(s) {
  32631. if (s.crossDomain || s.scriptAttrs) {
  32632. var script, callback2;
  32633. return {
  32634. send: function(_, complete) {
  32635. script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback2 = function(evt) {
  32636. script.remove();
  32637. callback2 = null;
  32638. if (evt) {
  32639. complete(evt.type === "error" ? 404 : 200, evt.type);
  32640. }
  32641. });
  32642. document2.head.appendChild(script[0]);
  32643. },
  32644. abort: function() {
  32645. if (callback2) {
  32646. callback2();
  32647. }
  32648. }
  32649. };
  32650. }
  32651. });
  32652. var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
  32653. jQuery.ajaxSetup({
  32654. jsonp: "callback",
  32655. jsonpCallback: function() {
  32656. var callback2 = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
  32657. this[callback2] = true;
  32658. return callback2;
  32659. }
  32660. });
  32661. jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
  32662. var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
  32663. if (jsonProp || s.dataTypes[0] === "jsonp") {
  32664. callbackName = s.jsonpCallback = isFunction2(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
  32665. if (jsonProp) {
  32666. s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
  32667. } else if (s.jsonp !== false) {
  32668. s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
  32669. }
  32670. s.converters["script json"] = function() {
  32671. if (!responseContainer) {
  32672. jQuery.error(callbackName + " was not called");
  32673. }
  32674. return responseContainer[0];
  32675. };
  32676. s.dataTypes[0] = "json";
  32677. overwritten = window2[callbackName];
  32678. window2[callbackName] = function() {
  32679. responseContainer = arguments;
  32680. };
  32681. jqXHR.always(function() {
  32682. if (overwritten === void 0) {
  32683. jQuery(window2).removeProp(callbackName);
  32684. } else {
  32685. window2[callbackName] = overwritten;
  32686. }
  32687. if (s[callbackName]) {
  32688. s.jsonpCallback = originalSettings.jsonpCallback;
  32689. oldCallbacks.push(callbackName);
  32690. }
  32691. if (responseContainer && isFunction2(overwritten)) {
  32692. overwritten(responseContainer[0]);
  32693. }
  32694. responseContainer = overwritten = void 0;
  32695. });
  32696. return "script";
  32697. }
  32698. });
  32699. support.createHTMLDocument = function() {
  32700. var body = document2.implementation.createHTMLDocument("").body;
  32701. body.innerHTML = "<form></form><form></form>";
  32702. return body.childNodes.length === 2;
  32703. }();
  32704. jQuery.parseHTML = function(data, context, keepScripts) {
  32705. if (typeof data !== "string") {
  32706. return [];
  32707. }
  32708. if (typeof context === "boolean") {
  32709. keepScripts = context;
  32710. context = false;
  32711. }
  32712. var base2, parsed, scripts;
  32713. if (!context) {
  32714. if (support.createHTMLDocument) {
  32715. context = document2.implementation.createHTMLDocument("");
  32716. base2 = context.createElement("base");
  32717. base2.href = document2.location.href;
  32718. context.head.appendChild(base2);
  32719. } else {
  32720. context = document2;
  32721. }
  32722. }
  32723. parsed = rsingleTag.exec(data);
  32724. scripts = !keepScripts && [];
  32725. if (parsed) {
  32726. return [context.createElement(parsed[1])];
  32727. }
  32728. parsed = buildFragment([data], context, scripts);
  32729. if (scripts && scripts.length) {
  32730. jQuery(scripts).remove();
  32731. }
  32732. return jQuery.merge([], parsed.childNodes);
  32733. };
  32734. jQuery.fn.load = function(url, params, callback2) {
  32735. var selector, type2, response, self2 = this, off2 = url.indexOf(" ");
  32736. if (off2 > -1) {
  32737. selector = stripAndCollapse(url.slice(off2));
  32738. url = url.slice(0, off2);
  32739. }
  32740. if (isFunction2(params)) {
  32741. callback2 = params;
  32742. params = void 0;
  32743. } else if (params && typeof params === "object") {
  32744. type2 = "POST";
  32745. }
  32746. if (self2.length > 0) {
  32747. jQuery.ajax({
  32748. url,
  32749. type: type2 || "GET",
  32750. dataType: "html",
  32751. data: params
  32752. }).done(function(responseText) {
  32753. response = arguments;
  32754. self2.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
  32755. }).always(callback2 && function(jqXHR, status) {
  32756. self2.each(function() {
  32757. callback2.apply(this, response || [jqXHR.responseText, status, jqXHR]);
  32758. });
  32759. });
  32760. }
  32761. return this;
  32762. };
  32763. jQuery.expr.pseudos.animated = function(elem) {
  32764. return jQuery.grep(jQuery.timers, function(fn2) {
  32765. return elem === fn2.elem;
  32766. }).length;
  32767. };
  32768. jQuery.offset = {
  32769. setOffset: function(elem, options2, i2) {
  32770. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position2 = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
  32771. if (position2 === "static") {
  32772. elem.style.position = "relative";
  32773. }
  32774. curOffset = curElem.offset();
  32775. curCSSTop = jQuery.css(elem, "top");
  32776. curCSSLeft = jQuery.css(elem, "left");
  32777. calculatePosition = (position2 === "absolute" || position2 === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
  32778. if (calculatePosition) {
  32779. curPosition = curElem.position();
  32780. curTop = curPosition.top;
  32781. curLeft = curPosition.left;
  32782. } else {
  32783. curTop = parseFloat(curCSSTop) || 0;
  32784. curLeft = parseFloat(curCSSLeft) || 0;
  32785. }
  32786. if (isFunction2(options2)) {
  32787. options2 = options2.call(elem, i2, jQuery.extend({}, curOffset));
  32788. }
  32789. if (options2.top != null) {
  32790. props.top = options2.top - curOffset.top + curTop;
  32791. }
  32792. if (options2.left != null) {
  32793. props.left = options2.left - curOffset.left + curLeft;
  32794. }
  32795. if ("using" in options2) {
  32796. options2.using.call(elem, props);
  32797. } else {
  32798. curElem.css(props);
  32799. }
  32800. }
  32801. };
  32802. jQuery.fn.extend({
  32803. offset: function(options2) {
  32804. if (arguments.length) {
  32805. return options2 === void 0 ? this : this.each(function(i2) {
  32806. jQuery.offset.setOffset(this, options2, i2);
  32807. });
  32808. }
  32809. var rect, win2, elem = this[0];
  32810. if (!elem) {
  32811. return;
  32812. }
  32813. if (!elem.getClientRects().length) {
  32814. return { top: 0, left: 0 };
  32815. }
  32816. rect = elem.getBoundingClientRect();
  32817. win2 = elem.ownerDocument.defaultView;
  32818. return {
  32819. top: rect.top + win2.pageYOffset,
  32820. left: rect.left + win2.pageXOffset
  32821. };
  32822. },
  32823. position: function() {
  32824. if (!this[0]) {
  32825. return;
  32826. }
  32827. var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
  32828. if (jQuery.css(elem, "position") === "fixed") {
  32829. offset = elem.getBoundingClientRect();
  32830. } else {
  32831. offset = this.offset();
  32832. doc = elem.ownerDocument;
  32833. offsetParent = elem.offsetParent || doc.documentElement;
  32834. while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
  32835. offsetParent = offsetParent.parentNode;
  32836. }
  32837. if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
  32838. parentOffset = jQuery(offsetParent).offset();
  32839. parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
  32840. parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
  32841. }
  32842. }
  32843. return {
  32844. top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
  32845. left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
  32846. };
  32847. },
  32848. offsetParent: function() {
  32849. return this.map(function() {
  32850. var offsetParent = this.offsetParent;
  32851. while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
  32852. offsetParent = offsetParent.offsetParent;
  32853. }
  32854. return offsetParent || documentElement;
  32855. });
  32856. }
  32857. });
  32858. jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
  32859. var top = "pageYOffset" === prop;
  32860. jQuery.fn[method] = function(val) {
  32861. return access(this, function(elem, method2, val2) {
  32862. var win2;
  32863. if (isWindow(elem)) {
  32864. win2 = elem;
  32865. } else if (elem.nodeType === 9) {
  32866. win2 = elem.defaultView;
  32867. }
  32868. if (val2 === void 0) {
  32869. return win2 ? win2[prop] : elem[method2];
  32870. }
  32871. if (win2) {
  32872. win2.scrollTo(
  32873. !top ? val2 : win2.pageXOffset,
  32874. top ? val2 : win2.pageYOffset
  32875. );
  32876. } else {
  32877. elem[method2] = val2;
  32878. }
  32879. }, method, val, arguments.length);
  32880. };
  32881. });
  32882. jQuery.each(["top", "left"], function(_i, prop) {
  32883. jQuery.cssHooks[prop] = addGetHookIf(
  32884. support.pixelPosition,
  32885. function(elem, computed2) {
  32886. if (computed2) {
  32887. computed2 = curCSS(elem, prop);
  32888. return rnumnonpx.test(computed2) ? jQuery(elem).position()[prop] + "px" : computed2;
  32889. }
  32890. }
  32891. );
  32892. });
  32893. jQuery.each({ Height: "height", Width: "width" }, function(name, type2) {
  32894. jQuery.each({
  32895. padding: "inner" + name,
  32896. content: type2,
  32897. "": "outer" + name
  32898. }, function(defaultExtra, funcName) {
  32899. jQuery.fn[funcName] = function(margin, value) {
  32900. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  32901. return access(this, function(elem, type3, value2) {
  32902. var doc;
  32903. if (isWindow(elem)) {
  32904. return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
  32905. }
  32906. if (elem.nodeType === 9) {
  32907. doc = elem.documentElement;
  32908. return Math.max(
  32909. elem.body["scroll" + name],
  32910. doc["scroll" + name],
  32911. elem.body["offset" + name],
  32912. doc["offset" + name],
  32913. doc["client" + name]
  32914. );
  32915. }
  32916. return value2 === void 0 ? jQuery.css(elem, type3, extra) : jQuery.style(elem, type3, value2, extra);
  32917. }, type2, chainable ? margin : void 0, chainable);
  32918. };
  32919. });
  32920. });
  32921. jQuery.each([
  32922. "ajaxStart",
  32923. "ajaxStop",
  32924. "ajaxComplete",
  32925. "ajaxError",
  32926. "ajaxSuccess",
  32927. "ajaxSend"
  32928. ], function(_i, type2) {
  32929. jQuery.fn[type2] = function(fn2) {
  32930. return this.on(type2, fn2);
  32931. };
  32932. });
  32933. jQuery.fn.extend({
  32934. bind: function(types, data, fn2) {
  32935. return this.on(types, null, data, fn2);
  32936. },
  32937. unbind: function(types, fn2) {
  32938. return this.off(types, null, fn2);
  32939. },
  32940. delegate: function(selector, types, data, fn2) {
  32941. return this.on(types, selector, data, fn2);
  32942. },
  32943. undelegate: function(selector, types, fn2) {
  32944. return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn2);
  32945. },
  32946. hover: function(fnOver, fnOut) {
  32947. return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
  32948. }
  32949. });
  32950. jQuery.each(
  32951. "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
  32952. function(_i, name) {
  32953. jQuery.fn[name] = function(data, fn2) {
  32954. return arguments.length > 0 ? this.on(name, null, data, fn2) : this.trigger(name);
  32955. };
  32956. }
  32957. );
  32958. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  32959. jQuery.proxy = function(fn2, context) {
  32960. var tmp, args, proxy;
  32961. if (typeof context === "string") {
  32962. tmp = fn2[context];
  32963. context = fn2;
  32964. fn2 = tmp;
  32965. }
  32966. if (!isFunction2(fn2)) {
  32967. return void 0;
  32968. }
  32969. args = slice.call(arguments, 2);
  32970. proxy = function() {
  32971. return fn2.apply(context || this, args.concat(slice.call(arguments)));
  32972. };
  32973. proxy.guid = fn2.guid = fn2.guid || jQuery.guid++;
  32974. return proxy;
  32975. };
  32976. jQuery.holdReady = function(hold) {
  32977. if (hold) {
  32978. jQuery.readyWait++;
  32979. } else {
  32980. jQuery.ready(true);
  32981. }
  32982. };
  32983. jQuery.isArray = Array.isArray;
  32984. jQuery.parseJSON = JSON.parse;
  32985. jQuery.nodeName = nodeName;
  32986. jQuery.isFunction = isFunction2;
  32987. jQuery.isWindow = isWindow;
  32988. jQuery.camelCase = camelCase3;
  32989. jQuery.type = toType;
  32990. jQuery.now = Date.now;
  32991. jQuery.isNumeric = function(obj) {
  32992. var type2 = jQuery.type(obj);
  32993. return (type2 === "number" || type2 === "string") && !isNaN(obj - parseFloat(obj));
  32994. };
  32995. jQuery.trim = function(text) {
  32996. return text == null ? "" : (text + "").replace(rtrim, "$1");
  32997. };
  32998. var _jQuery = window2.jQuery, _$ = window2.$;
  32999. jQuery.noConflict = function(deep) {
  33000. if (window2.$ === jQuery) {
  33001. window2.$ = _$;
  33002. }
  33003. if (deep && window2.jQuery === jQuery) {
  33004. window2.jQuery = _jQuery;
  33005. }
  33006. return jQuery;
  33007. };
  33008. if (typeof noGlobal === "undefined") {
  33009. window2.jQuery = window2.$ = jQuery;
  33010. }
  33011. return jQuery;
  33012. });
  33013. })(jquery);
  33014. var _style_0$2 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-wall-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-wall-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-wall-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-wall-row .col-main{flex:1;display:flex;flex-direction:row}.jt-wall-row .col-main .el-input--suffix{background-color:#fff0}.jt-wall-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-wall-row .col-main .el-input-number__decrease,.jt-wall-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-wall-dialog{pointer-events:none}.jt-wall-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-wall-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-wall-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-wall-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-wall-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-wall-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  33015. `;
  33016. var _export_sfc = (sfc, props) => {
  33017. const target = sfc.__vccOpts || sfc;
  33018. for (const [key, val] of props) {
  33019. target[key] = val;
  33020. }
  33021. return target;
  33022. };
  33023. const _hoisted_1$2 = { class: "jt-wall-dialog" };
  33024. const _hoisted_2$2 = {
  33025. slot: "title",
  33026. class: "header-title"
  33027. };
  33028. const _hoisted_3$2 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  33029. const _hoisted_4$2 = { class: "odin-dialog__content" };
  33030. const _hoisted_5$2 = { class: "jt-wall-row" };
  33031. const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u9AD8\u5EA6", -1);
  33032. const _hoisted_7$2 = { class: "col-main" };
  33033. const _hoisted_8$2 = { class: "jt-wall-row" };
  33034. const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5F2F\u66F2\u5EA6", -1);
  33035. const _hoisted_10$1 = { class: "col-main" };
  33036. const _hoisted_11$1 = { class: "jt-wall-row" };
  33037. const _hoisted_12$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EBF\u5BBD", -1);
  33038. const _hoisted_13$1 = { class: "col-main" };
  33039. const _hoisted_14$1 = { class: "jt-wall-row" };
  33040. const _hoisted_15$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u53D1\u5149\u5F3A\u5EA6", -1);
  33041. const _hoisted_16$1 = { class: "col-main" };
  33042. const _hoisted_17$1 = { class: "jt-wall-row" };
  33043. const _hoisted_18$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  33044. const _hoisted_19$1 = { class: "col-main" };
  33045. const _hoisted_20$1 = { class: "jt-wall-row" };
  33046. const _hoisted_21$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65B9\u5411", -1);
  33047. const _hoisted_22$1 = { class: "col-main" };
  33048. const _hoisted_23$1 = { class: "jt-wall-row" };
  33049. const _hoisted_24$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u987A\u5E8F", -1);
  33050. const _hoisted_25$1 = { class: "col-main" };
  33051. const _hoisted_26$1 = { class: "jt-wall-row" };
  33052. const _hoisted_27$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65F6\u95F4", -1);
  33053. const _hoisted_28$1 = { class: "col-main" };
  33054. const _hoisted_29$1 = { class: "col-main" };
  33055. const _hoisted_30$1 = { class: "jt-wall-row" };
  33056. const _hoisted_31$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u91CD\u590D\u6570\u91CF", -1);
  33057. const _hoisted_32$1 = { class: "col-main" };
  33058. const _hoisted_33$1 = {
  33059. class: "jt-wall-row",
  33060. style: { "height": "60rem" }
  33061. };
  33062. const _hoisted_34$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6587\u5B57\u5185\u5BB9", -1);
  33063. const _hoisted_35$1 = { class: "col-main" };
  33064. const _hoisted_36$1 = { class: "jt-wall-row" };
  33065. const _hoisted_37$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u5BBD\u5EA6", -1);
  33066. const _hoisted_38$1 = { class: "col-main" };
  33067. const _hoisted_39$1 = { class: "jt-wall-row" };
  33068. const _hoisted_40$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u989C\u8272", -1);
  33069. const _hoisted_41$1 = { class: "col-main" };
  33070. const _hoisted_42$1 = {
  33071. class: "jt-wall-row",
  33072. style: { "height": "100rem" }
  33073. };
  33074. const _hoisted_43$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u89C6\u9891\u5730\u5740", -1);
  33075. const _hoisted_44$1 = { class: "col-main" };
  33076. const _hoisted_45$1 = { class: "jt-wall-row" };
  33077. const _hoisted_46$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "X\u8F74\u5E73\u79FB", -1);
  33078. const _hoisted_47$1 = { class: "col-main" };
  33079. const _hoisted_48$1 = { class: "jt-wall-row" };
  33080. const _hoisted_49$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Y\u8F74\u5E73\u79FB", -1);
  33081. const _hoisted_50$1 = { class: "col-main" };
  33082. const _hoisted_51$1 = { class: "jt-wall-row" };
  33083. const _hoisted_52$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Z\u8F74\u5E73\u79FB", -1);
  33084. const _hoisted_53$1 = { class: "col-main" };
  33085. const _hoisted_54$1 = { class: "el-body-foot" };
  33086. const _sfc_main$2 = {
  33087. __name: "CrEditProperty.ce",
  33088. props: {
  33089. params: {
  33090. id: {
  33091. type: String,
  33092. default: () => void 0
  33093. },
  33094. height: {
  33095. type: Number,
  33096. default: () => 13
  33097. },
  33098. bottomHeight: {
  33099. type: Number,
  33100. default: () => 0
  33101. },
  33102. color: {
  33103. type: String,
  33104. default: () => "255,255,0,0.9"
  33105. },
  33106. direction: {
  33107. type: String,
  33108. default: () => "horizontal"
  33109. },
  33110. order: {
  33111. type: String,
  33112. default: () => "+"
  33113. },
  33114. count: {
  33115. type: Number,
  33116. default: () => 2
  33117. },
  33118. text: {
  33119. type: String,
  33120. default: () => ""
  33121. },
  33122. lineWidth: {
  33123. type: Number,
  33124. default: () => 2
  33125. },
  33126. glowPower: {
  33127. type: Number,
  33128. default: () => 0.25
  33129. },
  33130. outlineWidth: {
  33131. type: Number,
  33132. default: () => 0
  33133. },
  33134. outlineColor: {
  33135. type: String,
  33136. default: () => "255,255,0,0.9"
  33137. },
  33138. speed: {
  33139. type: Number,
  33140. default: () => 1.5
  33141. },
  33142. videoUrl: {
  33143. type: String,
  33144. default: () => ""
  33145. },
  33146. arcHeight: {
  33147. type: Number,
  33148. default: () => 1e3
  33149. },
  33150. axisX: {
  33151. type: Number,
  33152. default: () => 0
  33153. },
  33154. axisY: {
  33155. type: Number,
  33156. default: () => 0
  33157. },
  33158. axisZ: {
  33159. type: Number,
  33160. default: () => 0
  33161. }
  33162. },
  33163. showDialog: {
  33164. type: Boolean,
  33165. default: () => false
  33166. }
  33167. },
  33168. emits: ["submit", "update:showDialog", "update:params", "remove"],
  33169. setup(__props, { expose: __expose, emit }) {
  33170. const props = __props;
  33171. const language = ref("zh-cn");
  33172. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  33173. const {
  33174. proxy
  33175. } = getCurrentInstance();
  33176. const predefineColors = ref([
  33177. "#ff4500",
  33178. "#ff8c00",
  33179. "#ffd700",
  33180. "#90ee90",
  33181. "#00ced1",
  33182. "#1e90ff",
  33183. "#c71585",
  33184. "rgba(255, 69, 0, 0.68)",
  33185. "rgb(255, 120, 0)",
  33186. "hsv(51, 100, 98)",
  33187. "hsva(120, 40, 94, 0.5)",
  33188. "hsl(181, 100%, 37%)",
  33189. "hsla(209, 100%, 56%, 0.73)",
  33190. "#c7158577"
  33191. ]);
  33192. const isShowColor = ref(false);
  33193. const isShowText = ref(false);
  33194. const isShowHeight = ref(false);
  33195. const isShowDirection = ref(false);
  33196. const isShowOrder = ref(false);
  33197. const isShowCount = ref(false);
  33198. ref(false);
  33199. const isShowLineWidth = ref(false);
  33200. const isShowGlowpower = ref(false);
  33201. const isShowOutlineWidth = ref(false);
  33202. const isShowOutlineColor = ref(false);
  33203. const isShowSpeed = ref(false);
  33204. const isShowVideoUrl = ref(false);
  33205. const isShowArcHeight = ref(false);
  33206. const isShowAxis = ref(false);
  33207. const color2 = ref(props.params.color);
  33208. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  33209. const dialogVisible = ref(props.showDialog);
  33210. const directions = reactive([{
  33211. key: "\u5DE6\u53F3",
  33212. value: "horizontal"
  33213. }, {
  33214. key: "\u4E0A\u4E0B",
  33215. value: "vertical"
  33216. }]);
  33217. const orders = reactive([]);
  33218. const radioDirection = ref("");
  33219. const radioOrder = ref("");
  33220. const wallHeight = ref(0);
  33221. const yCount = ref(0);
  33222. const txtContent = ref("");
  33223. const lineWidth = ref(0);
  33224. const glowPower = ref(0.25);
  33225. const outlineWidth = ref(0);
  33226. const outlineColor = ref(props.params.outlineColor);
  33227. const speed = ref(1.5);
  33228. const txtVideoUrl = ref("");
  33229. const arcHeight = ref(1e3);
  33230. const axisX = ref(0);
  33231. const axisY = ref(0);
  33232. const axisZ = ref(0);
  33233. updateParams(props.params);
  33234. function updateParams(params) {
  33235. proxy._params = params;
  33236. _setShowControls(false);
  33237. if (params.id === DrawTools.DrawType.TextWall) {
  33238. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  33239. isShowColor.value = true;
  33240. isShowText.value = true;
  33241. isShowHeight.value = true;
  33242. } else if (params.id === DrawTools.DrawType.DynamicWall) {
  33243. title.value = "\u52A8\u6001\u56F4\u680F\u7F16\u8F91";
  33244. isShowColor.value = true;
  33245. isShowDirection.value = true;
  33246. isShowOrder.value = true;
  33247. isShowCount.value = true;
  33248. isShowHeight.value = true;
  33249. isShowSpeed.value = true;
  33250. } else if (params.id === DrawTools.DrawType.NormalWall) {
  33251. title.value = "\u666E\u901A\u56F4\u680F\u7F16\u8F91";
  33252. isShowColor.value = true;
  33253. isShowHeight.value = true;
  33254. } else if (params.id === DrawTools.DrawType.Circle) {
  33255. title.value = "\u8D34\u5730\u5706\u7F16\u8F91";
  33256. isShowColor.value = true;
  33257. isShowOutlineColor.value = true;
  33258. isShowOutlineWidth.value = true;
  33259. } else if (params.id === DrawTools.DrawType.DynamicCircle) {
  33260. title.value = "\u6269\u6563\u5706\u7F16\u8F91";
  33261. isShowColor.value = true;
  33262. isShowCount.value = true;
  33263. isShowSpeed.value = true;
  33264. } else if (params.id === DrawTools.DrawType.House) {
  33265. title.value = "\u623F\u5C4B\u7F16\u8F91";
  33266. isShowColor.value = true;
  33267. isShowHeight.value = true;
  33268. } else if (params.id === DrawTools.DrawType.VideoWall) {
  33269. title.value = "\u89C6\u9891\u5899\u7F16\u8F91";
  33270. isShowHeight.value = true;
  33271. isShowVideoUrl.value = true;
  33272. isShowAxis.value = true;
  33273. } else if (params.id === DrawTools.DrawType.Polyline) {
  33274. title.value = "\u8D34\u5730\u7EBF\u7F16\u8F91";
  33275. isShowColor.value = true;
  33276. isShowLineWidth.value = true;
  33277. } else if (params.id === DrawTools.DrawType.ArrowPolyline) {
  33278. title.value = "\u7BAD\u5934\u7EBF\u7F16\u8F91";
  33279. isShowColor.value = true;
  33280. isShowLineWidth.value = true;
  33281. } else if (params.id === DrawTools.DrawType.DynamicPolyline) {
  33282. title.value = "\u52A8\u6001\u7EBF\u7F16\u8F91";
  33283. isShowColor.value = true;
  33284. isShowOrder.value = true;
  33285. isShowCount.value = true;
  33286. isShowLineWidth.value = true;
  33287. isShowSpeed.value = true;
  33288. } else if (params.id === DrawTools.DrawType.GrowPolyline) {
  33289. title.value = "\u53D1\u5149\u7EBF\u7F16\u8F91";
  33290. isShowColor.value = true;
  33291. isShowLineWidth.value = true;
  33292. isShowGlowpower.value = true;
  33293. } else if (params.id === DrawTools.DrawType.OutlinePolyline) {
  33294. title.value = "\u63CF\u8FB9\u7EBF\u7F16\u8F91";
  33295. isShowColor.value = true;
  33296. isShowLineWidth.value = true;
  33297. isShowOutlineColor.value = true;
  33298. isShowOutlineWidth.value = true;
  33299. } else if (params.id === DrawTools.DrawType.Polygon) {
  33300. title.value = "\u8D34\u5730\u9762\u7F16\u8F91";
  33301. isShowColor.value = true;
  33302. isShowOutlineColor.value = true;
  33303. isShowOutlineWidth.value = true;
  33304. } else if (params.id === DrawTools.DrawType.Rectangle) {
  33305. title.value = "\u77E9\u5F62\u7F16\u8F91";
  33306. isShowColor.value = true;
  33307. isShowOutlineColor.value = true;
  33308. isShowOutlineWidth.value = true;
  33309. } else if (params.id === DrawTools.DrawType.SpatialLine) {
  33310. title.value = "\u7A7A\u95F4\u7EBF\u7F16\u8F91";
  33311. isShowColor.value = true;
  33312. isShowLineWidth.value = true;
  33313. } else if (params.id === DrawTools.DrawType.OdLine) {
  33314. title.value = "OD\u7EBF\u7F16\u8F91";
  33315. isShowSpeed.value = true;
  33316. isShowColor.value = true;
  33317. isShowLineWidth.value = true;
  33318. isShowOrder.value = true;
  33319. isShowArcHeight.value = true;
  33320. } else {
  33321. _setShowControls(false);
  33322. }
  33323. color2.value = params.color;
  33324. if (params.direction === "horizontal") {
  33325. radioDirection.value = directions[0].key;
  33326. Object.assign(orders, [{
  33327. key: "\u81EA\u5DE6\u81F3\u53F3",
  33328. value: "-"
  33329. }, {
  33330. key: "\u81EA\u53F3\u81F3\u5DE6",
  33331. value: "+"
  33332. }]);
  33333. if (params.order === "-") {
  33334. radioOrder.value = orders[0].key;
  33335. } else {
  33336. radioOrder.value = orders[1].key;
  33337. }
  33338. } else {
  33339. radioDirection.value = directions[1].key;
  33340. Object.assign(orders, [{
  33341. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33342. value: "+"
  33343. }, {
  33344. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33345. value: "-"
  33346. }]);
  33347. if (params.order === "+") {
  33348. radioOrder.value = orders[0].key;
  33349. } else {
  33350. radioOrder.value = orders[1].key;
  33351. }
  33352. }
  33353. if (params.id === DrawTools.DrawType.OdLine) {
  33354. Object.assign(orders, [{
  33355. key: "\u6C47\u805A",
  33356. value: "+"
  33357. }, {
  33358. key: "\u6269\u6563",
  33359. value: "-"
  33360. }]);
  33361. if (params.order === "+") {
  33362. radioOrder.value = orders[0].key;
  33363. } else {
  33364. radioOrder.value = orders[1].key;
  33365. }
  33366. }
  33367. wallHeight.value = parseFloat(params.height).toFixed(2);
  33368. yCount.value = params.count;
  33369. txtContent.value = params.text;
  33370. lineWidth.value = params.lineWidth;
  33371. glowPower.value = params.power;
  33372. outlineColor.value = params.outlineColor;
  33373. outlineWidth.value = params.outlineWidth;
  33374. speed.value = (parseFloat(params.duration) / 1e3).toFixed(2);
  33375. txtVideoUrl.value = params.videoUrl;
  33376. arcHeight.value = params.odlineHeight;
  33377. axisX.value = params.axisX;
  33378. axisY.value = params.axisY;
  33379. axisZ.value = params.axisZ;
  33380. }
  33381. function _setShowControls(isShow) {
  33382. isShowColor.value = isShow;
  33383. isShowText.value = isShow;
  33384. isShowDirection.value = isShow;
  33385. isShowOrder.value = isShow;
  33386. isShowCount.value = isShow;
  33387. isShowHeight.value = isShow;
  33388. isShowLineWidth.value = isShow;
  33389. isShowGlowpower.value = isShow;
  33390. isShowOutlineColor.value = isShow;
  33391. isShowOutlineWidth.value = isShow;
  33392. isShowSpeed.value = isShow;
  33393. isShowVideoUrl.value = isShow;
  33394. isShowArcHeight.value = isShow;
  33395. isShowAxis.value = isShow;
  33396. }
  33397. __expose({});
  33398. function submit() {
  33399. let outParam = proxy._params;
  33400. outParam.height = wallHeight.value;
  33401. outParam.color = color2.value;
  33402. outParam.direction = directions.filter((item) => {
  33403. return item.key === radioDirection.value;
  33404. })[0].value;
  33405. outParam.order = orders.filter((item) => {
  33406. return item.key === radioOrder.value;
  33407. })[0].value;
  33408. outParam.count = yCount.value;
  33409. outParam.text = txtContent.value;
  33410. outParam.lineWidth = lineWidth.value;
  33411. outParam.power = glowPower.value;
  33412. outParam.outlineColor = outlineColor.value;
  33413. outParam.outlineWidth = outlineWidth.value;
  33414. outParam.duration = speed.value * 1e3;
  33415. outParam.videoUrl = txtVideoUrl.value;
  33416. outParam.odlineHeight = arcHeight.value;
  33417. outParam.bottomHeight = props.params.bottomHeight;
  33418. outParam.axisX = axisX.value;
  33419. outParam.axisY = axisY.value;
  33420. outParam.axisZ = axisZ.value;
  33421. emit("submit", outParam);
  33422. axisX.value = axisY.value = axisZ.value = 0;
  33423. }
  33424. function close() {
  33425. dialogVisible.value = false;
  33426. }
  33427. function remove2() {
  33428. emit("remove", {});
  33429. dialogVisible.value = false;
  33430. }
  33431. function directionChange(e) {
  33432. if (e.target.value === directions[0].key) {
  33433. Object.assign(orders, [{
  33434. key: "\u81EA\u5DE6\u81F3\u53F3",
  33435. value: "-"
  33436. }, {
  33437. key: "\u81EA\u53F3\u81F3\u5DE6",
  33438. value: "+"
  33439. }]);
  33440. radioOrder.value = orders[0].key;
  33441. } else if (e.target.value === directions[1].key) {
  33442. Object.assign(orders, [{
  33443. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33444. value: "-"
  33445. }, {
  33446. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33447. value: "+"
  33448. }]);
  33449. radioOrder.value = orders[0].key;
  33450. }
  33451. }
  33452. function closeDialog() {
  33453. emit("update:showDialog", false);
  33454. }
  33455. function openDialog() {
  33456. updateParams(props.params);
  33457. }
  33458. return (_ctx, _cache) => {
  33459. return openBlock(), createElementBlock("div", _hoisted_1$2, [
  33460. createVNode(unref(ElDialog), {
  33461. modal: false,
  33462. "destroy-on-close": false,
  33463. modelValue: dialogVisible.value,
  33464. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => dialogVisible.value = $event),
  33465. title: title.value,
  33466. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  33467. onClose: closeDialog,
  33468. onOpen: openDialog,
  33469. "show-close": false
  33470. }, {
  33471. header: withCtx(() => [
  33472. createElementVNode("div", _hoisted_2$2, [
  33473. createElementVNode("span", _hoisted_3$2, toDisplayString(title.value), 1)
  33474. ])
  33475. ]),
  33476. default: withCtx(() => [
  33477. createElementVNode("div", _hoisted_4$2, [
  33478. withDirectives(createElementVNode("div", _hoisted_5$2, [
  33479. _hoisted_6$2,
  33480. createElementVNode("div", _hoisted_7$2, [
  33481. createVNode(unref(ElInput), {
  33482. modelValue: wallHeight.value,
  33483. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => wallHeight.value = $event),
  33484. placeholder: "\u8F93\u5165\u9AD8\u5EA6\u503C",
  33485. clearable: ""
  33486. }, null, 8, ["modelValue"])
  33487. ])
  33488. ], 512), [
  33489. [vShow, isShowHeight.value]
  33490. ]),
  33491. withDirectives(createElementVNode("div", _hoisted_8$2, [
  33492. _hoisted_9$1,
  33493. createElementVNode("div", _hoisted_10$1, [
  33494. createVNode(unref(ElInput), {
  33495. modelValue: arcHeight.value,
  33496. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => arcHeight.value = $event),
  33497. placeholder: "\u8F93\u5165\u5F2F\u66F2\u5EA60\uFF5E9000",
  33498. clearable: ""
  33499. }, null, 8, ["modelValue"])
  33500. ])
  33501. ], 512), [
  33502. [vShow, isShowArcHeight.value]
  33503. ]),
  33504. withDirectives(createElementVNode("div", _hoisted_11$1, [
  33505. _hoisted_12$1,
  33506. createElementVNode("div", _hoisted_13$1, [
  33507. createVNode(unref(ElInput), {
  33508. modelValue: lineWidth.value,
  33509. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => lineWidth.value = $event),
  33510. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33511. clearable: ""
  33512. }, null, 8, ["modelValue"])
  33513. ])
  33514. ], 512), [
  33515. [vShow, isShowLineWidth.value]
  33516. ]),
  33517. withDirectives(createElementVNode("div", _hoisted_14$1, [
  33518. _hoisted_15$1,
  33519. createElementVNode("div", _hoisted_16$1, [
  33520. createVNode(unref(ElInput), {
  33521. modelValue: glowPower.value,
  33522. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => glowPower.value = $event),
  33523. placeholder: "\u8F93\u5165\u53D1\u5149\u5F3A\u5EA60\uFF5E1",
  33524. clearable: ""
  33525. }, null, 8, ["modelValue"])
  33526. ])
  33527. ], 512), [
  33528. [vShow, isShowGlowpower.value]
  33529. ]),
  33530. withDirectives(createElementVNode("div", _hoisted_17$1, [
  33531. _hoisted_18$1,
  33532. createElementVNode("div", _hoisted_19$1, [
  33533. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33534. default: withCtx(() => [
  33535. createVNode(unref(ElColorPicker), {
  33536. modelValue: color2.value,
  33537. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => color2.value = $event),
  33538. "show-alpha": "",
  33539. predefine: predefineColors.value,
  33540. label: "12"
  33541. }, null, 8, ["modelValue", "predefine"])
  33542. ]),
  33543. _: 1
  33544. }, 8, ["locale"])
  33545. ])
  33546. ], 512), [
  33547. [vShow, isShowColor.value]
  33548. ]),
  33549. withDirectives(createElementVNode("div", _hoisted_20$1, [
  33550. _hoisted_21$1,
  33551. createElementVNode("div", _hoisted_22$1, [
  33552. createVNode(unref(ElRadioGroup), {
  33553. modelValue: radioDirection.value,
  33554. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => radioDirection.value = $event)
  33555. }, {
  33556. default: withCtx(() => [
  33557. (openBlock(true), createElementBlock(Fragment, null, renderList(directions, (item, index2) => {
  33558. return openBlock(), createBlock(unref(ElRadioButton), {
  33559. label: item.key,
  33560. modelValue: item.value,
  33561. "onUpdate:modelValue": ($event) => item.value = $event,
  33562. onChange: directionChange
  33563. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33564. }), 256))
  33565. ]),
  33566. _: 1
  33567. }, 8, ["modelValue"])
  33568. ])
  33569. ], 512), [
  33570. [vShow, isShowDirection.value]
  33571. ]),
  33572. withDirectives(createElementVNode("div", _hoisted_23$1, [
  33573. _hoisted_24$1,
  33574. createElementVNode("div", _hoisted_25$1, [
  33575. createVNode(unref(ElRadioGroup), {
  33576. modelValue: radioOrder.value,
  33577. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => radioOrder.value = $event)
  33578. }, {
  33579. default: withCtx(() => [
  33580. (openBlock(true), createElementBlock(Fragment, null, renderList(orders, (item, index2) => {
  33581. return openBlock(), createBlock(unref(ElRadioButton), {
  33582. label: item.key,
  33583. modelValue: item.value,
  33584. "onUpdate:modelValue": ($event) => item.value = $event
  33585. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33586. }), 256))
  33587. ]),
  33588. _: 1
  33589. }, 8, ["modelValue"])
  33590. ])
  33591. ], 512), [
  33592. [vShow, isShowOrder.value]
  33593. ]),
  33594. withDirectives(createElementVNode("div", _hoisted_26$1, [
  33595. _hoisted_27$1,
  33596. createElementVNode("div", _hoisted_28$1, [
  33597. createElementVNode("div", _hoisted_29$1, [
  33598. createVNode(unref(ElInput), {
  33599. modelValue: speed.value,
  33600. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => speed.value = $event),
  33601. placeholder: "\u8F93\u5165\u6D41\u52A8\u65F6\u95F40\uFF5E10",
  33602. clearable: ""
  33603. }, null, 8, ["modelValue"])
  33604. ])
  33605. ])
  33606. ], 512), [
  33607. [vShow, isShowSpeed.value]
  33608. ]),
  33609. withDirectives(createElementVNode("div", _hoisted_30$1, [
  33610. _hoisted_31$1,
  33611. createElementVNode("div", _hoisted_32$1, [
  33612. createVNode(unref(ElInput), {
  33613. modelValue: yCount.value,
  33614. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => yCount.value = $event),
  33615. placeholder: "\u8F93\u51651\uFF5E100",
  33616. clearable: ""
  33617. }, null, 8, ["modelValue"])
  33618. ])
  33619. ], 512), [
  33620. [vShow, isShowCount.value]
  33621. ]),
  33622. withDirectives(createElementVNode("div", _hoisted_33$1, [
  33623. _hoisted_34$1,
  33624. createElementVNode("div", _hoisted_35$1, [
  33625. createVNode(unref(ElInput), {
  33626. modelValue: txtContent.value,
  33627. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => txtContent.value = $event),
  33628. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  33629. clearable: "",
  33630. type: "textarea",
  33631. rows: 2
  33632. }, null, 8, ["modelValue"])
  33633. ])
  33634. ], 512), [
  33635. [vShow, isShowText.value]
  33636. ]),
  33637. withDirectives(createElementVNode("div", _hoisted_36$1, [
  33638. _hoisted_37$1,
  33639. createElementVNode("div", _hoisted_38$1, [
  33640. createVNode(unref(ElInput), {
  33641. modelValue: outlineWidth.value,
  33642. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => outlineWidth.value = $event),
  33643. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33644. clearable: ""
  33645. }, null, 8, ["modelValue"])
  33646. ])
  33647. ], 512), [
  33648. [vShow, isShowOutlineWidth.value]
  33649. ]),
  33650. withDirectives(createElementVNode("div", _hoisted_39$1, [
  33651. _hoisted_40$1,
  33652. createElementVNode("div", _hoisted_41$1, [
  33653. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33654. default: withCtx(() => [
  33655. createVNode(unref(ElColorPicker), {
  33656. modelValue: outlineColor.value,
  33657. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => outlineColor.value = $event),
  33658. "show-alpha": "",
  33659. predefine: predefineColors.value,
  33660. label: "12"
  33661. }, null, 8, ["modelValue", "predefine"])
  33662. ]),
  33663. _: 1
  33664. }, 8, ["locale"])
  33665. ])
  33666. ], 512), [
  33667. [vShow, isShowOutlineColor.value]
  33668. ]),
  33669. withDirectives(createElementVNode("div", _hoisted_42$1, [
  33670. _hoisted_43$1,
  33671. createElementVNode("div", _hoisted_44$1, [
  33672. createVNode(unref(ElInput), {
  33673. modelValue: txtVideoUrl.value,
  33674. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => txtVideoUrl.value = $event),
  33675. placeholder: "\u8F93\u5165\u64AD\u653E\u89C6\u9891\u7684\u5730\u5740",
  33676. clearable: "",
  33677. type: "textarea",
  33678. rows: 4
  33679. }, null, 8, ["modelValue"])
  33680. ])
  33681. ], 512), [
  33682. [vShow, isShowVideoUrl.value]
  33683. ]),
  33684. withDirectives(createElementVNode("div", _hoisted_45$1, [
  33685. _hoisted_46$1,
  33686. createElementVNode("div", _hoisted_47$1, [
  33687. createVNode(unref(ElInputNumber), {
  33688. modelValue: axisX.value,
  33689. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => axisX.value = $event),
  33690. precision: 2,
  33691. step: 0.1,
  33692. max: 10
  33693. }, null, 8, ["modelValue"])
  33694. ])
  33695. ], 512), [
  33696. [vShow, isShowAxis.value]
  33697. ]),
  33698. withDirectives(createElementVNode("div", _hoisted_48$1, [
  33699. _hoisted_49$1,
  33700. createElementVNode("div", _hoisted_50$1, [
  33701. createVNode(unref(ElInputNumber), {
  33702. modelValue: axisY.value,
  33703. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => axisY.value = $event),
  33704. precision: 2,
  33705. step: 0.1,
  33706. max: 10
  33707. }, null, 8, ["modelValue"])
  33708. ])
  33709. ], 512), [
  33710. [vShow, isShowAxis.value]
  33711. ]),
  33712. withDirectives(createElementVNode("div", _hoisted_51$1, [
  33713. _hoisted_52$1,
  33714. createElementVNode("div", _hoisted_53$1, [
  33715. createVNode(unref(ElInputNumber), {
  33716. modelValue: axisZ.value,
  33717. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => axisZ.value = $event),
  33718. precision: 2,
  33719. step: 0.1,
  33720. max: 10
  33721. }, null, 8, ["modelValue"])
  33722. ])
  33723. ], 512), [
  33724. [vShow, isShowAxis.value]
  33725. ]),
  33726. createElementVNode("div", _hoisted_54$1, [
  33727. createVNode(unref(ElButtonGroup), null, {
  33728. default: withCtx(() => [
  33729. createVNode(unref(ElButton), {
  33730. type: "primary",
  33731. icon: unref(edit_default),
  33732. onClick: _cache[16] || (_cache[16] = ($event) => submit())
  33733. }, {
  33734. default: withCtx(() => [
  33735. createTextVNode("\u4FEE\u6539")
  33736. ]),
  33737. _: 1
  33738. }, 8, ["icon"]),
  33739. createVNode(unref(ElButton), {
  33740. type: "primary",
  33741. style: { "background-color": "rgb(222, 146, 47)" },
  33742. icon: unref(delete_default),
  33743. onClick: _cache[17] || (_cache[17] = ($event) => remove2())
  33744. }, {
  33745. default: withCtx(() => [
  33746. createTextVNode("\u5220\u9664")
  33747. ]),
  33748. _: 1
  33749. }, 8, ["icon"]),
  33750. createVNode(unref(ElButton), {
  33751. type: "primary",
  33752. style: { "background-color": "rgb(126, 128, 135)" },
  33753. icon: unref(close_default),
  33754. onClick: _cache[18] || (_cache[18] = ($event) => close())
  33755. }, {
  33756. default: withCtx(() => [
  33757. createTextVNode("\u5173\u95ED")
  33758. ]),
  33759. _: 1
  33760. }, 8, ["icon"])
  33761. ]),
  33762. _: 1
  33763. })
  33764. ])
  33765. ])
  33766. ]),
  33767. _: 1
  33768. }, 8, ["modelValue", "title", "style"])
  33769. ]);
  33770. };
  33771. }
  33772. };
  33773. var DialogEditProperty$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["styles", [_style_0$2]]]);
  33774. Array.prototype.last = function() {
  33775. if (this === void 0 || this.length === void 0 || this.length === 0)
  33776. return void 0;
  33777. return this[this.length - 1];
  33778. };
  33779. Array.prototype.first = function() {
  33780. if (this === void 0 || this.length === void 0 || this.length === 0)
  33781. return void 0;
  33782. return this[0];
  33783. };
  33784. Cesium.Entity.prototype.setEditType = function(options2) {
  33785. this._editType = options2;
  33786. };
  33787. Cesium.Entity.prototype.getEditType = function() {
  33788. return this._editType;
  33789. };
  33790. Cesium.Entity.prototype.setEntityType = function(entityType) {
  33791. this._entityType = entityType;
  33792. };
  33793. Cesium.Entity.prototype.getEntityType = function(entityType) {
  33794. return this._entityType;
  33795. };
  33796. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  33797. this._isEdit = isEdit;
  33798. };
  33799. Cesium.Entity.prototype.getIsEdit = function() {
  33800. return this._isEdit;
  33801. };
  33802. Cesium.Entity.prototype.setParams = function(params) {
  33803. this._params = params;
  33804. };
  33805. Cesium.Entity.prototype.getParams = function() {
  33806. return this._params;
  33807. };
  33808. Cesium.Entity.prototype.bindEntity = function(entity) {
  33809. this._bindEntity = entity;
  33810. };
  33811. Cesium.Entity.prototype.getBindEntity = function() {
  33812. return this._bindEntity;
  33813. };
  33814. class DrawTools {
  33815. constructor(viewer2, options2) {
  33816. this._viewer = viewer2;
  33817. this._init(options2);
  33818. }
  33819. static initEditPropertyParams() {
  33820. return {
  33821. id: void 0,
  33822. height: 20,
  33823. bottomHeight: 0,
  33824. color: "rgba(0,255,0,0.75)",
  33825. direction: "horizontal",
  33826. order: "-",
  33827. count: 2,
  33828. text: "",
  33829. lineWidth: 0,
  33830. power: 0.25,
  33831. outlineWidth: 0,
  33832. outlineColor: "rgba(255,255,255,1)",
  33833. videoUrl: "",
  33834. duration: 1500,
  33835. odlineHeight: 1e3,
  33836. odlineCount: 50,
  33837. axisX: 0,
  33838. axisY: 0,
  33839. axisZ: 0
  33840. };
  33841. }
  33842. _init(options2) {
  33843. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  33844. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  33845. this._sketchEntityName = this._guid();
  33846. let dataSource = new Cesium.CustomDataSource(this._sketchEntityName);
  33847. this._viewer.dataSources.add(dataSource);
  33848. this._entities = dataSource.entities;
  33849. this._pointEntitys = [];
  33850. this._sketchPointImage = void 0;
  33851. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  33852. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  33853. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  33854. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  33855. this._image_arrow_forward = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTA3MThEMzhCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTA3MThEMzdCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjI3YWU1YjEtZmRkMy0wOTQyLWIyMzUtMDFkYWY3YTJlNGUyIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+BD9OfQAAEDhJREFUeNrsXT3PJEcRrho2QQ5IkAj4HfwJEhLInUHAjwBBgEACCRC2gAA5MEiQ2QRYpCQgPiJbsiAxyMYGm+O48927u+8WPd6Zd3t7u6qe6lnfe3tvt9Sa3Zmej+6uruep6i9+9NxzTPvAh4MQHf+Z09RCfsPRzUXInyOVa9b/Hnq4zMBdmnv9dhnp7enpDKtToJf9f04/5OZajQiwQhK4UmWskAUtTa3avSAV8aj9Ro7a7/JcDz34UtkVba/fp1JGLrCSpQvmx0EASnAfwZ8V650rgMugdAkA7lIhGGSQkMP1wxs1oqJds64jxIZOyg8jGTmZ2BXXdzfXOf2WozRykub4XAeWbiktK+deR5299G9+mhXgd1N8McU3z+wBqFrqNTLAQE0xYNE7ROKkS0J/n5hppJJXAQgBBT0SrBCH4yNP0K6TjsP3SfUZHlGxiA9ViEeNXOyyNLsszXVxXxmv1fTyDECL2Yazi7dJduRp1Vs9dJdQJ11nCF9K8ZMpfj/FN5pr9XQMgGptt1jPFEhvWd9FGp59Qdo9Gvk4h5XvfbsFvEPQMxF5JgeOZf0OgW8ZjPKI3jd/wzD9Lo+7gohcT+e3Bbko4674v90fOUXZHf7TLnvWdddwPfTQw4WEzaS7fp3ij1N8bYkHQLPec+bHDdZwrsxF8SZoYC8KYFDWETRUniv1fJieCDGAq/Z8bSwDWgZEtW4X37MiFSCV4LElTwwSQ494kXOfFP8/UXipNDLjkZ35sRGylBMXOX4X5zK4qxCOmVhsMwKSx43yf5OlXxf3dnLSQw89lPj9hRQ/m+KnU3w1xfvn8gBQ0JpHLFvb2q/34deUvxjWvgb0kT58Bq1hxPL13uNZ6QP4Tu97Ix4C6x2IFwUpj4hXQ3sH8u3oteg57TuQMkO+r/Xbau/PycmmIBzr7Pfj7Pp87Sr7vT785hRlk5GcHp5U6N74HvbtMJeI91J8IcWXU/xbCwGwQNvrG/cG7KGg7H2DRwyQ5wwKkUCfMVTyFiEELfdEAMRIV+06iRIA9PuRb1wK4lGiYZWRlq7iAQgTiyUEhQnv8tHS1fI9BGXMqmO0fq137DJisi7i1URO5uPj6fx4/DD7X6Zbd3LSwzNOAErMemkiAn8pSELIA+BZqwIAjzc1EL0HJSje/S1WeASQlzwXsbARr8K5PQHnsuqXehdQS/j0+n5Cq/atshBQ0XuigGqBfQuZGgJ5o4bvjJIjPkvdtsssSmZr77iavB8jyXiUkY2RiDyczj3Kfj+Yrn2YpZt/bzuO9XAmD0DeJfnHFL+T4m8mOTQJwED1PnAEqJda8BqAc+B7UOtaAGBBr0UHEUa+tQZcVlcABZWkl1YMMEIsYdS6jIAc6vmIgLTlGVpq0aNl3jImoREMmQ3vD0pUEALHhpyg+YwAey6XA0AgozNpWtoQ0v6HkD6IEc9tRkRmYvIgi/ez3/em4/+m45x2Qz1cEgEoceftFH9G+wGCf496AFr6/C0vAmLdKySDWZkGyNQ+6wAhHC0uejLARah9vECrm5waFFNUCVmgN5yWdwiIxsNQ1H/Uy+DlCx1vQADI1cBwiTKPkpHl3RKH6amtXo0ocYl6LILyeCNvVt2j71hC9lrG1ESeHSH2pOjWCBmJfFftnGTk5P5ERMb43+n/Byn+OzuXX3t89NS7OR5iA3jRxy6w36b4rRR/F+0CiPb7e258aQTw0gL20nrjDWrPo4pbGPVG5B4UT1miwNkKuMh5VPFFXP8RBbhUqbVaXUxtHpOlsw9axwNoRCPaBeC882ZciEcKqLCyW8BwaCgvVBZQr1K0Tmr1ER0/YbzrCITR5wr5U4qXkoaIt7Ce7uDFXGrkRL22BHo1kfdcTWTkPym+P5GSf9F+0N3b0//3p3MfTKTmNgkAVbDr9RS/meIvLAJgWebeNaL4QMCWlflQdhmZmRBhsS1MN2qha982NL4zYBFADXQIlsUSwGtR/i19wxGS0gpemLV5rDSHj58AwIAZ6FY5IhUWEQ6AOXM2HRm15j2PD/KcqCejdTYJUVvXFS98XlQnDQFdvAToOfunLYaG4gY34gWqbxEvMOopR7zn6AJ2+e/Re/K9FH+S4ju1ymwJEVIghjVuFYoEGpL1DXkQsFKIsLUKECdUba47WnZWHpD8ksMQvWfXGGb5OgG+Q1tVMvqM8t7IEtNI2VvpxCkvtEyl+l3ilgEiP1q55jIoC/NuvFfYaMMElE9lczGxvo0b86DVpSzQhWiQxvtr+kiMMhanDUXzKISvr4J4bP16FHd/FqTurXYrICC31BNSJ2zIXjkxXoB2VMvPp1L8Woo/TfFzHgEQowAFLMDagjxcqUA/87oClYAyJ6XhREBTAvfVCIYYjVCAckbA2RJycQSFi5+sAEe+uI6leFhRHlEm3KJEBbB4tPITkOwyqFS1bjJk4SdEYUfkWQy5jACCR0CI6otfeRa/V67aQl8CKO4WHdEOnAzLbfRJUskvA+DikVEEsDQ9jui0aSqySbzYAVAkPy1BFmALGwZOxEjQu4TFXKRNHHzLr30+xV+m+HyKn5m7AKIsDun3j/7mhvdaFSCAuxeZdsgN744+h2l5l4D3HM2diPZpou9t7Y/kQF644T1L3LWeaxidf3/OkfBaHpeU//H3H/f9L51aiHxvax211Dc6Y6Hl2+y9Pc4jk0u6ABHdQKAcU7DMiOJufG09EwGIJOKab+2eRvR+BNPQay33l+U1jm14ZWkXAOLGRdiWtyMgwlS5YG7sMGEBLUfEOkI2B0LvQayUSFeC57KNHKPWYst+EFFvTov3hSqeDW/cS83iQrtmOOB2RNtRixsQUSaHe8VU9uLLJyPtwHPtCpDO86awo7ti9ciwXrQs9mjdWN8kDe2vxTpmMD/syLJXl863SkQfH+sutrzbWXcmm1vXe5a2AN5YT68zWJ4Casmq7AyKwvAEp6XwLUUgZG+ZS6DLiEFBR9YxkEAjkqAyQIkJohxa6oYbFZKnTCOKBumSEPCd7NSfp+ijOz8iZRx1US6RM1baBBmuTISIWG3QyydX+u2lkq3IeB5PFoXaBluhXT45MYoYRXWChZPEsq2KAcLR8Q61vAoom7WxJZ7coWSnTCaAnvHSlLMSiu/NBpmKWocCkOzIFveahR4h2/Z7T+9+K8WvpPjVAQQhcVwe3qA6MQqOlYxG9xhA+8JrDVEChYsCnShPbLHUCWDT5DRmURpqpIxR0EStXAZkDQEetHykoazF8FIJQESQvFnAICH5wrInAcvcIgZWPpV3iNUGI4NzEY+HOHUaLVNkDECE7EmQwJfGS8Qjxwu/2+prZooPxEXD9GzxNiQD88za96K6PGIMoeO4JNjOI56c8v5x98Av0n6RoH8OhkUsgRcgzDHafyFKYxEQQKKj7cXJjwDP1nY95IyNSYBsRZUyWgcRa9ADfw4KJUK20MGlrcCOKuiagovOICDCBxp6HiiEVHBxyfPIWXKlDTBjhda2TBVm0DPIwLdansAzWKGmvLIB7l6/bMSrihJDDsihAM9EZrGgso2Ut+ZdEDBfClEQRM8tGVQYGQ+HzqjgRlnIwzgN8Ospfjk94g/zyVWgceQL5HhuIc2NoW1L28JbvalsnmJh0l3hVtcCG+RkVoaSuQnRDYc0j4onIBJQdJGpY0T1LYUHUJFGWLrnoq2VkCdDkcWrPBlG9r4gh0wPhocGXWZbew7apiJWk9Zm60RFTCJXey4B8sYV/dNKvgT0aFkyUNMBg6NbvHyDg7g+uh1tUyh5x9pbnawg7QuRI03movPoa3p7AGW4xQMTbVe2YViXj3yRoX9Mv9+lvQv/JcczldfFGyl+g24WAsoaa8NCQHkYCJ8T2rKgD9JAoqsORhd0QI6WVUPA957jHZHvtlcRq2+gg74/siOdZQW2bK1L1L4KHJKvc64EiD4HSVdZclm9Z2iUjSUb6Gh7EZTph2A5WGVTy0skr6i8DwvaSPS7tbIWalvds2X5cDrjEWmnSBu2cGm+Pu6P8HCyhMcV+8b9DsbV/O5NwPredP4eHZYgHuMVPZ1hA+CjuxTwymHiOaCK40KuMZjWUbkUuP9wD9+42D2LGbGgIiPRxWGibFg5FqNGLHbPJW+5n+vCI6bl6b2fHE8KSo4igxSt+cMSlLn8dq4UBiKTkXn4iOcqQqzF8Rp49eYt2d3igSNjvQjNChycNJ6F7xGhljU8kFlTeTqtrMXw9NW8C0L24EV2dAgH2i5ax1s63unwwQSu8wZDI9iOGwyNS+jOa/3fn9KO6caNinbUw5JgyRa0GdDKAARRFLG2+AYFG5jnMkVchcfXxHTdiuOytZSOVejS2IC8iszeXe0HMdxtVeCKEiPNnUkG2A+Om8xTWFYdDUG3YsTNq8iJIKSPi+pBVy9ESKEF2uKAH5tk2RfHSBtBlVWETFl6wUuHki7U4CjbFgfbCmLZbiaLbd5mON9e+PEEpjPQPiyAd073cEq7DpssPVxyyLs7RlL1pxS/TcB2wKvTB90IuFQ8AB7bVBqrKnFRDwHaFy4KMEWtaALf4ylZbzlhtr0BQgB4ZdfFy5vQMitVUymn9+XDH22PAkoKo91U1iJRnifCA2zLY6Kl1/oovXtbPQ6R+pSK/LSQWlEs5+hAPQHPkWKhXk3AupkAcjMB5Ayy60lBbjLwvJqANU/3+ADOcvnQ2cH/GQF9zrFhrtWXU/xRin/+SK4dsrc6VSriWRfIspGFkpOWxoxaz4hLNToTAPVgsML+I6QGAT0UCCygtFb+I8dNGtnKWahcubo+gLSlqwWx6C2wQWUw6i2QLFfeltgEeFUsMuN1B1nuZ3Y8CdaztxmYXhf/1wXYrqfj1RTXWZp1FrcTuG6n2EMPlxuerGeFC8NwHMPwQoo/T/GvKNlbATwRcYtrykb7BGQhHgZca0SxEdh4FR6P5EcsO9QyQ6bRRTd6sfpErbXfkVH/5RKcrVaZZ1Eu8UoI4BmxtoC2ABdfXEYgi3j+v52AdDfF6+zcNvu9no4zuO4ygN1mxxyQt0XsNl8Pt45Yd8Emv6Xw+xR/mOKrtB9nAYeVAVxWP3wNlL3FIKzlZJGFJFpdksgKS6cgJJDF71mRiNehVYxQELY2S4m4l6XY4tUjIMrzquMTKOAN0DbSmcFUClC9zq7PabbF9esCgL1z+bN66OFCgb2D/4WHUQe9Qvstfl9recAKAMxaPz7iXkUGEVrWaHS0bmR+prezUmSN+cg3Bqxtt3VHRjWj3QRz2BWWKhXgqh132f/r7Pz14Zzk13fF9fIZPfTQwwWZoj08sfAO7Vf1+0GKr7dywJUBTBGhQheI8abLnQJsm5cq0reqLUHsjWL33scFoFrLD9eWRC1jDYRr50T5Lx1Ye+hWcA/PRpWdo34vWkZ+leKLKb65hAPm2wHrGxacTnPSRq7nA5G8qTBWvzS6ap4G4LVZCzXQ9YBYA2frd1dcXXH1cJfq86z134Wpy9uTCyvAYt4Vq8LlVm0NdLm4tmSnPLp7rUG6BF9avqTX0Z1ugnLOcu51dOdE9xbz9n8BBgASWdK5g1XGVgAAAABJRU5ErkJggg==";
  33856. this._image_arrow_reverse = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QThBQTYyN0ZCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QThBQTYyN0VCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YmIzYjdkNGEtYmQwYi04YjRjLTkwNmQtMTRhMTNkNjEwZWUxIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EmbDrAAAEJdJREFUeNrsXTuPJEkRjujpmdnd2b1bYFkEAhwkpMPi7eCiQ+LuPAyEEMLhcQiQDgmEARL8AhxMDHxsHH4C+Hg4CAMDIYGziBMVZO1k7WRnZ0R8kdWz2zObKeVUVU898hEZX0RkZCQ/ubigkQ6UOGUZzfDc2mq096CRkUa6WRSNXEvjf61R4Y0Q2b1n5/anJ9vRJwdMchM51gsqsxzJOwaQHvF4Gl03UpjSuQJTNs6RY+vcAmiPgqU4SuN3Nu6pn6/vpaYAcXlX+it7zx5CAPh4yt9N+UdD5B9cdqRb2MVDEx+C2lXaFEC65M3e9WVdNo17qLimxrtQUK4BT4JAK8a79Puu+sh6PzsAbfU4eh83hIGWYLBb6upZXjkF8FrKP0z5zZQ/Mkbw4CQjje6/vroYFbs9dS4B86Q4X643jazdvylAe6OA9qYBrhYQWsCn3cPF+T7YcjpK6LseaCP3i6JRTwYga4KGouk/rTZaXsti4Akr1rUYAsMqC8DrKX875TdoTCUMrX6k0f3XXhc5VJ25ANNtAZ7pnNO5nFxd00mRN9X1SQW62+Ld1ADpqXGsAXJJUwDAIs+Vx6mhNUqwHaegOLqvqcrevPYUpBJ26iBgucT4vdayq3ex5J+l+qwlmrID/K2yMnC/oNaDHuB+JWv8P0j5s4PbjjTSSApz2xYgelacn+bz0+Ke1vW2AOJtA4ALcN1hwNLQ6ATTKoUqAPKeE0c71jRNUTRvD6AsIBADyFogwQ6AIMcIeCMAHRUErHl0ZF4dMa9b78/lFDa+L2A7tMo9BWik+p1dISQqAHws5a+l/HbKj4eqOZJLiiNdZ1q01gSccpZB9jQfl/Pz4nzJdwqwPasA+bQCWc3Ui4IeApbe8572Kw3iYwWgxKFWSwuManHeNy2Q9kaTOPXSwKp3zrlHSy4BDNXMyzZloF0toYDJd7SjgBZOQLvYNKKXuvWtloCItkfp9Ke2FyoAzEzhkxn4vzHY/kgm+d4+kD3LoHleHJff7uXjct26r8wL0G46gbNxnyAg7Wlz0wG0Me0+uQYq85hbbQHwTKceOEgQoJl057AImGvz59c0Ck2nC0SAsSwEqHUj8i2tv7W+pUa7liA7AZYAcjR9XdgRWKjQ2pEBywI8jhABYPYS/FLKP075M44JY6SRetK2ANN71fn9lO9mOrxbnN8rQDb9xudZCz4HwJQCGiqBYCrgdy0mEQE5URibKMylBSyTo915jDwyt6oxPA9E2Dm3NH1vbpsbWqsoJdO0X68fUS3dA3A22l2CVgkPG7yyS/D9njCDrGsXh75QS4vnG4GAMgP9x+AYQdf0E/AeBvjIznOeADB79s+Oft9M+UMdHT/S8aTTDKYX+fggHx/m45xfKc7vF0C7AO8W1IpQMEU0UNDbWFBty5ofZEcLbmkOEziAGRw/GuAJyCQQTcn5bcd7mQDNFxG2LOBH6hRhlhJoBwZaCtWEkekGASwmaN9pQoUlVEVAlp1xbD13ZfrfXzqHCCkofSA0JqBAbbUTg2MgMi4twQ39dlRw2HmvJQB8IeWfpvzFbLrs/eDtTfstcSeD6KsZWJfjo5TfW/3vYb5eQJZBCdUC0QjoSsXsraU7iObqMVbLgckzBzL5c55rrFKKRsZSRc5q1S3yXTkotelOQ+1nd9mxYVYUAjTuKIhbtIy8R8hehsVAm7cAaAKEC+kQxObb5nnY1vun9ruejUV07hrR/D0rQ49AgDgPlrCPll8DYDZ4j7XKAPX94ICiwri1gEuLCgMKR6v9vPpq/JaBMqvLAL+a8s9S/gQ4yJ5nupfB9P0pvy+D62ydeJx/e5R/f0++75zwtaM1o2ETbMVkEhbD84A+Im55modjOhNES/YGbO2tKo4Jc6qKxEGQtPquZWZEwFP7DOpVjWjZiBNaRNjSn69DgTRLxajzXI+w52nvHASwCMP3hCgUzHumLsrHUS18GYvsCBwC1Kc13iyTeY8JGp3TZ0f7RpwNifS1+Uy+74qQ7ZDI4Phkh883VkMIO+2D8lbNzB9RLqBVAB9M+Vspv5M1VW9wlum/hikqEDzBNO2g0Zs8k6VHpIjJkU2T3GVwCwl0kucbiswptjRAD+gQT1tkTi0aSMQyM0faHPm/xTBaXstEWJANhUaYC00OnSJwono1wVoTgBbx1KFfeV6WvCXgSxnyBZ33D5k0wXFCDlj0Wm487dYTJGVlu7ToF5nKWcrlOechJmzptE5EV2VooI2sXkBC8EZB1uOHETrRcDTSvlDfbIobPpfyb1L+RQP8EQmbi4GOgDgDxBQdgKz8xgEtEjGbeYO3Bf51Ga0wl8g1NcxKPVYai2ARKZgp7nTEnQyWgMFFjgk5aiJG+1EarxFQqyWDuS2XDJgwo3WghoUPmS+NMJ3yK0hYVqTNidYt2+qxOiCgzEFabwFb4B1sjePI8jEkLgEFtU82ymLRT9STXYzvInSEWi0JrCOTv6lP6/9s/I7wn640CwAfoEsnv9+l/GWDcLgxANsgJeoAYqBCHlPmQOcQ2V6n67UaHUQ5rmWwxVSteSNR+icCusi8Uk0L3txcb3v2vMVjwuibGHiHN6fp0UOLltmhFXTuMsI4OWhdQTScqGc7U3tumcE+ZpApinOftWGMHEB4RcBdwH7hhgVNW+/P1WcZsKwi1lOvLSLToBauRPi8p2R69BzhERq2eMKkF6CICfOVQKze7vTYPAXw65Tfot3lU0joQURjRADdezcDDeqBmOVUQgEmaAxIKGh5xCQbCVrSIkZ0Hr/H1N6zjCliSmv5Dfd6BaPmNc9aIAB9IVpMj8ORpqWX72yvv991/EOdsBzggaaU0PlyRNhsTeG0fD0kQGMe86SOtkKdYxFTsxfAhwxeUT0jmrVhopiDncVDJgfEEQ98hD45MA4j1iKEJ3GwnZhiFu+eUMzRlU4743ijAjmHGbllykL2OY7Ov4hjFSijL3HDbCaN+6yYz86cjiASoyWtevPh7GikvWDsCXYMCB8eYUfNaXGLDYcFUwaB2tJavb6MrNRQ+pq9cWNZ47gYyWJoVwyMcwnQDKJ9e2M/2o8REyriF4Bqodw5rjxLROT91jr2iBPyGq2bO9ug12rHYHsglhxv/r4WNiOR+lBlM7qK6CCr8WYB4Pt0uZ3vX5VPiaOdR5mSx4QY+C4FTFaL41EmKGkxZi6eZpBIjHsYnXdETVTWGlUBGYeA7ewJdhpYiwGMKHMXh2Fb1Magqdeia89EyyvGAzkCawn2rQ1FPCuX1p6IjwfiVc+geRUBlOhe6lHHKhS4PcHQmvZA55kRS5KAdEPgN3sEbu5oYw7wMwRoI4AYoTNkejDCs9Glx0jYbERpphV9Q4Y18akA8PeUf5vyV1L+fdCc6g02r2GQzpdOoo9oLHkAMKrlki3YCFP/sknUAUnzqxCKaWQ9dZaGaYw7Bi3qfISWmzrrboVaFZB+UdrUYi5QNYXEwPcsCxCqOTtty7SiXwQU9BgoKwFWNE1joyAv8KyOEdrzIvihfg89q18iIG3F/kAdC6NtXf+3Z4kbO/2AWJwlKGBxsI3Z4N1k8AWP/jkwnpt9WqwC4D+lP99J+Zcp/6tz0HNAo7I0CnYkr54EgJNQh8VC03Yjkd/QAYoyBwGYlQDaMjqtENW+BGCAVuAMDkjGa6wvVjkQJzVP0udA/3PFJhFth4GyOhqHRIUGDmpgFKBDxFqmMdm1MUw4MB5RK0uUR1lttMZ7noFzRINHhfT2+8TkC9b6fYuvWb4XkdUJiACH+JoxyGu8PlizVPYqAMuTi4vWA3MgoJ+n/Brhc/PzJkEfpctVBXMgng/TbrAezUENia2Nrmm1rAiexcGKaDWB1gkw+p4Zcx2dR7aes9YDR8oIhOBtlWMnAlb0vRIc2JOjya/dKAfdHwAtU3RLWWQnPuQ7E+mOc2v2MfA2FbKesTZu6WnDKA1QR9u3/78b9yM6hhDa4JXtb9WLKBbILDoevMBqGt+eqvb16hUJXYzu54A4hbYDFTG1lr4SyN/ZqKMn6HjOnc+e0QSAOWmhgDUgPaXjTPPqhiX07qN8nCMEPs7CycN8fj//PsdAmBtl22j4ySESCRDPmqiBIBBDAk6UGZECKMh3J5DxXBfgaO0+AXWlFQBtlbnRLyyN8Mw9ghRaV689NQbrtT3ar2u2G+4V6iJClSeY9AgPER4xrR67+2DUQxu9gsEa3nXIb3jPeXTChCsmPd9DlF5PQQ1ZoywBYE7aZkCtRjlWAeAmpHkq5m4WPuZQx6/Q1V4Bc0jjB1koWTbueTUfyx3ztp2DskeIiOxJ4DFNlPFqjHBS7mNQi0QZOVK3ifRoglMH+EXLI53PdAoqXaArnXWK0BGy10VUWOwBME+Dj7RppEyI0HAIUEXvYcAipT1v3cNgOTxAR33S6o2NohFue3zfPMFhTXRD8QQAoqvtgH+S8qczWLXW4w4B4CYnbEZp2fN+2Zr3ohJEyusH+d5y+9672SJzVtBLr3m2cT+XexusmWpAtaFDaX+HAnOj3Grb9AJO77bHqNXALs+VyV0UZh6d9ukRsiLadKStvBgHiBUCsXagZW7RjyO47O0oGVEsKDBOkSkGMqyXUYuBrHjWExYQS4J3D0esErYAcFXNmVl/KuXvpfz13Rc96+izgaIjHYkoc14IK4vQcScLIeeFEHOaj2fVfaf5+jTn+fcTAACmgCaGaINTh7a1dj6/R+CJmOFbYBed70fKjW4vjQJ1r6WmVzDy/AqY4r4RnjUHEWx6rIsR4Eetikhdestujd2Ipr5ipdveTqSIMKAFAFpWue1t/rY1WenVre+m/MeU/5nyX1J+my7nzctNT45JUx3p5U0zdfwn538fcTm3Od/Jx7Min1fn51kQOauEkvJ6m4WU5fqEsI1GagZiMTJrsySieIRNVsBMX3XiO4N5dSGD4Vtm1hoUDrFHuxG+N31H1LKx044tM7AV26DeLY8I22iHwTbUVn71cPneXQx7o1MeIupodBe/cmfISIRFZzO7/YiQyBRAneZ56TfpMoDQ5+n4nQBHGhLVSP3Esa1yKXBsi/NFQNlUQshZPm4LIWU5bnI+KSwsh7Z4oJaNXl8DxMrQ40/Qqbk/G88Rh75JAcs1/kOW1SKqjaNWgbaVYFdoZMId+CZHiNDKiewsiTqMW/2NRBM0HQR7BIAlvU6XWwe/VWgeIw1BYaSRnncqhYg6b8HfNvn3WiA5qYQVLs4twIwuRaWAw2IEFFF/AUR4QQQfpKxr6oPWAxEeiGK+A9Hl6hG/AFEsBl55kT1fVGFhu4L3/yHlv6X8j5TfGDzotqcB/iMdbZpyfvfIJehNJUhUVhDhQgAp/8/Fb5uGMKIdl+9agYO0zZusQa9NOSCmew8gUY3Dm9rQmJi2MRFS7poZRsvYalukHtrUhXL+9NSaynmWMAFAr+KfU/5Vyk9ebs028I6hSA/rx0gvqwT9v5yPndg3tB9JcqNcbxrP1cJHKyqlFvu+tRcDExZ2WByQZ2Ng90Q7RdgGg2AeES5qfw2kqM33rZkCGDx1pBfX6dFXDXobpDTSbeo0K6S2F2obDb/bCv+NOBIigYy8CLgtE34dO4FVwWd/Q/Wmc+j2hdGCDFp/OZWgAzWqDHp7qYlXXvaBeBPrJYd+mdyQjrJ+4+DzJfBPDYKo91Uw9wz5vwADAFVdqz1vyN8hAAAAAElFTkSuQmCC";
  33857. this._image_h_l_r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAABIklEQVR4nO3WbQuCMBiG0dn//80tiAp6WT4zi+A+54vTTdMKuZZ20Y/H2/is9/r+aFxdNz5/qa7t1/Gr+dlj79ZX5mrnvz93p+3T9zKznbnnynW/OPfwnLXP/v2xqXvolXv8dH7Ld7Vhvs+cf/2v/d/vd3dfq8/0zbm1a1d/18L2o3fIzHbtnVi51p5zK8f6q3Xj8cza8XjrusH+oQEAcQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAAJCmtXYCutDwWwUr9cEAAAAASUVORK5CYII=";
  33858. this._image_h_r_l = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAC90lEQVR4Ae3WzVbbMBAG0PzBgcOa93/M7nCj2F8zUUILdDmXjWTNSLauBMz+19vbstvvl139+c5zza39sd7hUNe99mveZ/3dbs3/LF7W3j/IXbZ5hzI/Yzf7TXxux/fPY3n+W+wrOfP3Zs5P26wXk22d/bzenJf8jNf82h/73XLOh7KeS51b++fEw/R8uQfzetvzsubmbtyuPXLmteo6W/9Qv2lZ7te4fde6l6xT52Ysbf22jK3t+o7j8frdt/H1HTWe96RdY+v8OnfrX84u45kznrPm6Cde2/THnPRrW/vjK+e8OT6e61j6OZcaH/ZbfDvXy+/Qsc5Jv55TxtKOWNY/t39+bx/NSV6dk3VGrM4Zu/2fsbFW/Ou69RvGO2rOFlvq2Pwdc2w8Z/0tdpqeL/HTab0/iaWd1xt5iaWd587PyXt6evyOOT939LP8jCcv66d9fn78nsSH2cvLv3OS//p6mzvmJza3Izb+D64/ae/zR/zR3IyN+MfH/fz39+tY9j9yv9//6pw57+45/xvOfzv9ECBAgAABAt0EFADdTtx+CRAgQIDAWUAB4BoQIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgK/AX08dE/3SOoSAAAAAElFTkSuQmCC";
  33859. this._image_v_b_t = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAADcklEQVR4nO3di27bMAyFYdpWLuv2/o+aJfFFgxOp5VjKdjDM6rD/A4KkbZyhwIBzTMluE/s+CAAA+J/EIH1/SL9ws/KLR/5rAADwZb2S4zHIMBzVN9YOzh8QN74XAAD8HTmLt2Z3Ns3PId7vR/MB9oPihtcAAGBfOq9Lr3WOR/0Icrt5BaAxb14rAwAA4OsUAC/HPxWAk4i0hSmAF/iT8zMAALCvnNXtQiHwwn/O8WkuAGdTALy1hFhoEQAAoA5ver+W4aoAXK8UAAAA/j1/UgDGED8mAHYZQB/ofYBQAgAAqMIL/qXN/L+F/6MAyPX6TUS6lQLgPYQCAABAFaUCsJbjY3oMQS4XXQDaFwoAywAAANRRCv6lApDP/odHAYi3Wy4A3YYCMFEAAACozgv9tUn+qApAnycA4cUCMFEAAACoxgv+LQVgSI8Q5OdPWwDawoE2/CcKAAAAVZTC3zuRn5wC0M0F4LuIHJx9AHb3/2TCnwIAAEAdugC0zmtRWW4LwP0xAYjPCcAhTQHswZ9uHOAUAQAAsC971t8WLunXBeD97H9+X14COBT2Adj1flsCKAAAAOzPC35vGcBb/291ATguFIBS8FMAAACoo1QASpP8993/7wUgLQGcUgEICxMAHfojVwIAAFCNLQDdCwUgPDcBXi5vqQAcCgUgOsFv9wIAAID9NE74ezf1swXgnt7X6CWAo7oh0FIBGLkSAACAqvJGPxv+paX8UW8AnH+Q7wR4NhsBvQIwqgnASAEAAKAaO/7fUgB6lfEx3wnwbDYCLhWAkQIAAEBVXgHwbuufc3xQ9/xJBeB6PacCcFooAF74jxQAAACqWAp/fVdfXQD6lO+PE/ggH0sA+koAUQdKOpACAADA1/BKARC1AbDNpSDE5wQgXwrYpQKwNgEYKQAAAFRTKgD27/roCYC+1f84TwDOZg9AMAfa9f+BCQAAAFW16iqAYJ717YBzjg9qiX96/jng2+2Uzv6PqgSUJgCDKQHcDRAAgP3Zs/9gvvY2Abb6ioC5AOTgP5vw17p0QKueKQAAANThFYCgzvytLn2dpwHHEO/3tfCX9P2ggr8zlwICAIB9NGb8vxT8OsePefw/XxIYpO9/mJ3/S/LGgqDW/ikAAADsp9kQ+J45v9/S9+NcALaGv5X/4W77IQAAoLI3EWl/AQ/TsX9wLtbWAAAAAElFTkSuQmCC";
  33860. this._image_v_t_b = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAHhUlEQVR4Ae2d2W7bSBREucmy7IcA+f+fnAePtXCZqr68IhVLSGLATIA5DbS72QspHT9U9UbV79++vVdV9axIgAAEIAABCEDgf0Kgq3a7f/RdR8WXT37nSf0yfvIWdIMABCAAAQhA4DcJNHP7+jf7uXlvA/CmTHb2TEDe0A3uhRT7XpWOg+JU1bXLCRCAAAQgAAEIbEFgmqzXjq1iN+d/ruF13dfT9NbVT08XdXI8zZ33StMQKHsN94R/UMNBFZ5BIEAAAhCAAAQgsBEB6W8j/U0T4MF4GgGnj3TcA/ej4rmr9vuzM4rpHpQteXfOG1j8ffOMvSos/CWqHAMgCAQIQAACEIDAVgRW4m8TYB1uNRs/VtNkA5AmYK3jFv+zCs7qe+6m/f6ki92qsW+SZsAdLf6OLrcBKNP+Kuj1oEEPyjpVESAAAQhAAAIQ2IhALR1uZsH3TH4n0W4lymkAbAys4w7W8F5t+6muPeg/dbUMgAp25SYh9BZ5G4BavUpH3cwd0wBY9Ici/mEI7DZcR4AABCAAAQhAYCsCtWX6ugfAot9rTO5ZgDQAax33YN0GwPrtJf9j18gAyA3kVEGO5m0AHIoB0J8QeU8thOjnUoDTNAduT4AABCAAAQhAYAsC0xQzADHi92g/xD+WAH7UcQ3xp75qGpuAMADT4XDUbsBaJqCeR/Ke4i8zAEqLAVCaIn9rAGIJYJTjcDkBAhCAAAQgAIGNCEi2lxmAZSkgR/85sE8d9wA/l/FPujh6E+BRmUYi3tSNNhTaIaQBsLtw8BG/2FhwHfmrj5cCxkblaoQBKKD4AwEIQAACENiIQAzcGwlwGf3rsq3GMZcAYv1/reOzAZB+n1UpA/Dy4uMAthFW+0E32in94BzUwSI/qFNJnVcc53KXESAAAQhAAAIQ2I6A5Lpq9MfRum0zUGYAXKZr1zs6eMe+Ndyn+C7KH7v6+fmoYo3xPZxvBqVlF6HLZAuio+rKDIA6W/B1A5//TyOgonJKoDyBPxCAAAQgAAEIbELAS/eN9NknAWppeCsNb10m+S5lNzpuDdfSvTS8HP/vqsPhXY2t4EXY9ZG9/u8phFqL+8UA6E7aJFDW+Yvou63arDcA2gQQIAABCEAAAhDYjoA12iP9YgK0lu+0GIC57J6O9xLsi3T/1E0vL+8e/auxR/flHKHyZQlAdy4GQOWut+hnXIu/y1xPgAAEIAABCEBgOwIxUz9q/C7h1+g+zEBcF3NwR8fLuwDU/tQ1h8O/cgLe0NdrE6BfCNQpbwdxuwRg8W+8vHA1Abn730cEMQDb/cN5EgQgAAEIQCAJlNG/hD7Ef53e03Gf3ov3BehVwN4DMIu6VDxmAGQAtALgtYUyAyCnYIVPob8xAaWvTwkQIAABCEAAAhDYmkARfonwYgBm4S+m4KOOFwMgXb/EEsA4xuheGwD1yTtVWNFjA4G/ii9jlL+IfxwLtPCPpd7tCBCAAAQgAAEIbEkgtNrr/2kCmqaUze/3uQ7kVT/qmKB13C8EunRtnAKwiNsVxAZAO4b5BldxTwOwFv6cFfD7AwgQgAAEIAABCGxLYPSreDRgT81OI+BZfEeHmBGYZvH3gN96X2YAvAegV7uz0usJAFXaTSwhDYDTtQmIlwdhABZS5CAAAQhAAALbELDIW/Rz4G5DkGYgDcDySXIGwL8H0PsYoN8DMEjXPfUf7wBwp3AVS7dZ6DWlEHsBMg1DgAFYSJGDAAQgAAEIbEMgRvf5PoCSSsLzdEDMAOQnkY5PsQQwGwAdA5TY+6d9y+hfSh5vAfzROcQMwDL693WO/qMuH0EKAQhAAAIQgMAWBNZi77xmA8rav4/x39PxeKePlwCGbtrtjmqT7//3C4CaMvq/19GC7zP/FnwMwBb/Wp4BAQhAAAIQeEzAWu3oWfvMW/zzet0zdPu6DNB1r69HqX+e/S9vANQ97joH9Q3hb9vFBPjmLidAAAIQgAAEILAtAeu1Q+r2oDf1W8QVStn601jEFTR7P1bDMJQfA+r860F++Y83DrhT39feFbju17mTQ9ct4p9lma47kIcABCAAAQhA4GsJpFan4M8a7ofe1XFruPcBKHZV256qp6dWbiDE352fnrQb8NYAlG9goc/oAud9MwIEIAABCEAAAn+GgAbt19H+rOG+9sa+m5D67bRtZQBeX09l5H+5LAbAN/hVA+A9AQQIQAACEIAABP4MgU4H+FKzU7/zev2J1gZAmwE7jfaP89T/YgC8gcAhb+BOS4h8HCWo1H9dt7QiBwEIQAACEIDA1xM4n0OzvYwfYVnC/6jjMZO/28kANM1ZsdZvAoSDyMaR5k2iQ36NtSFY57OeFAIQgAAEIACBbQgcDqnVy8DdT36k4/NMQFd9/352s+rt7Z4BWD78Wugf5ZfW5CAAAQhAAAIQ2IJADtz9rEd516V2Xw3A6WQDUFX7fU4d3N6gVN75M9/g5mF3mlEEAQhAAAIQgMAXErAeW/jX4v/ocWkCVK/f+Z2ena7arvOr4muWNf8rCjIQgAAEIACBv47AL+m4TwlcFH/W+K/7dnwgCEAAAhCAAAQ+T+A/hVJn6rP9qnIAAAAASUVORK5CYII=";
  33861. this._sketchTempPoints = [];
  33862. this._sketchPoints = [];
  33863. this._sketchOutputPoints = [];
  33864. this._sketchWallHeights = [];
  33865. this._drawEntity = void 0;
  33866. this._lineLabel = void 0;
  33867. this._polygonLabel = void 0;
  33868. if (options2 && options2.isDrawPoint)
  33869. this._isDrawPoint = options2.isDrawPoint;
  33870. else
  33871. this._isDrawPoint = false;
  33872. if (options2 && options2.isRetainDrawPoint)
  33873. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  33874. else
  33875. this._isRetainDrawPoint = false;
  33876. this._param = {
  33877. lineWidth: 3,
  33878. lineColor: "rgba(0,255,0,0.75)",
  33879. outlineWidth: 2,
  33880. outlineColor: "rgba(255,255,255,1)",
  33881. polygonColor: "rgba(0,255,0,0.5)",
  33882. wallHeight: 30,
  33883. power: 0.25,
  33884. odlineHeight: 1e3,
  33885. odlineCount: 50,
  33886. text: "\u91D1\u7530\u4EA7\u4E1A\u96C6\u56E2",
  33887. duration: 1500,
  33888. count: 1,
  33889. direction_h: "horizontal",
  33890. direction_v: "vertical",
  33891. order_add: "+",
  33892. order_minus: "-",
  33893. houseColor: "rgba(0,255,0,0.95)"
  33894. };
  33895. if (options2 && options2.iconType) {
  33896. switch (options2.iconType) {
  33897. case DrawTools.IconType.Normal:
  33898. this._sketchPointImage = this._iconNormal;
  33899. break;
  33900. case DrawTools.IconType.Blue:
  33901. this._sketchPointImage = this._iconBlue;
  33902. break;
  33903. case DrawTools.IconType.Green:
  33904. this._sketchPointImage = this._iconGreen;
  33905. break;
  33906. case DrawTools.IconType.Violet:
  33907. this._sketchPointImage = this._iconViolet;
  33908. break;
  33909. default:
  33910. this._sketchPointImage = this._iconNormal;
  33911. break;
  33912. }
  33913. } else {
  33914. this._sketchPointImage = this._iconNormal;
  33915. }
  33916. this._canvasWidth = this._viewer.scene.canvas.width;
  33917. this._canvasHeight = this._viewer.scene.canvas.height;
  33918. if (this._isRuntimeApp()) {
  33919. this._viewer._cesiumWidget._supportsImageRenderingPixelated = Cesium.FeatureDetection.supportsImageRenderingPixelated();
  33920. this._viewer._cesiumWidget._forceResize = true;
  33921. if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
  33922. this._viewer.resolutionScale = 2.6;
  33923. }
  33924. }
  33925. }
  33926. _arcToDegree(arc) {
  33927. return arc / Math.PI * 180;
  33928. }
  33929. _toColor(red, green, blue, alpha) {
  33930. let normalColor = new Cesium.Color(0, 0, 0, 1);
  33931. if (typeof red != "number")
  33932. return normalColor;
  33933. if (typeof green != "number")
  33934. return normalColor;
  33935. if (typeof blue != "number")
  33936. return normalColor;
  33937. if (typeof alpha != "number")
  33938. return normalColor;
  33939. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  33940. return normalColor;
  33941. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  33942. }
  33943. _toColorFromArray(array) {
  33944. if (!array || array.length === void 0 || array.length === 0)
  33945. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  33946. let r2 = 255, g = 255, b = 255, a = 1;
  33947. if (array.length === 1) {
  33948. r2 = parseInt(array[0]);
  33949. } else if (array.length === 2) {
  33950. r2 = parseInt(array[0]);
  33951. g = parseInt(array[1]);
  33952. } else if (array.length === 3) {
  33953. r2 = parseInt(array[0]);
  33954. g = parseInt(array[1]);
  33955. b = parseInt(array[2]);
  33956. } else if (array.length >= 4) {
  33957. r2 = parseInt(array[0]);
  33958. g = parseInt(array[1]);
  33959. b = parseInt(array[2]);
  33960. a = parseFloat(array[3]);
  33961. }
  33962. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  33963. }
  33964. _updateScene() {
  33965. this._viewer.scene.requestRender();
  33966. }
  33967. _getScreenClickPosition(screenPosition) {
  33968. let resCartesian = void 0;
  33969. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  33970. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33971. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33972. if (Cesium.defined(position2)) {
  33973. resCartesian = {
  33974. x: position2.x,
  33975. y: position2.y,
  33976. z: position2.z
  33977. };
  33978. }
  33979. return resCartesian;
  33980. }
  33981. _getScreenClickPositionAndHeight(screenPoint) {
  33982. var lng = void 0, lat = void 0, height2 = void 0;
  33983. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  33984. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33985. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33986. cartographic = Cesium.Cartographic.fromCartesian(position2);
  33987. var feature2 = this._viewer.scene.pick(screenPoint);
  33988. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  33989. lng = this._arcToDegree(cartographic.longitude);
  33990. lat = this._arcToDegree(cartographic.latitude);
  33991. height2 = cartographic.height;
  33992. } else {
  33993. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  33994. if (Cesium.defined(cartesian)) {
  33995. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  33996. if (Cesium.defined(cartographic)) {
  33997. lng = this._arcToDegree(cartographic.longitude);
  33998. lat = this._arcToDegree(cartographic.latitude);
  33999. height2 = cartographic.height;
  34000. }
  34001. }
  34002. }
  34003. return {
  34004. lng,
  34005. lat,
  34006. height: height2
  34007. };
  34008. }
  34009. _transfromFromScreenPoint(screenPosition) {
  34010. let location = this._getScreenClickPositionAndHeight(screenPosition);
  34011. if (location.lng != void 0) {
  34012. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  34013. return {
  34014. gLocation: location,
  34015. sLocation: cartesian
  34016. };
  34017. } else {
  34018. return {
  34019. gLocation: void 0,
  34020. sLocation: void 0
  34021. };
  34022. }
  34023. }
  34024. _removeEntityByName(entityName) {
  34025. var entities2 = this._entities;
  34026. if (!entities2 || !entities2.values)
  34027. return;
  34028. var delEntitys = [];
  34029. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  34030. if (entities2.values[i2].name == entityName) {
  34031. delEntitys.push(entities2.values[i2]);
  34032. }
  34033. }
  34034. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  34035. entities2.remove(delEntitys[i2]);
  34036. }
  34037. this._updateScene();
  34038. }
  34039. _removeEntityByObject(objEntity) {
  34040. if (!Cesium.defined(objEntity))
  34041. return;
  34042. this._entities.remove(objEntity);
  34043. }
  34044. _createPoint(coord, label2) {
  34045. let _self = this;
  34046. let entity = new Cesium.Entity({
  34047. name: _self._sketchEntityName + "_Point",
  34048. position: coord,
  34049. billboard: {
  34050. image: _self._sketchPointImage,
  34051. horizontalOrigin: Cesium.HorizontalOrigin.center,
  34052. verticalOrigin: Cesium.VerticalOrigin.bottom,
  34053. scale: 0.5,
  34054. pixelOffset: new Cesium.Cartesian2(0, -11),
  34055. disableDepthTestDistance: Number.POSITIVE_INFINITY
  34056. }
  34057. });
  34058. if (label2) {
  34059. entity.label = {
  34060. text: label2,
  34061. font: "12px sans-serif",
  34062. fillColor: this._toColor(255, 255, 255, 1),
  34063. outlineColor: this._toColor(0, 154, 94, 1),
  34064. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  34065. outlineWidth: 1,
  34066. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  34067. pixelOffset: new Cesium.Cartesian2(0, -28),
  34068. showBackground: true,
  34069. backgroundColor: this._toColor(0, 0, 0, 0.6),
  34070. disableDepthTestDistance: Number.POSITIVE_INFINITY
  34071. };
  34072. }
  34073. this._entities.add(entity);
  34074. this._pointEntitys.push(entity);
  34075. this._updateScene();
  34076. }
  34077. _removePointEntitys() {
  34078. this._removeEntityByName(this._sketchEntityName + "_Point");
  34079. this._pointEntitys = [];
  34080. }
  34081. _callUpdaeEllipseCenterPosition() {
  34082. let _self = this;
  34083. return function() {
  34084. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  34085. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  34086. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(
  34087. Cesium.Math.toDegrees(
  34088. point1cartographic.longitude
  34089. ),
  34090. Cesium.Math.toDegrees(point1cartographic.latitude),
  34091. point2cartographic.height
  34092. );
  34093. return _self._sketchEllipseCenterPosition;
  34094. };
  34095. }
  34096. _callUpdateEllipseMinorAxis(positions) {
  34097. let _self = this;
  34098. return function() {
  34099. if (positions === void 0 || positions.length === void 0 || positions.length < 2) {
  34100. _self._sketchEllipseRadius = 0;
  34101. } else {
  34102. _self._sketchEllipseRadius = _self._calculateEllipseMinorAxis(positions[0], positions[1]);
  34103. if (_self._sketchEllipseRadius <= 0)
  34104. _self._sketchEllipseRadius = 1;
  34105. }
  34106. return _self._sketchEllipseRadius;
  34107. };
  34108. }
  34109. _calculateEllipseMinorAxis(position1, position2) {
  34110. let point1cartographic = Cesium.Cartographic.fromCartesian(position1);
  34111. let point2cartographic = Cesium.Cartographic.fromCartesian(position2);
  34112. let geodesic = new Cesium.EllipsoidGeodesic();
  34113. geodesic.setEndPoints(point1cartographic, point2cartographic);
  34114. return geodesic.surfaceDistance;
  34115. }
  34116. _calculateEllipseOutlineCoordinate(position1, position2) {
  34117. let positionCenter = position1;
  34118. let positionRotate = position2;
  34119. let ellipseOutlineCoordinates = [];
  34120. for (let angle = 5; angle < 360; ) {
  34121. let newPosition = this._rotatedPointByAngle(positionRotate, positionCenter, angle);
  34122. ellipseOutlineCoordinates.push(newPosition);
  34123. angle = angle + 5;
  34124. }
  34125. ellipseOutlineCoordinates.push(ellipseOutlineCoordinates[0]);
  34126. return ellipseOutlineCoordinates;
  34127. }
  34128. _callEllipseOutlineCoordinate(positions) {
  34129. let _self = this;
  34130. return function() {
  34131. _self._ellipseOutlineCoordinates = _self._calculateEllipseOutlineCoordinate(positions[0], positions[1]);
  34132. return _self._ellipseOutlineCoordinates;
  34133. };
  34134. }
  34135. _rotatedPointByAngle(position_A, position_B, angle) {
  34136. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  34137. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  34138. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  34139. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  34140. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  34141. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  34142. var new_z = localPosition_A.z;
  34143. return Cesium.Matrix4.multiplyByPoint(
  34144. localToWorld_Matrix,
  34145. new Cesium.Cartesian3(new_x, new_y, new_z),
  34146. new Cesium.Cartesian3()
  34147. );
  34148. }
  34149. _callUpdateRectangleCoordinates(positions) {
  34150. let _self = this;
  34151. return function() {
  34152. let g0 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[0]);
  34153. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[1]);
  34154. let lng0 = Cesium.Math.toDegrees(g0.longitude);
  34155. let lat0 = Cesium.Math.toDegrees(g0.latitude);
  34156. let lng1 = Cesium.Math.toDegrees(g1.longitude);
  34157. let lat1 = Cesium.Math.toDegrees(g1.latitude);
  34158. _self._rectangleCoordinates = [0, 0, 1, 1];
  34159. if (lng0 < lng1) {
  34160. _self._rectangleCoordinates[0] = lng0;
  34161. _self._rectangleCoordinates[2] = lng1;
  34162. } else {
  34163. _self._rectangleCoordinates[0] = lng1;
  34164. _self._rectangleCoordinates[2] = lng0;
  34165. }
  34166. if (lat0 < lat1) {
  34167. _self._rectangleCoordinates[1] = lat0;
  34168. _self._rectangleCoordinates[3] = lat1;
  34169. } else {
  34170. _self._rectangleCoordinates[1] = lat1;
  34171. _self._rectangleCoordinates[3] = lat0;
  34172. }
  34173. let rectangle = Cesium.Rectangle.fromDegrees(
  34174. _self._rectangleCoordinates[0],
  34175. _self._rectangleCoordinates[1],
  34176. _self._rectangleCoordinates[2],
  34177. _self._rectangleCoordinates[3]
  34178. );
  34179. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  34180. _self._rectangleOutlineCoordinates = res.cPoints;
  34181. _self._sketchOutputPoints = res.gPoints;
  34182. return rectangle;
  34183. };
  34184. }
  34185. _calculateRectangleOutlineCoordinates(rectangle) {
  34186. let south_east = Cesium.Rectangle.southeast(rectangle);
  34187. let se2 = Cesium.Cartographic.toCartesian(south_east);
  34188. let south_west = Cesium.Rectangle.southwest(rectangle);
  34189. let sw = Cesium.Cartographic.toCartesian(south_west);
  34190. let north_east = Cesium.Rectangle.northeast(rectangle);
  34191. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  34192. let north_west = Cesium.Rectangle.northwest(rectangle);
  34193. let nw = Cesium.Cartographic.toCartesian(north_west);
  34194. let gPoints = [];
  34195. gPoints.push({
  34196. lng: Cesium.Math.toDegrees(south_west.longitude),
  34197. lat: Cesium.Math.toDegrees(south_west.latitude),
  34198. height: south_west.height
  34199. });
  34200. gPoints.push({
  34201. lng: Cesium.Math.toDegrees(south_east.longitude),
  34202. lat: Cesium.Math.toDegrees(south_east.latitude),
  34203. height: south_east.height
  34204. });
  34205. gPoints.push({
  34206. lng: Cesium.Math.toDegrees(north_east.longitude),
  34207. lat: Cesium.Math.toDegrees(north_east.latitude),
  34208. height: north_east.height
  34209. });
  34210. gPoints.push({
  34211. lng: Cesium.Math.toDegrees(north_west.longitude),
  34212. lat: Cesium.Math.toDegrees(north_west.latitude),
  34213. height: north_west.height
  34214. });
  34215. gPoints.push({
  34216. lng: Cesium.Math.toDegrees(south_west.longitude),
  34217. lat: Cesium.Math.toDegrees(south_west.latitude),
  34218. height: south_west.height
  34219. });
  34220. return {
  34221. cPoints: [sw, se2, ne2, nw, sw],
  34222. gPoints
  34223. };
  34224. }
  34225. _callUpdateRectangleOutlineCoordinates() {
  34226. let _self = this;
  34227. return function() {
  34228. return _self._rectangleOutlineCoordinates;
  34229. };
  34230. }
  34231. _materialTextImageProperty(options2) {
  34232. this._canvasId = "canvasJt";
  34233. let canvasObj = document.getElementById(this._canvasId);
  34234. if (canvasObj != null) {
  34235. document.body.removeChild(canvasObj);
  34236. }
  34237. canvasObj = document.createElement("canvas");
  34238. canvasObj.id = this._canvasId;
  34239. canvasObj.setAttribute("width", "1024px");
  34240. canvasObj.setAttribute("height", "256px");
  34241. document.body.appendChild(canvasObj);
  34242. let context = canvasObj.getContext("2d");
  34243. context.fillStyle = options2.color === void 0 ? "rgba(255,0,0,1)" : options2.color;
  34244. context.font = "bold 240px \u5FAE\u8F6F\u96C5\u9ED1";
  34245. context.textAlign = "left";
  34246. context.textBaseline = "bottom";
  34247. context.fillText(options2.text, 12, 250, 1e3);
  34248. let textMaterial = new Cesium.ImageMaterialProperty({
  34249. image: canvasObj,
  34250. transparent: true
  34251. });
  34252. textMaterial._param = {
  34253. color: context.fillStyle,
  34254. text: options2.text
  34255. };
  34256. return textMaterial;
  34257. }
  34258. _materialColorProperty(options2) {
  34259. let mColor = "rgba(0,255,0,1)";
  34260. if (options2 !== void 0 && options2.color !== void 0)
  34261. mColor = options2.color;
  34262. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34263. colorMaterial._param = {
  34264. color: mColor
  34265. };
  34266. return colorMaterial;
  34267. }
  34268. _materialPolylineArrowProperty(options2) {
  34269. let mColor = "rgba(0,255,0,1)";
  34270. if (options2 !== void 0 && options2.color !== void 0)
  34271. mColor = options2.color;
  34272. let colorMaterial = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34273. colorMaterial._param = {
  34274. color: mColor
  34275. };
  34276. return colorMaterial;
  34277. }
  34278. _materialPolylineGlowProperty(options2) {
  34279. let mColor = "rgba(0,255,0,1)";
  34280. if (options2 !== void 0 && options2.color !== void 0)
  34281. mColor = options2.color;
  34282. let power = 0.25;
  34283. if (options2 !== void 0 && options2.power !== void 0 && typeof options2.power === "number")
  34284. power = options2.power;
  34285. let colorMaterial = new Cesium.PolylineGlowMaterialProperty({
  34286. color: Cesium.Color.fromCssColorString(mColor),
  34287. glowPower: power
  34288. });
  34289. colorMaterial._param = {
  34290. color: mColor,
  34291. power
  34292. };
  34293. return colorMaterial;
  34294. }
  34295. _materialPolylineOutlineProperty(options2) {
  34296. let mColor = "rgba(0,255,0,1)";
  34297. let outlineColor = "rgba(255,255,255,1.0)";
  34298. let outlineWidth = 1.2;
  34299. if (options2 !== void 0 && options2.color !== void 0)
  34300. mColor = options2.color;
  34301. if (options2 !== void 0 && options2.outlineColor !== void 0)
  34302. outlineColor = options2.outlineColor;
  34303. if (options2 !== void 0 && options2.outlineWidth !== void 0 && typeof options2.outlineWidth === "number")
  34304. outlineWidth = options2.outlineWidth;
  34305. let colorMaterial = new Cesium.PolylineOutlineMaterialProperty({
  34306. color: Cesium.Color.fromCssColorString(mColor),
  34307. outlineColor: Cesium.Color.fromCssColorString(outlineColor),
  34308. outlineWidth
  34309. });
  34310. colorMaterial._param = {
  34311. color: mColor,
  34312. outlineColor,
  34313. outlineWidth
  34314. };
  34315. return colorMaterial;
  34316. }
  34317. _clear(isAll) {
  34318. if (isAll != void 0 && isAll === true) {
  34319. this._removeEntityByName(this._sketchEntityName);
  34320. this._removePointEntitys();
  34321. }
  34322. this._sketchTempPoints = [];
  34323. this._sketchPoints = [];
  34324. this._sketchOutputPoints = [];
  34325. this._sketchWallHeights = [];
  34326. this._drawEntity = void 0;
  34327. this._removeOperationDom();
  34328. this._tooltipRemove();
  34329. if (this._drawEventHandler !== null && this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  34330. this._clearEvent(this._drawEventHandler);
  34331. }
  34332. }
  34333. }
  34334. Object.assign(DrawTools.prototype, {
  34335. setLabel: function(options2) {
  34336. if (!options2) {
  34337. options2 = {
  34338. lineLabel: void 0,
  34339. polygonLabel: void 0
  34340. };
  34341. }
  34342. if (options2.lineLabel)
  34343. this._lineLabel = options2.lineLabel;
  34344. if (options2.polygonLabel)
  34345. this._lineLabel = options2.polygonLabel;
  34346. }
  34347. });
  34348. Object.assign(DrawTools.prototype, {
  34349. _registerLeftClickEvent: function(handler, callChange) {
  34350. let _self = this;
  34351. if (!handler)
  34352. return;
  34353. handler.setInputAction(function(event2) {
  34354. _self._lock = true;
  34355. clearTimeout(_self._timer);
  34356. _self._timer = setTimeout(function() {
  34357. if (callChange)
  34358. callChange(event2);
  34359. _self._lock = false;
  34360. }, 200);
  34361. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  34362. },
  34363. _registerLeftDoubleClickEvent: function(handler, callChange) {
  34364. let _self = this;
  34365. if (!handler)
  34366. return;
  34367. handler.setInputAction(function(event2) {
  34368. clearTimeout(_self._timer);
  34369. _self._lock = false;
  34370. if (callChange)
  34371. callChange(event2);
  34372. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  34373. },
  34374. _registerMouseMoveEvent: function(handler, callChange) {
  34375. let _self = this;
  34376. if (!handler)
  34377. return;
  34378. handler.setInputAction(function(event2) {
  34379. if (_self._lock === void 0 || _self._lock === false) {
  34380. if (callChange)
  34381. callChange(event2);
  34382. }
  34383. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  34384. },
  34385. _registerRightClickEvent: function(handler, callChange) {
  34386. if (!handler)
  34387. return;
  34388. handler.setInputAction(function(event2) {
  34389. if (callChange)
  34390. callChange(event2);
  34391. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  34392. },
  34393. _registerLeftDownEvent: function(handler, callChange) {
  34394. if (!handler)
  34395. return;
  34396. handler.setInputAction(function(event2) {
  34397. if (callChange)
  34398. callChange(event2);
  34399. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  34400. },
  34401. _registerLeftUpEvent: function(handler, callChange) {
  34402. if (!handler)
  34403. return;
  34404. handler.setInputAction(function(event2) {
  34405. if (callChange)
  34406. callChange(event2);
  34407. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  34408. },
  34409. _clearEvent: function(handler) {
  34410. this._endTooltip();
  34411. this._removeOperationDom();
  34412. if (!handler)
  34413. return;
  34414. handler.destroy();
  34415. handler = null;
  34416. }
  34417. });
  34418. Object.assign(DrawTools.prototype, {
  34419. _createPolyline: function(polylineType) {
  34420. let _self = this;
  34421. let entityParam = DrawTools.initEditPropertyParams();
  34422. let polylineWidth = _self._param.lineWidth;
  34423. let polylineMaterial = this._materialColorProperty({
  34424. color: _self._param.lineColor
  34425. });
  34426. entityParam.id = DrawTools.DrawType.Polyline;
  34427. if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.ArrowsPolyline) {
  34428. polylineMaterial = this._materialPolylineArrowProperty({
  34429. color: _self._param.lineColor
  34430. });
  34431. polylineWidth = _self._param.lineWidth * 3;
  34432. entityParam.color = _self._param.lineColor;
  34433. entityParam.id = DrawTools.DrawType.ArrowPolyline;
  34434. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.GrowPolyline) {
  34435. polylineMaterial = this._materialPolylineGlowProperty({
  34436. color: _self._param.lineColor,
  34437. power: _self._param.power
  34438. });
  34439. polylineWidth = _self._param.lineWidth * 3;
  34440. entityParam.color = _self._param.lineColor;
  34441. entityParam.power = _self._param.power;
  34442. entityParam.id = DrawTools.DrawType.GrowPolyline;
  34443. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.OutlinePolyline) {
  34444. polylineMaterial = this._materialPolylineOutlineProperty({
  34445. color: _self._param.lineColor,
  34446. outlineColor: _self._param.outlineColor,
  34447. outlineWidth: _self._param.outlineWidth
  34448. });
  34449. polylineWidth = _self._param.lineWidth * 2;
  34450. entityParam.color = _self._param.lineColor;
  34451. entityParam.outlineColor = _self._param.outlineColor;
  34452. entityParam.outlineWidth = _self._param.outlineWidth;
  34453. entityParam.id = DrawTools.DrawType.OutlinePolyline;
  34454. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.DynamicPolyline) {
  34455. polylineMaterial = new WallMaterialProperty({
  34456. viewer: _self._viewer,
  34457. trailImage: _self._image_h_l_r,
  34458. duration: _self._param.duration,
  34459. color: Cesium.Color.fromCssColorString(_self._param.lineColor),
  34460. param: {
  34461. direction: _self._param.direction_h,
  34462. count: _self._param.count,
  34463. order: _self._param.order_minus
  34464. }
  34465. });
  34466. polylineWidth = _self._param.lineWidth;
  34467. entityParam.color = _self._param.lineColor;
  34468. entityParam.duration = _self._param.duration;
  34469. entityParam.direction = _self._param.direction_h;
  34470. entityParam.count = _self._param.count;
  34471. entityParam.order = _self._param.order_minus;
  34472. entityParam.id = DrawTools.DrawType.DynamicPolyline;
  34473. }
  34474. entityParam.lineWidth = polylineWidth;
  34475. let entityPolyline = new Cesium.Entity({
  34476. name: _self._sketchEntityName,
  34477. polyline: {
  34478. show: true,
  34479. positions: new Cesium.CallbackProperty(function() {
  34480. return _self._sketchTempPoints;
  34481. }, false),
  34482. material: polylineMaterial,
  34483. width: polylineWidth,
  34484. clampToGround: true
  34485. }
  34486. });
  34487. this._drawEntity = this._entities.add(entityPolyline);
  34488. this._drawEntity.setParams(entityParam);
  34489. },
  34490. _updatePolyline: function(isEdit) {
  34491. this._drawEntity.polyline.positions = this._sketchPoints;
  34492. this._drawEntity.setEntityType(DrawTools.DrawType.Polyline);
  34493. if (isEdit != void 0 && isEdit === true) {
  34494. this._removePointEntitys();
  34495. this._setEntityIsEdit(this._drawEntity);
  34496. }
  34497. },
  34498. _createSpatialPolyline: function() {
  34499. let _self = this;
  34500. let entityParam = DrawTools.initEditPropertyParams();
  34501. let lineMaterial = this._materialColorProperty({
  34502. color: _self._param.lineColor
  34503. });
  34504. entityParam.id = DrawTools.DrawType.SpatialLine;
  34505. entityParam.color = _self._param.lineColor;
  34506. entityParam.lineWidth = _self._param.lineWidth;
  34507. let entity = new Cesium.Entity({
  34508. name: _self._sketchEntityName,
  34509. polyline: {
  34510. show: true,
  34511. positions: new Cesium.CallbackProperty(function() {
  34512. return _self._sketchTempPoints;
  34513. }, false),
  34514. material: lineMaterial,
  34515. width: _self._param.lineWidth,
  34516. clampToGround: false
  34517. }
  34518. });
  34519. this._drawEntity = this._entities.add(entity);
  34520. this._drawEntity.setParams(entityParam);
  34521. },
  34522. _updateSpatialPolyline: function(isEdit) {
  34523. this._drawEntity.polyline.positions = this._sketchPoints;
  34524. this._drawEntity.setEntityType(DrawTools.DrawType.SpatialLine);
  34525. if (isEdit != void 0 && isEdit === true) {
  34526. this._removePointEntitys();
  34527. this._setEntityIsEdit(this._drawEntity);
  34528. }
  34529. },
  34530. _createPolygon: function(polygonType) {
  34531. let _self = this;
  34532. let entityParam = DrawTools.initEditPropertyParams();
  34533. let polygonMaterial = this._materialColorProperty({
  34534. color: _self._param.polygonColor
  34535. });
  34536. let lineMaterial = this._materialColorProperty({
  34537. color: _self._param.outlineColor
  34538. });
  34539. let entityPolygon = new Cesium.Entity({
  34540. name: _self._sketchEntityName,
  34541. polygon: {
  34542. show: true,
  34543. hierarchy: new Cesium.CallbackProperty(function() {
  34544. return {
  34545. positions: _self._sketchTempPoints
  34546. };
  34547. }, false),
  34548. material: polygonMaterial,
  34549. classificationType: Cesium.ClassificationType.BOTH
  34550. },
  34551. polyline: {
  34552. show: true,
  34553. positions: new Cesium.CallbackProperty(function() {
  34554. return _self._sketchTempPoints;
  34555. }, false),
  34556. material: lineMaterial,
  34557. width: _self._param.outlineWidth,
  34558. clampToGround: true
  34559. }
  34560. });
  34561. entityParam.color = _self._param.polygonColor;
  34562. entityParam.outlineColor = _self._param.outlineColor;
  34563. entityParam.outlineWidth = _self._param.outlineWidth;
  34564. this._drawEntity = this._entities.add(entityPolygon);
  34565. if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.NormalPolygon) {
  34566. this._drawEntity.setEntityType(DrawTools.DrawType.Polygon);
  34567. entityParam.id = DrawTools.DrawType.Polygon;
  34568. } else if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.HousePolygon) {
  34569. this._drawEntity.setEntityType(DrawTools.DrawType.House);
  34570. entityParam.id = DrawTools.DrawType.House;
  34571. }
  34572. this._drawEntity.setParams(entityParam);
  34573. },
  34574. _updatePolygon: function(isEdit) {
  34575. let _self = this;
  34576. let houseMaterial = this._materialColorProperty({
  34577. color: _self._param.houseColor
  34578. });
  34579. let entityType = this._drawEntity.getEntityType();
  34580. if (entityType === DrawTools.DrawType.Polygon) {
  34581. this._drawEntity.polygon.hierarchy = {
  34582. positions: _self._sketchPoints
  34583. };
  34584. this._drawEntity.polyline.positions = this._sketchPoints;
  34585. } else if (entityType === DrawTools.DrawType.House) {
  34586. let entityParam = this._drawEntity.getParams();
  34587. this._removeEntityByObject(this._drawEntity);
  34588. let height2 = parseFloat(this._sketchOutputPoints[0].height);
  34589. let houseHeight = height2 + parseInt(_self._param.wallHeight);
  34590. let houseEntity = new Cesium.Entity({
  34591. name: _self._sketchEntityName,
  34592. polygon: {
  34593. show: true,
  34594. hierarchy: {
  34595. positions: _self._sketchPoints
  34596. },
  34597. extrudedHeight: houseHeight,
  34598. material: houseMaterial
  34599. }
  34600. });
  34601. this._drawEntity = this._entities.add(houseEntity);
  34602. this._drawEntity.setEntityType(entityType);
  34603. entityParam.height = _self._param.wallHeight;
  34604. entityParam.bottomHeight = height2;
  34605. entityParam.color = _self._param.houseColor;
  34606. this._drawEntity.setParams(entityParam);
  34607. }
  34608. if (isEdit != void 0 && isEdit === true) {
  34609. this._removePointEntitys();
  34610. this._setEntityIsEdit(this._drawEntity);
  34611. }
  34612. },
  34613. _createRectangle: function() {
  34614. let _self = this;
  34615. let entityParam = DrawTools.initEditPropertyParams();
  34616. let rectMaterial = this._materialColorProperty({
  34617. color: _self._param.polygonColor
  34618. });
  34619. let lineMaterial = this._materialColorProperty({
  34620. color: _self._param.outlineColor
  34621. });
  34622. let entityRectangle = new Cesium.Entity({
  34623. name: _self._sketchEntityName,
  34624. polyline: {
  34625. show: true,
  34626. positions: new Cesium.CallbackProperty(
  34627. _self._callUpdateRectangleOutlineCoordinates(),
  34628. false
  34629. ),
  34630. material: lineMaterial,
  34631. width: _self._param.outlineWidth,
  34632. clampToGround: true
  34633. },
  34634. rectangle: {
  34635. show: true,
  34636. coordinates: new Cesium.CallbackProperty(
  34637. _self._callUpdateRectangleCoordinates(
  34638. _self._sketchTempPoints
  34639. ),
  34640. false
  34641. ),
  34642. material: rectMaterial,
  34643. classificationType: Cesium.ClassificationType.BOTH
  34644. }
  34645. });
  34646. entityParam.id = DrawTools.DrawType.Rectangle;
  34647. entityParam.color = _self._param.polygonColor;
  34648. entityParam.outlineColor = _self._param.outlineColor;
  34649. entityParam.outlineWidth = _self._param.outlineWidth;
  34650. this._drawEntity = this._entities.add(entityRectangle);
  34651. this._drawEntity.setParams(entityParam);
  34652. },
  34653. _updateRectangle(isEdit) {
  34654. this._drawEntity.polyline.positions = this._rectangleOutlineCoordinates;
  34655. let coordinates = this._rectangleCoordinates;
  34656. this._drawEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
  34657. this._drawEntity.setEntityType(DrawTools.DrawType.Rectangle);
  34658. if (isEdit != void 0 && isEdit === true) {
  34659. this._setEntityIsEdit(this._drawEntity);
  34660. }
  34661. },
  34662. _createCircle: function(centerPosition, circleType) {
  34663. let _self = this;
  34664. let entityParam = DrawTools.initEditPropertyParams();
  34665. let circleMaterial = this._materialColorProperty({
  34666. color: _self._param.polygonColor
  34667. });
  34668. let lineMaterial = this._materialColorProperty({
  34669. color: _self._param.outlineColor
  34670. });
  34671. if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34672. circleMaterial = new CircleMaterialProperty({
  34673. viewer: _self._viewer,
  34674. duration: _self._param.duration,
  34675. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34676. count: _self._param.count
  34677. });
  34678. }
  34679. this._sketchEllipseCenterPosition = centerPosition.clone();
  34680. let entityCircle = new Cesium.Entity({
  34681. name: _self._sketchEntityName,
  34682. position: centerPosition,
  34683. ellipse: {
  34684. show: true,
  34685. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34686. _self._sketchTempPoints
  34687. ), false),
  34688. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34689. _self._sketchTempPoints
  34690. ), false),
  34691. material: circleMaterial,
  34692. classificationType: Cesium.ClassificationType.BOTH
  34693. }
  34694. });
  34695. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34696. entityCircle.polyline = {
  34697. show: true,
  34698. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(
  34699. _self._sketchTempPoints
  34700. ), false),
  34701. material: lineMaterial,
  34702. width: _self._param.outlineWidth,
  34703. clampToGround: true
  34704. };
  34705. }
  34706. this._drawEntity = this._entities.add(entityCircle);
  34707. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34708. this._drawEntity.setEntityType(DrawTools.DrawType.Circle);
  34709. entityParam.id = DrawTools.DrawType.Circle;
  34710. entityParam.color = _self._param.polygonColor;
  34711. entityParam.outlineColor = _self._param.outlineColor;
  34712. entityParam.outlineWidth = _self._param.outlineWidth;
  34713. } else if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34714. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicCircle);
  34715. entityParam.id = DrawTools.DrawType.DynamicCircle;
  34716. entityParam.color = _self._param.polygonColor;
  34717. entityParam.duration = _self._param.duration;
  34718. entityParam.count = _self._param.count;
  34719. }
  34720. this._drawEntity.setParams(entityParam);
  34721. },
  34722. _updateCircle(isEdit) {
  34723. this._drawEntity.position = this._sketchEllipseCenterPosition;
  34724. let center2 = this._sketchTempPoints.first();
  34725. let outpoint = this._sketchTempPoints.last();
  34726. this._ellipseOutlineCoordinates = this._calculateEllipseOutlineCoordinate(center2, outpoint);
  34727. this._sketchEllipseRadius = this._calculateEllipseMinorAxis(center2, outpoint);
  34728. if (this._drawEntity.polyline != void 0) {
  34729. this._drawEntity.polyline.positions = this._ellipseOutlineCoordinates;
  34730. }
  34731. this._drawEntity.ellipse.semiMajorAxis = this._sketchEllipseRadius;
  34732. this._drawEntity.ellipse.semiMinorAxis = this._sketchEllipseRadius;
  34733. if (isEdit != void 0 && isEdit === true) {
  34734. this._setEntityIsEdit(this._drawEntity);
  34735. }
  34736. },
  34737. _createWall: function(wallType) {
  34738. let _self = this;
  34739. let entityParam = DrawTools.initEditPropertyParams();
  34740. let wallMaterial = this._materialColorProperty({
  34741. color: _self._param.polygonColor
  34742. });
  34743. entityParam.color = _self._param.polygonColor;
  34744. if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34745. wallMaterial = this._materialTextImageProperty({
  34746. color: _self._param.polygonColor,
  34747. text: _self._param.text
  34748. });
  34749. entityParam.text = _self._param.text;
  34750. entityParam.color = _self._param.polygonColor;
  34751. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34752. wallMaterial = new WallMaterialProperty({
  34753. viewer: _self._viewer,
  34754. trailImage: _self._image_v_t_b,
  34755. duration: _self._param.duration,
  34756. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34757. param: {
  34758. count: _self._param.count,
  34759. direction: _self._param.direction_v,
  34760. order: _self._param.order_minus
  34761. }
  34762. });
  34763. entityParam.color = _self._param.polygonColor;
  34764. entityParam.duration = _self._param.duration;
  34765. entityParam.direction = _self._param.direction_v;
  34766. entityParam.count = _self._param.count;
  34767. entityParam.order = _self._param.order_minus;
  34768. }
  34769. let normalWall = new Cesium.Entity({
  34770. name: _self._sketchEntityName,
  34771. wall: {
  34772. show: true,
  34773. positions: new Cesium.CallbackProperty(function() {
  34774. return _self._sketchTempPoints;
  34775. }, false),
  34776. minimumHeights: new Cesium.CallbackProperty(function() {
  34777. return _self._sketchWallHeights;
  34778. }, false),
  34779. maximumHeights: new Cesium.CallbackProperty(function() {
  34780. _self._sketchWallMaxHeights = [];
  34781. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  34782. _self._sketchWallMaxHeights.push(_self._sketchWallHeights[i2] + _self._param.wallHeight);
  34783. }
  34784. return _self._sketchWallMaxHeights;
  34785. }, false),
  34786. material: wallMaterial
  34787. }
  34788. });
  34789. this._drawEntity = this._entities.add(normalWall);
  34790. entityParam.height = this._param.wallHeight;
  34791. if (wallType === void 0 || wallType === DrawTools.WallType.ColorWall) {
  34792. this._drawEntity.setEntityType(DrawTools.DrawType.NormalWall);
  34793. entityParam.id = DrawTools.DrawType.NormalWall;
  34794. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34795. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicWall);
  34796. entityParam.id = DrawTools.DrawType.DynamicWall;
  34797. } else if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34798. this._drawEntity.setEntityType(DrawTools.DrawType.TextWall);
  34799. entityParam.id = DrawTools.DrawType.TextWall;
  34800. }
  34801. this._drawEntity.setParams(entityParam);
  34802. },
  34803. _updateWall: function(isEdit) {
  34804. let hLength = this._sketchWallHeights.length;
  34805. let mhLength = this._sketchWallMaxHeights.length;
  34806. let pLength = this._sketchPoints.length;
  34807. if (hLength === mhLength && hLength - pLength === 1) {
  34808. this._sketchWallHeights.pop();
  34809. this._sketchWallMaxHeights.pop();
  34810. this._drawEntity.wall.positions = this._sketchPoints;
  34811. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34812. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34813. if (isEdit != void 0 && isEdit === true) {
  34814. this._removePointEntitys();
  34815. this._setEntityIsEdit(this._drawEntity);
  34816. }
  34817. } else {
  34818. this._console(hLength, mhLength, pLength);
  34819. }
  34820. },
  34821. _createVideoWall: function() {
  34822. let _self = this;
  34823. let entityWall = new Cesium.Entity({
  34824. name: _self._sketchEntityName,
  34825. position: _self._sketchOutputPoints[0],
  34826. wall: {
  34827. show: true,
  34828. positions: new Cesium.CallbackProperty(function() {
  34829. let pt0 = _self._sketchOutputPoints[0];
  34830. let pt1 = _self._sketchOutputPoints[1];
  34831. _self._wallPositions = [];
  34832. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34833. pt0.lng,
  34834. pt0.lat,
  34835. pt0.height
  34836. ));
  34837. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34838. pt1.lng,
  34839. pt1.lat,
  34840. pt0.height
  34841. ));
  34842. return _self._wallPositions;
  34843. }, false),
  34844. maximumHeights: new Cesium.CallbackProperty(function() {
  34845. _self._sketchWallHeights = [];
  34846. let pt2 = _self._sketchOutputPoints[0];
  34847. _self._sketchWallHeights.push(pt2.height);
  34848. _self._sketchWallHeights.push(pt2.height);
  34849. return _self._sketchWallHeights;
  34850. }, false),
  34851. minimumHeights: new Cesium.CallbackProperty(function() {
  34852. _self._sketchWallMaxHeights = [];
  34853. let pt2 = _self._sketchOutputPoints[1];
  34854. _self._sketchWallMaxHeights.push(pt2.height);
  34855. _self._sketchWallMaxHeights.push(pt2.height);
  34856. return _self._sketchWallMaxHeights;
  34857. }, false),
  34858. material: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34859. outline: true,
  34860. outlineColor: Cesium.Color.fromCssColorString(_self._param.outlineColor),
  34861. outlineWidth: _self._param.outlineWidth
  34862. }
  34863. });
  34864. _self._drawEntity = _self._entities.add(entityWall);
  34865. },
  34866. _updateVideoWall: function(isEdit) {
  34867. let entityParam = DrawTools.initEditPropertyParams();
  34868. entityParam.id = DrawTools.DrawType.VideoWall;
  34869. let videoElement = document.getElementById("wallVideo");
  34870. if (videoElement !== null) {
  34871. document.body.removeChild(videoElement);
  34872. }
  34873. videoElement = document.createElement("video");
  34874. videoElement.id = "wallVideo";
  34875. videoElement.setAttribute("crossorigin", "anonymous");
  34876. videoElement.setAttribute("width", "1024px");
  34877. videoElement.setAttribute("height", "256px");
  34878. videoElement.setAttribute("controls", "controls");
  34879. videoElement.setAttribute(
  34880. "src",
  34881. "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4"
  34882. );
  34883. videoElement.setAttribute("loop", "loop");
  34884. videoElement.play();
  34885. document.body.appendChild(videoElement);
  34886. this._drawEntity.wall.positions = this._wallPositions;
  34887. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34888. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34889. entityParam.height = this._sketchWallMaxHeights[0] - this._sketchWallHeights[0];
  34890. this._drawEntity.wall.material = videoElement;
  34891. this._removePointEntitys();
  34892. this._drawEntity.setEntityType(DrawTools.DrawType.VideoWall);
  34893. entityParam.videoUrl = "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4";
  34894. entityParam.id = DrawTools.DrawType.VideoWall;
  34895. this._drawEntity.setParams(entityParam);
  34896. if (isEdit != void 0 && isEdit === true) {
  34897. this._setEntityIsEdit(this._drawEntity);
  34898. }
  34899. },
  34900. _calculateOdlinePositios: function(strPoint, endPoint, height2, count) {
  34901. let pt1 = this._cartesian3ToGeo(strPoint);
  34902. let pt2 = this._cartesian3ToGeo(endPoint);
  34903. var h2 = height2 && height2 < 1e3 ? height2 : 1e3;
  34904. var L = Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude) ? Math.abs(pt1.longitude - pt2.longitude) : Math.abs(pt1.latitude - pt2.latitude);
  34905. var num = count && count > 50 ? count : 50;
  34906. var result = [];
  34907. var tempResult = [];
  34908. var dlt = L / num;
  34909. var addHeight = pt1.height > pt2.height ? pt1.height : pt2.height;
  34910. var maxHeight = addHeight + h2;
  34911. var minHeight1 = pt1.height;
  34912. var minHeight2 = pt2.height;
  34913. if (Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude)) {
  34914. var delLat = (pt2.latitude - pt1.latitude) / num;
  34915. if (pt1.longitude - pt2.longitude > 0) {
  34916. dlt = -dlt;
  34917. }
  34918. for (var i2 = 1; i2 < num; i2++) {
  34919. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34920. var lon = pt1.longitude + dlt * i2;
  34921. var lat = pt1.latitude + delLat * i2;
  34922. var alt = void 0;
  34923. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34924. alt = maxHeight;
  34925. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34926. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34927. } else {
  34928. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34929. }
  34930. tempResult.push([lon, lat, alt]);
  34931. }
  34932. } else {
  34933. var delLon = (pt2.longitude - pt1.longitude) / num;
  34934. if (pt1.latitude - pt2.latitude > 0) {
  34935. dlt = -dlt;
  34936. }
  34937. for (var i2 = 1; i2 < num; i2++) {
  34938. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34939. var lon = pt1.longitude + delLon * i2;
  34940. var lat = pt1.latitude + dlt * i2;
  34941. var alt = void 0;
  34942. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34943. alt = maxHeight;
  34944. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34945. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34946. } else {
  34947. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34948. }
  34949. tempResult.push([lon, lat, alt]);
  34950. }
  34951. }
  34952. result.push([pt1.longitude, pt1.latitude, pt1.height]);
  34953. for (var i2 = 0; i2 < tempResult.length; i2++) {
  34954. result.push(tempResult[i2]);
  34955. }
  34956. result.push([pt2.longitude, pt2.latitude, pt2.height]);
  34957. let results = [];
  34958. for (let i3 = 0; i3 < result.length; i3++) {
  34959. results.push(Cesium.Cartesian3.fromDegrees(result[i3][0], result[i3][1], result[i3][2]));
  34960. }
  34961. return results;
  34962. },
  34963. _createOdline: function(isFirst) {
  34964. let _self = this;
  34965. if (isFirst !== void 0 && isFirst === true) {
  34966. let fatherEntity = new Cesium.Entity({
  34967. name: this._sketchEntityName
  34968. });
  34969. this._odlineFatherEntity = this._entities.add(fatherEntity);
  34970. let entityParam = DrawTools.initEditPropertyParams();
  34971. entityParam.id = DrawTools.DrawType.OdLine;
  34972. entityParam.color = _self._param.polygonColor;
  34973. entityParam.duration = _self._param.duration;
  34974. entityParam.direction = _self._param.direction_h;
  34975. entityParam.count = _self._param.count;
  34976. entityParam.order = _self._param.order_add;
  34977. entityParam.odlineHeight = _self._param.odlineHeight;
  34978. entityParam.odlineCount = _self._param.odlineCount;
  34979. entityParam.lineWidth = _self._param.lineWidth * 3;
  34980. this._odlineFatherEntity.setParams(entityParam);
  34981. this._odlineEntitys = [];
  34982. }
  34983. let faterParam = this._odlineFatherEntity.getParams();
  34984. let odLineMaterial = new WallMaterialProperty({
  34985. viewer: _self._viewer,
  34986. trailImage: _self._image_arrow_reverse,
  34987. duration: faterParam.duration,
  34988. color: Cesium.Color.fromCssColorString(faterParam.color),
  34989. param: {
  34990. direction: faterParam.direction,
  34991. count: faterParam.count,
  34992. order: faterParam.order
  34993. }
  34994. });
  34995. let entity = new Cesium.Entity({
  34996. name: _self._sketchEntityName,
  34997. parent: this._odlineFatherEntity,
  34998. polyline: {
  34999. show: true,
  35000. positions: new Cesium.CallbackProperty(function() {
  35001. let center2 = _self._sketchTempPoints[0];
  35002. let endPoint = _self._sketchTempPoints[_self._sketchTempPoints.length - 1];
  35003. let results = _self._calculateOdlinePositios(
  35004. center2,
  35005. endPoint,
  35006. parseInt(
  35007. faterParam.odlineHeight
  35008. ),
  35009. parseInt(faterParam.odlineCount)
  35010. );
  35011. return results;
  35012. }, false),
  35013. material: odLineMaterial,
  35014. width: faterParam.lineWidth,
  35015. clampToGround: false
  35016. }
  35017. });
  35018. this._drawEntity = this._entities.add(entity);
  35019. },
  35020. _updateOdline: function(isLast, isEdit) {
  35021. if (isLast !== void 0 && isLast === true) {
  35022. if (isEdit !== void 0 && isEdit === true) {
  35023. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  35024. this._setEntityIsEdit(this._drawEntity);
  35025. this._drawEntity.parent.setIsEdit(true);
  35026. }
  35027. } else {
  35028. let params = this._drawEntity.parent.getParams();
  35029. let center2 = this._sketchTempPoints[0];
  35030. let endPoint = this._sketchTempPoints[this._sketchTempPoints.length - 1];
  35031. let results = this._calculateOdlinePositios(
  35032. center2,
  35033. endPoint,
  35034. parseInt(params.odlineHeight),
  35035. parseInt(params.odlineCount)
  35036. );
  35037. this._drawEntity.polyline.positions = results;
  35038. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  35039. this._odlineEntitys.push(this._drawEntity);
  35040. if (isEdit !== void 0 && isEdit === true) {
  35041. this._drawEntity.setIsEdit(true);
  35042. }
  35043. }
  35044. },
  35045. _guid() {
  35046. function S4() {
  35047. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  35048. }
  35049. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  35050. },
  35051. _console(...rest) {
  35052. console.log("===>>>", rest);
  35053. }
  35054. });
  35055. Object.assign(DrawTools.prototype, {
  35056. _drawMovingDoubleTooltip(position2) {
  35057. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236,\u53F3\u952E\u5355\u51FB\u64A4\u9500<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  35058. },
  35059. _drawMovingSimpleTooltip(position2) {
  35060. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  35061. },
  35062. _removeLastDrawPointEntity() {
  35063. let lastPointEntity = this._pointEntitys.last();
  35064. if (lastPointEntity !== void 0) {
  35065. this._removeEntityByObject(lastPointEntity);
  35066. this._pointEntitys.pop();
  35067. }
  35068. },
  35069. _sketchDrawPoint(handler, options2) {
  35070. let _self = this;
  35071. this._registerLeftClickEvent(handler, function(event2) {
  35072. let scene = _self._viewer.scene;
  35073. if (scene.mode !== Cesium.SceneMode.MORPHING) {
  35074. var pickedObject = scene.pick(event2.position);
  35075. if (scene.pickPositionSupported && Cesium.defined(pickedObject)) {
  35076. var cartesian = scene.pickPosition(event2.position);
  35077. if (Cesium.defined(cartesian)) {
  35078. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  35079. var lng = Cesium.Math.toDegrees(cartographic.longitude);
  35080. var lat = Cesium.Math.toDegrees(cartographic.latitude);
  35081. var height2 = cartographic.height;
  35082. _self._sketchOutputPoints.push({
  35083. lng,
  35084. lat,
  35085. height: height2
  35086. });
  35087. }
  35088. _self._createPoint(cartesian, "\u70B9");
  35089. _self._sketchPoints.push(cartesian.clone());
  35090. if (_self._sketchPoints.length >= 2) {
  35091. _self._createVideoWall();
  35092. _self._clearEvent(handler);
  35093. }
  35094. }
  35095. }
  35096. if (options2.onComplete)
  35097. options2.onComplete(loc.sLocation, loc.gLocation);
  35098. });
  35099. },
  35100. _sketchDrawMultiplePoint(handler, options2) {
  35101. let _self = this;
  35102. this._registerLeftClickEvent(handler, function(event2) {
  35103. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35104. if (!Cesium.defined(loc2.sLocation))
  35105. return;
  35106. if (_self._isDrawPoint) {
  35107. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35108. }
  35109. _self._sketchPoints.push(loc2.sLocation);
  35110. _self._sketchOutputPoints.push(loc2.gLocation);
  35111. if (options2.onAdded)
  35112. options2.onAdded(loc2.sLocation, loc2.gLocation);
  35113. });
  35114. this._registerRightClickEvent(handler, function(event2) {
  35115. if (_self._sketchPoints.length > 0) {
  35116. _self._sketchPoints.pop();
  35117. _self._sketchOutputPoints.pop();
  35118. if (options2.onUndo)
  35119. options2.onUndo();
  35120. }
  35121. });
  35122. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35123. _self._clearEvent(handler);
  35124. if (options2.onComplete)
  35125. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35126. });
  35127. },
  35128. _sketchDrawPolyline(handler, options2) {
  35129. let _self = this;
  35130. this._registerLeftClickEvent(handler, function(event2) {
  35131. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35132. if (!Cesium.defined(loc2.sLocation))
  35133. return;
  35134. if (_self._isDrawPoint) {
  35135. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35136. }
  35137. if (_self._sketchTempPoints.length === 0) {
  35138. _self._createPolyline(options2.polylineType);
  35139. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35140. }
  35141. _self._sketchTempPoints.push(loc2.sLocation);
  35142. _self._sketchPoints.push(loc2.sLocation.clone());
  35143. _self._sketchOutputPoints.push(loc2.gLocation);
  35144. if (options2.onAdded)
  35145. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35146. _self._createOperationDom();
  35147. });
  35148. this._registerMouseMoveEvent(handler, function(event2) {
  35149. if (_self._isRuntimeApp())
  35150. return;
  35151. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35152. if (!Cesium.defined(loc2.sLocation))
  35153. return;
  35154. if (_self._sketchTempPoints.length > 1) {
  35155. _self._drawMovingDoubleTooltip(event2.endPosition);
  35156. _self._sketchTempPoints.pop();
  35157. _self._sketchTempPoints.push(loc2.sLocation);
  35158. if (options2.onMoving)
  35159. options2.onMoving(loc2.sLocation);
  35160. }
  35161. });
  35162. this._registerRightClickEvent(handler, function(event2) {
  35163. if (_self._sketchTempPoints.length > 2) {
  35164. _self._drawByUndo();
  35165. if (options2.onUndo)
  35166. options2.onUndo();
  35167. }
  35168. });
  35169. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35170. if (_self._sketchPoints.length < 2) {
  35171. if (options2.onError)
  35172. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35173. return;
  35174. }
  35175. _self._updatePolyline(options2.isEdit);
  35176. if (!_self._isRetainDrawPoint)
  35177. _self._removePointEntitys();
  35178. _self._clearEvent(handler);
  35179. if (options2.onComplete)
  35180. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35181. });
  35182. },
  35183. _sketchDrawSpatialPolyline(handler, options2) {
  35184. let _self = this;
  35185. this._registerLeftClickEvent(handler, function(event2) {
  35186. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35187. if (!Cesium.defined(loc2.sLocation))
  35188. return;
  35189. if (_self._isDrawPoint) {
  35190. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35191. }
  35192. if (_self._sketchTempPoints.length === 0) {
  35193. _self._createSpatialPolyline();
  35194. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35195. }
  35196. _self._sketchTempPoints.push(loc2.sLocation);
  35197. _self._sketchPoints.push(loc2.sLocation.clone());
  35198. _self._sketchOutputPoints.push(loc2.gLocation);
  35199. if (options2.onAdded)
  35200. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35201. _self._createOperationDom();
  35202. });
  35203. this._registerMouseMoveEvent(handler, function(event2) {
  35204. if (_self._isRuntimeApp())
  35205. return;
  35206. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35207. if (!Cesium.defined(loc2.sLocation))
  35208. return;
  35209. if (_self._sketchTempPoints.length > 1) {
  35210. _self._drawMovingDoubleTooltip(event2.endPosition);
  35211. _self._sketchTempPoints.pop();
  35212. _self._sketchTempPoints.push(loc2.sLocation);
  35213. if (options2.onMoving)
  35214. options2.onMoving(loc2.sLocation);
  35215. }
  35216. });
  35217. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35218. if (_self._sketchPoints.length < 2) {
  35219. if (options2.onError)
  35220. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35221. return;
  35222. }
  35223. _self._updateSpatialPolyline(options2.isEdit);
  35224. _self._removePointEntitys();
  35225. _self._clearEvent(handler);
  35226. if (options2.onComplete)
  35227. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35228. });
  35229. this._registerRightClickEvent(handler, function(event2) {
  35230. if (_self._sketchTempPoints.length > 2) {
  35231. _self._drawByUndo();
  35232. if (options2.onUndo)
  35233. options2.onUndo();
  35234. }
  35235. });
  35236. },
  35237. _sketchDrawOdline(handler, options2) {
  35238. let _self = this;
  35239. this._registerLeftClickEvent(handler, function(event2) {
  35240. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35241. if (!Cesium.defined(loc2.sLocation))
  35242. return;
  35243. if (_self._isDrawPoint) {
  35244. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35245. }
  35246. if (_self._isRuntimeApp()) {
  35247. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED8\u5236\u4E00\u6761OD\u7EBF\uFF01");
  35248. }
  35249. if (_self._sketchTempPoints.length === 0) {
  35250. _self._createOdline(true);
  35251. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35252. } else {
  35253. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35254. _self._updateOdline(false, options2.isEdit);
  35255. _self._createOdline();
  35256. }
  35257. _self._sketchTempPoints.push(loc2.sLocation);
  35258. _self._sketchPoints.push(loc2.sLocation.clone());
  35259. _self._sketchOutputPoints.push(loc2.gLocation);
  35260. if (options2.onAdded)
  35261. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35262. _self._createOperationDom();
  35263. });
  35264. this._registerMouseMoveEvent(handler, function(event2) {
  35265. if (_self._isRuntimeApp())
  35266. return;
  35267. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35268. if (!Cesium.defined(loc2.sLocation))
  35269. return;
  35270. if (_self._sketchTempPoints.length > 1) {
  35271. _self._drawMovingDoubleTooltip(event2.endPosition);
  35272. _self._sketchTempPoints.pop();
  35273. _self._sketchTempPoints.push(loc2.sLocation);
  35274. if (options2.onMoving)
  35275. options2.onMoving(loc2.sLocation);
  35276. }
  35277. });
  35278. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35279. _self._removeEntityByObject(_self._drawEntity);
  35280. _self._updateOdline(true, options2.isEdit);
  35281. _self._removePointEntitys();
  35282. _self._clearEvent(handler);
  35283. if (options2.onComplete)
  35284. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35285. });
  35286. this._registerRightClickEvent(handler, function(event2) {
  35287. if (_self._odlineEntitys.length > 0) {
  35288. if (_self._isDrawPoint) {
  35289. _self._removeLastDrawPointEntity();
  35290. }
  35291. _self._removeEntityByObject(_self._odlineEntitys.last());
  35292. _self._odlineEntitys.pop();
  35293. if (options2.onUndo)
  35294. options2.onUndo();
  35295. }
  35296. });
  35297. },
  35298. _sketchDrawPolygon(handler, options2) {
  35299. let _self = this;
  35300. this._registerLeftClickEvent(handler, function(event2) {
  35301. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35302. if (!Cesium.defined(loc2.sLocation))
  35303. return;
  35304. if (_self._isDrawPoint) {
  35305. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35306. }
  35307. if (_self._sketchTempPoints.length === 0) {
  35308. _self._createPolygon(options2.polygonType);
  35309. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35310. }
  35311. _self._sketchTempPoints.push(loc2.sLocation);
  35312. _self._sketchPoints.push(loc2.sLocation.clone());
  35313. _self._sketchOutputPoints.push(loc2.gLocation);
  35314. if (options2.onAdded)
  35315. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35316. _self._createOperationDom();
  35317. });
  35318. this._registerMouseMoveEvent(handler, function(event2) {
  35319. if (_self._isRuntimeApp())
  35320. return;
  35321. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35322. if (!Cesium.defined(loc2.sLocation))
  35323. return;
  35324. if (_self._sketchTempPoints.length > 1) {
  35325. _self._drawMovingDoubleTooltip(event2.endPosition);
  35326. _self._sketchTempPoints.pop();
  35327. _self._sketchTempPoints.push(loc2.sLocation);
  35328. if (options2.onMoving)
  35329. options2.onMoving(loc2.sLocation);
  35330. }
  35331. });
  35332. this._registerRightClickEvent(handler, function(event2) {
  35333. if (_self._sketchTempPoints.length > 2) {
  35334. _self._drawByUndo();
  35335. if (options2.onUndo)
  35336. options2.onUndo();
  35337. }
  35338. });
  35339. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35340. if (_self._sketchPoints.length < 3) {
  35341. if (options2.onError)
  35342. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35343. return;
  35344. }
  35345. _self._updatePolygon(options2.isEdit);
  35346. if (!_self._isRetainDrawPoint)
  35347. _self._removePointEntitys();
  35348. _self._clearEvent(handler);
  35349. if (options2.onComplete)
  35350. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35351. });
  35352. },
  35353. _sketchDrawCircle: function(handler, options2) {
  35354. let _self = this;
  35355. this._registerLeftClickEvent(handler, function(event2) {
  35356. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35357. if (!Cesium.defined(loc2.sLocation))
  35358. return;
  35359. if (_self._sketchTempPoints.length === 0) {
  35360. if (_self._isDrawPoint) {
  35361. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35362. }
  35363. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35364. _self._sketchTempPoints.push(loc2.sLocation);
  35365. _self._sketchPoints.push(loc2.sLocation.clone());
  35366. _self._sketchOutputPoints.push(loc2.gLocation);
  35367. _self._createCircle(loc2.sLocation, options2.circleType);
  35368. if (_self._isRuntimeApp()) {
  35369. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35370. }
  35371. if (options2.onAdded)
  35372. options2.onAdded(loc2.sLocation);
  35373. } else {
  35374. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35375. _self._removePointEntitys();
  35376. _self._updateCircle(options2.isEdit);
  35377. _self._clearEvent(handler);
  35378. if (options2.onComplete)
  35379. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  35380. }
  35381. });
  35382. this._registerMouseMoveEvent(handler, function(event2) {
  35383. if (_self._isRuntimeApp()) {
  35384. return;
  35385. }
  35386. if (_self._sketchTempPoints.length <= 0)
  35387. return;
  35388. _self._drawMovingSimpleTooltip(event2.endPosition);
  35389. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  35390. if (cartesian == void 0)
  35391. return;
  35392. _self._sketchTempPoints.pop();
  35393. _self._sketchTempPoints.push(cartesian);
  35394. });
  35395. },
  35396. _sketchDrawRectangle: function(handler, options2) {
  35397. let _self = this;
  35398. this._registerLeftClickEvent(handler, function(event2) {
  35399. if (_self._sketchTempPoints.length === 0) {
  35400. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35401. if (!Cesium.defined(loc2.sLocation))
  35402. return;
  35403. if (_self._isDrawPoint) {
  35404. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35405. }
  35406. _self._sketchTempPoints.push(loc2.sLocation);
  35407. _self._sketchTempPoints.push(loc2.sLocation);
  35408. _self._sketchPoints.push(loc2.gLocation);
  35409. _self._createRectangle();
  35410. if (options2.onAdded)
  35411. options2.onAdded(loc2.sLocation);
  35412. if (_self._isRuntimeApp()) {
  35413. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35414. }
  35415. } else {
  35416. _self._removePointEntitys();
  35417. _self._removeEntityByObject(_self._sketchTempRectangle);
  35418. _self._updateRectangle(options2.isEdit);
  35419. _self._clearEvent(handler);
  35420. if (options2.onComplete)
  35421. options2.onComplete(_self._sketchOutputPoints);
  35422. }
  35423. });
  35424. this._registerMouseMoveEvent(handler, function(event2) {
  35425. if (_self._sketchTempPoints.length < 1)
  35426. return;
  35427. _self._drawMovingSimpleTooltip(event2.endPosition);
  35428. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35429. if (!Cesium.defined(loc2.sLocation))
  35430. return;
  35431. _self._sketchTempPoints.pop();
  35432. _self._sketchTempPoints.push(loc2.sLocation);
  35433. });
  35434. },
  35435. _sketchDrawWall: function(handler, options2) {
  35436. let _self = this;
  35437. this._registerLeftClickEvent(handler, function(event2) {
  35438. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35439. if (!Cesium.defined(loc2.sLocation))
  35440. return;
  35441. if (_self._isDrawPoint) {
  35442. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35443. }
  35444. if (_self._sketchTempPoints.length === 0) {
  35445. _self._createWall(options2.wallType);
  35446. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35447. _self._sketchWallHeights.push(loc2.gLocation.height);
  35448. }
  35449. _self._sketchTempPoints.push(loc2.sLocation);
  35450. _self._sketchWallHeights.push(loc2.gLocation.height);
  35451. _self._sketchPoints.push(loc2.sLocation.clone());
  35452. _self._createOperationDom();
  35453. });
  35454. this._registerMouseMoveEvent(handler, function(event2) {
  35455. if (_self._isRuntimeApp()) {
  35456. return;
  35457. }
  35458. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35459. if (!Cesium.defined(loc2.sLocation))
  35460. return;
  35461. if (_self._sketchTempPoints.length > 1) {
  35462. _self._drawMovingDoubleTooltip(event2.endPosition);
  35463. _self._sketchTempPoints.pop();
  35464. _self._sketchTempPoints.push(loc2.sLocation);
  35465. _self._sketchWallHeights.pop();
  35466. _self._sketchWallHeights.push(loc2.gLocation.height);
  35467. }
  35468. });
  35469. this._registerRightClickEvent(handler, function(event2) {
  35470. if (_self._sketchTempPoints.length > 2) {
  35471. _self._sketchPoints.pop();
  35472. if (_self._isRuntimeApp()) {
  35473. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 1, 1);
  35474. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 1, 1);
  35475. } else {
  35476. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  35477. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 2, 1);
  35478. }
  35479. if (_self._isDrawPoint) {
  35480. _self._removeLastDrawPointEntity();
  35481. }
  35482. }
  35483. });
  35484. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35485. if (_self._sketchPoints.length < 2) {
  35486. if (options2.onError)
  35487. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35488. return;
  35489. }
  35490. _self._updateWall(options2.isEdit);
  35491. if (!_self._isRetainDrawPoint)
  35492. _self._removePointEntitys();
  35493. _self._clearEvent(handler);
  35494. });
  35495. },
  35496. _sketchDrawVideoWall: function(handler, options2) {
  35497. let _self = this;
  35498. this._registerLeftClickEvent(handler, function(event2) {
  35499. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35500. if (!Cesium.defined(loc2.sLocation))
  35501. return;
  35502. if (_self._isDrawPoint) {
  35503. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35504. }
  35505. if (_self._sketchOutputPoints.length === 0) {
  35506. _self._sketchOutputPoints.push(loc2.gLocation);
  35507. _self._sketchOutputPoints.push(loc2.gLocation);
  35508. _self._createVideoWall();
  35509. if (_self._isRuntimeApp()) {
  35510. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  35511. }
  35512. } else {
  35513. _self._updateVideoWall(options2.isEdit);
  35514. _self._clearEvent(handler);
  35515. }
  35516. });
  35517. this._registerMouseMoveEvent(handler, function(event2) {
  35518. if (_self._isRuntimeApp())
  35519. return;
  35520. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35521. if (!Cesium.defined(loc2.sLocation))
  35522. return;
  35523. if (_self._sketchOutputPoints.length > 1) {
  35524. _self._drawMovingSimpleTooltip(event2.endPosition);
  35525. _self._sketchOutputPoints.pop();
  35526. _self._sketchOutputPoints.push(loc2.gLocation);
  35527. }
  35528. });
  35529. },
  35530. _drawByUndo: function() {
  35531. this._sketchPoints.pop();
  35532. if (this._isRuntimeApp()) {
  35533. this._sketchTempPoints.splice(this._sketchTempPoints.length - 1, 1);
  35534. } else {
  35535. this._sketchTempPoints.splice(this._sketchTempPoints.length - 2, 1);
  35536. }
  35537. if (this._isDrawPoint) {
  35538. this._removeLastDrawPointEntity();
  35539. }
  35540. },
  35541. draw: function(type2, options2) {
  35542. let _self = this;
  35543. this._clear();
  35544. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35545. if (this._isRuntimeApp()) {
  35546. this._showTooltipMessage("\u5355\u51FB\u7ED8\u5236");
  35547. } else {
  35548. this._beginTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236", void 0);
  35549. }
  35550. this._drawType = type2;
  35551. switch (type2) {
  35552. case DrawTools.DrawType.Point:
  35553. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  35554. break;
  35555. case DrawTools.DrawType.Polyline:
  35556. options2.polylineType = DrawTools.PolylineType.NormalPolyline;
  35557. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35558. break;
  35559. case DrawTools.DrawType.ArrowPolyline:
  35560. options2.polylineType = DrawTools.PolylineType.ArrowsPolyline;
  35561. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35562. break;
  35563. case DrawTools.DrawType.DynamicPolyline:
  35564. options2.polylineType = DrawTools.PolylineType.DynamicPolyline;
  35565. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35566. break;
  35567. case DrawTools.DrawType.GrowPolyline:
  35568. options2.polylineType = DrawTools.PolylineType.GrowPolyline;
  35569. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35570. break;
  35571. case DrawTools.DrawType.OutlinePolyline:
  35572. options2.polylineType = DrawTools.PolylineType.OutlinePolyline;
  35573. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35574. break;
  35575. case DrawTools.DrawType.Polygon:
  35576. options2.polygonType = DrawTools.PolygonType.NormalPolygon;
  35577. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35578. break;
  35579. case DrawTools.DrawType.SpatialLine:
  35580. _self._sketchDrawSpatialPolyline(_self._drawEventHandler, options2);
  35581. break;
  35582. case DrawTools.DrawType.Circle:
  35583. options2.circleType = DrawTools.CircleType.ColorCircle;
  35584. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35585. break;
  35586. case DrawTools.DrawType.Rectangle:
  35587. _self._sketchDrawRectangle(_self._drawEventHandler, options2);
  35588. break;
  35589. case DrawTools.DrawType.NormalWall:
  35590. options2.wallType = DrawTools.WallType.ColorWall;
  35591. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35592. break;
  35593. case DrawTools.DrawType.DynamicWall:
  35594. options2.wallType = DrawTools.WallType.DynamicWall;
  35595. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35596. break;
  35597. case DrawTools.DrawType.TextWall:
  35598. options2.wallType = DrawTools.WallType.TextWall;
  35599. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35600. break;
  35601. case DrawTools.DrawType.DynamicCircle:
  35602. options2.circleType = DrawTools.CircleType.DynamicCircle;
  35603. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35604. break;
  35605. case DrawTools.DrawType.House:
  35606. options2.polygonType = DrawTools.PolygonType.HousePolygon;
  35607. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35608. break;
  35609. case DrawTools.DrawType.VideoWall:
  35610. _self._sketchDrawVideoWall(_self._drawEventHandler, options2);
  35611. break;
  35612. case DrawTools.DrawType.OdLine:
  35613. _self._sketchDrawOdline(_self._drawEventHandler, options2);
  35614. break;
  35615. }
  35616. },
  35617. Clear: function() {
  35618. this._clear(true);
  35619. this._unActivateEdit();
  35620. this._closePropertyEditDialog();
  35621. this._removeOperationDom();
  35622. },
  35623. sketchInit: function() {
  35624. this._clear(false);
  35625. },
  35626. _checkAppOrWeb() {
  35627. if (window.navigator.userAgent.match(
  35628. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  35629. )) {
  35630. return DrawTools.RuntimeEnvironment.App;
  35631. } else {
  35632. return DrawTools.RuntimeEnvironment.Web;
  35633. }
  35634. },
  35635. _isRuntimeApp() {
  35636. if (this._checkAppOrWeb() === DrawTools.RuntimeEnvironment.App) {
  35637. return true;
  35638. }
  35639. return false;
  35640. }
  35641. });
  35642. Object.assign(DrawTools.prototype, {
  35643. _tooltipInit: function(text, mousePosition) {
  35644. let _self = this;
  35645. this._tooltipId = "tooltipSketchmodel";
  35646. let tooltipObj = document.getElementById(this._tooltipId);
  35647. if (tooltipObj === null) {
  35648. tooltipObj = document.createElement("div");
  35649. tooltipObj.id = this._tooltipId;
  35650. document.body.appendChild(tooltipObj);
  35651. let divStyle = "";
  35652. divStyle += "top: 30px;";
  35653. divStyle += "left: 30px;";
  35654. divStyle += "position: absolute;";
  35655. divStyle += "display: flex;";
  35656. divStyle += "align-items: center;";
  35657. divStyle += "width: 12x0px;";
  35658. divStyle += "height: auto;";
  35659. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  35660. divStyle += "border-radius: 5px;";
  35661. divStyle += "color: rgb(255, 255, 255);";
  35662. divStyle += "font-size: 12px;";
  35663. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  35664. divStyle += "padding: 8px;";
  35665. divStyle += "border:solid 1px rgb(255,0,0);";
  35666. tooltipObj.setAttribute("style", divStyle);
  35667. }
  35668. if (text != void 0)
  35669. tooltipObj.innerHTML = text;
  35670. if (mousePosition === void 0) {
  35671. document.onmousemove = function(event2) {
  35672. if (event2.clientX < 100 || event2.clientX > _self._canvasWidth - 100 || event2.clientY < 100 || event2.clientY > _self._canvasHeight - 100) {
  35673. tooltipObj.style.display = "none";
  35674. } else {
  35675. tooltipObj.style.display = "flex";
  35676. tooltipObj.style.left = event2.clientX + 10 + "px";
  35677. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  35678. }
  35679. };
  35680. } else {
  35681. if (mousePosition.x < 100 || mousePosition.x > _self._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > _self._canvasHeight - 100) {
  35682. tooltipObj.style.display = "none";
  35683. } else {
  35684. tooltipObj.style.display = "flex";
  35685. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35686. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35687. }
  35688. }
  35689. },
  35690. _tooltipRemove: function() {
  35691. let tooltipObj = document.getElementById(this._tooltipId);
  35692. if (tooltipObj != null) {
  35693. document.body.removeChild(tooltipObj);
  35694. }
  35695. },
  35696. _tooltipSetText: function(text, mousePosition) {
  35697. let tooltipObj = document.getElementById(this._tooltipId);
  35698. if (tooltipObj != null) {
  35699. if (text != void 0)
  35700. tooltipObj.innerHTML = text;
  35701. if (mousePosition != void 0) {
  35702. if (mousePosition.x < 100 || mousePosition.x > this._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > this._canvasHeight - 100) {
  35703. tooltipObj.style.display = "none";
  35704. } else {
  35705. tooltipObj.style.display = "flex";
  35706. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35707. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35708. }
  35709. }
  35710. }
  35711. },
  35712. _setMousePointerStyle: function() {
  35713. document.querySelector("body").style.cursor = "crosshair";
  35714. },
  35715. _setMouseDefaultStyle: function() {
  35716. document.querySelector("body").style.cursor = "default";
  35717. },
  35718. _beginTooltip(text, position2) {
  35719. this._tooltipInit(text, position2);
  35720. this._setMousePointerStyle();
  35721. },
  35722. _updateTooltip(text, position2) {
  35723. this._tooltipSetText(text, position2);
  35724. },
  35725. _endTooltip() {
  35726. this._tooltipRemove();
  35727. this._setMouseDefaultStyle();
  35728. },
  35729. _showTooltipMessage: function(message) {
  35730. let msgMainDom = document.getElementById("messageMainDom");
  35731. if (msgMainDom !== null && msgMainDom !== void 0) {
  35732. document.body.removeChild(msgMainDom);
  35733. }
  35734. msgMainDom = document.createElement("div");
  35735. msgMainDom.style.width = "30%";
  35736. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  35737. msgMainDom.style.height = "45px";
  35738. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  35739. msgMainDom.style.borderRadius = "8px";
  35740. msgMainDom.style.display = "flex";
  35741. msgMainDom.style.alignItems = "center";
  35742. msgMainDom.style.paddingLeft = "10px";
  35743. msgMainDom.style.color = "rgb(91, 188, 48)";
  35744. msgMainDom.style.fontSize = "14px";
  35745. msgMainDom.style.fontWeight = "600";
  35746. msgMainDom.style.position = "absolute";
  35747. msgMainDom.style.left = "35%";
  35748. msgMainDom.style.transition = "transform 1s";
  35749. msgMainDom.style.transform = "translateY(-90px)";
  35750. msgMainDom.style.top = "0px";
  35751. msgMainDom.style.zIndex = 1e3;
  35752. document.body.appendChild(msgMainDom);
  35753. let strHtml = "";
  35754. strHtml += "<div style='";
  35755. strHtml += "background-color: rgb(88, 185, 45);";
  35756. strHtml += "color: rgb(255, 255, 255);";
  35757. strHtml += "height: 24px;";
  35758. strHtml += "width: 24px;";
  35759. strHtml += "border-radius: 20px;";
  35760. strHtml += "display: flex;";
  35761. strHtml += "justify-content: center;";
  35762. strHtml += "align-items: center;";
  35763. strHtml += "font-size: 14px;";
  35764. strHtml += "margin-right: 18px;";
  35765. strHtml += "'>&#10003</div>";
  35766. strHtml += "<div>" + message + "</div>";
  35767. msgMainDom.innerHTML = strHtml;
  35768. msgMainDom.addEventListener("transitionend", function() {
  35769. setTimeout(function() {
  35770. document.body.removeChild(msgMainDom);
  35771. }, 1e3);
  35772. }, false);
  35773. setTimeout(function() {
  35774. msgMainDom.style.transform = "translateY(50px)";
  35775. }, 100);
  35776. }
  35777. });
  35778. Object.assign(DrawTools.prototype, {
  35779. _createSingleCoordinateAxisArrow(positions, color2, axisEntityId) {
  35780. let _self = this;
  35781. let coordinateAxisEntity = new Cesium.Entity({
  35782. id: axisEntityId,
  35783. name: _self._coordinateAxisEntityName,
  35784. position: positions[0],
  35785. polyline: {
  35786. positions,
  35787. width: 10,
  35788. material: _self._materialPolylineArrowProperty({
  35789. color: color2
  35790. })
  35791. }
  35792. });
  35793. coordinateAxisEntity.setEditType({
  35794. type: DrawTools.EditPointType.CoordinateAxis
  35795. });
  35796. return this._entities.add(coordinateAxisEntity);
  35797. },
  35798. _getTranslatePostion: function(originPosition, translateCartesian) {
  35799. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(originPosition);
  35800. let m = new Cesium.Matrix4();
  35801. Cesium.Matrix4.setTranslation(
  35802. Cesium.Matrix4.IDENTITY,
  35803. translateCartesian,
  35804. m
  35805. );
  35806. let modelMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  35807. let outPosition = new Cesium.Cartesian3(0, 0, 0);
  35808. Cesium.Matrix4.getTranslation(modelMatrix, outPosition);
  35809. return outPosition;
  35810. },
  35811. _createCoordinateAxis: function(position2) {
  35812. this._showTooltipMessage("\u5355\u51FB\u53F3\u952E\u79FB\u9664\u8C03\u6574\u8F74\u7EBF\uFF01");
  35813. this._removeCoorinateAxis();
  35814. let _self = this;
  35815. let cameraRight = this._viewer.scene.camera.rightWC;
  35816. this._tx = cameraRight.x > 0 ? 150 : -150;
  35817. this._ty = cameraRight.y > 0 ? 150 : -150;
  35818. this._tz = 150;
  35819. this._coordinateAxisEntityId_x = "coordinateAxisId_x";
  35820. this._coordinateAxisEntityId_y = "coordinateAxisId_y";
  35821. this._coordinateAxisEntityId_z = "coordinateAxisId_z";
  35822. this._coordinateAxisEntityName = "coordinateAxisEntity";
  35823. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35824. let endPosition = this._getTranslatePostion(position2, translateCartesian);
  35825. const xPos = [position2, endPosition];
  35826. this._coordinateEntity_x = this._createSingleCoordinateAxisArrow(xPos, "rgba(0,255,0,1.0)", this._coordinateAxisEntityId_x);
  35827. this._coordinateAxisBindEntity(this._coordinateEntity_x);
  35828. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35829. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35830. const yPos = [position2, endPosition];
  35831. this._coordinateEntity_y = this._createSingleCoordinateAxisArrow(yPos, "rgba(0,0,255,1.0)", this._coordinateAxisEntityId_y);
  35832. this._coordinateAxisBindEntity(this._coordinateEntity_y);
  35833. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35834. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35835. const zPos = [position2, endPosition];
  35836. this._coordinateEntity_z = this._createSingleCoordinateAxisArrow(zPos, "rgba(255,0,0,1.0)", this._coordinateAxisEntityId_z);
  35837. this._coordinateAxisBindEntity(this._coordinateEntity_z);
  35838. this._eventCoorinateAxis = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35839. this._registerLeftDownEvent(this._eventCoorinateAxis, function(event2) {
  35840. _self._coorinateAxisMouseDown(event2);
  35841. });
  35842. this._registerMouseMoveEvent(this._eventCoorinateAxis, function(event2) {
  35843. _self._coorinateAxisMouseMove(event2);
  35844. });
  35845. this._registerLeftUpEvent(this._eventCoorinateAxis, function(event2) {
  35846. _self._coorinateAxisMouseUp(event2);
  35847. });
  35848. this._registerRightClickEvent(this._eventCoorinateAxis, function(event2) {
  35849. _self._removeCoorinateAxis();
  35850. });
  35851. },
  35852. _coordinateAxisBindEntity: function(axisEntity) {
  35853. if (this._editEntity === void 0)
  35854. return;
  35855. let editEntityType = this._editEntity.getEntityType();
  35856. if (editEntityType === void 0)
  35857. return;
  35858. if (editEntityType === DrawTools.DrawType.VideoWall) {
  35859. axisEntity.bindEntity(this._editEntity);
  35860. }
  35861. },
  35862. _coorinateAxisMouseDown: function(event2) {
  35863. let _self = this;
  35864. let feature2 = this._viewer.scene.pick(event2.position);
  35865. if (feature2 === void 0)
  35866. return;
  35867. if (feature2.id != void 0 && feature2.id instanceof Cesium.Entity) {
  35868. this._viewer.scene.screenSpaceCameraController.enableRotate = false;
  35869. if (feature2.id.getEditType() === void 0)
  35870. return;
  35871. let entityType = feature2.id.getEditType().type;
  35872. if (entityType !== DrawTools.EditPointType.CoordinateAxis)
  35873. return;
  35874. this._editCoorinateAxis = feature2.id;
  35875. this._editCoorinateAxis.polyline.width = 15;
  35876. this._coordinateAxisMoveStartPosition = this._viewer.scene.camera.pickEllipsoid(
  35877. event2.position,
  35878. this._viewer.scene.globe.ellipsoid
  35879. );
  35880. this._coordinateAxisMoveStartScreen = event2.position;
  35881. this._coorinateAxisPosition = this._editCoorinateAxis.position._value;
  35882. this._coordinateEntity_x.polyline.positions = new Cesium.CallbackProperty(function() {
  35883. let translateCartesian = new Cesium.Cartesian3(_self._tx, 0, 0);
  35884. let endPosition = _self._getTranslatePostion(
  35885. _self._coorinateAxisPosition,
  35886. translateCartesian
  35887. );
  35888. return [_self._coorinateAxisPosition, endPosition];
  35889. }, false);
  35890. this._coordinateEntity_y.polyline.positions = new Cesium.CallbackProperty(function() {
  35891. let translateCartesian = new Cesium.Cartesian3(0, _self._ty, 0);
  35892. let endPosition = _self._getTranslatePostion(
  35893. _self._coorinateAxisPosition,
  35894. translateCartesian
  35895. );
  35896. return [_self._coorinateAxisPosition, endPosition];
  35897. }, false);
  35898. this._coordinateEntity_z.polyline.positions = new Cesium.CallbackProperty(function() {
  35899. let translateCartesian = new Cesium.Cartesian3(0, 0, _self._tz);
  35900. let endPosition = _self._getTranslatePostion(
  35901. _self._coorinateAxisPosition,
  35902. translateCartesian
  35903. );
  35904. return [_self._coorinateAxisPosition, endPosition];
  35905. }, false);
  35906. this._coordinateAxisActivateEditEntity(this._editCoorinateAxis);
  35907. }
  35908. },
  35909. _coorinateAxisMouseMove: function(event2) {
  35910. if (!Cesium.defined(this._editCoorinateAxis))
  35911. return;
  35912. let position2 = this._viewer.scene.camera.pickEllipsoid(
  35913. event2.endPosition,
  35914. this._viewer.scene.globe.ellipsoid
  35915. );
  35916. if (!position2)
  35917. return;
  35918. let strGeo = this._cartesian3ToGeo(this._coordinateAxisMoveStartPosition);
  35919. let endGeo = this._cartesian3ToGeo(position2);
  35920. let entityId = this._editCoorinateAxis.id;
  35921. let entityPosition = this._editCoorinateAxis.position._value;
  35922. let entityGeo = this._cartesian3ToGeo(entityPosition);
  35923. let heightDifference = 0;
  35924. if (entityId === this._coordinateAxisEntityId_x) {
  35925. let difference = strGeo.longitude - endGeo.longitude;
  35926. entityGeo.longitude = entityGeo.longitude - difference;
  35927. } else if (entityId === this._coordinateAxisEntityId_y) {
  35928. let difference = strGeo.latitude - endGeo.latitude;
  35929. entityGeo.latitude = entityGeo.latitude - difference;
  35930. } else if (entityId === this._coordinateAxisEntityId_z) {
  35931. heightDifference = event2.endPosition.y - this._coordinateAxisMoveStartScreen.y;
  35932. heightDifference = heightDifference * 0.5;
  35933. entityGeo.height = entityGeo.height - heightDifference;
  35934. }
  35935. this._coorinateAxisPosition = Cesium.Cartesian3.fromDegrees(entityGeo.longitude, entityGeo.latitude, entityGeo.height);
  35936. this._moveEditEntityByCoordinateAxis(entityPosition, this._coorinateAxisPosition, heightDifference);
  35937. },
  35938. _coorinateAxisMouseUp: function(event2) {
  35939. this._viewer.scene.screenSpaceCameraController.enableRotate = true;
  35940. if (this._editCoorinateAxis !== void 0) {
  35941. this._editCoorinateAxis.polyline.width = 10;
  35942. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35943. let endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35944. this._coordinateEntity_x.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35945. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35946. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35947. this._coordinateEntity_y.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35948. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35949. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35950. this._coordinateEntity_z.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35951. this._coordinateEntity_x.position = this._coorinateAxisPosition;
  35952. this._coordinateEntity_y.position = this._coorinateAxisPosition;
  35953. this._coordinateEntity_z.position = this._coorinateAxisPosition;
  35954. this._coordinateAxisUpdateEditEntity(this._editCoorinateAxis);
  35955. this._editCoorinateAxis = void 0;
  35956. }
  35957. },
  35958. _moveEditEntityByCoordinateAxis: function(strPosition, endPosition, heightDifference) {
  35959. let movePosition = Cesium.Cartesian3.subtract(endPosition, strPosition, new Cesium.Cartesian3());
  35960. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35961. let moveResult = Cesium.Cartesian3.add(this._moveInitPositions[i2], movePosition, new Cesium.Cartesian3());
  35962. this._moveUpdatePositions[i2] = moveResult.clone();
  35963. }
  35964. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35965. this._moveUpdateHeights[i2] = parseFloat(this._moveInitHeights[i2]) + heightDifference * -1;
  35966. }
  35967. },
  35968. _coordinateAxisActivateEditEntity: function(moveAxisEntity) {
  35969. let _self = this;
  35970. let bindEntity = moveAxisEntity.getBindEntity();
  35971. if (bindEntity === void 0)
  35972. return;
  35973. let bindEntityType = bindEntity.getEntityType();
  35974. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  35975. let wall = bindEntity.wall;
  35976. this._moveInitPositions = wall.positions._value;
  35977. this._moveInitHeights = wall.minimumHeights._value;
  35978. this._moveInitHeight = wall.maximumHeights._value[0] - wall.minimumHeights._value[0];
  35979. this._moveUpdatePositions = [];
  35980. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35981. this._moveUpdatePositions.push(this._moveInitPositions[i2].clone());
  35982. }
  35983. wall.positions = new Cesium.CallbackProperty(function() {
  35984. return _self._moveUpdatePositions;
  35985. }, false);
  35986. this._moveUpdateHeights = [];
  35987. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35988. this._moveUpdateHeights.push(this._moveInitHeights[i2]);
  35989. }
  35990. wall.minimumHeights = new Cesium.CallbackProperty(function() {
  35991. return _self._moveUpdateHeights;
  35992. }, false);
  35993. wall.maximumHeights = new Cesium.CallbackProperty(function() {
  35994. let maxHeights = [];
  35995. for (let i2 = 0; i2 < _self._moveUpdateHeights.length; i2++) {
  35996. maxHeights.push(parseFloat(_self._moveUpdateHeights[i2]) + _self._moveInitHeight);
  35997. }
  35998. return maxHeights;
  35999. }, false);
  36000. }
  36001. },
  36002. _coordinateAxisUpdateEditEntity: function(moveAxisEntity) {
  36003. let bindEntity = moveAxisEntity.getBindEntity();
  36004. if (bindEntity === void 0)
  36005. return;
  36006. let bindEntityType = bindEntity.getEntityType();
  36007. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  36008. let wall = bindEntity.wall;
  36009. wall.positions = this._moveUpdatePositions;
  36010. wall.minimumHeights = this._moveUpdateHeights;
  36011. let maxHeights = [];
  36012. for (let i2 = 0; i2 < this._moveUpdateHeights.length; i2++) {
  36013. maxHeights.push(parseFloat(this._moveUpdateHeights[i2]) + this._moveInitHeight);
  36014. }
  36015. wall.maximumHeights = maxHeights;
  36016. }
  36017. },
  36018. _coordinateCalculateEntityOrientation: function(entity, options2) {
  36019. let position2 = entity.position._value;
  36020. let orientation = entity.orientation === void 0 ? new Cesium.Cartesian3(0, 0, 0) : entity.orientation._value;
  36021. let transform3 = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  36022. position2,
  36023. orientation,
  36024. new Cesium.Cartesian3(1, 1, 1),
  36025. new Cesium.Matrix4()
  36026. );
  36027. let _rotateX = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.x));
  36028. let _rotateY = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.y));
  36029. let _rotateZ = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.z));
  36030. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateX, transform3);
  36031. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateY, transform3);
  36032. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateZ, transform3);
  36033. let m3 = Cesium.Matrix4.getRotation(transform3, new Cesium.Matrix3());
  36034. let resOrientation = new Cesium.Quaternion();
  36035. Cesium.Quaternion.fromRotationMatrix(m3, resOrientation);
  36036. return resOrientation;
  36037. },
  36038. _removeCoorinateAxis: function() {
  36039. if (this._coordinateAxisEntityName !== void 0) {
  36040. this._removeEntityByName(this._coordinateAxisEntityName);
  36041. }
  36042. if (this._eventCoorinateAxis !== void 0) {
  36043. this._clearEvent(this._eventCoorinateAxis);
  36044. this._eventCoorinateAxis = void 0;
  36045. }
  36046. }
  36047. });
  36048. Object.assign(DrawTools.prototype, {
  36049. _setEntityIsEdit(entity) {
  36050. let _self = this;
  36051. entity.setIsEdit(true);
  36052. this._unActivateEdit();
  36053. this._sendShowPropertyDialog(entity);
  36054. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36055. this._registerLeftClickEvent(handler, function(event2) {
  36056. _self._unActivateEdit();
  36057. let feature2 = _self._viewer.scene.pick(event2.position);
  36058. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  36059. let featureType = feature2.id.getEditType();
  36060. let entityType = feature2.id.getEntityType();
  36061. if (featureType === DrawTools.EditPointType.Node || featureType === DrawTools.EditPointType.Middle || featureType === DrawTools.EditPointType.Center || featureType === DrawTools.EditPointType.CoordinateAxis || featureType === DrawTools.EditPointType.OdlineStrartNode || featureType === DrawTools.EditPointType.OdlineEndNode || entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.ArrowPolyline || entityType === DrawTools.DrawType.DynamicPolyline || entityType === DrawTools.DrawType.GrowPolyline || entityType === DrawTools.DrawType.OutlinePolyline || entityType === DrawTools.DrawType.OdLine || entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.SpatialLine || entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle || entityType === DrawTools.DrawType.Rectangle || entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.House || entityType === DrawTools.DrawType.TextWall || entityType === DrawTools.DrawType.VideoWall) {
  36062. _self._sendShowPropertyDialog(feature2.id);
  36063. }
  36064. }
  36065. });
  36066. },
  36067. _sendShowPropertyDialog(entity) {
  36068. let _self = this;
  36069. let editEntityType = entity.getEntityType();
  36070. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  36071. this._unActivateEdit();
  36072. return;
  36073. }
  36074. let editProperty = entity.getParams();
  36075. if (editEntityType === DrawTools.DrawType.OdLine) {
  36076. editProperty = entity.parent.getParams();
  36077. }
  36078. this._console("\u9009\u62E9\u5B9E\u4F53\u7684\u5C5E\u6027", editProperty);
  36079. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  36080. this._openPropertyEditDialog(editProperty, function(params) {
  36081. _self.updateEditEntityProperty(params);
  36082. }, function() {
  36083. _self._removeEditEntity();
  36084. });
  36085. }
  36086. this._activateEdit(entity);
  36087. },
  36088. _removeEditEntity() {
  36089. if (this._editEntity !== void 0) {
  36090. this._console("\u79FB\u9664\u5B9E\u4F53", this._editEntity);
  36091. let entityType = this._editEntity.getEntityType();
  36092. if (entityType === DrawTools.DrawType.OdLine) {
  36093. let fatherEntityId = this._editEntity.parent.id;
  36094. let removeEntitys = [];
  36095. for (let entity of this._entities.values) {
  36096. if (entity.parent !== void 0 && entity.parent.id === fatherEntityId) {
  36097. removeEntitys.push(entity);
  36098. }
  36099. }
  36100. for (let removeEntity of removeEntitys) {
  36101. this._removeEntityByObject(removeEntity);
  36102. }
  36103. } else {
  36104. this._removeEntityByObject(this._editEntity);
  36105. }
  36106. this._unActivateEdit();
  36107. this._editEntity = void 0;
  36108. }
  36109. },
  36110. updateEditEntityProperty: function(params) {
  36111. if (this._editEntity === void 0)
  36112. return;
  36113. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  36114. return;
  36115. let editEntityType = this._editEntity.getEntityType();
  36116. if (editEntityType === void 0)
  36117. return;
  36118. if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36119. this._updateWallProperty(params);
  36120. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36121. this._updateCircleProperty(params);
  36122. } else if (editEntityType === DrawTools.DrawType.House) {
  36123. this._updateHouseProperty(params);
  36124. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36125. this._updateVideoWallProperty(params);
  36126. } else if (editEntityType === DrawTools.DrawType.Polyline) {
  36127. this._updatePolylineProperty(params);
  36128. } else if (editEntityType === DrawTools.DrawType.Polygon) {
  36129. this._updatePolygonProperty(params);
  36130. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36131. this._updateRectangleProperty(params);
  36132. } else if (editEntityType === DrawTools.DrawType.SpatialLine) {
  36133. this._updateSpatialPolylineProperty(params);
  36134. } else if (editEntityType === DrawTools.DrawType.OdLine) {
  36135. this._updateOdlineProperty(params);
  36136. }
  36137. },
  36138. _updateOdlineProperty(params) {
  36139. let _self = this;
  36140. let fatherEntity = this._editEntity.parent;
  36141. this._editOdlineEntities = [];
  36142. for (let entity of this._entities.values) {
  36143. if (entity.parent !== void 0 && entity.parent.id === fatherEntity.id) {
  36144. this._editOdlineEntities.push(entity);
  36145. }
  36146. }
  36147. let meterialImage = this._image_arrow_reverse;
  36148. if (params.order === this._param.order_add) {
  36149. meterialImage = this._image_arrow_reverse;
  36150. } else if (params.order === this._param.order_minus) {
  36151. meterialImage = this._image_arrow_forward;
  36152. }
  36153. let odLineMaterial = new WallMaterialProperty({
  36154. viewer: _self._viewer,
  36155. trailImage: meterialImage,
  36156. duration: params.duration,
  36157. color: Cesium.Color.fromCssColorString(params.color),
  36158. param: {
  36159. direction: params.direction,
  36160. count: params.count,
  36161. order: params.order
  36162. }
  36163. });
  36164. for (let entity of this._editOdlineEntities) {
  36165. entity.polyline.material = odLineMaterial;
  36166. let positions = entity.polyline.positions._value;
  36167. let strPoint = positions.first();
  36168. let endPoint = positions.last();
  36169. let newPositios = this._calculateOdlinePositios(
  36170. strPoint,
  36171. endPoint,
  36172. parseInt(params.odlineHeight),
  36173. parseInt(params.odlineCount)
  36174. );
  36175. entity.polyline.positions = newPositios;
  36176. entity.polyline.width = parseInt(params.lineWidth);
  36177. }
  36178. fatherEntity.setParams(params);
  36179. },
  36180. _updateSpatialPolylineProperty(params) {
  36181. let material = this._editEntity.polyline.material;
  36182. let newMaterial = void 0;
  36183. if (material instanceof Cesium.ColorMaterialProperty) {
  36184. newMaterial = this._materialColorProperty({
  36185. color: params.color
  36186. });
  36187. }
  36188. if (newMaterial !== void 0)
  36189. this._editEntity.polyline.material = newMaterial;
  36190. this._editEntity.polyline.width = parseFloat(params.lineWidth);
  36191. this._editEntity.setParams(params);
  36192. },
  36193. _updateRectangleProperty(params) {
  36194. let material = this._editEntity.rectangle.material;
  36195. if (material instanceof Cesium.ColorMaterialProperty) {
  36196. let newMaterial = this._materialColorProperty({
  36197. color: params.color
  36198. });
  36199. this._editEntity.rectangle.material = newMaterial;
  36200. }
  36201. if (this._editEntity.polyline !== void 0) {
  36202. let newMaterial = this._materialColorProperty({
  36203. color: params.outlineColor
  36204. });
  36205. this._editEntity.polyline.material = newMaterial;
  36206. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36207. }
  36208. this._editEntity.setParams(params);
  36209. },
  36210. _updatePolygonProperty(params) {
  36211. let material = this._editEntity.polygon.material;
  36212. if (material instanceof Cesium.ColorMaterialProperty) {
  36213. let newMaterial = this._materialColorProperty({
  36214. color: params.color
  36215. });
  36216. this._editEntity.polygon.material = newMaterial;
  36217. }
  36218. if (this._editEntity.polyline !== void 0) {
  36219. let newMaterial = this._materialColorProperty({
  36220. color: params.outlineColor
  36221. });
  36222. this._editEntity.polyline.material = newMaterial;
  36223. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36224. }
  36225. this._editEntity.setParams(params);
  36226. },
  36227. _updatePolylineProperty(params) {
  36228. let material = this._editEntity.polyline.material;
  36229. let newMaterial = void 0;
  36230. if (material instanceof Cesium.ColorMaterialProperty) {
  36231. newMaterial = this._materialColorProperty({
  36232. color: params.color
  36233. });
  36234. } else if (material instanceof Cesium.PolylineArrowMaterialProperty) {
  36235. newMaterial = this._materialPolylineArrowProperty({
  36236. color: params.color
  36237. });
  36238. } else if (material instanceof WallMaterialProperty) {
  36239. let materialImage = this._image_h_l_r;
  36240. if (params.order === this._param.order_minus) {
  36241. materialImage = this._image_h_r_l;
  36242. } else if (params.order === this._param.order_add) {
  36243. materialImage = this._image_h_l_r;
  36244. }
  36245. newMaterial = new WallMaterialProperty({
  36246. viewer: this._viewer,
  36247. trailImage: materialImage,
  36248. duration: params.duration,
  36249. color: Cesium.Color.fromCssColorString(params.color),
  36250. param: {
  36251. count: parseInt(params.count),
  36252. direction: params.direction,
  36253. order: params.order
  36254. }
  36255. });
  36256. } else if (material instanceof Cesium.PolylineGlowMaterialProperty) {
  36257. newMaterial = this._materialPolylineGlowProperty({
  36258. color: params.color,
  36259. power: parseFloat(params.power)
  36260. });
  36261. } else if (material instanceof Cesium.PolylineOutlineMaterialProperty) {
  36262. newMaterial = this._materialPolylineOutlineProperty({
  36263. color: params.color,
  36264. outlineWidth: parseFloat(params.outlineWidth),
  36265. outlineColor: params.outlineColor
  36266. });
  36267. }
  36268. if (newMaterial !== void 0)
  36269. this._editEntity.polyline.material = newMaterial;
  36270. this._editEntity.polyline.width = params.lineWidth;
  36271. this._editEntity.setParams(params);
  36272. },
  36273. _updateHouseProperty(params) {
  36274. let entityParams = this._editEntity.getParams();
  36275. let polygonMaterial = this._editEntity.polygon.material;
  36276. if (polygonMaterial instanceof Cesium.ColorMaterialProperty) {
  36277. let material = this._materialColorProperty({
  36278. color: params.color
  36279. });
  36280. this._editEntity.polygon.material = material;
  36281. this._editEntity.polygon.extrudedHeight = parseFloat(params.height) + parseFloat(
  36282. entityParams.bottomHeight
  36283. );
  36284. this._editEntity.setParams(params);
  36285. }
  36286. },
  36287. _updateCircleProperty(params) {
  36288. let circleMaterial = this._editEntity.ellipse.material;
  36289. if (circleMaterial instanceof CircleMaterialProperty) {
  36290. let material = new CircleMaterialProperty({
  36291. viewer: this._viewer,
  36292. duration: params.duration,
  36293. color: Cesium.Color.fromCssColorString(params.color),
  36294. count: parseFloat(params.count)
  36295. });
  36296. this._editEntity.ellipse.material = material;
  36297. } else if (circleMaterial instanceof Cesium.ColorMaterialProperty) {
  36298. let material = this._materialColorProperty({
  36299. color: params.color
  36300. });
  36301. this._editEntity.ellipse.material = material;
  36302. if (this._editEntity.polyline !== void 0) {
  36303. let newMaterial = this._materialColorProperty({
  36304. color: params.outlineColor
  36305. });
  36306. this._editEntity.polyline.material = newMaterial;
  36307. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36308. }
  36309. }
  36310. this._editEntity.setParams(params);
  36311. },
  36312. _updateVideoWallProperty(params) {
  36313. let videoElement = document.getElementById("wallVideo");
  36314. if (videoElement !== null) {
  36315. document.body.removeChild(videoElement);
  36316. }
  36317. videoElement = document.createElement("video");
  36318. videoElement.id = "wallVideo";
  36319. videoElement.setAttribute("crossorigin", "anonymous");
  36320. videoElement.setAttribute("width", "1024px");
  36321. videoElement.setAttribute("height", "256px");
  36322. videoElement.setAttribute("controls", "controls");
  36323. videoElement.setAttribute("src", params.videoUrl);
  36324. videoElement.setAttribute("loop", "loop");
  36325. videoElement.play();
  36326. document.body.appendChild(videoElement);
  36327. let minimumHeights = this._editEntity.wall.minimumHeights._value;
  36328. let maximumHeights = [];
  36329. for (let i2 = 0; i2 < minimumHeights.length; i2++) {
  36330. maximumHeights.push(minimumHeights[i2] + parseFloat(params.height));
  36331. }
  36332. this._editEntity.wall.maximumHeights = maximumHeights;
  36333. this._editEntity.wall.material = videoElement;
  36334. let wallPositions = this._editEntity.wall.positions._value;
  36335. let newPositions = [];
  36336. for (let wallPosition of wallPositions) {
  36337. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(wallPosition);
  36338. let m = new Cesium.Matrix4();
  36339. Cesium.Matrix4.setTranslation(Cesium.Matrix4.IDENTITY, new Cesium.Cartesian3(
  36340. parseFloat(params.axisX),
  36341. parseFloat(params.axisY),
  36342. parseFloat(params.axisZ)
  36343. ), m);
  36344. let moveMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  36345. let newPosition = new Cesium.Cartesian3();
  36346. Cesium.Matrix4.getTranslation(moveMatrix, newPosition);
  36347. newPositions.push(newPosition);
  36348. }
  36349. this._editEntity.wall.positions = newPositions;
  36350. params.axisX = params.axisY = params.axisZ = 0;
  36351. this._editEntity.setParams(params);
  36352. this._activateEdit(this._editEntity);
  36353. },
  36354. _updateWallProperty(params) {
  36355. let minHeights = this._editEntity.wall.minimumHeights._value;
  36356. let maxHeights = [];
  36357. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36358. maxHeights.push(minHeights[i2] + parseFloat(params.height));
  36359. }
  36360. this._editEntity.wall.maximumHeights = maxHeights;
  36361. this._sketchWallMaxHeights = maxHeights;
  36362. let wallMaterial = this._editEntity.wall.material;
  36363. if (wallMaterial instanceof Cesium.ImageMaterialProperty) {
  36364. let material = this._materialTextImageProperty({
  36365. color: params.color,
  36366. text: params.text
  36367. });
  36368. this._editEntity.wall.material = material;
  36369. } else if (wallMaterial instanceof WallMaterialProperty) {
  36370. let materialImage = this._image_h_l_r;
  36371. if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36372. materialImage = this._image_h_l_r;
  36373. } else if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36374. materialImage = this._image_h_r_l;
  36375. } else if (params.direction === this._param.direction_v && params.order === this._param.order_minus) {
  36376. materialImage = this._image_v_t_b;
  36377. } else if (params.direction === this._param.direction_v && params.order === this._param.order_add) {
  36378. materialImage = this._image_v_b_t;
  36379. }
  36380. let material = new WallMaterialProperty({
  36381. viewer: this._viewer,
  36382. trailImage: materialImage,
  36383. duration: params.duration,
  36384. color: Cesium.Color.fromCssColorString(params.color),
  36385. param: {
  36386. count: parseFloat(params.count),
  36387. direction: params.direction,
  36388. order: params.order
  36389. }
  36390. });
  36391. this._editEntity.wall.material = material;
  36392. } else if (wallMaterial instanceof Cesium.ColorMaterialProperty) {
  36393. let material = this._materialColorProperty({
  36394. color: params.color
  36395. });
  36396. this._editEntity.wall.material = material;
  36397. }
  36398. this._editEntity.setParams(params);
  36399. },
  36400. rotationEntity(options2) {
  36401. if (this._editEntity === void 0)
  36402. return;
  36403. this._coordinateCalculateEntityOrientation(this._editEntity, options2);
  36404. },
  36405. _getEntityEditData: function(entity) {
  36406. if (entity instanceof Cesium.Entity) {
  36407. let editEntityType = entity.getEntityType();
  36408. if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36409. return entity.polyline.positions._value;
  36410. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36411. let positions = entity.polygon.hierarchy._value.positions;
  36412. if (positions[0].x !== positions[positions.length - 1].x) {
  36413. positions.push(positions[0].clone());
  36414. }
  36415. return positions;
  36416. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36417. let rect = entity.rectangle.coordinates._value;
  36418. let gNw = Cesium.Rectangle.northwest(rect);
  36419. if (gNw.height <= 0) {
  36420. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gNw.longitude), Cesium.Math.toDegrees(gNw.latitude));
  36421. gNw.height = height2;
  36422. }
  36423. let cNw = Cesium.Cartesian3.fromRadians(gNw.longitude, gNw.latitude, gNw.height);
  36424. let gSe = Cesium.Rectangle.southeast(rect);
  36425. if (gSe.height <= 0) {
  36426. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gSe.longitude), Cesium.Math.toDegrees(gSe.latitude));
  36427. gSe.height = height2;
  36428. }
  36429. let cSe = Cesium.Cartesian3.fromRadians(gSe.longitude, gSe.latitude, gSe.height);
  36430. return [cNw, cSe];
  36431. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36432. let centerPosition = entity.position._value;
  36433. let radius = entity.ellipse.semiMajorAxis._value;
  36434. let cbPoint = this._calculateCircleBoundaryPoint(centerPosition, radius);
  36435. return [centerPosition, cbPoint];
  36436. } else if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36437. this._sketchWallHeights = [];
  36438. this._sketchWallMaxHeights = [];
  36439. let minHeights = entity.wall.minimumHeights._value;
  36440. let maxHeights = entity.wall.maximumHeights._value;
  36441. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36442. this._sketchWallHeights.push(minHeights[i2]);
  36443. this._sketchWallMaxHeights.push(maxHeights[i2]);
  36444. }
  36445. return entity.wall.positions._value;
  36446. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36447. let positions = entity.wall.positions._value;
  36448. return [positions[0].clone()];
  36449. } else {
  36450. return [];
  36451. }
  36452. } else {
  36453. return [];
  36454. }
  36455. },
  36456. _calculateCircleBoundaryPoint: function(centerPosition, radius) {
  36457. let gCenter = Cesium.Ellipsoid.WGS84.cartesianToCartographic(centerPosition);
  36458. let cPoint = point([Cesium.Math.toDegrees(gCenter.longitude), Cesium.Math.toDegrees(
  36459. gCenter.latitude
  36460. )]);
  36461. let boundaryPoint = destination(cPoint, radius / 1e3, 90, {
  36462. units: "kilometers"
  36463. }).geometry.coordinates;
  36464. let height2 = this._queryHeightFromGeo(boundaryPoint[0], boundaryPoint[1]);
  36465. let cbPoint = Cesium.Cartesian3.fromDegrees(boundaryPoint[0], boundaryPoint[1], height2);
  36466. return cbPoint;
  36467. },
  36468. _calculateCenterPosition: function(positions) {
  36469. if (positions === void 0 || positions.length === 0)
  36470. return void 0;
  36471. else if (positions.length === 1) {
  36472. return positions[0];
  36473. } else if (positions.length === 2) {
  36474. let pt0 = this._cartesian3ToGeo(positions[0]);
  36475. let pt1 = this._cartesian3ToGeo(positions[1]);
  36476. let point0 = point([pt0.longitude, pt0.latitude]);
  36477. let point1 = point([pt1.longitude, pt1.latitude]);
  36478. let center2 = midpoint(point0, point1).geometry.coordinates;
  36479. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36480. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36481. } else {
  36482. let geoPoints = [
  36483. []
  36484. ];
  36485. for (let i2 = 0; i2 < positions.length; i2++) {
  36486. let geoPoint = this._cartesian3ToGeo(positions[i2]);
  36487. geoPoints[0].push([geoPoint.longitude, geoPoint.latitude]);
  36488. }
  36489. geoPoints[0].push(geoPoints[0][0]);
  36490. let polygon$1 = polygon(geoPoints);
  36491. let center2 = centerOfMass(polygon$1).geometry.coordinates;
  36492. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36493. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36494. }
  36495. },
  36496. _calculateTransformPosition: function(position2, distance2, bearing2, options2) {
  36497. let geoPoint = this._cartesian3ToGeo(position2);
  36498. let point$1 = point([geoPoint.longitude, geoPoint.latitude]);
  36499. let resPoint = destination(point$1, distance2, bearing2, options2).geometry.coordinates;
  36500. let height2 = geoPoint.height;
  36501. if (options2 !== void 0 && options2.calculateHeight !== void 0 && options2.calculateHeight === true) {
  36502. height2 = this._queryHeightFromGeo(resPoint[0], resPoint[1]);
  36503. }
  36504. let cPosition = Cesium.Cartesian3.fromDegrees(
  36505. resPoint[0],
  36506. resPoint[1],
  36507. height2
  36508. );
  36509. return cPosition;
  36510. },
  36511. _unActivateEdit: function() {
  36512. this._clearEditPoint();
  36513. this._removeCoorinateAxis();
  36514. this._closePropertyEditDialog();
  36515. },
  36516. _activateEdit: function(editEntity) {
  36517. let entityType = editEntity.getEntityType();
  36518. let entityIsEdit = editEntity.getIsEdit();
  36519. if (entityIsEdit === void 0 || entityType === void 0 || entityIsEdit === false) {
  36520. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91");
  36521. return;
  36522. }
  36523. if (entityType === DrawTools.DrawType.OdLine) {
  36524. this._activeteOdlineEdit(editEntity);
  36525. } else {
  36526. this._activeteNormalEdit(editEntity);
  36527. }
  36528. },
  36529. _activeteOdlineEdit: function(editEntity) {
  36530. let _self = this;
  36531. let entityType = editEntity.getEntityType();
  36532. if (entityType === void 0 || entityType !== DrawTools.DrawType.OdLine) {
  36533. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91\u6216\u8BE5\u5B9E\u4F53\u4E0D\u662FOD\u7EBF\u7C7B\u578B");
  36534. return;
  36535. }
  36536. let faterEntityId = editEntity.parent.id;
  36537. this._editOdlineEntities = [];
  36538. for (let entity of this._entities.values) {
  36539. if (entity.parent !== void 0 && entity.parent.id === faterEntityId) {
  36540. this._editOdlineEntities.push(entity);
  36541. }
  36542. }
  36543. if (this._editOdlineEntities.length === 0)
  36544. return;
  36545. this._editEntity = this._editOdlineEntities[0];
  36546. for (let i2 = 0; i2 < this._editOdlineEntities.length; i2++) {
  36547. let entity = this._editOdlineEntities[i2];
  36548. let positions = entity.polyline.positions._value;
  36549. if (i2 === 0) {
  36550. this._createEditOdlineStartPoint(positions.first(), entity);
  36551. this._createEditOdlineEndPoint(positions.last(), entity);
  36552. } else {
  36553. this._createEditOdlineEndPoint(positions.last(), entity);
  36554. }
  36555. }
  36556. if (this._sketchEditHandler === void 0) {
  36557. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36558. }
  36559. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36560. _self._eventEditMouseDown(event2);
  36561. });
  36562. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36563. _self._eventEditMouseMove(event2);
  36564. });
  36565. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36566. _self._eventEditMouseUp(event2);
  36567. });
  36568. },
  36569. _activeteNormalEdit: function(editEntity) {
  36570. let _self = this;
  36571. let positions = this._getEntityEditData(editEntity);
  36572. this._removePointEntitys();
  36573. let entityType = editEntity.getEntityType();
  36574. this._editEntity = editEntity;
  36575. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36576. this._createEditCenterPoint(positions[0]);
  36577. this._createEditNodePoint(positions, 1);
  36578. } else if (entityType === DrawTools.DrawType.VideoWall) {
  36579. if (!this._isRuntimeApp()) {
  36580. let position2 = positions[0];
  36581. this._removeCoorinateAxis();
  36582. this._createCoordinateAxis(position2);
  36583. }
  36584. } else {
  36585. this._createEditNodePoint(positions);
  36586. let centerPosition = this._calculateCenterPosition(positions);
  36587. if (centerPosition !== void 0) {
  36588. this._createEditCenterPoint(centerPosition);
  36589. }
  36590. }
  36591. if (entityType !== DrawTools.DrawType.Rectangle && entityType !== DrawTools.DrawType.Circle && entityType !== DrawTools.DrawType.DynamicCircle && entityType !== DrawTools.DrawType.VideoWall) {
  36592. if (entityType === DrawTools.DrawType.SpatialLine) {
  36593. this._createEditMiddlePoint(positions, true);
  36594. } else {
  36595. this._createEditMiddlePoint(positions);
  36596. }
  36597. }
  36598. if (this._sketchEditHandler === void 0) {
  36599. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36600. }
  36601. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36602. _self._eventEditMouseDown(event2);
  36603. });
  36604. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36605. _self._eventEditMouseMove(event2);
  36606. });
  36607. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36608. _self._eventEditMouseUp(event2);
  36609. });
  36610. },
  36611. _eventEditMouseDown: function(event2) {
  36612. let _self = this;
  36613. let feature2 = _self._viewer.scene.pick(event2.position);
  36614. if (feature2 != void 0 && feature2.id instanceof Cesium.Entity) {
  36615. let featureType = feature2.id.getEditType();
  36616. if (featureType === void 0)
  36617. return;
  36618. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  36619. let entityPosition = feature2.id.position._value;
  36620. _self._editPointEntity = feature2.id;
  36621. _self._setMousePointerStyle();
  36622. if (featureType.type === DrawTools.EditPointType.Node || featureType.type === DrawTools.EditPointType.Middle) {
  36623. _self._entityCallbackPropertyByMouseDown();
  36624. _self._removeEntityByObject(_self._editPointEntity);
  36625. if (_self._sketchEditEntitySpatialName != void 0) {
  36626. _self._removeEntityByName(_self._sketchEditEntitySpatialName);
  36627. }
  36628. } else if (featureType.type === DrawTools.EditPointType.Center) {
  36629. _self._entityCenterMouseDownEvent();
  36630. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode) {
  36631. _self._removeEntityByObject(_self._editPointEntity);
  36632. _self._editEntity = featureType.joinEntity;
  36633. let params = _self._editEntity.parent.getParams();
  36634. _self._sketchEditPoints = [];
  36635. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36636. _self._sketchEditPoints.push(joinEntityPositions.first());
  36637. _self._sketchEditPoints.push(joinEntityPositions.last());
  36638. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36639. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36640. return positions;
  36641. }, false);
  36642. } else if (featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36643. _self._removeEntityByObject(_self._editPointEntity);
  36644. _self._editEntity = featureType.joinEntity;
  36645. let params = _self._editEntity.parent.getParams();
  36646. _self._sketchEditPoints = [];
  36647. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36648. _self._sketchEditPoints.push(joinEntityPositions.first());
  36649. for (let odEntity of _self._editOdlineEntities) {
  36650. let odEntityPositions = odEntity.polyline.positions._value;
  36651. let lastPosition = odEntityPositions.last();
  36652. _self._sketchEditPoints.push(lastPosition.clone());
  36653. odEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36654. let positions = _self._calculateOdlinePositios(
  36655. _self._sketchEditPoints[0],
  36656. lastPosition,
  36657. parseInt(params.odlineHeight),
  36658. parseInt(params.odlineCount)
  36659. );
  36660. return positions;
  36661. }, false);
  36662. }
  36663. }
  36664. if (featureType.type === DrawTools.EditPointType.Middle) {
  36665. let index2 = featureType.index;
  36666. _self._sketchEditPoints.splice(index2, 0, entityPosition);
  36667. _self._sketchEditIndex = index2;
  36668. if (_self._sketchWallHeights != void 0 && _self._sketchWallHeights.length > 0) {
  36669. let geoPoint = _self._cartesian3ToGeo(entityPosition);
  36670. let height2 = _self._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  36671. _self._sketchWallHeights.splice(index2, 0, height2);
  36672. let heightDifference = _self._sketchWallMaxHeights[0] - _self._sketchWallHeights[0];
  36673. _self._sketchWallMaxHeights.splice(index2, 0, height2 + heightDifference);
  36674. }
  36675. _self._tooltipInit("\u62D6\u52A8\u4E2D\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36676. } else if (featureType.type === DrawTools.EditPointType.Node) {
  36677. _self._sketchEditIndex = featureType.index;
  36678. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36679. } else if (featureType.type === DrawTools.EditPointType.Spatial) {
  36680. _self._sketchEditIndex = featureType.index;
  36681. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u9AD8\u5EA6", event2.position);
  36682. } else if (featureType.type === DrawTools.EditPointType.CoordinateAxis) {
  36683. _self._tooltipInit("\u62D6\u52A8\u5750\u6807\u8F74\uFF0C\u6539\u53D8\u4F4D\u7F6E", event2.position);
  36684. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode || featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36685. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8OD\u7EBF\u4F4D\u7F6E", event2.position);
  36686. }
  36687. }
  36688. },
  36689. _eventEditMouseMove: function(event2) {
  36690. let _self = this;
  36691. if (_self._editPointEntity != void 0) {
  36692. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  36693. if (!Cesium.defined(loc2.sLocation))
  36694. return;
  36695. _self._editPosition = loc2.sLocation;
  36696. let editEntityType = _self._editPointEntity.getEditType();
  36697. if (editEntityType.type === DrawTools.EditPointType.Node) {
  36698. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36699. let editEntityType2 = _self._editEntity.getEntityType();
  36700. if (editEntityType2 != DrawTools.DrawType.Rectangle && editEntityType2 != DrawTools.DrawType.Circle && editEntityType2 != DrawTools.DrawType.DynamicCircle) {
  36701. if ((editEntityType2 === DrawTools.DrawType.Polygon || editEntityType2 === DrawTools.DrawType.House) && _self._sketchEditIndex === 0) {
  36702. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36703. } else if (editEntityType2 === DrawTools.DrawType.NormalWall || editEntityType2 === DrawTools.DrawType.DynamicWall || editEntityType2 === DrawTools.DrawType.TextWall) {
  36704. _self._sketchWallHeights[_self._sketchEditIndex] = loc2.gLocation.height;
  36705. }
  36706. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36707. if (editEntityType2 === DrawTools.DrawType.SpatialLine) {
  36708. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36709. } else {
  36710. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36711. }
  36712. }
  36713. } else if (editEntityType.type === DrawTools.EditPointType.Middle) {
  36714. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36715. } else if (editEntityType.type === DrawTools.EditPointType.Center) {
  36716. _self._entityCenterMouseMoveEvent(event2);
  36717. } else if (editEntityType.type === DrawTools.EditPointType.Spatial) {
  36718. let ellipsoid = _self._viewer.scene.globe.ellipsoid;
  36719. let cartesian = _self._viewer.camera.pickEllipsoid(
  36720. event2.endPosition,
  36721. ellipsoid
  36722. );
  36723. let bottomPoint = _self._sketchEditPoints[_self._sketchEditIndex];
  36724. let heightDifference = cartesian.z - bottomPoint.z;
  36725. if (heightDifference > 0 && heightDifference < 500) {
  36726. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  36727. _self._sketchWallMaxHeights[i2] = _self._sketchWallHeights[i2] + heightDifference;
  36728. }
  36729. }
  36730. } else if (editEntityType.type === DrawTools.EditPointType.OdlineEndNode) {
  36731. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36732. } else if (editEntityType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36733. _self._sketchEditPoints[0] = loc2.sLocation;
  36734. }
  36735. _self._tooltipInit("\u62AC\u8D77\u9F20\u6807\uFF0C\u5B8C\u6210\u66F4\u6539", event2.endPosition);
  36736. }
  36737. },
  36738. _eventEditMouseUp: function(event2) {
  36739. let _self = this;
  36740. if (_self._editPointEntity != void 0) {
  36741. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  36742. _self._tooltipRemove();
  36743. _self._setMouseDefaultStyle();
  36744. let editEntityPointType = _self._editPointEntity.getEditType().type;
  36745. let entityType = _self._editEntity.getEntityType();
  36746. if (editEntityPointType === DrawTools.EditPointType.CoordinateAxis)
  36747. ;
  36748. else if (editEntityPointType === DrawTools.EditPointType.OdlineEndNode) {
  36749. let params = _self._editEntity.parent.getParams();
  36750. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36751. _self._editEntity.polyline.positions = positions;
  36752. _self._createEditOdlineEndPoint(_self._sketchEditPoints[1], _self._editEntity);
  36753. } else if (editEntityPointType === DrawTools.EditPointType.OdlineStrartNode) {
  36754. let params = _self._editEntity.parent.getParams();
  36755. let index2 = 1;
  36756. for (let odEntity of _self._editOdlineEntities) {
  36757. let lastPosition = _self._sketchEditPoints[index2++];
  36758. let positions = _self._calculateOdlinePositios(
  36759. _self._sketchEditPoints[0],
  36760. lastPosition,
  36761. parseInt(params.odlineHeight),
  36762. parseInt(params.odlineCount)
  36763. );
  36764. odEntity.polyline.positions = positions;
  36765. }
  36766. _self._createEditOdlineStartPoint(_self._sketchEditPoints[0], _self._editOdlineEntities[0]);
  36767. } else {
  36768. if (editEntityPointType === DrawTools.EditPointType.Node || editEntityPointType === DrawTools.EditPointType.Middle) {
  36769. _self._entityCallbackPropertyByMouseUp();
  36770. } else if (editEntityPointType === DrawTools.EditPointType.Center) {
  36771. _self._entityCenterMouseUpEvent(event2);
  36772. }
  36773. _self._removeEntityByName(_self._sketchEditEntityNodeName);
  36774. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36775. _self._removeEntityByName(_self._sketchEditEntityCenterName);
  36776. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36777. let centerPosition = _self._editEntity.position._value;
  36778. let boundaryPosition = _self._calculateCircleBoundaryPoint(
  36779. centerPosition,
  36780. _self._sketchEllipseRadius
  36781. );
  36782. _self._sketchEditPoints[0] = centerPosition;
  36783. _self._sketchEditPoints[1] = boundaryPosition;
  36784. _self._createEditNodePoint(_self._sketchEditPoints, 1);
  36785. _self._createEditCenterPoint(centerPosition);
  36786. } else {
  36787. _self._createEditNodePoint(_self._sketchEditPoints);
  36788. let centerPosition = _self._calculateCenterPosition(_self._sketchEditPoints);
  36789. _self._createEditCenterPoint(centerPosition);
  36790. }
  36791. if (entityType != DrawTools.DrawType.Rectangle && entityType != DrawTools.DrawType.Circle && entityType != DrawTools.DrawType.DynamicCircle) {
  36792. if (entityType === DrawTools.DrawType.SpatialLine) {
  36793. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36794. } else {
  36795. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36796. }
  36797. }
  36798. }
  36799. _self._editPointEntity = void 0;
  36800. }
  36801. },
  36802. _entityCenterMouseDownEvent: function() {
  36803. let _self = this;
  36804. let entityPosition = this._editEntity.position._value;
  36805. this._removeEntityByName(this._sketchEditEntityNodeName);
  36806. this._removeEntityByName(this._sketchEditEntityMiddleName);
  36807. this._removeEntityByName(this._sketchEditEntityCenterName);
  36808. this._startPoint = entityPosition;
  36809. this._startMovePoints = [];
  36810. this._movePoint = entityPosition;
  36811. let editEntityType = this._editEntity.getEntityType();
  36812. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36813. if (this._editEntity.polyline !== void 0) {
  36814. for (let i2 = 0; i2 < this._ellipseOutlineCoordinates.length; i2++) {
  36815. this._startMovePoints.push(this._ellipseOutlineCoordinates[i2]);
  36816. }
  36817. this._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36818. function() {
  36819. return _self._ellipseOutlineCoordinates;
  36820. },
  36821. false
  36822. );
  36823. }
  36824. this._editEntity.position = new Cesium.CallbackProperty(function() {
  36825. return _self._movePoint;
  36826. }, false);
  36827. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36828. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36829. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36830. }
  36831. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(function() {
  36832. return {
  36833. positions: _self._sketchEditPoints
  36834. };
  36835. }, false);
  36836. if (_self._editEntity.polyline != void 0) {
  36837. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36838. return _self._sketchEditPoints;
  36839. }, false);
  36840. }
  36841. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36842. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36843. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36844. }
  36845. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36846. return _self._sketchEditPoints;
  36847. }, false);
  36848. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36849. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36850. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36851. }
  36852. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(_self._sketchEditPoints), false);
  36853. if (_self._editEntity.polyline != void 0) {
  36854. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36855. _self._callUpdateRectangleOutlineCoordinates(),
  36856. false
  36857. );
  36858. }
  36859. }
  36860. },
  36861. _entityCenterMouseMoveEvent: function(event2) {
  36862. this._calculatePositionsByCenter(event2.endPosition, false);
  36863. },
  36864. _calculatePositionsByCenter: function(screenPosition, calculateHeight) {
  36865. let strLoc = this._cartesian3ToGeo(this._startPoint);
  36866. let endLoc = this._transfromFromScreenPoint(screenPosition);
  36867. var point1 = point([strLoc.longitude, strLoc.latitude]);
  36868. var point2 = point([endLoc.gLocation.lng, endLoc.gLocation.lat]);
  36869. var bearing$1 = bearing(point1, point2);
  36870. var options2 = {
  36871. units: "kilometers",
  36872. calculateHeight
  36873. };
  36874. var distance$1 = distance(point1, point2, options2);
  36875. let editEntityType = this._editEntity.getEntityType();
  36876. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36877. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36878. let position2 = this._calculateTransformPosition(
  36879. this._startMovePoints[i2],
  36880. distance$1,
  36881. bearing$1,
  36882. options2
  36883. );
  36884. this._ellipseOutlineCoordinates[i2] = position2.clone();
  36885. }
  36886. this._movePoint = endLoc.sLocation;
  36887. } else {
  36888. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36889. let position2 = this._calculateTransformPosition(
  36890. this._startMovePoints[i2],
  36891. distance$1,
  36892. bearing$1,
  36893. options2
  36894. );
  36895. this._sketchEditPoints[i2] = position2.clone();
  36896. }
  36897. }
  36898. },
  36899. _entityCenterMouseUpEvent: function(event2) {
  36900. this._calculatePositionsByCenter(event2.position, true);
  36901. let _self = this;
  36902. let editEntityType = this._editEntity.getEntityType();
  36903. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36904. this._editEntity.position = this._movePoint;
  36905. if (this._editEntity.polyline !== void 0) {
  36906. this._editEntity.polyline.positions = this._ellipseOutlineCoordinates;
  36907. }
  36908. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36909. this._editEntity.polyline.positions = this._sketchEditPoints;
  36910. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36911. this._editEntity.polygon.hierarchy = {
  36912. positions: _self._sketchEditPoints
  36913. };
  36914. if (this._editEntity.polyline != void 0) {
  36915. this._editEntity.polyline.positions = this._sketchEditPoints;
  36916. }
  36917. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36918. this._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36919. if (this._editEntity.polyline != void 0) {
  36920. this._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36921. }
  36922. }
  36923. },
  36924. _entityCallbackPropertyByMouseUp: function() {
  36925. let _self = this;
  36926. let entityType = _self._editEntity.getEntityType();
  36927. if (entityType === DrawTools.DrawType.Polyline) {
  36928. _self._editEntity.polyline.positions = _self._sketchEditPoints;
  36929. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36930. _self._editEntity.polygon.hierarchy = {
  36931. positions: _self._sketchEditPoints
  36932. };
  36933. if (_self._editEntity.polyline != void 0) {
  36934. let polygonPositions = _self._editEntity.polygon.hierarchy._value.positions;
  36935. let linePositions = [];
  36936. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36937. linePositions.push(polygonPositions[i2].clone());
  36938. }
  36939. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36940. linePositions.push(linePositions[0].clone());
  36941. }
  36942. _self._editEntity.polyline.positions = linePositions;
  36943. }
  36944. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36945. _self._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36946. if (_self._editEntity.polyline != void 0) {
  36947. _self._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36948. }
  36949. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36950. _self._editEntity.ellipse.semiMajorAxis = _self._sketchEllipseRadius;
  36951. _self._editEntity.ellipse.semiMinorAxis = _self._sketchEllipseRadius;
  36952. if (_self._editEntity.polyline != void 0) {
  36953. _self._editEntity.polyline.positions = _self._ellipseOutlineCoordinates;
  36954. }
  36955. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  36956. _self._editEntity.wall.positions = _self._sketchEditPoints;
  36957. _self._editEntity.wall.minimumHeights = _self._sketchWallHeights;
  36958. _self._editEntity.wall.maximumHeights = _self._sketchWallMaxHeights;
  36959. }
  36960. },
  36961. _entityCallbackPropertyByMouseDown: function() {
  36962. let _self = this;
  36963. let entityType = _self._editEntity.getEntityType();
  36964. if (entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.SpatialLine) {
  36965. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36966. function() {
  36967. return _self._sketchEditPoints;
  36968. },
  36969. false
  36970. );
  36971. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36972. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(
  36973. function() {
  36974. return {
  36975. positions: _self._sketchEditPoints
  36976. };
  36977. },
  36978. false
  36979. );
  36980. if (_self._editEntity.polyline != void 0) {
  36981. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36982. function() {
  36983. let polygonPositions = _self._sketchEditPoints;
  36984. let linePositions = [];
  36985. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36986. linePositions.push(polygonPositions[i2].clone());
  36987. }
  36988. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36989. linePositions.push(linePositions[0].clone());
  36990. }
  36991. return linePositions;
  36992. },
  36993. false
  36994. );
  36995. }
  36996. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36997. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(
  36998. _self._callUpdateRectangleCoordinates(_self._sketchEditPoints),
  36999. false
  37000. );
  37001. if (_self._editEntity.polyline != void 0) {
  37002. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  37003. _self._callUpdateRectangleOutlineCoordinates(),
  37004. false
  37005. );
  37006. }
  37007. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  37008. if (_self._editPointEntity.getEditType().index === 1) {
  37009. _self._editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty(
  37010. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  37011. false
  37012. );
  37013. _self._editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty(
  37014. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  37015. false
  37016. );
  37017. }
  37018. if (_self._editEntity.polyline != void 0) {
  37019. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  37020. _self._callEllipseOutlineCoordinate(_self._sketchEditPoints),
  37021. false
  37022. );
  37023. }
  37024. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  37025. _self._editEntity.wall.positions = new Cesium.CallbackProperty(function() {
  37026. return _self._sketchEditPoints;
  37027. }, false);
  37028. _self._editEntity.wall.minimumHeights = new Cesium.CallbackProperty(function() {
  37029. return _self._sketchWallHeights;
  37030. }, false);
  37031. _self._editEntity.wall.maximumHeights = new Cesium.CallbackProperty(function() {
  37032. return _self._sketchWallMaxHeights;
  37033. }, false);
  37034. }
  37035. },
  37036. _createEditPointEntity(options2) {
  37037. let _self = this;
  37038. if (options2 === void 0 || options2.position === void 0)
  37039. return;
  37040. if (options2 === void 0 || options2.editType === void 0)
  37041. return;
  37042. let color2 = options2.color != void 0 ? options2.color : [255, 0, 0, 1];
  37043. let size = options2.size != void 0 && typeof options2.size === "number" ? options2.size : 9;
  37044. let outlineWidth = options2.outlineWidth != void 0 && typeof options2.outlineWidth === "number" ? options2.outlineWidth : 1;
  37045. let outlineColor = options2.outlineColor != void 0 ? options2.outlineColor : [255, 255, 255, 1];
  37046. let pointEntity = new Cesium.Entity({
  37047. name: options2.name != void 0 ? options2.name : _self._sketchEntityName,
  37048. position: options2.position,
  37049. point: {
  37050. show: true,
  37051. pixelSize: size,
  37052. heightReference: Cesium.HeightReference.NONE,
  37053. color: _self._toColorFromArray(color2),
  37054. outlineWidth,
  37055. outlineColor: _self._toColorFromArray(outlineColor),
  37056. disableDepthTestDistance: 15e11
  37057. }
  37058. });
  37059. pointEntity.setEditType(options2.editType);
  37060. _self._entities.add(pointEntity);
  37061. },
  37062. _createEditNodePoint(positions, startIndex) {
  37063. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37064. let _self = this;
  37065. this._sketchEditPoints = [];
  37066. let strIndex = startIndex === void 0 ? 0 : startIndex;
  37067. for (let i2 = 0; i2 < positions.length; i2++) {
  37068. let position2 = positions[i2];
  37069. this._sketchEditPoints.push(position2.clone());
  37070. if (i2 < strIndex)
  37071. continue;
  37072. if (i2 !== 0 && position2.x === positions[0].x && position2.y === positions[0].y && position2.z === positions[0].z) {
  37073. continue;
  37074. }
  37075. let geoPoint = this._cartesian3ToGeo(position2);
  37076. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37077. let newPosition = Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37078. _self._createEditPointEntity({
  37079. name: _self._sketchEditEntityNodeName,
  37080. position: newPosition,
  37081. size: 12,
  37082. color: [0, 0, 255, 1],
  37083. editType: {
  37084. type: DrawTools.EditPointType.Node,
  37085. index: i2
  37086. }
  37087. });
  37088. }
  37089. },
  37090. _createEditSpatialPoint(positions, heights, startIndex) {
  37091. return;
  37092. },
  37093. _createEditMiddlePoint(positions, isSpatial = false) {
  37094. this._sketchEditEntityMiddleName = "SketchEditEntityMiddle";
  37095. let _self = this;
  37096. if (!isSpatial) {
  37097. for (let i2 = 1; i2 < positions.length; i2++) {
  37098. let p1 = positions[i2 - 1];
  37099. let p2 = positions[i2];
  37100. let pCenter = this._calculateMiddlePoint(p1, p2);
  37101. this._createEditPointEntity({
  37102. name: _self._sketchEditEntityMiddleName,
  37103. position: pCenter,
  37104. size: 9,
  37105. color: [255, 255, 0, 1],
  37106. editType: {
  37107. type: DrawTools.EditPointType.Middle,
  37108. index: i2
  37109. }
  37110. });
  37111. }
  37112. } else {
  37113. for (let i2 = 1; i2 < positions.length; i2++) {
  37114. let p1 = positions[i2 - 1];
  37115. let p2 = positions[i2];
  37116. let pCenter = {
  37117. x: (p1.x + p2.x) / 2,
  37118. y: (p1.y + p2.y) / 2,
  37119. z: (p1.z + p2.z) / 2
  37120. };
  37121. this._createEditPointEntity({
  37122. name: _self._sketchEditEntityMiddleName,
  37123. position: pCenter,
  37124. size: 9,
  37125. color: [255, 255, 0, 1],
  37126. editType: {
  37127. type: DrawTools.EditPointType.Middle,
  37128. index: i2
  37129. }
  37130. });
  37131. }
  37132. }
  37133. },
  37134. _createEditCenterPoint(position2) {
  37135. let _self = this;
  37136. this._sketchEditEntityCenterName = "SketchEditEntityCenter";
  37137. this._createEditPointEntity({
  37138. name: _self._sketchEditEntityCenterName,
  37139. position: position2,
  37140. size: 12,
  37141. color: [0, 255, 0, 0.1],
  37142. outlineWidth: 2,
  37143. outlineColor: [255, 255, 255, 1],
  37144. editType: {
  37145. type: DrawTools.EditPointType.Center
  37146. }
  37147. });
  37148. if (this._editEntity != void 0) {
  37149. this._editEntity.position = position2.clone();
  37150. }
  37151. },
  37152. _createEditOdlineEndPoint(position2, joinEntity) {
  37153. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37154. let _self = this;
  37155. let geoPoint = this._cartesian3ToGeo(position2);
  37156. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37157. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37158. _self._createEditPointEntity({
  37159. name: _self._sketchEditEntityNodeName,
  37160. position: position2,
  37161. size: 12,
  37162. color: [0, 0, 255, 1],
  37163. editType: {
  37164. type: DrawTools.EditPointType.OdlineEndNode,
  37165. joinEntity
  37166. }
  37167. });
  37168. },
  37169. _createEditOdlineStartPoint(position2, joinEntity) {
  37170. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37171. let _self = this;
  37172. let geoPoint = this._cartesian3ToGeo(position2);
  37173. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37174. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37175. _self._createEditPointEntity({
  37176. name: _self._sketchEditEntityNodeName,
  37177. position: position2,
  37178. size: 12,
  37179. color: [0, 255, 0, 0.6],
  37180. editType: {
  37181. type: DrawTools.EditPointType.OdlineStrartNode,
  37182. joinEntity
  37183. }
  37184. });
  37185. },
  37186. _calculateMiddlePoint(position1, position2) {
  37187. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position1);
  37188. let g2 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37189. let pt1 = [Cesium.Math.toDegrees(g1.longitude), Cesium.Math.toDegrees(g1.latitude)];
  37190. let pt2 = [Cesium.Math.toDegrees(g2.longitude), Cesium.Math.toDegrees(g2.latitude)];
  37191. let tpt1 = point(pt1);
  37192. let tpt2 = point(pt2);
  37193. let midpoint$1 = midpoint(tpt1, tpt2).geometry.coordinates;
  37194. let height2 = this._queryHeightFromGeo(midpoint$1[0], midpoint$1[1]);
  37195. let result = Cesium.Cartesian3.fromDegrees(midpoint$1[0], midpoint$1[1], height2);
  37196. return result;
  37197. },
  37198. _cartesian3ToGeo: function(position2) {
  37199. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37200. return {
  37201. longitude: Cesium.Math.toDegrees(g.longitude),
  37202. latitude: Cesium.Math.toDegrees(g.latitude),
  37203. height: g.height
  37204. };
  37205. },
  37206. _queryHeightFromGeo: function(longitude, latitude) {
  37207. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37208. return 0;
  37209. let rLng = Cesium.Math.toRadians(longitude);
  37210. let rLat = Cesium.Math.toRadians(latitude);
  37211. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37212. let noQueryEntities = [];
  37213. for (let i2 = 0; i2 < this._entities.values.length; i2++) {
  37214. if (this._entities.values[i2].name === this._sketchEntityName) {
  37215. noQueryEntities.push(this._entities.values[i2]);
  37216. }
  37217. }
  37218. let height2 = this._viewer.scene.sampleHeight(cartographic, noQueryEntities);
  37219. if (height2 === void 0)
  37220. return 0;
  37221. else
  37222. return height2;
  37223. },
  37224. _queryHeightFromGeoAsync: function(longitude, latitude, callComplete) {
  37225. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37226. return 0;
  37227. let rLng = Cesium.Math.toRadians(longitude);
  37228. let rLat = Cesium.Math.toRadians(latitude);
  37229. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37230. let promise = this._viewer.scene.sampleHeightMostDetailed([cartographic]);
  37231. promise.then(function(updatedPositions) {
  37232. if (callComplete)
  37233. callComplete(updatedPositions[0].height);
  37234. });
  37235. },
  37236. _clearEditPoint: function() {
  37237. if (this._sketchEditHandler != void 0) {
  37238. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  37239. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  37240. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37241. }
  37242. this._sketchEditPoints = [];
  37243. this._sketchEditIndex = void 0;
  37244. this._editEntity = void 0;
  37245. this._removeEntityByName(this._sketchEditEntityNodeName);
  37246. this._removeEntityByName(this._sketchEditEntityMiddleName);
  37247. this._removeEntityByName(this._sketchEditEntityCenterName);
  37248. this._removeEntityByName(this._sketchEditEntitySpatialName);
  37249. }
  37250. });
  37251. Object.assign(DrawTools.prototype, {
  37252. _checkColor: function(color2) {
  37253. if (color2 === void 0 || color2 === null)
  37254. return false;
  37255. if (typeof color2 != "number")
  37256. return false;
  37257. let intColor = parseInt(color2);
  37258. if (intColor < 0 || intColor > 255)
  37259. return false;
  37260. return true;
  37261. },
  37262. _checkAlpha: function(alpha) {
  37263. if (alpha === void 0 || alpha === null)
  37264. return false;
  37265. if (typeof alpha != "number")
  37266. return false;
  37267. let floatAlpha = parseFloat(alpha);
  37268. if (floatAlpha < 0 || floatAlpha > 1)
  37269. return false;
  37270. return true;
  37271. },
  37272. _checkColorAndAlpha: function(colorAndAlpah) {
  37273. let setColor = void 0;
  37274. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  37275. return void 0;
  37276. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  37277. setColor = [colorAndAlpah[0], 0, 0, 1];
  37278. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37279. colorAndAlpah[1]
  37280. )) {
  37281. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  37282. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37283. colorAndAlpah[1]
  37284. ) && this._checkColor(colorAndAlpah[2])) {
  37285. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  37286. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37287. colorAndAlpah[1]
  37288. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  37289. colorAndAlpah[3]
  37290. )) {
  37291. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  37292. }
  37293. return setColor;
  37294. }
  37295. });
  37296. Object.assign(DrawTools.prototype, {
  37297. _initOperationDom: function() {
  37298. let _self = this;
  37299. this._operationDomId = "drawButtonDiv";
  37300. this._operationDom = document.getElementById(this._operationDomId);
  37301. this._removeOperationDom();
  37302. this._createOperationMainDom();
  37303. if ([
  37304. DrawTools.DrawType.Rectangle,
  37305. DrawTools.DrawType.Circle,
  37306. DrawTools.DrawType.DynamicCircle,
  37307. DrawTools.DrawType.VideoWall
  37308. ].indexOf(this._drawType) === -1) {
  37309. let btnUndo = this._createOperationUndoButtonDom();
  37310. btnUndo.onclick = function() {
  37311. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  37312. };
  37313. }
  37314. if ([
  37315. DrawTools.DrawType.Rectangle,
  37316. DrawTools.DrawType.Circle,
  37317. DrawTools.DrawType.DynamicCircle,
  37318. DrawTools.DrawType.VideoWall
  37319. ] === -1) {
  37320. let btnCompletion = this._crateOperationCompletionButtonDom();
  37321. btnCompletion.onclick = function() {
  37322. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37323. };
  37324. } else {
  37325. let btnCompletion = this._crateOperationCompletionButtonDom();
  37326. btnCompletion.onclick = function() {
  37327. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  37328. };
  37329. }
  37330. },
  37331. _operationExecuteEvent(eventType) {
  37332. if (this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  37333. let event2 = {
  37334. position: new Cesium.Cartesian2(300, 300)
  37335. };
  37336. let action = this._drawEventHandler.getInputAction(eventType);
  37337. action(event2);
  37338. }
  37339. },
  37340. _createOperationMainDom: function() {
  37341. this._operationDom = document.createElement("div");
  37342. this._operationDom.id = this._operationDomId;
  37343. this._operationDom.style.width = "80px";
  37344. this._operationDom.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37345. this._operationDom.style.borderRadius = "5px";
  37346. this._operationDom.style.display = "flex";
  37347. this._operationDom.style.flexDirection = "column";
  37348. this._operationDom.style.padding = "8px";
  37349. this._operationDom.style.justifyContent = "center";
  37350. this._operationDom.style.position = "absolute";
  37351. this._operationDom.style.bottom = "150px";
  37352. this._operationDom.style.right = "10px";
  37353. document.body.appendChild(this._operationDom);
  37354. },
  37355. _createOperationUndoButtonDom: function() {
  37356. let btnUndo = document.createElement("button");
  37357. btnUndo.id = "btnDrawBackout";
  37358. btnUndo.style.height = "30px";
  37359. btnUndo.style.marginBottom = "8px";
  37360. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37361. btnUndo.style.color = "rgb(255, 255, 255)";
  37362. btnUndo.style.border = "0px solid red";
  37363. btnUndo.style.borderRadius = "5px";
  37364. btnUndo.innerHTML = "\u56DE\u9000";
  37365. btnUndo.style.fontSize = "13px";
  37366. btnUndo.style.cursor = "pointer";
  37367. this._operationDom.appendChild(btnUndo);
  37368. return btnUndo;
  37369. },
  37370. _crateOperationCompletionButtonDom: function() {
  37371. let btnCompletion = document.createElement("button");
  37372. btnCompletion.id = "btnDrawComplete";
  37373. btnCompletion.style.height = "30px";
  37374. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37375. btnCompletion.style.color = "rgb(255, 255, 255)";
  37376. btnCompletion.style.border = "0px solid red";
  37377. btnCompletion.style.borderRadius = "5px";
  37378. btnCompletion.innerHTML = "\u5B8C\u6210";
  37379. btnCompletion.style.fontSize = "13px";
  37380. btnCompletion.style.cursor = "pointer";
  37381. this._operationDom.appendChild(btnCompletion);
  37382. return btnCompletion;
  37383. },
  37384. _removeOperationDom: function() {
  37385. if (this._operationDom !== null && this._operationDom !== void 0) {
  37386. document.body.removeChild(this._operationDom);
  37387. this._operationDom = void 0;
  37388. }
  37389. },
  37390. _createOperationDom: function() {
  37391. if (this._isRuntimeApp()) {
  37392. this._initOperationDom();
  37393. }
  37394. }
  37395. });
  37396. Object.assign(DrawTools.prototype, {
  37397. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  37398. this._editPropertyDialogDomId = "dialog-property-dom";
  37399. this._registerDOMPropertyEdit = "dialog-edit-property";
  37400. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  37401. if (PropertyEditComponent === void 0) {
  37402. PropertyEditComponent = defineCustomElement(DialogEditProperty$2);
  37403. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  37404. }
  37405. this._closePropertyEditDialog();
  37406. let dialogPropertyElement = new PropertyEditComponent({
  37407. params
  37408. });
  37409. dialogPropertyElement.id = this._editPropertyDialogDomId;
  37410. dialogPropertyElement.showDialog = true;
  37411. document.body.appendChild(dialogPropertyElement);
  37412. dialogPropertyElement.addEventListener(
  37413. "submit",
  37414. (e) => {
  37415. if (callEdit)
  37416. callEdit(e.detail[0]);
  37417. },
  37418. false
  37419. );
  37420. dialogPropertyElement.addEventListener(
  37421. "remove",
  37422. (e) => {
  37423. if (callRemove)
  37424. callRemove();
  37425. },
  37426. false
  37427. );
  37428. },
  37429. _closePropertyEditDialog() {
  37430. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  37431. if (dom2 !== null && dom2 !== void 0) {
  37432. document.body.removeChild(dom2);
  37433. }
  37434. }
  37435. });
  37436. DrawTools.DrawType = Object.freeze({
  37437. Point: "point",
  37438. Polyline: "polyline",
  37439. ArrowPolyline: "arrowPolyline",
  37440. DynamicPolyline: "dynamicPolyline",
  37441. GrowPolyline: "\u53D1\u5149\u7EBF",
  37442. OutlinePolyline: "outlinePolyline",
  37443. OdLine: "odLine",
  37444. Polygon: "polygon",
  37445. SpatialLine: "spatialLine",
  37446. Circle: "circle",
  37447. DynamicCircle: "dynamicCircle",
  37448. Rectangle: "rectangle",
  37449. NormalWall: "normalWall",
  37450. DynamicWall: "dynamicWall",
  37451. House: "house",
  37452. TextWall: "text",
  37453. VideoWall: "videoWall"
  37454. });
  37455. DrawTools.IconType = Object.freeze({
  37456. Normal: "normal",
  37457. Blue: "blue",
  37458. Green: "green",
  37459. Violet: "violter"
  37460. });
  37461. DrawTools.EditPointType = Object.freeze({
  37462. Node: "node",
  37463. Middle: "middle",
  37464. Center: "center",
  37465. CoordinateAxis: "coordinateAxis",
  37466. OdlineStrartNode: "odlineStartNode",
  37467. OdlineEndNode: "odlineEndNode"
  37468. });
  37469. DrawTools.WallType = Object.freeze({
  37470. ColorWall: "colorWall",
  37471. DynamicWall: "dynamicWall",
  37472. TextWall: "textWall"
  37473. });
  37474. DrawTools.CircleType = Object.freeze({
  37475. ColorCircle: "colorCircle",
  37476. DynamicCircle: "dynamicCircle"
  37477. });
  37478. DrawTools.PolylineType = Object.freeze({
  37479. NormalPolyline: "normalPolyline",
  37480. ArrowsPolyline: "arrowsPolyline",
  37481. DynamicPolyline: "dynamicPolyline",
  37482. DottedPolyline: "dottedPolyline",
  37483. GrowPolyline: "growPolyline",
  37484. OutlinePolyline: "outlinePolyline"
  37485. });
  37486. DrawTools.PolygonType = Object.freeze({
  37487. NormalPolygon: "normalPolygon",
  37488. HousePolygon: "housePolygon"
  37489. });
  37490. DrawTools.RuntimeEnvironment = Object.freeze({
  37491. App: "app",
  37492. Web: "web"
  37493. });
  37494. class WallMaterialProperty {
  37495. constructor(options2) {
  37496. this._viewer = options2.viewer;
  37497. this._definitionChanged = new Cesium.Event();
  37498. this._color = void 0;
  37499. this.color = options2.color || Cesium.Color.BLUE;
  37500. this.duration = options2.duration || 1e3;
  37501. this.trailImage = options2.trailImage;
  37502. this._time = new Date().getTime();
  37503. this._materialTypeName = "WallMaterial" + this._guid();
  37504. this._param = {
  37505. color: this.color._value.toCssColorString(),
  37506. image: this.trailImage,
  37507. duration: this.duration,
  37508. count: 0,
  37509. direction: "",
  37510. order: ""
  37511. };
  37512. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37513. fabric: {
  37514. type: this._materialTypeName,
  37515. uniforms: {
  37516. time: -20,
  37517. color: new Cesium.Color(1, 0, 0, 0.5),
  37518. image: options2.trailImage
  37519. },
  37520. source: this._getDirectionWallShader(options2.param)
  37521. },
  37522. translucent: function(material) {
  37523. return true;
  37524. }
  37525. });
  37526. }
  37527. _guid() {
  37528. function S4() {
  37529. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  37530. }
  37531. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  37532. }
  37533. getType(time) {
  37534. return this._materialTypeName;
  37535. }
  37536. getValue(time, result) {
  37537. if (!Cesium.defined(result)) {
  37538. result = {};
  37539. }
  37540. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37541. result.image = this.trailImage;
  37542. if (this.duration) {
  37543. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37544. }
  37545. this._viewer.scene.requestRender();
  37546. return result;
  37547. }
  37548. equals(other) {
  37549. return this === other || other instanceof WallMaterialProperty && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  37550. }
  37551. _getDirectionWallShader(options2) {
  37552. let op = Cesium.defaultValue(options2, {});
  37553. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  37554. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  37555. let order = op.order === "+" ? "+" : "-";
  37556. this._param.count = count;
  37557. this._param.direction = direction;
  37558. this._param.order = order;
  37559. let materail = "";
  37560. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  37561. if (direction === "vertical") {
  37562. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  37563. } else if (direction === "horizontal") {
  37564. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  37565. }
  37566. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  37567. return materail;
  37568. }
  37569. }
  37570. Object.defineProperties(WallMaterialProperty.prototype, {
  37571. isConstant: {
  37572. get: function() {
  37573. return false;
  37574. }
  37575. },
  37576. definitionChanged: {
  37577. get: function() {
  37578. return this._definitionChanged;
  37579. }
  37580. },
  37581. color: Cesium.createPropertyDescriptor("color")
  37582. });
  37583. class CircleMaterialProperty {
  37584. constructor(options2) {
  37585. this._viewer = options2.viewer;
  37586. this._definitionChanged = new Cesium.Event();
  37587. this._color = void 0;
  37588. this.color = options2.color || Cesium.Color.BLUE;
  37589. this.count = options2.count || 1;
  37590. this.duration = options2.duration || 1e3;
  37591. this._time = new Date().getTime();
  37592. this._materialTypeName = "jtCircleMaterial";
  37593. this._param = {
  37594. color: this.color._value.toCssColorString(),
  37595. duration: this.duration,
  37596. count: this.count
  37597. };
  37598. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37599. fabric: {
  37600. type: this._materialTypeName,
  37601. uniforms: {
  37602. time: 0,
  37603. color: new Cesium.Color(1, 0, 0, 0.5),
  37604. count: 1
  37605. },
  37606. source: this._getCircleMaterial()
  37607. },
  37608. translucent: function(material) {
  37609. return true;
  37610. }
  37611. });
  37612. }
  37613. _getCircleMaterial() {
  37614. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  37615. return circleMaterial;
  37616. }
  37617. }
  37618. Object.assign(CircleMaterialProperty.prototype, {
  37619. getType: function(time) {
  37620. return this._materialTypeName;
  37621. },
  37622. getValue: function(time, result) {
  37623. if (!Cesium.defined(result)) {
  37624. result = {};
  37625. }
  37626. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37627. result.count = this.count;
  37628. if (this.duration) {
  37629. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37630. }
  37631. this._viewer.scene.requestRender();
  37632. return result;
  37633. },
  37634. equals: function(other) {
  37635. return this === other || other instanceof CircleMaterialProperty && Cesium.Property.equals(this._color, other._color);
  37636. }
  37637. });
  37638. Object.defineProperties(CircleMaterialProperty.prototype, {
  37639. isConstant: {
  37640. get: function() {
  37641. return false;
  37642. }
  37643. },
  37644. definitionChanged: {
  37645. get: function() {
  37646. return this._definitionChanged;
  37647. }
  37648. },
  37649. color: Cesium.createPropertyDescriptor("color")
  37650. });
  37651. const _checkAppOrWeb = function() {
  37652. if (window.navigator.userAgent.match(
  37653. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  37654. )) {
  37655. return "App";
  37656. } else {
  37657. return "Web";
  37658. }
  37659. };
  37660. const isRuntimeApp = function() {
  37661. if (_checkAppOrWeb() === "App") {
  37662. return true;
  37663. }
  37664. return false;
  37665. };
  37666. const isRuntimeWeb = function() {
  37667. if (_checkAppOrWeb() === "Web") {
  37668. return true;
  37669. }
  37670. return false;
  37671. };
  37672. function createOperationMainDom() {
  37673. let buttonDiv = document.createElement("div");
  37674. buttonDiv.id = "drawButtonDiv";
  37675. buttonDiv.style.width = "80px";
  37676. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37677. buttonDiv.style.borderRadius = "5px";
  37678. buttonDiv.style.display = "flex";
  37679. buttonDiv.style.flexDirection = "column";
  37680. buttonDiv.style.padding = "8px";
  37681. buttonDiv.style.justifyContent = "center";
  37682. buttonDiv.style.position = "absolute";
  37683. buttonDiv.style.bottom = "150px";
  37684. buttonDiv.style.right = "10px";
  37685. let btnUndo = document.createElement("button");
  37686. btnUndo.id = "btnDrawBackout";
  37687. btnUndo.style.height = "30px";
  37688. btnUndo.style.marginBottom = "8px";
  37689. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37690. btnUndo.style.color = "rgb(255, 255, 255)";
  37691. btnUndo.style.border = "0px solid red";
  37692. btnUndo.style.borderRadius = "5px";
  37693. btnUndo.innerHTML = "\u56DE\u9000";
  37694. btnUndo.style.fontSize = "13px";
  37695. btnUndo.style.cursor = "pointer";
  37696. buttonDiv.appendChild(btnUndo);
  37697. let btnCompletion = document.createElement("button");
  37698. btnCompletion.id = "btnDrawComplete";
  37699. btnCompletion.style.height = "30px";
  37700. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37701. btnCompletion.style.color = "rgb(255, 255, 255)";
  37702. btnCompletion.style.border = "0px solid red";
  37703. btnCompletion.style.borderRadius = "5px";
  37704. btnCompletion.innerHTML = "\u5B8C\u6210";
  37705. btnCompletion.style.fontSize = "13px";
  37706. btnCompletion.style.cursor = "pointer";
  37707. buttonDiv.appendChild(btnCompletion);
  37708. document.body.appendChild(buttonDiv);
  37709. }
  37710. function showTooltipMessage(message) {
  37711. let msgMainDom = document.getElementById("messageMainDom");
  37712. if (msgMainDom !== null && msgMainDom !== void 0) {
  37713. document.body.removeChild(msgMainDom);
  37714. }
  37715. msgMainDom = document.createElement("div");
  37716. msgMainDom.style.width = "30%";
  37717. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  37718. msgMainDom.style.height = "45px";
  37719. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  37720. msgMainDom.style.borderRadius = "8px";
  37721. msgMainDom.style.display = "flex";
  37722. msgMainDom.style.alignItems = "center";
  37723. msgMainDom.style.paddingLeft = "10px";
  37724. msgMainDom.style.color = "rgb(91, 188, 48)";
  37725. msgMainDom.style.fontSize = "14px";
  37726. msgMainDom.style.fontWeight = "600";
  37727. msgMainDom.style.position = "absolute";
  37728. msgMainDom.style.left = "35%";
  37729. msgMainDom.style.transition = "transform 1s";
  37730. msgMainDom.style.transform = "translateY(-90px)";
  37731. msgMainDom.style.top = "0px";
  37732. msgMainDom.style.zIndex = 1e3;
  37733. document.body.appendChild(msgMainDom);
  37734. let strHtml = "";
  37735. strHtml += "<div style='";
  37736. strHtml += "background-color: rgb(88, 185, 45);";
  37737. strHtml += "color: rgb(255, 255, 255);";
  37738. strHtml += "height: 24px;";
  37739. strHtml += "width: 24px;";
  37740. strHtml += "border-radius: 20px;";
  37741. strHtml += "display: flex;";
  37742. strHtml += "justify-content: center;";
  37743. strHtml += "align-items: center;";
  37744. strHtml += "font-size: 14px;";
  37745. strHtml += "margin-right: 18px;";
  37746. strHtml += "'>&#10003</div>";
  37747. strHtml += "<div>" + message + "</div>";
  37748. msgMainDom.innerHTML = strHtml;
  37749. msgMainDom.addEventListener("transitionend", function() {
  37750. setTimeout(function() {
  37751. document.body.removeChild(msgMainDom);
  37752. }, 1e3);
  37753. }, false);
  37754. setTimeout(function() {
  37755. msgMainDom.style.transform = "translateY(50px)";
  37756. }, 100);
  37757. }
  37758. var RuntimeEnvironment = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  37759. __proto__: null,
  37760. isRuntimeApp,
  37761. isRuntimeWeb,
  37762. createOperationMainDom,
  37763. showTooltipMessage
  37764. }, Symbol.toStringTag, { value: "Module" }));
  37765. class DrawStraightArrow {
  37766. constructor(arg) {
  37767. this.viewer = arg.viewer;
  37768. this.Cesium = arg.Cesium;
  37769. this.floatingPoint = null;
  37770. this._straightArrow = null;
  37771. this._straightArrowLast = null;
  37772. this._positions = [];
  37773. this._entities_point = [];
  37774. this._entities_straightArrow = [];
  37775. this._straightArrowData = null;
  37776. this.DrawStartEvent = new Cesium.Event();
  37777. this.DrawEndEvent = new Cesium.Event();
  37778. this._tooltip = createTooltip(this.viewer.container);
  37779. this._param = {
  37780. id: "DrawStraightArrow",
  37781. polygonColor: "rgba(0,255,0,0.5)",
  37782. outlineColor: "rgba(255, 255, 255, 1)",
  37783. outlineWidth: 1
  37784. };
  37785. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  37786. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  37787. }
  37788. get straightArrow() {
  37789. return this._straightArrowLast;
  37790. }
  37791. getData() {
  37792. return this._straightArrowData;
  37793. }
  37794. computePosition(data) {
  37795. var $this = this;
  37796. var length = data.length;
  37797. var p1 = data[0];
  37798. var p2 = data[length - 1];
  37799. var firstPoint = $this.cartesianToLatlng(p1);
  37800. var endPoints = $this.cartesianToLatlng(p2);
  37801. var arrow = [];
  37802. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37803. for (var i2 = 0; i2 < res.length; i2++) {
  37804. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37805. arrow.push(cart3);
  37806. }
  37807. $this._straightArrowData = [firstPoint, endPoints];
  37808. return new $this.Cesium.PolygonHierarchy(arrow);
  37809. }
  37810. addload(data) {
  37811. var $this = this;
  37812. if (data.length < 2) {
  37813. return null;
  37814. }
  37815. var length = data.length;
  37816. var p1 = data[0];
  37817. var p2 = data[length - 1];
  37818. var arrow = [];
  37819. var res = $this.fineArrow([p1[0], p1[1]], [p2[0], p2[1]]);
  37820. for (var i2 = 0; i2 < res.length; i2++) {
  37821. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37822. arrow.push(cart3);
  37823. }
  37824. var arrowEntity = $this.viewer.entities.add({
  37825. Type: "DrawStraightArrow",
  37826. Position: data,
  37827. id: data.id || $this.objId,
  37828. polygon: {
  37829. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  37830. show: true,
  37831. fill: true,
  37832. clampToGround: true,
  37833. material: $this.polygonMaterial
  37834. }
  37835. });
  37836. return arrowEntity;
  37837. }
  37838. startCreate(drawType) {
  37839. if (isRuntimeApp()) {
  37840. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37841. }
  37842. var $this = this;
  37843. this.drawType = drawType;
  37844. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  37845. this.handler.setInputAction(function(evt) {
  37846. if (isRuntimeApp()) {
  37847. var cartesian = $this.getCatesian3FromPX(evt.position);
  37848. if (!cartesian) {
  37849. return;
  37850. }
  37851. $this.createPoint(cartesian);
  37852. $this._positions.push(cartesian);
  37853. if ($this._positions.length === 2) {
  37854. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  37855. $this.destroy();
  37856. if (!$this.Cesium.defined($this._straightArrow)) {
  37857. $this._straightArrow = $this.createStraightArrow();
  37858. createOperationMainDom();
  37859. document.getElementById("btnDrawBackout").style.display = "none";
  37860. document.getElementById("btnDrawComplete").onclick = () => {
  37861. $this._straightArrowData = $this._positions.concat();
  37862. $this.viewer.entities.remove($this._straightArrow);
  37863. $this._straightArrow = null;
  37864. $this._positions = [];
  37865. var lnglatArr = [];
  37866. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37867. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37868. lnglatArr.push(lnglat);
  37869. }
  37870. $this._straightArrowData = lnglatArr;
  37871. var straightArrow = $this.addload($this._straightArrowData);
  37872. $this._entities_straightArrow.push(straightArrow);
  37873. $this._straightArrowLast = straightArrow;
  37874. $this.clearPoint();
  37875. $this.destroy();
  37876. let buttonDiv = document.getElementById("drawButtonDiv");
  37877. if (buttonDiv) {
  37878. document.body.removeChild(buttonDiv);
  37879. }
  37880. };
  37881. }
  37882. }
  37883. } else {
  37884. clearTimeout($this._timer);
  37885. $this._timer = setTimeout(function() {
  37886. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  37887. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  37888. if ($this._positions.length == 0) {
  37889. $this._positions.push(cartesian2.clone());
  37890. $this.floatingPoint = $this.createPoint(cartesian2);
  37891. $this._positions.push(cartesian2);
  37892. }
  37893. if (!$this._straightArrow) {
  37894. $this.createPoint(cartesian2);
  37895. } else {
  37896. $this._straightArrowData = $this._positions.concat();
  37897. $this.viewer.entities.remove($this._straightArrow);
  37898. $this._straightArrow = null;
  37899. $this._positions = [];
  37900. $this.floatingPoint.position.setValue(cartesian2);
  37901. var lnglatArr = [];
  37902. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37903. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37904. lnglatArr.push(lnglat);
  37905. }
  37906. $this._straightArrowData = lnglatArr;
  37907. var straightArrow = $this.addload($this._straightArrowData);
  37908. $this._entities_straightArrow.push(straightArrow);
  37909. $this._straightArrowLast = straightArrow;
  37910. $this.clearPoint();
  37911. $this.destroy();
  37912. $this._tooltip.setVisible(false);
  37913. }
  37914. }, 200);
  37915. }
  37916. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37917. this.handler.setInputAction(function(evt) {
  37918. if (isRuntimeApp())
  37919. return;
  37920. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37921. if ($this._positions.length < 2)
  37922. return;
  37923. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  37924. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  37925. if (!$this.Cesium.defined($this._straightArrow)) {
  37926. $this._straightArrow = $this.createStraightArrow();
  37927. }
  37928. $this.floatingPoint.position.setValue(cartesian);
  37929. if ($this._straightArrow) {
  37930. $this._positions.pop();
  37931. $this._positions.push(cartesian);
  37932. }
  37933. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37934. }
  37935. createStraightArrow() {
  37936. var $this = this;
  37937. var arrowEntity = $this.viewer.entities.add({
  37938. polygon: {
  37939. hierarchy: new $this.Cesium.CallbackProperty(
  37940. function() {
  37941. var length = $this._positions.length;
  37942. var p1 = $this._positions[0];
  37943. var p2 = $this._positions[length - 1];
  37944. var firstPoint = $this.cartesianToLatlng(p1);
  37945. var endPoints = $this.cartesianToLatlng(p2);
  37946. var arrow = [];
  37947. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37948. for (var i2 = 0; i2 < res.length; i2++) {
  37949. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37950. arrow.push(cart3);
  37951. }
  37952. return new $this.Cesium.PolygonHierarchy(arrow);
  37953. },
  37954. false
  37955. ),
  37956. show: true,
  37957. fill: true,
  37958. clampToGround: true,
  37959. material: $this.polygonMaterial
  37960. }
  37961. });
  37962. $this._entities_straightArrow.push(arrowEntity);
  37963. return arrowEntity;
  37964. }
  37965. createPoint(cartesian) {
  37966. var $this = this;
  37967. var point2 = this.viewer.entities.add({
  37968. position: cartesian,
  37969. point: {
  37970. pixelSize: 10,
  37971. color: $this.Cesium.Color.RED,
  37972. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  37973. }
  37974. });
  37975. $this._entities_point.push(point2);
  37976. return point2;
  37977. }
  37978. cartesianToLatlng(cartesian) {
  37979. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  37980. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  37981. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  37982. return [lng, lat];
  37983. }
  37984. destroy() {
  37985. if (this.handler) {
  37986. this.handler.destroy();
  37987. this.handler = null;
  37988. }
  37989. }
  37990. clearPoint() {
  37991. this.DrawEndEvent.raiseEvent(this._straightArrowLast, this._straightArrowData, this.drawType);
  37992. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37993. this.viewer.entities.remove(this._entities_point[i2]);
  37994. }
  37995. this._entities_point = [];
  37996. }
  37997. clear() {
  37998. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37999. this.viewer.entities.remove(this._entities_point[i2]);
  38000. }
  38001. for (var i2 = 0; i2 < this._entities_straightArrow.length; i2++) {
  38002. this.viewer.entities.remove(this._entities_straightArrow[i2]);
  38003. }
  38004. this.floatingPoint = null;
  38005. this._straightArrow = null;
  38006. this._straightArrowLast = null;
  38007. this._positions = [];
  38008. this._entities_point = [];
  38009. this._entities_straightArrow = [];
  38010. this._straightArrowData = null;
  38011. }
  38012. getCatesian3FromPX(px) {
  38013. var cartesian;
  38014. var ray = this.viewer.camera.getPickRay(px);
  38015. if (!ray)
  38016. return null;
  38017. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38018. return cartesian;
  38019. }
  38020. fineArrowDefualParam() {
  38021. return {
  38022. tailWidthFactor: 0.15,
  38023. neckWidthFactor: 0.2,
  38024. headWidthFactor: 0.25,
  38025. headAngle: Math.PI / 8.5,
  38026. neckAngle: Math.PI / 13
  38027. };
  38028. }
  38029. fineArrow(tailPoint, headerPoint) {
  38030. var $this = this;
  38031. if (tailPoint.length < 2 || headerPoint.length < 2)
  38032. return;
  38033. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  38034. let neckWidthFactor = $this.fineArrowDefualParam().neckWidthFactor;
  38035. let headWidthFactor = $this.fineArrowDefualParam().headWidthFactor;
  38036. let headAngle = $this.fineArrowDefualParam().headAngle;
  38037. let neckAngle = $this.fineArrowDefualParam().neckAngle;
  38038. var o = [];
  38039. o[0] = tailPoint;
  38040. o[1] = headerPoint;
  38041. var e = o[0], r2 = o[1], n = $this.getBaseLength(o), g = n * tailWidthFactor, i2 = n * neckWidthFactor, s = n * headWidthFactor, a = $this.getThirdPoint(r2, e, Math.PI / 2, g, true), l = $this.getThirdPoint(r2, e, Math.PI / 2, g, false), u = $this.getThirdPoint(e, r2, headAngle, s, false), c = $this.getThirdPoint(e, r2, headAngle, s, true), p = $this.getThirdPoint(e, r2, neckAngle, i2, false), h2 = $this.getThirdPoint(e, r2, neckAngle, i2, true), d2 = [];
  38042. d2.push(a[0], a[1], p[0], p[1], u[0], u[1], r2[0], r2[1], c[0], c[1], h2[0], h2[1], l[0], l[1], e[0], e[1]);
  38043. return $this.Cesium.Cartesian3.fromDegreesArray(d2);
  38044. }
  38045. getBaseLength(t2) {
  38046. return Math.pow(this.wholeDistance(t2), 0.99);
  38047. }
  38048. wholeDistance(t2) {
  38049. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38050. o += this.distance(t2[e], t2[e + 1]);
  38051. return o;
  38052. }
  38053. distance(t2, o) {
  38054. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38055. }
  38056. getThirdPoint(t2, o, e, r2, n) {
  38057. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38058. return [o[0] + s, o[1] + a];
  38059. }
  38060. getAzimuth(t2, o) {
  38061. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38062. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38063. }
  38064. }
  38065. class DrawAttackArrow {
  38066. constructor(arg) {
  38067. __publicField(this, "getAttackArrowBodyPoints", function(t2, o, e, r2) {
  38068. var $this = this;
  38069. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38070. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38071. l += $this.distance(t2[p - 1], t2[p]);
  38072. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38073. u.push(f), c.push(E2);
  38074. }
  38075. return u.concat(c);
  38076. });
  38077. __publicField(this, "getQBSplinePoints", function(t2) {
  38078. if (t2.length <= 2)
  38079. return t2;
  38080. var o = 2, e = [], r2 = t2.length - o - 1, y = 0;
  38081. e.push(t2[0]);
  38082. for (var n = 0; r2 >= n; n++)
  38083. for (var g = 0; 1 >= g; g += 0.05) {
  38084. for (var i2 = y = 0, s = 0; o >= s; s++) {
  38085. var a = this.getQuadricBSplineFactor(s, g);
  38086. i2 += a * t2[n + s][0], y += a * t2[n + s][1];
  38087. }
  38088. e.push([i2, y]);
  38089. }
  38090. return e.push(t2[t2.length - 1]), e;
  38091. });
  38092. __publicField(this, "getQuadricBSplineFactor", function(t2, o) {
  38093. return 0 == t2 ? Math.pow(o - 1, 2) / 2 : 1 == t2 ? (-2 * Math.pow(o, 2) + 2 * o + 1) / 2 : 2 == t2 ? Math.pow(o, 2) / 2 : 0;
  38094. });
  38095. __publicField(this, "array2Dto1D", function(array) {
  38096. var newArray = [];
  38097. array.forEach(function(elt) {
  38098. newArray.push(elt[0]);
  38099. newArray.push(elt[1]);
  38100. });
  38101. return newArray;
  38102. });
  38103. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  38104. this.viewer = arg.viewer;
  38105. this.Cesium = arg.Cesium;
  38106. this.floatingPoint = null;
  38107. this._AttackArrow = null;
  38108. this._AttackArrowLast = null;
  38109. this._positions = [];
  38110. this._entities_point = [];
  38111. this._entities_AttackArrow = [];
  38112. this._AttackArrowData = null;
  38113. this.DrawStartEvent = new Cesium.Event();
  38114. this.DrawEndEvent = new Cesium.Event();
  38115. this._tooltip = createTooltip(this.viewer.container);
  38116. this._param = {
  38117. id: "DrawStraightArrow",
  38118. polygonColor: "rgba(0,255,0,0.5)",
  38119. outlineColor: "rgba(255, 255, 255, 1)",
  38120. outlineWidth: 1
  38121. };
  38122. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38123. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38124. }
  38125. get AttackArrow() {
  38126. return this._AttackArrowLast;
  38127. }
  38128. getData() {
  38129. return this._AttackArrowData;
  38130. }
  38131. addload(data) {
  38132. var $this = this;
  38133. if (data.length < 3) {
  38134. return null;
  38135. }
  38136. var res = $this.fineArrow(data);
  38137. var returnData = res.polygonalPoint;
  38138. var arrowEntity = $this.viewer.entities.add({
  38139. Type: "DrawAttackArrow",
  38140. Position: data,
  38141. id: data.id || $this.objId,
  38142. polygon: {
  38143. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38144. show: true,
  38145. fill: true,
  38146. clampToGround: true,
  38147. material: $this.polygonMaterial
  38148. }
  38149. });
  38150. return arrowEntity;
  38151. }
  38152. computePosition(data) {
  38153. let $this = this;
  38154. var lnglatArr = [];
  38155. for (var i2 = 0; i2 < data.length; i2++) {
  38156. var lnglat = $this.cartesianToLatlng(data[i2]);
  38157. lnglatArr.push(lnglat);
  38158. }
  38159. $this._AttackArrowData = lnglatArr;
  38160. var res = $this.fineArrow(lnglatArr);
  38161. var returnData = res.polygonalPoint;
  38162. return new $this.Cesium.PolygonHierarchy(returnData);
  38163. }
  38164. startCreate(drawType) {
  38165. if (isRuntimeApp()) {
  38166. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38167. }
  38168. var $this = this;
  38169. this.drawType = drawType;
  38170. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  38171. this.handler.setInputAction(function(evt) {
  38172. if (isRuntimeApp()) {
  38173. var cartesian = $this.getCatesian3FromPX(evt.position);
  38174. if (!cartesian) {
  38175. return;
  38176. }
  38177. $this.createPoint(cartesian);
  38178. $this._positions.push(cartesian);
  38179. if ($this._positions.length <= 2) {
  38180. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38181. } else {
  38182. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38183. if ($this._positions.length === 3) {
  38184. if (!$this.Cesium.defined($this._AttackArrow)) {
  38185. $this._AttackArrow = $this.createAttackArrow();
  38186. createOperationMainDom();
  38187. document.getElementById("btnDrawBackout").style.display = "none";
  38188. document.getElementById("btnDrawComplete").onclick = () => {
  38189. $this._AttackArrowData = $this._positions.concat();
  38190. $this.viewer.entities.remove($this._AttackArrow);
  38191. $this._AttackArrow = null;
  38192. $this._positions = [];
  38193. let lnglatArr = [];
  38194. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38195. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38196. lnglatArr.push(lnglat);
  38197. }
  38198. $this._AttackArrowData = lnglatArr;
  38199. var straightArrow = $this.addload(lnglatArr);
  38200. $this._entities_AttackArrow.push(straightArrow);
  38201. $this._AttackArrowLast = straightArrow;
  38202. $this.clearPoint();
  38203. $this.destroy();
  38204. let buttonDiv = document.getElementById("drawButtonDiv");
  38205. if (buttonDiv) {
  38206. document.body.removeChild(buttonDiv);
  38207. }
  38208. };
  38209. }
  38210. }
  38211. }
  38212. } else {
  38213. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38214. clearTimeout($this._timer);
  38215. $this._timer = setTimeout(function() {
  38216. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38217. if (!cartesian2) {
  38218. return;
  38219. }
  38220. if ($this._positions.length == 0) {
  38221. $this.floatingPoint = $this.createPoint(cartesian2);
  38222. $this.createPoint(cartesian2);
  38223. }
  38224. if ($this._positions.length == 1) {
  38225. $this._positions.push(cartesian2.clone());
  38226. $this.createPoint(cartesian2);
  38227. }
  38228. $this._positions.push(cartesian2);
  38229. }, 200);
  38230. }
  38231. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38232. this.handler.setInputAction(function(evt) {
  38233. if (isRuntimeApp())
  38234. return;
  38235. if ($this._positions.length == 0) {
  38236. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38237. } else {
  38238. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38239. }
  38240. if ($this._positions.length < 3)
  38241. return;
  38242. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38243. if (!$this.Cesium.defined($this._AttackArrow)) {
  38244. $this._AttackArrow = $this.createAttackArrow();
  38245. }
  38246. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38247. if (!cartesian) {
  38248. return;
  38249. }
  38250. $this.floatingPoint.position.setValue(cartesian);
  38251. if ($this._AttackArrow) {
  38252. $this._positions.pop();
  38253. $this._positions.push(cartesian);
  38254. }
  38255. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38256. this.handler.setInputAction(function(evt) {
  38257. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38258. this.handler.setInputAction(function(evt) {
  38259. if (isRuntimeApp())
  38260. return;
  38261. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38262. clearTimeout($this._timer);
  38263. var cartesian = $this.getCatesian3FromPX(evt.position);
  38264. $this._positions.pop();
  38265. $this._positions.push(cartesian);
  38266. $this._AttackArrowData = $this._positions.concat();
  38267. $this.viewer.entities.remove($this._AttackArrow);
  38268. $this._AttackArrow = null;
  38269. $this._positions = [];
  38270. $this.floatingPoint.position.setValue(cartesian);
  38271. let lnglatArr = [];
  38272. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38273. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38274. lnglatArr.push(lnglat);
  38275. }
  38276. $this._AttackArrowData = lnglatArr;
  38277. var straightArrow = $this.addload(lnglatArr);
  38278. $this._entities_AttackArrow.push(straightArrow);
  38279. $this._AttackArrowLast = straightArrow;
  38280. $this.clearPoint();
  38281. $this.destroy();
  38282. $this._tooltip.setVisible(false);
  38283. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38284. }
  38285. createAttackArrow() {
  38286. var $this = this;
  38287. var arrowEntity = $this.viewer.entities.add({
  38288. polygon: {
  38289. hierarchy: new $this.Cesium.CallbackProperty(
  38290. function() {
  38291. var lnglatArr = [];
  38292. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38293. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38294. lnglatArr.push(lnglat);
  38295. }
  38296. var res = $this.fineArrow(lnglatArr);
  38297. var returnData = res.polygonalPoint;
  38298. return new $this.Cesium.PolygonHierarchy(returnData);
  38299. },
  38300. false
  38301. ),
  38302. show: true,
  38303. fill: true,
  38304. clampToGround: true,
  38305. material: $this.polygonMaterial
  38306. }
  38307. });
  38308. $this._entities_AttackArrow.push(arrowEntity);
  38309. return arrowEntity;
  38310. }
  38311. createPoint(cartesian) {
  38312. var $this = this;
  38313. var point2 = this.viewer.entities.add({
  38314. position: cartesian,
  38315. point: {
  38316. pixelSize: 10,
  38317. color: $this.Cesium.Color.RED,
  38318. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38319. }
  38320. });
  38321. point2.objId = this.objId;
  38322. $this._entities_point.push(point2);
  38323. return point2;
  38324. }
  38325. cartesianToLatlng(cartesian) {
  38326. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38327. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38328. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38329. let alt = cartographic.height;
  38330. return [lng, lat, alt];
  38331. }
  38332. destroy() {
  38333. if (this.handler) {
  38334. this.handler.destroy();
  38335. this.handler = null;
  38336. }
  38337. }
  38338. clearPoint() {
  38339. this.DrawEndEvent.raiseEvent(this._AttackArrowLast, this._AttackArrowData, this.drawType);
  38340. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38341. this.viewer.entities.remove(this._entities_point[i2]);
  38342. }
  38343. this._entities_point = [];
  38344. }
  38345. clear() {
  38346. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38347. this.viewer.entities.remove(this._entities_point[i2]);
  38348. }
  38349. for (var i2 = 0; i2 < this._entities_AttackArrow.length; i2++) {
  38350. this.viewer.entities.remove(this._entities_AttackArrow[i2]);
  38351. }
  38352. this.floatingPoint = null;
  38353. this._AttackArrow = null;
  38354. this._AttackArrowLast = null;
  38355. this._positions = [];
  38356. this._entities_point = [];
  38357. this._entities_AttackArrow = [];
  38358. this._AttackArrowData = null;
  38359. }
  38360. getCatesian3FromPX(px) {
  38361. var cartesian;
  38362. var ray = this.viewer.camera.getPickRay(px);
  38363. if (!ray)
  38364. return null;
  38365. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38366. return cartesian;
  38367. }
  38368. fineArrowDefualParam() {
  38369. return {
  38370. headHeightFactor: 0.18,
  38371. headWidthFactor: 0.3,
  38372. neckHeightFactor: 0.85,
  38373. neckWidthFactor: 0.15,
  38374. tailWidthFactor: 0.1,
  38375. headTailFactor: 0.8,
  38376. swallowTailFactor: 1
  38377. };
  38378. }
  38379. fineArrow(inputPoint) {
  38380. var $this = this;
  38381. inputPoint = $this.dereplication(inputPoint);
  38382. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  38383. let swallowTailFactor = $this.fineArrowDefualParam().swallowTailFactor;
  38384. let swallowTailPnt = $this.fineArrowDefualParam().swallowTailPnt;
  38385. var result = {
  38386. controlPoint: null,
  38387. polygonalPoint: null
  38388. };
  38389. result.controlPoint = inputPoint;
  38390. var t2 = inputPoint.length;
  38391. if (!(2 > t2)) {
  38392. if (2 == inputPoint.length) {
  38393. result.polygonalPoint = inputPoint;
  38394. return result;
  38395. }
  38396. var o = inputPoint, e = o[0], r2 = o[1];
  38397. $this.isClockWise(o[0], o[1], o[2]) && (e = o[1], r2 = o[0]);
  38398. var n = $this.mid(e, r2), g = [n].concat(o.slice(2)), i2 = $this.getAttackArrowHeadPoints(g, e, r2, $this.fineArrowDefualParam()), s = i2[0], a = i2[4], l = $this.distance(e, r2), u = $this.getBaseLength(g), c = u * tailWidthFactor * swallowTailFactor;
  38399. swallowTailPnt = $this.getThirdPoint(g[1], g[0], 0, c, true);
  38400. var p = l / u, h2 = $this.getAttackArrowBodyPoints(g, s, a, p), t2 = h2.length, d2 = [e].concat(h2.slice(0, t2 / 2));
  38401. d2.push(s);
  38402. var f = [r2].concat(h2.slice(t2 / 2, t2));
  38403. var newArray = [];
  38404. f.push(a), d2 = $this.getQBSplinePoints(d2), f = $this.getQBSplinePoints(f), newArray = $this.array2Dto1D(d2.concat(i2, f.reverse(), [swallowTailPnt, d2[0]]));
  38405. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38406. }
  38407. return result;
  38408. }
  38409. getArrowBodyPoints(t2, o, e, r2) {
  38410. var $this = this;
  38411. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38412. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38413. l += $this.distance(t2[p - 1], t2[p]);
  38414. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38415. u.push(f), c.push(E2);
  38416. }
  38417. return u.concat(c);
  38418. }
  38419. getAttackArrowHeadPoints(t2, o, e, defaultParam) {
  38420. var $this = this;
  38421. let headHeightFactor = defaultParam.headHeightFactor;
  38422. let headTailFactor = defaultParam.headTailFactor;
  38423. let headWidthFactor = defaultParam.headWidthFactor;
  38424. let neckWidthFactor = defaultParam.neckWidthFactor;
  38425. let neckHeightFactor = defaultParam.neckHeightFactor;
  38426. var r2 = $this.getBaseLength(t2), n = r2 * headHeightFactor, g = t2[t2.length - 1];
  38427. r2 = $this.distance(g, t2[t2.length - 2]);
  38428. var i2 = $this.distance(o, e);
  38429. n > i2 * headTailFactor && (n = i2 * headTailFactor);
  38430. var s = n * headWidthFactor, a = n * neckWidthFactor;
  38431. n = n > r2 ? r2 : n;
  38432. var l = n * neckHeightFactor, u = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), c = $this.getThirdPoint(t2[t2.length - 2], g, 0, l, true), p = $this.getThirdPoint(g, u, Math.PI / 2, s, false), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true), d2 = $this.getThirdPoint(g, c, Math.PI / 2, a, false), f = $this.getThirdPoint(g, c, Math.PI / 2, a, true);
  38433. return [d2, p, g, h2, f];
  38434. }
  38435. getAngleOfThreePoints(t2, o, e) {
  38436. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38437. return 0 > r2 ? r2 + Math.PI * 2 : r2;
  38438. }
  38439. dereplication(array) {
  38440. var last = array[array.length - 1];
  38441. var change = false;
  38442. var newArray = [];
  38443. newArray = array.filter(function(i2) {
  38444. if (i2[0] != last[0] && i2[1] != last[1]) {
  38445. return i2;
  38446. }
  38447. change = true;
  38448. });
  38449. if (change)
  38450. newArray.push(last);
  38451. return newArray;
  38452. }
  38453. getBaseLength(t2) {
  38454. return Math.pow(this.wholeDistance(t2), 0.99);
  38455. }
  38456. wholeDistance(t2) {
  38457. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38458. o += this.distance(t2[e], t2[e + 1]);
  38459. return o;
  38460. }
  38461. distance(t2, o) {
  38462. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38463. }
  38464. getThirdPoint(t2, o, e, r2, n) {
  38465. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38466. return [o[0] + s, o[1] + a];
  38467. }
  38468. getAzimuth(t2, o) {
  38469. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38470. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38471. }
  38472. isClockWise(t2, o, e) {
  38473. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38474. }
  38475. mid(t2, o) {
  38476. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38477. }
  38478. }
  38479. class DrawPincerArrow {
  38480. constructor(arg) {
  38481. this.viewer = arg.viewer;
  38482. this.Cesium = arg.Cesium;
  38483. this.floatingPoint = null;
  38484. this._PincerArrow = null;
  38485. this._PincerArrowLast = null;
  38486. this._positions = [];
  38487. this._entities_point = [];
  38488. this._entities_PincerArrow = [];
  38489. this._PincerArrowData = null;
  38490. this.DrawStartEvent = new Cesium.Event();
  38491. this.DrawEndEvent = new Cesium.Event();
  38492. this._tooltip = createTooltip(this.viewer.container);
  38493. this._param = {
  38494. id: "DrawStraightArrow",
  38495. polygonColor: "rgba(0,255,0,0.5)",
  38496. outlineColor: "rgba(255, 255, 255, 1)",
  38497. outlineWidth: 1
  38498. };
  38499. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38500. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38501. }
  38502. get PincerArrow() {
  38503. return this._PincerArrowLast;
  38504. }
  38505. getData() {
  38506. return this._PincerArrowData;
  38507. }
  38508. addload(data) {
  38509. var $this = this;
  38510. if (data.length < 3) {
  38511. return;
  38512. }
  38513. var res = $this.doubleArrow(data);
  38514. var returnData = res.polygonalPoint;
  38515. var arrowEntity = $this.viewer.entities.add({
  38516. Type: "DrawPincerArrow",
  38517. Position: data,
  38518. id: data.id || $this.objId,
  38519. polygon: {
  38520. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38521. show: true,
  38522. fill: true,
  38523. clampToGround: true,
  38524. material: $this.polygonMaterial
  38525. }
  38526. });
  38527. return arrowEntity;
  38528. }
  38529. computePosition(data) {
  38530. let $this = this;
  38531. var lnglatArr = [];
  38532. for (var i2 = 0; i2 < data.length; i2++) {
  38533. var lnglat = $this.cartesianToLatlng(data[i2]);
  38534. lnglatArr.push(lnglat);
  38535. }
  38536. $this._PincerArrowData = lnglatArr;
  38537. var res = $this.doubleArrow(lnglatArr);
  38538. var returnData = res.polygonalPoint;
  38539. return new $this.Cesium.PolygonHierarchy(returnData);
  38540. }
  38541. startCreate(drawType) {
  38542. if (isRuntimeApp()) {
  38543. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38544. }
  38545. var $this = this;
  38546. this.drawType = drawType;
  38547. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  38548. this.handler.setInputAction(function(evt) {
  38549. if (isRuntimeApp()) {
  38550. var cartesian = $this.getCatesian3FromPX(evt.position);
  38551. if (!cartesian) {
  38552. return;
  38553. }
  38554. $this.createPoint(cartesian);
  38555. $this._positions.push(cartesian);
  38556. if ($this._positions.length < 3 || $this._positions.length === 4) {
  38557. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38558. }
  38559. if ($this._positions.length === 2) {
  38560. if (!$this.Cesium.defined($this._PincerArrow)) {
  38561. $this._PincerArrow = $this.createPincerArrow();
  38562. }
  38563. }
  38564. if ($this._positions.length === 3) {
  38565. $this._positions.pop();
  38566. $this._positions.push(cartesian);
  38567. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38568. createOperationMainDom();
  38569. document.getElementById("btnDrawBackout").style.display = "none";
  38570. document.getElementById("btnDrawComplete").onclick = () => {
  38571. $this._PincerArrowData = $this._positions.concat();
  38572. $this.viewer.entities.remove($this._PincerArrow);
  38573. $this._PincerArrow = null;
  38574. $this._positions = [];
  38575. var lnglatArr = [];
  38576. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38577. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38578. lnglatArr.push(lnglat);
  38579. }
  38580. $this._PincerArrowData = lnglatArr;
  38581. var pincerArrow = $this.addload(lnglatArr);
  38582. $this._entities_PincerArrow.push(pincerArrow);
  38583. $this._PincerArrowLast = pincerArrow;
  38584. $this.clearPoint();
  38585. $this.destroy();
  38586. let buttonDiv = document.getElementById("drawButtonDiv");
  38587. if (buttonDiv) {
  38588. document.body.removeChild(buttonDiv);
  38589. }
  38590. };
  38591. }
  38592. if ($this._positions.length === 5) {
  38593. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38594. $this.destroy();
  38595. }
  38596. } else {
  38597. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38598. clearTimeout($this._timer);
  38599. $this._timer = setTimeout(function() {
  38600. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38601. if (!cartesian2) {
  38602. return;
  38603. }
  38604. if ($this._positions.length == 0) {
  38605. $this.floatingPoint = $this.createPoint(cartesian2);
  38606. }
  38607. if ($this._positions.length < 5) {
  38608. $this._positions.push(cartesian2);
  38609. $this.createPoint(cartesian2);
  38610. }
  38611. if ($this._positions.length == 5) {
  38612. $this._positions[4] = cartesian2;
  38613. $this.floatingPoint.position.setValue(cartesian2);
  38614. }
  38615. }, 200);
  38616. }
  38617. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38618. this.handler.setInputAction(function(evt) {
  38619. if (isRuntimeApp())
  38620. return;
  38621. if ($this._positions.length == 0) {
  38622. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38623. } else {
  38624. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38625. }
  38626. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38627. if (!cartesian)
  38628. return;
  38629. if ($this._positions.length < 2)
  38630. return;
  38631. if (!$this.Cesium.defined($this._PincerArrow)) {
  38632. if ($this._positions.length == 2) {
  38633. $this._positions.push(cartesian);
  38634. }
  38635. $this._PincerArrow = $this.createPincerArrow();
  38636. }
  38637. $this.floatingPoint.position.setValue(cartesian);
  38638. if ($this._positions.length == 3) {
  38639. $this._positions[2] = cartesian;
  38640. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38641. }
  38642. if ($this._positions.length > 3) {
  38643. $this._positions.pop();
  38644. $this._positions.push(cartesian);
  38645. if ($this._positions === 4) {
  38646. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38647. }
  38648. if ($this._positions.length == 5) {
  38649. $this._tooltip.showAt(evt.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38650. }
  38651. }
  38652. console.log($this._positions.length);
  38653. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38654. this.handler.setInputAction(function(evt) {
  38655. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38656. this.handler.setInputAction(function(evt) {
  38657. if (isRuntimeApp())
  38658. return;
  38659. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38660. clearTimeout($this._timer);
  38661. if (!$this._PincerArrow) {
  38662. return;
  38663. }
  38664. var cartesian = $this.getCatesian3FromPX(evt.position);
  38665. if (!cartesian)
  38666. return;
  38667. $this._positions.pop();
  38668. $this._PincerArrowData = $this._positions.concat();
  38669. $this.viewer.entities.remove($this._PincerArrow);
  38670. $this._PincerArrow = null;
  38671. $this._positions = [];
  38672. $this.floatingPoint.position.setValue(cartesian);
  38673. var lnglatArr = [];
  38674. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38675. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38676. lnglatArr.push(lnglat);
  38677. }
  38678. $this._PincerArrowData = lnglatArr;
  38679. var pincerArrow = $this.addload(lnglatArr);
  38680. $this._entities_PincerArrow.push(pincerArrow);
  38681. $this._PincerArrowLast = pincerArrow;
  38682. $this.clearPoint();
  38683. $this.destroy();
  38684. $this._tooltip.setVisible(false);
  38685. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38686. }
  38687. createPincerArrow() {
  38688. var $this = this;
  38689. $this._computeTempPositions();
  38690. var arrowEntity = $this.viewer.entities.add({
  38691. polygon: {
  38692. hierarchy: new $this.Cesium.CallbackProperty(
  38693. function() {
  38694. var lnglatArr = [];
  38695. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38696. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38697. lnglatArr.push(lnglat);
  38698. }
  38699. var res = $this.doubleArrow(lnglatArr);
  38700. var returnData = res.polygonalPoint;
  38701. return new $this.Cesium.PolygonHierarchy(returnData);
  38702. },
  38703. false
  38704. ),
  38705. show: true,
  38706. fill: true,
  38707. clampToGround: true,
  38708. material: $this.polygonMaterial
  38709. }
  38710. });
  38711. $this._entities_PincerArrow.push(arrowEntity);
  38712. return arrowEntity;
  38713. }
  38714. createPoint(cartesian) {
  38715. var $this = this;
  38716. var point2 = this.viewer.entities.add({
  38717. position: cartesian,
  38718. point: {
  38719. pixelSize: 10,
  38720. color: $this.Cesium.Color.RED,
  38721. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38722. }
  38723. });
  38724. $this._entities_point.push(point2);
  38725. return point2;
  38726. }
  38727. cartesianToLatlng(cartesian) {
  38728. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38729. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38730. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38731. let alt = cartographic.height;
  38732. return [lng, lat, alt];
  38733. }
  38734. destroy() {
  38735. if (this.handler) {
  38736. this.handler.destroy();
  38737. this.handler = null;
  38738. }
  38739. }
  38740. clearPoint() {
  38741. this.DrawEndEvent.raiseEvent(this._PincerArrowLast, this._PincerArrowData, this.drawType);
  38742. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38743. this.viewer.entities.remove(this._entities_point[i2]);
  38744. }
  38745. this._entities_point = [];
  38746. }
  38747. clear() {
  38748. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38749. this.viewer.entities.remove(this._entities_point[i2]);
  38750. }
  38751. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  38752. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  38753. }
  38754. this.floatingPoint = null;
  38755. this._PincerArrow = null;
  38756. this._PincerArrowLast = null;
  38757. this._positions = [];
  38758. this._entities_point = [];
  38759. this._entities_PincerArrow = [];
  38760. this._PincerArrowData = null;
  38761. }
  38762. getCatesian3FromPX(px) {
  38763. var cartesian;
  38764. var ray = this.viewer.camera.getPickRay(px);
  38765. if (!ray)
  38766. return null;
  38767. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38768. return cartesian;
  38769. }
  38770. _computeTempPositions() {
  38771. var _this = this;
  38772. var pnts = [].concat(_this._positions);
  38773. var num = pnts.length;
  38774. var first = pnts[0];
  38775. var last = pnts[num - 1];
  38776. if (_this._isSimpleXYZ(first, last) == false) {
  38777. pnts.push(first);
  38778. num += 1;
  38779. }
  38780. _this.tempPositions = [];
  38781. for (var i2 = 1; i2 < num; i2++) {
  38782. var p1 = pnts[i2 - 1];
  38783. var p2 = pnts[i2];
  38784. var cp = _this._computeCenterPotition(p1, p2);
  38785. _this.tempPositions.push(p1);
  38786. _this.tempPositions.push(cp);
  38787. }
  38788. }
  38789. _isSimpleXYZ(p1, p2) {
  38790. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  38791. return true;
  38792. }
  38793. return false;
  38794. }
  38795. _computeCenterPotition(p1, p2) {
  38796. var _this = this;
  38797. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  38798. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  38799. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  38800. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  38801. return cp;
  38802. }
  38803. doubleArrow(inputPoint) {
  38804. var $this = this;
  38805. this.connPoint = null;
  38806. this.tempPoint4 = null;
  38807. this.points = inputPoint;
  38808. var result = {
  38809. controlPoint: null,
  38810. polygonalPoint: null
  38811. };
  38812. var t2 = inputPoint.length;
  38813. if (!(2 > t2)) {
  38814. if (2 == t2)
  38815. return inputPoint;
  38816. var o = this.points[0], e = this.points[1], r2 = this.points[2], t2 = inputPoint.length;
  38817. 3 == t2 ? this.tempPoint4 = $this.getTempPoint4(o, e, r2) : this.tempPoint4 = this.points[3], 3 == t2 || 4 == t2 ? this.connPoint = $this.mid(o, e) : this.connPoint = this.points[4];
  38818. var n, g;
  38819. $this.isClockWise(o, e, r2) ? (n = $this.getArrowPoints(o, this.connPoint, this.tempPoint4, false), g = $this.getArrowPoints(this.connPoint, e, r2, true)) : (n = $this.getArrowPoints(e, this.connPoint, r2, false), g = $this.getArrowPoints(this.connPoint, o, this.tempPoint4, true));
  38820. var i2 = n.length, s = (i2 - 5) / 2, a = n.slice(0, s), l = n.slice(s, s + 5), u = n.slice(s + 5, i2), c = g.slice(0, s), p = g.slice(s, s + 5), h2 = g.slice(s + 5, i2);
  38821. c = $this.getBezierPoints(c);
  38822. var d2 = $this.getBezierPoints(h2.concat(a.slice(1)));
  38823. u = $this.getBezierPoints(u);
  38824. var f = c.concat(p, d2, l, u);
  38825. var newArray = $this.array2Dto1D(f);
  38826. result.controlPoint = [o, e, r2, this.tempPoint4, this.connPoint];
  38827. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38828. }
  38829. return result;
  38830. }
  38831. getTempPoint4(t2, o, e) {
  38832. var $this = this;
  38833. var r2, n, g, i2, s = $this.mid(t2, o), a = $this.distance(s, e), l = $this.getAngleOfThreePoints(t2, s, e);
  38834. return l < Math.PI / 2 ? (n = a * Math.sin(l), g = a * Math.cos(l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : l >= Math.PI / 2 && l < Math.PI ? (n = a * Math.sin(Math.PI - l), g = a * Math.cos(Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)) : l >= Math.PI && l < 1.5 * Math.PI ? (n = a * Math.sin(l - Math.PI), g = a * Math.cos(l - Math.PI), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : (n = a * Math.sin(2 * Math.PI - l), g = a * Math.cos(2 * Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)), r2;
  38835. }
  38836. mid(t2, o) {
  38837. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38838. }
  38839. isClockWise(t2, o, e) {
  38840. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38841. }
  38842. getArrowPoints(t2, o, e, r2) {
  38843. var $this = this;
  38844. var doubleArrowDefualParam = {
  38845. type: "doublearrow",
  38846. headHeightFactor: 0.25,
  38847. headWidthFactor: 0.3,
  38848. neckHeightFactor: 0.85,
  38849. fixPointCount: 4,
  38850. neckWidthFactor: 0.15
  38851. };
  38852. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38853. var n = $this.mid(t2, o), g = $this.distance(n, e), i2 = $this.getThirdPoint(e, n, 0, 0.3 * g, true), s = $this.getThirdPoint(e, n, 0, 0.5 * g, true);
  38854. i2 = $this.getThirdPoint(n, i2, Math.PI / 2, g / 5, r2), s = $this.getThirdPoint(n, s, Math.PI / 2, g / 4, r2);
  38855. var a = [n, i2, s, e], l = $this.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor), u = l[0], c = l[4], p = $this.distance(t2, o) / $this.getBaseLength(a) / 2, h2 = $this.getArrowBodyPoints(a, u, c, p), d2 = h2.length, f = h2.slice(0, d2 / 2), E2 = h2.slice(d2 / 2, d2);
  38856. return f.push(u), E2.push(c), f = f.reverse(), f.push(o), E2 = E2.reverse(), E2.push(t2), f.reverse().concat(l, E2);
  38857. }
  38858. getArrowHeadPoints(t2, o, e) {
  38859. var $this = this;
  38860. var doubleArrowDefualParam = {
  38861. type: "doublearrow",
  38862. headHeightFactor: 0.25,
  38863. headWidthFactor: 0.3,
  38864. neckHeightFactor: 0.85,
  38865. fixPointCount: 4,
  38866. neckWidthFactor: 0.15
  38867. };
  38868. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38869. var r2 = $this.getBaseLength(t2), n = r2 * this.headHeightFactor, g = t2[t2.length - 1], i2 = ($this.distance(o, e), n * this.headWidthFactor), s = n * this.neckWidthFactor, a = n * this.neckHeightFactor, l = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), u = $this.getThirdPoint(t2[t2.length - 2], g, 0, a, true), c = $this.getThirdPoint(g, l, Math.PI / 2, i2, false), p = $this.getThirdPoint(g, l, Math.PI / 2, i2, true), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, false), d2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true);
  38870. return [h2, c, g, p, d2];
  38871. }
  38872. getArrowBodyPoints(t2, o, e, r2) {
  38873. var $this = this;
  38874. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38875. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38876. l += $this.distance(t2[p - 1], t2[p]);
  38877. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38878. u.push(f), c.push(E2);
  38879. }
  38880. return u.concat(c);
  38881. }
  38882. getBezierPoints(t2) {
  38883. if (t2.length <= 2)
  38884. return t2;
  38885. for (var o = [], e = t2.length - 1, r2 = 0; 1 >= r2; r2 += 0.01) {
  38886. for (var n = 0, y = 0, g = 0; e >= g; g++) {
  38887. var i2 = this.getBinomialFactor(e, g), s = Math.pow(r2, g), a = Math.pow(1 - r2, e - g);
  38888. n += i2 * s * a * t2[g][0], y += i2 * s * a * t2[g][1];
  38889. }
  38890. o.push([n, y]);
  38891. }
  38892. return o.push(t2[e]), o;
  38893. }
  38894. getBaseLength(t2) {
  38895. return Math.pow(this.wholeDistance(t2), 0.99);
  38896. }
  38897. wholeDistance(t2) {
  38898. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38899. o += this.distance(t2[e], t2[e + 1]);
  38900. return o;
  38901. }
  38902. getBinomialFactor(t2, o) {
  38903. return this.getFactorial(t2) / (this.getFactorial(o) * this.getFactorial(t2 - o));
  38904. }
  38905. getFactorial(t2) {
  38906. if (1 >= t2)
  38907. return 1;
  38908. if (2 == t2)
  38909. return 2;
  38910. if (3 == t2)
  38911. return 6;
  38912. if (4 == t2)
  38913. return 24;
  38914. if (5 == t2)
  38915. return 120;
  38916. for (var o = 1, e = 1; t2 >= e; e++)
  38917. o *= e;
  38918. return o;
  38919. }
  38920. array2Dto1D(array) {
  38921. var newArray = [];
  38922. array.forEach(function(elt) {
  38923. newArray.push(elt[0]);
  38924. newArray.push(elt[1]);
  38925. });
  38926. return newArray;
  38927. }
  38928. distance(t2, o) {
  38929. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38930. }
  38931. getAngleOfThreePoints(t2, o, e) {
  38932. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38933. return 0 > r2 ? r2 + 2 * Math.PI : r2;
  38934. }
  38935. getAzimuth(t2, o) {
  38936. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38937. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38938. }
  38939. getThirdPoint(t2, o, e, r2, n) {
  38940. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38941. return [o[0] + s, o[1] + a];
  38942. }
  38943. }
  38944. class DrawGatheringPlace {
  38945. constructor(arg) {
  38946. this.viewer = arg.viewer;
  38947. this.Cesium = arg.Cesium;
  38948. this.tt = 0.4;
  38949. this.floatingPoint = null;
  38950. this.drawHandler = null;
  38951. this.gatheringPlace = null;
  38952. this._gatheringPlaceLast = null;
  38953. this._positions = [];
  38954. this._entities_point = [];
  38955. this._entities_PincerArrow = [];
  38956. this._gatheringPlaceData = null;
  38957. this.DrawStartEvent = new Cesium.Event();
  38958. this.DrawEndEvent = new Cesium.Event();
  38959. this._tooltip = createTooltip(this.viewer.container);
  38960. this._param = {
  38961. id: "DrawStraightArrow",
  38962. polygonColor: "rgba(0,255,0,0.5)",
  38963. outlineColor: "rgba(255, 255, 255, 1)",
  38964. outlineWidth: 1
  38965. };
  38966. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38967. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38968. }
  38969. get PincerArrow() {
  38970. return this._gatheringPlaceLast;
  38971. }
  38972. getData() {
  38973. return this._gatheringPlaceData;
  38974. }
  38975. computePosition(data) {
  38976. var $this = this;
  38977. if (data.length < 3) {
  38978. return;
  38979. }
  38980. var gatheringPlace = [];
  38981. var lonLats = [];
  38982. var res = $this.fineGatheringPlace(data);
  38983. for (var i2 = 0; i2 < res.length; i2++) {
  38984. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  38985. gatheringPlace.push(cart3);
  38986. }
  38987. for (let q2 = 0; q2 < data.length; q2++) {
  38988. lonLats.push($this.cartesianToLatlng(data[q2]));
  38989. }
  38990. this._gatheringPlaceData = lonLats;
  38991. return new $this.Cesium.PolygonHierarchy(gatheringPlace);
  38992. }
  38993. addload(data) {
  38994. var $this = this;
  38995. if (data.length < 3) {
  38996. return;
  38997. }
  38998. var gatheringPlace = [];
  38999. var lnglatArr = [];
  39000. for (var i2 = 0; i2 < data.length; i2++) {
  39001. var lnglat = $this.LatlngTocartesian(data[i2]);
  39002. lnglatArr.push(lnglat);
  39003. }
  39004. var res = $this.fineGatheringPlace(lnglatArr);
  39005. for (var i2 = 0; i2 < res.length; i2++) {
  39006. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  39007. gatheringPlace.push(cart3);
  39008. }
  39009. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  39010. var arrowEntity = $this.viewer.entities.add({
  39011. Type: "DrawGatheringPlace",
  39012. Position: data,
  39013. id: data.id || $this.objId,
  39014. polygon: {
  39015. hierarchy: pHierarchy,
  39016. show: true,
  39017. fill: true,
  39018. clampToGround: true,
  39019. material: $this.polygonMaterial
  39020. }
  39021. });
  39022. return arrowEntity;
  39023. }
  39024. startCreate(drawType) {
  39025. if (isRuntimeApp()) {
  39026. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39027. }
  39028. var $this = this;
  39029. this.drawType = drawType;
  39030. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  39031. this.handler.setInputAction(function(event2) {
  39032. if (isRuntimeApp()) {
  39033. var cartesian = $this.getCatesian3FromPX(event2.position);
  39034. if (!cartesian) {
  39035. return;
  39036. }
  39037. $this.createPoint(cartesian);
  39038. $this._positions.push(cartesian);
  39039. if ($this._positions.length < 3) {
  39040. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39041. }
  39042. if ($this._positions.length === 3) {
  39043. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  39044. $this.destroy();
  39045. if (!$this.Cesium.defined($this.gatheringPlace)) {
  39046. $this.gatheringPlace = $this.createGatheringPlace();
  39047. createOperationMainDom();
  39048. document.getElementById("btnDrawBackout").style.display = "none";
  39049. document.getElementById("btnDrawComplete").onclick = () => {
  39050. $this._gatheringPlaceData = $this._positions.concat();
  39051. $this.viewer.entities.remove($this.gatheringPlace);
  39052. $this.gatheringPlace = null;
  39053. var lnglatArr = [];
  39054. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  39055. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  39056. lnglatArr.push(lnglat);
  39057. }
  39058. $this._gatheringPlaceData = lnglatArr;
  39059. var pincerArrow = $this.addload(lnglatArr);
  39060. $this._entities_PincerArrow.push(pincerArrow);
  39061. $this._gatheringPlaceLast = pincerArrow;
  39062. $this.viewer.entities.remove($this.floatingPoint);
  39063. $this.floatingPoint = null;
  39064. $this.clearPoint();
  39065. $this.destroy();
  39066. let buttonDiv = document.getElementById("drawButtonDiv");
  39067. if (buttonDiv) {
  39068. document.body.removeChild(buttonDiv);
  39069. }
  39070. };
  39071. }
  39072. }
  39073. } else {
  39074. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39075. clearTimeout($this._timer);
  39076. $this._timer = setTimeout(function() {
  39077. var position2 = event2.position;
  39078. if (!$this.Cesium.defined(position2)) {
  39079. return;
  39080. }
  39081. var ray = $this.viewer.camera.getPickRay(position2);
  39082. if (!$this.Cesium.defined(ray)) {
  39083. return;
  39084. }
  39085. var cartesian2 = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39086. if (!$this.Cesium.defined(cartesian2)) {
  39087. return;
  39088. }
  39089. if ($this._positions.length == 0) {
  39090. $this._positions.push(cartesian2.clone());
  39091. $this.floatingPoint = $this.createPoint(cartesian2);
  39092. }
  39093. if ($this._positions.length <= 2) {
  39094. $this.createPoint(cartesian2);
  39095. $this._positions.push(cartesian2);
  39096. }
  39097. }, 200);
  39098. }
  39099. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39100. this.handler.setInputAction(function(event2) {
  39101. if (isRuntimeApp())
  39102. return;
  39103. if ($this._positions.length == 0) {
  39104. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39105. } else {
  39106. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39107. }
  39108. if ($this._positions.length < 2) {
  39109. return;
  39110. }
  39111. if ($this._positions.length == 3) {
  39112. $this._tooltip.showAt(event2.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39113. }
  39114. var position2 = event2.endPosition;
  39115. if (!$this.Cesium.defined(position2)) {
  39116. return;
  39117. }
  39118. var ray = $this.viewer.camera.getPickRay(position2);
  39119. if (!$this.Cesium.defined(ray)) {
  39120. return;
  39121. }
  39122. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39123. if (!$this.Cesium.defined(cartesian)) {
  39124. return;
  39125. }
  39126. if (!$this.Cesium.defined($this.gatheringPlace)) {
  39127. $this.gatheringPlace = $this.createGatheringPlace();
  39128. }
  39129. $this.floatingPoint.position.setValue(cartesian);
  39130. if ($this.gatheringPlace) {
  39131. if ($this._positions.length == 3) {
  39132. $this._positions[1] = cartesian;
  39133. } else {
  39134. $this._positions.pop();
  39135. $this._positions.push(cartesian);
  39136. }
  39137. }
  39138. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39139. this.handler.setInputAction(function(movement) {
  39140. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39141. this.handler.setInputAction(function(movement) {
  39142. if (isRuntimeApp())
  39143. return;
  39144. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39145. clearTimeout($this._timer);
  39146. if ($this._positions.length >= 3) {
  39147. $this._gatheringPlaceData = $this._positions.concat();
  39148. $this.viewer.entities.remove($this.gatheringPlace);
  39149. $this.gatheringPlace = null;
  39150. var lnglatArr = [];
  39151. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  39152. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  39153. lnglatArr.push(lnglat);
  39154. }
  39155. $this._gatheringPlaceData = lnglatArr;
  39156. var pincerArrow = $this.addload(lnglatArr);
  39157. $this._entities_PincerArrow.push(pincerArrow);
  39158. $this._gatheringPlaceLast = pincerArrow;
  39159. $this.viewer.entities.remove($this.floatingPoint);
  39160. $this.floatingPoint = null;
  39161. $this.clearPoint();
  39162. $this.destroy();
  39163. $this._tooltip.setVisible(false);
  39164. }
  39165. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39166. }
  39167. createGatheringPlace() {
  39168. let $this = this;
  39169. var gatheringPlaceEntity = $this.viewer.entities.add({
  39170. polygon: {
  39171. hierarchy: new $this.Cesium.CallbackProperty(function() {
  39172. if ($this._positions.length < 3) {
  39173. return;
  39174. }
  39175. var gatheringPlace = [];
  39176. var res = $this.fineGatheringPlace($this._positions);
  39177. for (var i2 = 0; i2 < res.length; i2++) {
  39178. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  39179. gatheringPlace.push(cart3);
  39180. }
  39181. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  39182. var lonLats = $this.cartesianToLatlng($this._positions);
  39183. pHierarchy.keyPoints = lonLats;
  39184. return pHierarchy;
  39185. }, false),
  39186. show: true,
  39187. fill: true,
  39188. clampToGround: true,
  39189. material: $this.polygonMaterial
  39190. }
  39191. });
  39192. $this._entities_PincerArrow.push(gatheringPlaceEntity);
  39193. return gatheringPlaceEntity;
  39194. }
  39195. createPoint(cartesian) {
  39196. var $this = this;
  39197. var point2 = this.viewer.entities.add({
  39198. position: cartesian,
  39199. point: {
  39200. pixelSize: 10,
  39201. color: $this.Cesium.Color.RED,
  39202. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39203. }
  39204. });
  39205. $this._entities_point.push(point2);
  39206. return point2;
  39207. }
  39208. cartesianToLatlng(cartesian) {
  39209. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39210. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  39211. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  39212. let alt = cartographic.height;
  39213. return [lng, lat, alt];
  39214. }
  39215. destroy() {
  39216. if (this.handler) {
  39217. this.handler.destroy();
  39218. this.handler = null;
  39219. }
  39220. }
  39221. clearPoint() {
  39222. this.DrawEndEvent.raiseEvent(this._gatheringPlaceLast, this._gatheringPlaceData, this.drawType);
  39223. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39224. this.viewer.entities.remove(this._entities_point[i2]);
  39225. }
  39226. this._entities_point = [];
  39227. }
  39228. clear() {
  39229. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39230. this.viewer.entities.remove(this._entities_point[i2]);
  39231. }
  39232. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  39233. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  39234. }
  39235. this.floatingPoint = null;
  39236. this._PincerArrow = null;
  39237. this._PincerArrowLast = null;
  39238. this._positions = [];
  39239. this._entities_point = [];
  39240. this._entities_PincerArrow = [];
  39241. this._PincerArrowData = null;
  39242. }
  39243. getCatesian3FromPX(px) {
  39244. var cartesian;
  39245. var ray = this.viewer.camera.getPickRay(px);
  39246. if (!ray)
  39247. return null;
  39248. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39249. return cartesian;
  39250. }
  39251. _computeTempPositions() {
  39252. var _this = this;
  39253. var pnts = [].concat(_this._positions);
  39254. var num = pnts.length;
  39255. var first = pnts[0];
  39256. var last = pnts[num - 1];
  39257. if (_this._isSimpleXYZ(first, last) == false) {
  39258. pnts.push(first);
  39259. num += 1;
  39260. }
  39261. _this.tempPositions = [];
  39262. for (var i2 = 1; i2 < num; i2++) {
  39263. var p1 = pnts[i2 - 1];
  39264. var p2 = pnts[i2];
  39265. var cp = _this._computeCenterPotition(p1, p2);
  39266. _this.tempPositions.push(p1);
  39267. _this.tempPositions.push(cp);
  39268. }
  39269. }
  39270. _isSimpleXYZ(p1, p2) {
  39271. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  39272. return true;
  39273. }
  39274. return false;
  39275. }
  39276. _computeCenterPotition(p1, p2) {
  39277. var _this = this;
  39278. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  39279. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  39280. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  39281. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  39282. return cp;
  39283. }
  39284. getLonLat(cartesian) {
  39285. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39286. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  39287. var pos = {
  39288. lon: cartographic.longitude,
  39289. lat: cartographic.latitude,
  39290. alt: cartographic.height
  39291. };
  39292. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  39293. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  39294. return pos;
  39295. }
  39296. LatlngTocartesian(latlng) {
  39297. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39298. return cartesian3;
  39299. }
  39300. fineGatheringPlace(gatherPosition) {
  39301. let $this = this;
  39302. let points2 = gatherPosition.length;
  39303. if (points2 < 2) {
  39304. return false;
  39305. } else {
  39306. let pnts = new Array();
  39307. gatherPosition.forEach(function(item) {
  39308. var posLonLat = $this.getLonLat(item);
  39309. pnts.push([posLonLat.lon, posLonLat.lat]);
  39310. });
  39311. if (pnts.length === 2) {
  39312. let mid2 = $this.mid(pnts[0], pnts[1]);
  39313. let d2 = $this.distance(pnts[0], mid2) / 0.9;
  39314. let pnt = $this.getThirdPoint(pnts[0], mid2, Math.PI / 2, d2, true);
  39315. pnts = [pnts[0], pnt, pnts[1]];
  39316. }
  39317. let mid = $this.mid(pnts[0], pnts[2]);
  39318. pnts.push(mid, pnts[0], pnts[1]);
  39319. let [normals, pnt1, pnt2, pnt3, pList] = [
  39320. [],
  39321. void 0,
  39322. void 0,
  39323. void 0,
  39324. []
  39325. ];
  39326. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39327. pnt1 = pnts[i2];
  39328. pnt2 = pnts[i2 + 1];
  39329. pnt3 = pnts[i2 + 2];
  39330. let normalPoints = $this.getBisectorNormals($this.tt, pnt1, pnt2, pnt3);
  39331. normals = normals.concat(normalPoints);
  39332. }
  39333. let count = normals.length;
  39334. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39335. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39336. pnt1 = pnts[i2];
  39337. pnt2 = pnts[i2 + 1];
  39338. pList = pList.concat(pnt1);
  39339. for (let t2 = 0; t2 <= 100; t2++) {
  39340. let pnt = $this.getCubicValue(t2 / 100, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39341. pList = pList.concat(pnt);
  39342. }
  39343. pList = pList.concat(pnt2);
  39344. }
  39345. return Cesium.Cartesian3.fromDegreesArray(pList);
  39346. }
  39347. }
  39348. mid(t2, o) {
  39349. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  39350. }
  39351. distance(t2, o) {
  39352. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  39353. }
  39354. getThirdPoint(t2, o, e, r2, n) {
  39355. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  39356. return [o[0] + s, o[1] + a];
  39357. }
  39358. getAzimuth(t2, o) {
  39359. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  39360. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  39361. }
  39362. getBisectorNormals(t2, o, e, r2) {
  39363. var n = this.getNormal(o, e, r2), g = Math.sqrt(n[0] * n[0] + n[1] * n[1]), i2 = n[0] / g, s = n[1] / g, a = this.distance(o, e), l = this.distance(e, r2);
  39364. if (g > 1e-4)
  39365. if (this.isClockWise(o, e, r2)) {
  39366. var u = t2 * a, c = e[0] - u * s, p = e[1] + u * i2, h2 = [c, p];
  39367. u = t2 * l, c = e[0] + u * s, p = e[1] - u * i2;
  39368. var d2 = [c, p];
  39369. } else
  39370. u = t2 * a, c = e[0] + u * s, p = e[1] - u * i2, h2 = [c, p], u = t2 * l, c = e[0] - u * s, p = e[1] + u * i2, d2 = [c, p];
  39371. else
  39372. c = e[0] + t2 * (o[0] - e[0]), p = e[1] + t2 * (o[1] - e[1]), h2 = [c, p], c = e[0] + t2 * (r2[0] - e[0]), p = e[1] + t2 * (r2[1] - e[1]), d2 = [c, p];
  39373. return [h2, d2];
  39374. }
  39375. getNormal(t2, o, e) {
  39376. var r2 = t2[0] - o[0], n = t2[1] - o[1], g = Math.sqrt(r2 * r2 + n * n);
  39377. r2 /= g, n /= g;
  39378. var i2 = e[0] - o[0], s = e[1] - o[1], a = Math.sqrt(i2 * i2 + s * s);
  39379. i2 /= a, s /= a;
  39380. var l = r2 + i2, u = n + s;
  39381. return [l, u];
  39382. }
  39383. isClockWise(t2, o, e) {
  39384. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  39385. }
  39386. getCubicValue(t2, o, e, r2, n) {
  39387. t2 = Math.max(Math.min(t2, 1), 0);
  39388. var g = 1 - t2, i2 = t2 * t2, s = i2 * t2, a = g * g, l = a * g, u = l * o[0] + 3 * a * t2 * e[0] + 3 * g * i2 * r2[0] + s * n[0], c = l * o[1] + 3 * a * t2 * e[1] + 3 * g * i2 * r2[1] + s * n[1];
  39389. return [u, c];
  39390. }
  39391. }
  39392. class DrawClosedCurve {
  39393. constructor(arg) {
  39394. this.viewer = arg.viewer;
  39395. this.Cesium = arg.Cesium;
  39396. this.floatingPoint = null;
  39397. this._ClosedCurve = null;
  39398. this._ClosedCurveLast = null;
  39399. this._positions = [];
  39400. this._entities_point = [];
  39401. this._entities_ClosedCurve = [];
  39402. this._ClosedCurveData = null;
  39403. this.ZERO_TOLERANCE = 1e-4;
  39404. this.FITTING_COUNT = 100;
  39405. this.t = 0.3;
  39406. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  39407. this.DrawStartEvent = new Cesium.Event();
  39408. this.DrawEndEvent = new Cesium.Event();
  39409. this._tooltip = createTooltip(this.viewer.container);
  39410. this._param = {
  39411. id: "DrawStraightArrow",
  39412. polygonColor: "rgba(0,255,0,0.5)",
  39413. outlineColor: "rgba(255, 255, 255, 1)",
  39414. outlineWidth: 1
  39415. };
  39416. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39417. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39418. }
  39419. get ClosedCurve() {
  39420. return this._ClosedCurveLast;
  39421. }
  39422. getData() {
  39423. return this._ClosedCurveData;
  39424. }
  39425. computePosition(data) {
  39426. let $this = this;
  39427. if (data.length < 2)
  39428. return;
  39429. let pnts = [];
  39430. for (let p = 0; p < data.length; p++) {
  39431. pnts.push($this.cartesianToLatlng(data[p]));
  39432. }
  39433. this._ClosedCurveData = Array.from(pnts);
  39434. pnts.push(pnts[0], pnts[1]);
  39435. let [normals, pList] = [
  39436. [],
  39437. []
  39438. ];
  39439. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39440. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39441. normals = normals.concat(normalPoints);
  39442. }
  39443. let count = normals.length;
  39444. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39445. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39446. let pnt1 = pnts[i2];
  39447. let pnt2 = pnts[i2 + 1];
  39448. pList.push($this.LatlngTocartesian(pnt1));
  39449. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39450. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39451. pList.push($this.LatlngTocartesian(pnt));
  39452. }
  39453. pList.push($this.LatlngTocartesian(pnt2));
  39454. }
  39455. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(pList);
  39456. return {
  39457. PolygonHierarchy,
  39458. pList
  39459. };
  39460. }
  39461. addload(data) {
  39462. let $this = this;
  39463. if (data.length < 2)
  39464. return;
  39465. let pnts = Array.from(data);
  39466. pnts.push(pnts[0], pnts[1]);
  39467. let [normals, pList] = [
  39468. [],
  39469. []
  39470. ];
  39471. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39472. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39473. normals = normals.concat(normalPoints);
  39474. }
  39475. let count = normals.length;
  39476. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39477. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39478. let pnt1 = pnts[i2];
  39479. let pnt2 = pnts[i2 + 1];
  39480. pList.push($this.LatlngTocartesian(pnt1));
  39481. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39482. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39483. pList.push($this.LatlngTocartesian(pnt));
  39484. }
  39485. pList.push($this.LatlngTocartesian(pnt2));
  39486. }
  39487. console.log(data, pnts);
  39488. var arrowEntity = $this.viewer.entities.add({
  39489. Type: "DrawClosedCurve",
  39490. Position: data,
  39491. id: data.id || $this.objId,
  39492. polygon: {
  39493. hierarchy: new $this.Cesium.PolygonHierarchy(pList),
  39494. show: true,
  39495. fill: true,
  39496. clampToGround: true,
  39497. material: $this.polygonMaterial
  39498. },
  39499. polyline: {
  39500. positions: pList,
  39501. show: true,
  39502. material: new Cesium.PolylineDashMaterialProperty({
  39503. color: Cesium.Color.YELLOW
  39504. }),
  39505. width: 3,
  39506. clampToGround: true
  39507. }
  39508. });
  39509. return arrowEntity;
  39510. }
  39511. startCreate(drawType) {
  39512. if (isRuntimeApp()) {
  39513. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39514. }
  39515. var $this = this;
  39516. this.drawType = drawType;
  39517. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39518. this.handler.setInputAction(function(evt) {
  39519. if (isRuntimeApp()) {
  39520. var cartesian = $this.getCatesian3FromPX(evt.position);
  39521. if (!cartesian) {
  39522. return;
  39523. }
  39524. $this.createPoint(cartesian);
  39525. $this._positions.push(cartesian);
  39526. if ($this._positions.length > 2) {
  39527. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  39528. if ($this._positions.length === 3) {
  39529. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39530. $this._ClosedCurve = $this.createClosedCurve();
  39531. createOperationMainDom();
  39532. document.getElementById("btnDrawBackout").style.display = "none";
  39533. document.getElementById("btnDrawComplete").onclick = () => {
  39534. $this._ClosedCurveData = $this._positions.concat();
  39535. $this.viewer.entities.remove($this._ClosedCurve);
  39536. $this._ClosedCurve = null;
  39537. $this._positions = [];
  39538. var lnglatArr = [];
  39539. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39540. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39541. lnglatArr.push(lnglat);
  39542. }
  39543. $this._ClosedCurveData = lnglatArr;
  39544. var ClosedCurve = $this.addload(lnglatArr);
  39545. $this._entities_ClosedCurve.push(ClosedCurve);
  39546. $this._ClosedCurveLast = ClosedCurve;
  39547. $this.clearPoint();
  39548. $this.destroy();
  39549. let buttonDiv = document.getElementById("drawButtonDiv");
  39550. if (buttonDiv) {
  39551. document.body.removeChild(buttonDiv);
  39552. }
  39553. };
  39554. }
  39555. }
  39556. } else {
  39557. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39558. }
  39559. } else {
  39560. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39561. clearTimeout($this._timer);
  39562. $this._timer = setTimeout(function() {
  39563. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  39564. if ($this._positions.length == 0) {
  39565. $this.floatingPoint = $this.createPoint(cartesian2);
  39566. }
  39567. $this._positions.push(cartesian2);
  39568. $this.createPoint(cartesian2);
  39569. }, 200);
  39570. }
  39571. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39572. this.handler.setInputAction(function(evt) {
  39573. if (isRuntimeApp())
  39574. return;
  39575. if ($this._positions.length == 0) {
  39576. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39577. } else {
  39578. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39579. }
  39580. if ($this._positions.length < 2)
  39581. return;
  39582. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39583. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39584. if ($this._positions.length == 2) {
  39585. $this._positions.push(cartesian);
  39586. }
  39587. $this._positions.pop();
  39588. $this._positions.push(cartesian);
  39589. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39590. $this._ClosedCurve = $this.createClosedCurve();
  39591. }
  39592. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39593. this.handler.setInputAction(function(evt) {
  39594. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39595. this.handler.setInputAction(function(evt) {
  39596. if (isRuntimeApp())
  39597. return;
  39598. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39599. clearTimeout($this._timer);
  39600. if (!$this._ClosedCurve)
  39601. return;
  39602. var cartesian = $this.getCatesian3FromPX(evt.position);
  39603. $this._positions.pop();
  39604. $this._positions.push(cartesian);
  39605. $this._ClosedCurveData = $this._positions.concat();
  39606. $this.viewer.entities.remove($this._ClosedCurve);
  39607. $this._ClosedCurve = null;
  39608. $this._positions = [];
  39609. $this.floatingPoint.position.setValue(cartesian);
  39610. var lnglatArr = [];
  39611. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39612. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39613. lnglatArr.push(lnglat);
  39614. }
  39615. $this._ClosedCurveData = lnglatArr;
  39616. var ClosedCurve = $this.addload(lnglatArr);
  39617. $this._entities_ClosedCurve.push(ClosedCurve);
  39618. $this._ClosedCurveLast = ClosedCurve;
  39619. $this.clearPoint();
  39620. $this.destroy();
  39621. $this._tooltip.setVisible(false);
  39622. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39623. }
  39624. createClosedCurve() {
  39625. var $this = this;
  39626. $this.pLists = "";
  39627. var arrowEntity = $this.viewer.entities.add({
  39628. polygon: {
  39629. hierarchy: new $this.Cesium.CallbackProperty(
  39630. function() {
  39631. if ($this._positions.length < 2)
  39632. return;
  39633. let pnts = [];
  39634. for (let p = 0; p < $this._positions.length; p++) {
  39635. pnts.push($this.cartesianToLatlng($this._positions[p]));
  39636. }
  39637. pnts.push(pnts[0], pnts[1]);
  39638. let [normals, pList] = [
  39639. [],
  39640. []
  39641. ];
  39642. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39643. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39644. normals = normals.concat(normalPoints);
  39645. }
  39646. let count = normals.length;
  39647. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39648. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39649. let pnt1 = pnts[i2];
  39650. let pnt2 = pnts[i2 + 1];
  39651. pList.push($this.LatlngTocartesian(pnt1));
  39652. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39653. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39654. pList.push($this.LatlngTocartesian(pnt));
  39655. }
  39656. pList.push($this.LatlngTocartesian(pnt2));
  39657. }
  39658. $this.pLists = pList;
  39659. return new $this.Cesium.PolygonHierarchy(pList);
  39660. },
  39661. false
  39662. ),
  39663. show: true,
  39664. fill: true,
  39665. clampToGround: true,
  39666. material: $this.polygonMaterial
  39667. },
  39668. polyline: {
  39669. positions: new $this.Cesium.CallbackProperty(
  39670. function() {
  39671. return $this.pLists;
  39672. },
  39673. false
  39674. ),
  39675. show: true,
  39676. material: new Cesium.PolylineDashMaterialProperty({
  39677. color: Cesium.Color.YELLOW
  39678. }),
  39679. width: 3,
  39680. clampToGround: true
  39681. }
  39682. });
  39683. $this._entities_ClosedCurve.push(arrowEntity);
  39684. return arrowEntity;
  39685. }
  39686. createPoint(cartesian) {
  39687. var $this = this;
  39688. var point2 = this.viewer.entities.add({
  39689. position: cartesian,
  39690. point: {
  39691. pixelSize: 10,
  39692. color: $this.Cesium.Color.RED,
  39693. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39694. }
  39695. });
  39696. $this._entities_point.push(point2);
  39697. return point2;
  39698. }
  39699. cartesianToLatlng(cartesian) {
  39700. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39701. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  39702. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  39703. return [lng, lat];
  39704. }
  39705. LatlngTocartesian(latlng) {
  39706. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39707. return cartesian3;
  39708. }
  39709. lonLatToMercator(Latlng) {
  39710. var E2 = Latlng[0];
  39711. var N2 = Latlng[1];
  39712. var x = E2 * 2003750834e-2 / 180;
  39713. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  39714. y = y * 2003750834e-2 / 180;
  39715. return [x, y];
  39716. }
  39717. WebMercator2lonLat(mercator) {
  39718. let x = mercator[0] / 2003750834e-2 * 180;
  39719. let ly = mercator[1] / 2003750834e-2 * 180;
  39720. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  39721. return [x, y];
  39722. }
  39723. destroy() {
  39724. if (this.handler) {
  39725. this.handler.destroy();
  39726. this.handler = null;
  39727. }
  39728. }
  39729. clearPoint() {
  39730. this.DrawEndEvent.raiseEvent(this._ClosedCurveLast, this._ClosedCurveData);
  39731. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39732. this.viewer.entities.remove(this._entities_point[i2]);
  39733. }
  39734. this._entities_point = [];
  39735. }
  39736. clear() {
  39737. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39738. this.viewer.entities.remove(this._entities_point[i2]);
  39739. }
  39740. for (var i2 = 0; i2 < this._entities_ClosedCurve.length; i2++) {
  39741. this.viewer.entities.remove(this._entities_ClosedCurve[i2]);
  39742. }
  39743. this.floatingPoint = null;
  39744. this._ClosedCurve = null;
  39745. this._ClosedCurveLast = null;
  39746. this._positions = [];
  39747. this._entities_point = [];
  39748. this._entities_ClosedCurve = [];
  39749. this._ClosedCurveData = null;
  39750. }
  39751. getCatesian3FromPX(px) {
  39752. var cartesian;
  39753. var ray = this.viewer.camera.getPickRay(px);
  39754. if (!ray)
  39755. return null;
  39756. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39757. return cartesian;
  39758. }
  39759. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  39760. let $this = this;
  39761. let normal = $this.getNormal(pnt1, pnt2, pnt3);
  39762. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  39763. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  39764. let uX = normal[0] / dist;
  39765. let uY = normal[1] / dist;
  39766. let d1 = $this.MathDistance(pnt1, pnt2);
  39767. let d2 = $this.MathDistance(pnt2, pnt3);
  39768. if (dist > $this.ZERO_TOLERANCE) {
  39769. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  39770. dt2 = t2 * d1;
  39771. x = pnt2[0] - dt2 * uY;
  39772. y = pnt2[1] + dt2 * uX;
  39773. bisectorNormalRight = [x, y];
  39774. dt2 = t2 * d2;
  39775. x = pnt2[0] + dt2 * uY;
  39776. y = pnt2[1] - dt2 * uX;
  39777. bisectorNormalLeft = [x, y];
  39778. } else {
  39779. dt2 = t2 * d1;
  39780. x = pnt2[0] + dt2 * uY;
  39781. y = pnt2[1] - dt2 * uX;
  39782. bisectorNormalRight = [x, y];
  39783. dt2 = t2 * d2;
  39784. x = pnt2[0] - dt2 * uY;
  39785. y = pnt2[1] + dt2 * uX;
  39786. bisectorNormalLeft = [x, y];
  39787. }
  39788. } else {
  39789. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  39790. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  39791. bisectorNormalRight = [x, y];
  39792. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  39793. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  39794. bisectorNormalLeft = [x, y];
  39795. }
  39796. return [bisectorNormalRight, bisectorNormalLeft];
  39797. }
  39798. getNormal(pnt1, pnt2, pnt3) {
  39799. let dX1 = pnt1[0] - pnt2[0];
  39800. let dY1 = pnt1[1] - pnt2[1];
  39801. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  39802. dX1 /= d1;
  39803. dY1 /= d1;
  39804. let dX2 = pnt3[0] - pnt2[0];
  39805. let dY2 = pnt3[1] - pnt2[1];
  39806. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  39807. dX2 /= d2;
  39808. dY2 /= d2;
  39809. let uX = dX1 + dX2;
  39810. let uY = dY1 + dY2;
  39811. return [uX, uY];
  39812. }
  39813. MathDistance(pnt1, pnt2) {
  39814. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  39815. }
  39816. isClockWise(pnt1, pnt2, pnt3) {
  39817. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  39818. }
  39819. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  39820. t2 = Math.max(Math.min(t2, 1), 0);
  39821. let [tp, t22] = [1 - t2, t2 * t2];
  39822. let t3 = t22 * t2;
  39823. let tp2 = tp * tp;
  39824. let tp3 = tp2 * tp;
  39825. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  39826. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  39827. return [x, y];
  39828. }
  39829. }
  39830. class DrawSector {
  39831. constructor(arg) {
  39832. this.viewer = arg.viewer;
  39833. this.Cesium = arg.Cesium;
  39834. this.floatingPoint = null;
  39835. this._sector = null;
  39836. this._sectorLast = null;
  39837. this._positions = [];
  39838. this._entities_point = [];
  39839. this._entities_sector = [];
  39840. this._sectorData = null;
  39841. this.DrawStartEvent = new Cesium.Event();
  39842. this.DrawEndEvent = new Cesium.Event();
  39843. this._param = {
  39844. id: "DrawStraightArrow",
  39845. polygonColor: "rgba(0,255,0,0.5)",
  39846. outlineColor: "rgba(255, 255, 255, 1)",
  39847. outlineWidth: 1
  39848. };
  39849. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39850. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39851. }
  39852. get sector() {
  39853. return this._sectorLast;
  39854. }
  39855. getData() {
  39856. return this._sectorData;
  39857. }
  39858. computePosition(data) {
  39859. let $this = this;
  39860. let pnts = data;
  39861. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39862. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39863. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39864. var radius = $this.MathDistance(pnt2, center2);
  39865. var startAngle = $this.getAzimuth(pnt2, center2);
  39866. var endAngle = $this.getAzimuth(pnt3, center2);
  39867. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39868. pList.push(pnts[0], pList[0]);
  39869. let arrow = [];
  39870. for (var i2 = 0; i2 < pList.length; i2++) {
  39871. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39872. arrow.push(cart3);
  39873. }
  39874. var lnglatArr = [];
  39875. for (var d2 = 0; d2 < data.length; d2++) {
  39876. lnglatArr.push($this.cartesianToLatlng(data[d2]));
  39877. }
  39878. $this._sectorData = lnglatArr;
  39879. return new $this.Cesium.PolygonHierarchy(arrow);
  39880. }
  39881. addload(data) {
  39882. var $this = this;
  39883. let pnts = data;
  39884. let center2 = $this.lonLatToMercator(pnts[0]);
  39885. let pnt2 = $this.lonLatToMercator(pnts[1]);
  39886. let pnt3 = $this.lonLatToMercator(pnts[2]);
  39887. var radius = $this.MathDistance(pnt2, center2);
  39888. var startAngle = $this.getAzimuth(pnt2, center2);
  39889. var endAngle = $this.getAzimuth(pnt3, center2);
  39890. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39891. let pntsc = $this.Cesium.Cartesian3.fromDegrees(pnts[0][0], pnts[0][1]);
  39892. pList.push(pntsc, pList[0]);
  39893. let arrow = [];
  39894. for (var i2 = 0; i2 < pList.length; i2++) {
  39895. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39896. arrow.push(cart3);
  39897. }
  39898. var arrowEntity = $this.viewer.entities.add({
  39899. Type: "DrawSector",
  39900. Position: data,
  39901. id: data.id || $this.objId,
  39902. polygon: {
  39903. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  39904. show: true,
  39905. fill: true,
  39906. clampToGround: true,
  39907. material: $this.Cesium.Color.AQUA.withAlpha(0.9)
  39908. }
  39909. });
  39910. return arrowEntity;
  39911. }
  39912. startCreate() {
  39913. var $this = this;
  39914. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39915. this.handler.setInputAction(function(evt) {
  39916. var cartesian = $this.getCatesian3FromPX(evt.position);
  39917. if ($this._positions.length < 3) {
  39918. $this.floatingPoint = $this.createPoint(cartesian);
  39919. $this._positions.push(cartesian);
  39920. }
  39921. if (!$this._sector)
  39922. ;
  39923. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39924. this.handler.setInputAction(function(evt) {
  39925. if ($this._positions.length < 2)
  39926. return;
  39927. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39928. if ($this._positions.length == 2) {
  39929. $this._positions.push(cartesian);
  39930. }
  39931. if ($this._positions.length == 3) {
  39932. $this._positions.pop();
  39933. $this._positions.push(cartesian);
  39934. if (!$this.Cesium.defined($this._sector)) {
  39935. $this._sector = $this.createsector();
  39936. }
  39937. }
  39938. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39939. this.handler.setInputAction(function(evt) {
  39940. if (!$this._sector)
  39941. return;
  39942. var cartesian = $this.getCatesian3FromPX(evt.position);
  39943. $this._positions.pop();
  39944. $this._positions.push(cartesian);
  39945. $this._sectorData = $this._positions.concat();
  39946. $this.viewer.entities.remove($this._sector);
  39947. $this._sector = null;
  39948. $this._positions = [];
  39949. $this.floatingPoint.position.setValue(cartesian);
  39950. var lnglatArr = [];
  39951. for (var i2 = 0; i2 < $this._sectorData.length; i2++) {
  39952. var lnglat = $this.cartesianToLatlng($this._sectorData[i2]);
  39953. lnglatArr.push(lnglat);
  39954. }
  39955. $this._sectorData = lnglatArr;
  39956. var sector = $this.addload(lnglatArr);
  39957. $this._entities_sector.push(sector);
  39958. $this._sectorLast = sector;
  39959. $this.clearPoint();
  39960. $this.destroy();
  39961. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39962. }
  39963. createsector() {
  39964. var $this = this;
  39965. var arrowEntity = $this.viewer.entities.add(
  39966. {
  39967. polygon: {
  39968. hierarchy: new $this.Cesium.CallbackProperty(
  39969. function() {
  39970. let pnts = $this._positions;
  39971. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39972. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39973. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39974. var radius = $this.MathDistance(pnt2, center2);
  39975. var startAngle = $this.getAzimuth(pnt2, center2);
  39976. var endAngle = $this.getAzimuth(pnt3, center2);
  39977. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39978. pList.push(pnts[0], pList[0]);
  39979. for (var i2 = 0; i2 < pList.length; i2++) {
  39980. new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39981. }
  39982. return new $this.Cesium.PolygonHierarchy(pList);
  39983. },
  39984. false
  39985. ),
  39986. show: true,
  39987. fill: true,
  39988. clampToGround: true,
  39989. material: $this.Cesium.Color.AQUA.withAlpha(0.5)
  39990. }
  39991. }
  39992. );
  39993. $this._entities_sector.push(arrowEntity);
  39994. return arrowEntity;
  39995. }
  39996. createPoint(cartesian) {
  39997. var $this = this;
  39998. var point2 = this.viewer.entities.add({
  39999. position: cartesian,
  40000. point: {
  40001. pixelSize: 10,
  40002. color: $this.Cesium.Color.RED,
  40003. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40004. }
  40005. });
  40006. $this._entities_point.push(point2);
  40007. return point2;
  40008. }
  40009. cartesianToLatlng(cartesian) {
  40010. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40011. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  40012. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  40013. return [lng, lat];
  40014. }
  40015. lonLatToMercator(Latlng) {
  40016. var E2 = Latlng[0];
  40017. var N2 = Latlng[1];
  40018. var x = E2 * 2003750834e-2 / 180;
  40019. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40020. y = y * 2003750834e-2 / 180;
  40021. return [x, y];
  40022. }
  40023. WebMercator2lonLat(mercator) {
  40024. let x = mercator[0] / 2003750834e-2 * 180;
  40025. let ly = mercator[1] / 2003750834e-2 * 180;
  40026. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40027. return [x, y];
  40028. }
  40029. destroy() {
  40030. if (this.handler) {
  40031. this.handler.destroy();
  40032. this.handler = null;
  40033. }
  40034. }
  40035. clearPoint() {
  40036. this.DrawEndEvent.raiseEvent(this._sectorLast, this._sectorData);
  40037. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40038. this.viewer.entities.remove(this._entities_point[i2]);
  40039. }
  40040. this._entities_point = [];
  40041. }
  40042. clear() {
  40043. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40044. this.viewer.entities.remove(this._entities_point[i2]);
  40045. }
  40046. for (var i2 = 0; i2 < this._entities_sector.length; i2++) {
  40047. this.viewer.entities.remove(this._entities_sector[i2]);
  40048. }
  40049. this.floatingPoint = null;
  40050. this._sector = null;
  40051. this._sectorLast = null;
  40052. this._positions = [];
  40053. this._entities_point = [];
  40054. this._entities_sector = [];
  40055. this._sectorData = null;
  40056. }
  40057. getCatesian3FromPX(px) {
  40058. var cartesian;
  40059. var ray = this.viewer.camera.getPickRay(px);
  40060. if (!ray)
  40061. return null;
  40062. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40063. return cartesian;
  40064. }
  40065. MathDistance(pnt1, pnt2) {
  40066. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40067. }
  40068. getAzimuth(startPoint, endPoint) {
  40069. var azimuth;
  40070. var angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40071. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40072. azimuth = angle + Math.PI;
  40073. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40074. azimuth = Math.PI * 2 - angle;
  40075. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40076. azimuth = angle;
  40077. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40078. azimuth = Math.PI - angle;
  40079. }
  40080. return azimuth;
  40081. }
  40082. getArcPoints(center2, radius, startAngle, endAngle) {
  40083. var x = null, y = null, pnts = [], angleDiff = endAngle - startAngle;
  40084. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40085. for (var i2 = 0; i2 <= 100; i2++) {
  40086. var angle = startAngle + angleDiff * i2 / 100;
  40087. x = center2[0] + radius * Math.cos(angle);
  40088. y = center2[1] + radius * Math.sin(angle);
  40089. let latlon = this.WebMercator2lonLat([x, y]);
  40090. pnts.push(this.Cesium.Cartesian3.fromDegrees(latlon[0], latlon[1]));
  40091. }
  40092. return pnts;
  40093. }
  40094. }
  40095. class DrawBowLine {
  40096. constructor(arg) {
  40097. this.viewer = arg.viewer;
  40098. this.Cesium = arg.Cesium;
  40099. this.tt = 0.4;
  40100. this.floatingPoint = null;
  40101. this.drawHandler = null;
  40102. this.DrawBowLine = null;
  40103. this._DrawBowLineLast = null;
  40104. this._positions = [];
  40105. this._entities_point = [];
  40106. this._entities_PincerArrow = [];
  40107. this._DrawBowLineData = null;
  40108. this.DrawStartEvent = new Cesium.Event();
  40109. this.DrawEndEvent = new Cesium.Event();
  40110. this._param = {
  40111. id: "DrawStraightArrow",
  40112. polygonColor: "rgba(0,255,0,0.5)",
  40113. outlineColor: "rgba(255, 255, 255, 1)",
  40114. outlineWidth: 1
  40115. };
  40116. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40117. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40118. }
  40119. get PincerArrow() {
  40120. return this._DrawBowLineLast;
  40121. }
  40122. getData() {
  40123. return this._DrawBowLineData;
  40124. }
  40125. computePosition(data) {
  40126. var $this = this;
  40127. if (data.length < 3) {
  40128. return;
  40129. }
  40130. var DrawBowLine2 = [];
  40131. let positions = [];
  40132. for (var i2 = 0; i2 < data.length; i2++) {
  40133. positions.push($this.cartesianToLatlng(data[i2]));
  40134. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40135. DrawBowLine2.push(cart3);
  40136. }
  40137. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40138. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40139. let radius = $this.MathDistance(pnt1, center2);
  40140. let angle1 = $this.getAzimuth(pnt1, center2);
  40141. let angle2 = $this.getAzimuth(pnt2, center2);
  40142. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40143. startAngle = angle2;
  40144. endAngle = angle1;
  40145. } else {
  40146. startAngle = angle1;
  40147. endAngle = angle2;
  40148. }
  40149. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40150. let pHierarchy = [];
  40151. for (var l = 0; l < getArcPoint.length; l++) {
  40152. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40153. pHierarchy.push(cart3);
  40154. }
  40155. $this._DrawBowLineData = positions;
  40156. return pHierarchy;
  40157. }
  40158. addload(data) {
  40159. var $this = this;
  40160. if (data.length < 3) {
  40161. return;
  40162. }
  40163. var DrawBowLine2 = [];
  40164. for (var i2 = 0; i2 < data.length; i2++) {
  40165. var cart3 = $this.lonLatToMercator(data[i2]);
  40166. DrawBowLine2.push(cart3);
  40167. }
  40168. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40169. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40170. let radius = $this.MathDistance(pnt1, center2);
  40171. let angle1 = $this.getAzimuth(pnt1, center2);
  40172. let angle2 = $this.getAzimuth(pnt2, center2);
  40173. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40174. startAngle = angle2;
  40175. endAngle = angle1;
  40176. } else {
  40177. startAngle = angle1;
  40178. endAngle = angle2;
  40179. }
  40180. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40181. let pHierarchy = [];
  40182. for (var l = 0; l < getArcPoint.length; l++) {
  40183. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40184. pHierarchy.push(cart3);
  40185. }
  40186. var arrowEntity = $this.viewer.entities.add({
  40187. Type: "DrawBowLine",
  40188. Position: data,
  40189. id: data.id || $this.objId,
  40190. polyline: {
  40191. positions: pHierarchy,
  40192. show: true,
  40193. material: $this.Cesium.Color.YELLOW,
  40194. width: 3,
  40195. clampToGround: true
  40196. }
  40197. });
  40198. return arrowEntity;
  40199. }
  40200. startCreate(drawType) {
  40201. this.drawType = drawType;
  40202. var $this = this;
  40203. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40204. this.handler.setInputAction(function(event2) {
  40205. var position2 = event2.position;
  40206. if (!$this.Cesium.defined(position2)) {
  40207. return;
  40208. }
  40209. var ray = $this.viewer.camera.getPickRay(position2);
  40210. if (!$this.Cesium.defined(ray)) {
  40211. return;
  40212. }
  40213. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40214. if (!$this.Cesium.defined(cartesian)) {
  40215. return;
  40216. }
  40217. if ($this._positions.length == 0) {
  40218. $this._positions.push(cartesian.clone());
  40219. $this.floatingPoint = $this.createPoint(cartesian);
  40220. }
  40221. if ($this._positions.length <= 2) {
  40222. $this.createPoint(cartesian);
  40223. $this._positions.push(cartesian);
  40224. }
  40225. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40226. this.handler.setInputAction(function(event2) {
  40227. if ($this._positions.length < 2) {
  40228. return;
  40229. }
  40230. var position2 = event2.endPosition;
  40231. if (!$this.Cesium.defined(position2)) {
  40232. return;
  40233. }
  40234. var ray = $this.viewer.camera.getPickRay(position2);
  40235. if (!$this.Cesium.defined(ray)) {
  40236. return;
  40237. }
  40238. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40239. if (!$this.Cesium.defined(cartesian)) {
  40240. return;
  40241. }
  40242. if (!$this.Cesium.defined($this.DrawBowLine)) {
  40243. $this.DrawBowLine = $this.createDrawBowLine();
  40244. }
  40245. $this.floatingPoint.position.setValue(cartesian);
  40246. if ($this.DrawBowLine) {
  40247. if ($this._positions.length == 3) {
  40248. $this._positions[1] = cartesian;
  40249. } else {
  40250. $this._positions.pop();
  40251. $this._positions.push(cartesian);
  40252. }
  40253. }
  40254. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40255. this.handler.setInputAction(function(movement) {
  40256. if ($this._positions.length >= 3) {
  40257. $this._DrawBowLineData = $this._positions.concat();
  40258. $this.viewer.entities.remove($this.DrawBowLine);
  40259. $this.DrawBowLine = null;
  40260. var lnglatArr = [];
  40261. for (var i2 = 0; i2 < $this._DrawBowLineData.length; i2++) {
  40262. var lnglat = $this.cartesianToLatlng($this._DrawBowLineData[i2]);
  40263. lnglatArr.push(lnglat);
  40264. }
  40265. $this._DrawBowLineData = lnglatArr;
  40266. var pincerArrow = $this.addload(lnglatArr);
  40267. $this._entities_PincerArrow.push(pincerArrow);
  40268. $this._DrawBowLineLast = pincerArrow;
  40269. $this.viewer.entities.remove($this.floatingPoint);
  40270. $this.floatingPoint = null;
  40271. $this.clearPoint();
  40272. $this.destroy();
  40273. }
  40274. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40275. }
  40276. createDrawBowLine() {
  40277. let $this = this;
  40278. var DrawBowLineEntity = $this.viewer.entities.add({
  40279. polyline: {
  40280. positions: new $this.Cesium.CallbackProperty(function() {
  40281. if ($this._positions.length < 3) {
  40282. return;
  40283. }
  40284. var DrawBowLine2 = [];
  40285. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40286. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40287. DrawBowLine2.push(cart3);
  40288. }
  40289. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40290. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40291. let radius = $this.MathDistance(pnt1, center2);
  40292. let angle1 = $this.getAzimuth(pnt1, center2);
  40293. let angle2 = $this.getAzimuth(pnt2, center2);
  40294. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40295. startAngle = angle2;
  40296. endAngle = angle1;
  40297. } else {
  40298. startAngle = angle1;
  40299. endAngle = angle2;
  40300. }
  40301. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40302. let pHierarchy = [];
  40303. for (var l = 0; l < getArcPoint.length; l++) {
  40304. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40305. pHierarchy.push(cart3);
  40306. }
  40307. return pHierarchy;
  40308. }, false),
  40309. show: true,
  40310. material: $this.Cesium.Color.YELLOW,
  40311. width: 3,
  40312. clampToGround: true
  40313. }
  40314. });
  40315. $this._entities_PincerArrow.push(DrawBowLineEntity);
  40316. return DrawBowLineEntity;
  40317. }
  40318. createPoint(cartesian) {
  40319. var $this = this;
  40320. var point2 = this.viewer.entities.add({
  40321. position: cartesian,
  40322. point: {
  40323. pixelSize: 10,
  40324. color: $this.Cesium.Color.RED,
  40325. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40326. }
  40327. });
  40328. $this._entities_point.push(point2);
  40329. return point2;
  40330. }
  40331. cartesianToLatlng(cartesian) {
  40332. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40333. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40334. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40335. cartographic.height;
  40336. return [lng, lat];
  40337. }
  40338. destroy() {
  40339. if (this.handler) {
  40340. this.handler.destroy();
  40341. this.handler = null;
  40342. }
  40343. }
  40344. clearPoint() {
  40345. this.DrawEndEvent.raiseEvent(this._DrawBowLineLast, this._DrawBowLineData, this.drawType);
  40346. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40347. this.viewer.entities.remove(this._entities_point[i2]);
  40348. }
  40349. this._entities_point = [];
  40350. }
  40351. clear() {
  40352. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40353. this.viewer.entities.remove(this._entities_point[i2]);
  40354. }
  40355. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40356. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40357. }
  40358. this.floatingPoint = null;
  40359. this._PincerArrow = null;
  40360. this._PincerArrowLast = null;
  40361. this._positions = [];
  40362. this._entities_point = [];
  40363. this._entities_PincerArrow = [];
  40364. this._PincerArrowData = null;
  40365. }
  40366. getCatesian3FromPX(px) {
  40367. var cartesian;
  40368. var ray = this.viewer.camera.getPickRay(px);
  40369. if (!ray)
  40370. return null;
  40371. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40372. return cartesian;
  40373. }
  40374. _computeTempPositions() {
  40375. var _this = this;
  40376. var pnts = [].concat(_this._positions);
  40377. var num = pnts.length;
  40378. var first = pnts[0];
  40379. var last = pnts[num - 1];
  40380. if (_this._isSimpleXYZ(first, last) == false) {
  40381. pnts.push(first);
  40382. num += 1;
  40383. }
  40384. _this.tempPositions = [];
  40385. for (var i2 = 1; i2 < num; i2++) {
  40386. var p1 = pnts[i2 - 1];
  40387. var p2 = pnts[i2];
  40388. var cp = _this._computeCenterPotition(p1, p2);
  40389. _this.tempPositions.push(p1);
  40390. _this.tempPositions.push(cp);
  40391. }
  40392. }
  40393. _isSimpleXYZ(p1, p2) {
  40394. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40395. return true;
  40396. }
  40397. return false;
  40398. }
  40399. _computeCenterPotition(p1, p2) {
  40400. var _this = this;
  40401. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40402. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40403. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40404. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40405. return cp;
  40406. }
  40407. getLonLat(cartesian) {
  40408. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40409. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40410. var pos = {
  40411. lon: cartographic.longitude,
  40412. lat: cartographic.latitude,
  40413. alt: cartographic.height
  40414. };
  40415. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40416. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40417. return pos;
  40418. }
  40419. LatlngTocartesian(latlng) {
  40420. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40421. return cartesian3;
  40422. }
  40423. lonLatToMercator(Latlng) {
  40424. var E2 = Latlng[0];
  40425. var N2 = Latlng[1];
  40426. var x = E2 * 2003750834e-2 / 180;
  40427. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40428. y = y * 2003750834e-2 / 180;
  40429. return [x, y];
  40430. }
  40431. WebMercator2lonLat(mercator) {
  40432. let x = mercator[0] / 2003750834e-2 * 180;
  40433. let ly = mercator[1] / 2003750834e-2 * 180;
  40434. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40435. return [x, y];
  40436. }
  40437. getCircleCenterOfThreePoints(point1, point2, point3) {
  40438. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40439. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40440. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40441. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40442. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40443. }
  40444. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40445. if (pntA[1] === pntB[1]) {
  40446. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40447. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40448. let y2 = pntA[1];
  40449. return [x2, y2];
  40450. }
  40451. if (pntC[1] === pntD[1]) {
  40452. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40453. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40454. let y2 = pntC[1];
  40455. return [x2, y2];
  40456. }
  40457. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40458. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40459. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40460. let x = e * y - e * pntA[1] + pntA[0];
  40461. return [x, y];
  40462. }
  40463. MathDistance(pnt1, pnt2) {
  40464. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40465. }
  40466. getAzimuth(startPoint, endPoint) {
  40467. let azimuth;
  40468. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40469. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40470. azimuth = angle + Math.PI;
  40471. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40472. azimuth = Math.PI * 2 - angle;
  40473. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40474. azimuth = angle;
  40475. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40476. azimuth = Math.PI - angle;
  40477. }
  40478. return azimuth;
  40479. }
  40480. isClockWise(pnt1, pnt2, pnt3) {
  40481. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40482. }
  40483. getArcPoints(center2, radius, startAngle, endAngle) {
  40484. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40485. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40486. for (let i2 = 0; i2 <= 100; i2++) {
  40487. let angle = startAngle + angleDiff * i2 / 100;
  40488. x = center2[0] + radius * Math.cos(angle);
  40489. y = center2[1] + radius * Math.sin(angle);
  40490. pnts.push([x, y]);
  40491. }
  40492. return pnts;
  40493. }
  40494. }
  40495. class DrawBowPlane {
  40496. constructor(arg) {
  40497. this.viewer = arg.viewer;
  40498. this.Cesium = arg.Cesium;
  40499. this.tt = 0.4;
  40500. this.floatingPoint = null;
  40501. this.drawHandler = null;
  40502. this.DrawBowPlane = null;
  40503. this._DrawBowPlaneLast = null;
  40504. this._positions = [];
  40505. this._entities_point = [];
  40506. this._entities_PincerArrow = [];
  40507. this._DrawBowPlaneData = null;
  40508. this.DrawStartEvent = new Cesium.Event();
  40509. this.DrawEndEvent = new Cesium.Event();
  40510. this._param = {
  40511. id: "DrawStraightArrow",
  40512. polygonColor: "rgba(0,255,0,0.5)",
  40513. outlineColor: "rgba(255, 255, 255, 1)",
  40514. outlineWidth: 1
  40515. };
  40516. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40517. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40518. }
  40519. get PincerArrow() {
  40520. return this._DrawBowPlaneLast;
  40521. }
  40522. getData() {
  40523. return this._DrawBowPlaneData;
  40524. }
  40525. computePosition(data) {
  40526. var $this = this;
  40527. if (data.length < 3) {
  40528. return;
  40529. }
  40530. var DrawBowPlane2 = [];
  40531. let positions = [];
  40532. for (var i2 = 0; i2 < data.length; i2++) {
  40533. positions.push($this.cartesianToLatlng(data[i2]));
  40534. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40535. DrawBowPlane2.push(cart3);
  40536. }
  40537. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40538. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40539. let radius = $this.MathDistance(pnt1, center2);
  40540. let angle1 = $this.getAzimuth(pnt1, center2);
  40541. let angle2 = $this.getAzimuth(pnt2, center2);
  40542. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40543. startAngle = angle2;
  40544. endAngle = angle1;
  40545. } else {
  40546. startAngle = angle1;
  40547. endAngle = angle2;
  40548. }
  40549. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40550. let pHierarchy = [];
  40551. for (var l = 0; l < getArcPoint.length; l++) {
  40552. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40553. pHierarchy.push(cart3);
  40554. }
  40555. pHierarchy.push(pHierarchy[0]);
  40556. $this._DrawBowPlaneData = positions;
  40557. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40558. }
  40559. addload(data) {
  40560. var $this = this;
  40561. if (data.length < 3) {
  40562. return;
  40563. }
  40564. var DrawBowPlane2 = [];
  40565. for (var i2 = 0; i2 < data.length; i2++) {
  40566. var cart3 = $this.lonLatToMercator(data[i2]);
  40567. DrawBowPlane2.push(cart3);
  40568. }
  40569. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40570. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40571. let radius = $this.MathDistance(pnt1, center2);
  40572. let angle1 = $this.getAzimuth(pnt1, center2);
  40573. let angle2 = $this.getAzimuth(pnt2, center2);
  40574. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40575. startAngle = angle2;
  40576. endAngle = angle1;
  40577. } else {
  40578. startAngle = angle1;
  40579. endAngle = angle2;
  40580. }
  40581. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40582. let pHierarchy = [];
  40583. for (var l = 0; l < getArcPoint.length; l++) {
  40584. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40585. pHierarchy.push(cart3);
  40586. }
  40587. pHierarchy.push(pHierarchy[0]);
  40588. var arrowEntity = $this.viewer.entities.add(
  40589. {
  40590. Type: "DrawBowPlane",
  40591. Position: data,
  40592. id: data.id || $this.objId,
  40593. polygon: {
  40594. hierarchy: new $this.Cesium.PolygonHierarchy(pHierarchy),
  40595. show: true,
  40596. material: $this.Cesium.Color.YELLOW,
  40597. width: 3,
  40598. clampToGround: true,
  40599. outlineWidth: 3,
  40600. outline: true,
  40601. outlineColor: Cesium.Color.MAGENTA
  40602. }
  40603. }
  40604. );
  40605. return arrowEntity;
  40606. }
  40607. startCreate(drawType) {
  40608. this.drawType = drawType;
  40609. var $this = this;
  40610. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40611. this.handler.setInputAction(function(event2) {
  40612. var position2 = event2.position;
  40613. if (!$this.Cesium.defined(position2)) {
  40614. return;
  40615. }
  40616. var ray = $this.viewer.camera.getPickRay(position2);
  40617. if (!$this.Cesium.defined(ray)) {
  40618. return;
  40619. }
  40620. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40621. if (!$this.Cesium.defined(cartesian)) {
  40622. return;
  40623. }
  40624. if ($this._positions.length == 0) {
  40625. $this._positions.push(cartesian.clone());
  40626. $this.floatingPoint = $this.createPoint(cartesian);
  40627. }
  40628. if ($this._positions.length <= 2) {
  40629. $this.createPoint(cartesian);
  40630. $this._positions.push(cartesian);
  40631. }
  40632. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40633. this.handler.setInputAction(function(event2) {
  40634. if ($this._positions.length < 2) {
  40635. return;
  40636. }
  40637. var position2 = event2.endPosition;
  40638. if (!$this.Cesium.defined(position2)) {
  40639. return;
  40640. }
  40641. var ray = $this.viewer.camera.getPickRay(position2);
  40642. if (!$this.Cesium.defined(ray)) {
  40643. return;
  40644. }
  40645. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40646. if (!$this.Cesium.defined(cartesian)) {
  40647. return;
  40648. }
  40649. if (!$this.Cesium.defined($this.DrawBowPlane)) {
  40650. $this.DrawBowPlane = $this.createDrawBowPlane();
  40651. }
  40652. $this.floatingPoint.position.setValue(cartesian);
  40653. if ($this.DrawBowPlane) {
  40654. if ($this._positions.length == 3) {
  40655. $this._positions[1] = cartesian;
  40656. } else {
  40657. $this._positions.pop();
  40658. $this._positions.push(cartesian);
  40659. }
  40660. }
  40661. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40662. this.handler.setInputAction(function(movement) {
  40663. if ($this._positions.length >= 3) {
  40664. $this._DrawBowPlaneData = $this._positions.concat();
  40665. $this.viewer.entities.remove($this.DrawBowPlane);
  40666. $this.DrawBowPlane = null;
  40667. var lnglatArr = [];
  40668. for (var i2 = 0; i2 < $this._DrawBowPlaneData.length; i2++) {
  40669. var lnglat = $this.cartesianToLatlng($this._DrawBowPlaneData[i2]);
  40670. lnglatArr.push(lnglat);
  40671. }
  40672. $this._DrawBowPlaneData = lnglatArr;
  40673. var pincerArrow = $this.addload(lnglatArr);
  40674. $this._entities_PincerArrow.push(pincerArrow);
  40675. $this._DrawBowPlaneLast = pincerArrow;
  40676. $this.viewer.entities.remove($this.floatingPoint);
  40677. $this.floatingPoint = null;
  40678. $this.clearPoint();
  40679. $this.destroy();
  40680. }
  40681. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40682. }
  40683. createDrawBowPlane() {
  40684. let $this = this;
  40685. var DrawBowPlaneEntity = $this.viewer.entities.add(
  40686. {
  40687. polygon: {
  40688. hierarchy: new $this.Cesium.CallbackProperty(function() {
  40689. if ($this._positions.length < 3) {
  40690. return;
  40691. }
  40692. var DrawBowPlane2 = [];
  40693. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40694. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40695. DrawBowPlane2.push(cart3);
  40696. }
  40697. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40698. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40699. let radius = $this.MathDistance(pnt1, center2);
  40700. let angle1 = $this.getAzimuth(pnt1, center2);
  40701. let angle2 = $this.getAzimuth(pnt2, center2);
  40702. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40703. startAngle = angle2;
  40704. endAngle = angle1;
  40705. } else {
  40706. startAngle = angle1;
  40707. endAngle = angle2;
  40708. }
  40709. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40710. let pHierarchy = [];
  40711. for (var l = 0; l < getArcPoint.length; l++) {
  40712. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40713. pHierarchy.push(cart3);
  40714. }
  40715. pHierarchy.push(pHierarchy[0]);
  40716. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40717. }, false),
  40718. show: true,
  40719. material: $this.Cesium.Color.YELLOW,
  40720. clampToGround: true
  40721. }
  40722. }
  40723. );
  40724. $this._entities_PincerArrow.push(DrawBowPlaneEntity);
  40725. return DrawBowPlaneEntity;
  40726. }
  40727. createPoint(cartesian) {
  40728. var $this = this;
  40729. var point2 = this.viewer.entities.add({
  40730. position: cartesian,
  40731. point: {
  40732. pixelSize: 10,
  40733. color: $this.Cesium.Color.RED,
  40734. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40735. }
  40736. });
  40737. $this._entities_point.push(point2);
  40738. return point2;
  40739. }
  40740. cartesianToLatlng(cartesian) {
  40741. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40742. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40743. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40744. cartographic.height;
  40745. return [lng, lat];
  40746. }
  40747. destroy() {
  40748. if (this.handler) {
  40749. this.handler.destroy();
  40750. this.handler = null;
  40751. }
  40752. }
  40753. clearPoint() {
  40754. this.DrawEndEvent.raiseEvent(this._DrawBowPlaneLast, this._DrawBowPlaneData, this.drawType);
  40755. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40756. this.viewer.entities.remove(this._entities_point[i2]);
  40757. }
  40758. this._entities_point = [];
  40759. }
  40760. clear() {
  40761. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40762. this.viewer.entities.remove(this._entities_point[i2]);
  40763. }
  40764. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40765. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40766. }
  40767. this.floatingPoint = null;
  40768. this._PincerArrow = null;
  40769. this._PincerArrowLast = null;
  40770. this._positions = [];
  40771. this._entities_point = [];
  40772. this._entities_PincerArrow = [];
  40773. this._PincerArrowData = null;
  40774. }
  40775. getCatesian3FromPX(px) {
  40776. var cartesian;
  40777. var ray = this.viewer.camera.getPickRay(px);
  40778. if (!ray)
  40779. return null;
  40780. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40781. return cartesian;
  40782. }
  40783. _computeTempPositions() {
  40784. var _this = this;
  40785. var pnts = [].concat(_this._positions);
  40786. var num = pnts.length;
  40787. var first = pnts[0];
  40788. var last = pnts[num - 1];
  40789. if (_this._isSimpleXYZ(first, last) == false) {
  40790. pnts.push(first);
  40791. num += 1;
  40792. }
  40793. _this.tempPositions = [];
  40794. for (var i2 = 1; i2 < num; i2++) {
  40795. var p1 = pnts[i2 - 1];
  40796. var p2 = pnts[i2];
  40797. var cp = _this._computeCenterPotition(p1, p2);
  40798. _this.tempPositions.push(p1);
  40799. _this.tempPositions.push(cp);
  40800. }
  40801. }
  40802. _isSimpleXYZ(p1, p2) {
  40803. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40804. return true;
  40805. }
  40806. return false;
  40807. }
  40808. _computeCenterPotition(p1, p2) {
  40809. var _this = this;
  40810. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40811. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40812. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40813. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40814. return cp;
  40815. }
  40816. getLonLat(cartesian) {
  40817. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40818. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40819. var pos = {
  40820. lon: cartographic.longitude,
  40821. lat: cartographic.latitude,
  40822. alt: cartographic.height
  40823. };
  40824. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40825. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40826. return pos;
  40827. }
  40828. LatlngTocartesian(latlng) {
  40829. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40830. return cartesian3;
  40831. }
  40832. lonLatToMercator(Latlng) {
  40833. var E2 = Latlng[0];
  40834. var N2 = Latlng[1];
  40835. var x = E2 * 2003750834e-2 / 180;
  40836. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40837. y = y * 2003750834e-2 / 180;
  40838. return [x, y];
  40839. }
  40840. WebMercator2lonLat(mercator) {
  40841. let x = mercator[0] / 2003750834e-2 * 180;
  40842. let ly = mercator[1] / 2003750834e-2 * 180;
  40843. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40844. return [x, y];
  40845. }
  40846. getCircleCenterOfThreePoints(point1, point2, point3) {
  40847. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40848. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40849. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40850. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40851. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40852. }
  40853. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40854. if (pntA[1] === pntB[1]) {
  40855. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40856. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40857. let y2 = pntA[1];
  40858. return [x2, y2];
  40859. }
  40860. if (pntC[1] === pntD[1]) {
  40861. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40862. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40863. let y2 = pntC[1];
  40864. return [x2, y2];
  40865. }
  40866. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40867. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40868. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40869. let x = e * y - e * pntA[1] + pntA[0];
  40870. return [x, y];
  40871. }
  40872. MathDistance(pnt1, pnt2) {
  40873. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40874. }
  40875. getAzimuth(startPoint, endPoint) {
  40876. let azimuth;
  40877. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40878. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40879. azimuth = angle + Math.PI;
  40880. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40881. azimuth = Math.PI * 2 - angle;
  40882. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40883. azimuth = angle;
  40884. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40885. azimuth = Math.PI - angle;
  40886. }
  40887. return azimuth;
  40888. }
  40889. isClockWise(pnt1, pnt2, pnt3) {
  40890. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40891. }
  40892. getArcPoints(center2, radius, startAngle, endAngle) {
  40893. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40894. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40895. for (let i2 = 0; i2 <= 100; i2++) {
  40896. let angle = startAngle + angleDiff * i2 / 100;
  40897. x = center2[0] + radius * Math.cos(angle);
  40898. y = center2[1] + radius * Math.sin(angle);
  40899. pnts.push([x, y]);
  40900. }
  40901. return pnts;
  40902. }
  40903. }
  40904. class DrawCurve {
  40905. constructor(arg) {
  40906. this.viewer = arg.viewer;
  40907. this.Cesium = arg.Cesium;
  40908. this.floatingPoint = null;
  40909. this._curveline = null;
  40910. this._curvelineLast = null;
  40911. this._positions = [];
  40912. this._entities_point = [];
  40913. this._entities_line = [];
  40914. this._curvelineData = null;
  40915. this.DrawStartEvent = new Cesium.Event();
  40916. this.DrawEndEvent = new Cesium.Event();
  40917. this.ZERO_TOLERANCE = 1e-4;
  40918. this.FITTING_COUNT = 100;
  40919. this.t = 0.3;
  40920. this._param = {
  40921. id: "DrawStraightArrow",
  40922. polygonColor: "rgba(0,255,0,0.5)",
  40923. outlineColor: "rgba(255, 255, 255, 1)",
  40924. outlineWidth: 1
  40925. };
  40926. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40927. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40928. }
  40929. get curveline() {
  40930. return this._curvelineLast;
  40931. }
  40932. getData() {
  40933. return this._curvelineData;
  40934. }
  40935. addload(data) {
  40936. var $this = this;
  40937. let pnts = [];
  40938. for (let p = 0; p < data.length; p++) {
  40939. pnts.push($this.lonLatToMercator(data[p]));
  40940. }
  40941. let CurvePoints = $this.getCurvePoints(pnts);
  40942. let point2 = [];
  40943. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40944. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  40945. }
  40946. var polyline = this.viewer.entities.add({
  40947. Type: "DrawCurve",
  40948. Position: data,
  40949. id: data.id || $this.objId,
  40950. polyline: {
  40951. positions: point2,
  40952. show: true,
  40953. material: $this.Cesium.Color.YELLOW,
  40954. width: 3,
  40955. clampToGround: true
  40956. }
  40957. });
  40958. return polyline;
  40959. }
  40960. computePosition(data) {
  40961. let pnts = [];
  40962. let position2 = [];
  40963. for (let p = 0; p < data.length; p++) {
  40964. position2.push(this.cartesianToLatlng(data[p]));
  40965. pnts.push(this.lonLatToMercator(this.cartesianToLatlng(data[p])));
  40966. }
  40967. this._curvelineData = position2;
  40968. let CurvePoints = this.getCurvePoints(pnts);
  40969. let point2 = [];
  40970. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40971. point2.push(this.LatlngTocartesian(this.WebMercator2lonLat(CurvePoints[i2])));
  40972. }
  40973. return point2;
  40974. }
  40975. startCreate(drawType) {
  40976. this.drawType = drawType;
  40977. var $this = this;
  40978. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  40979. this.handler.setInputAction(function(evt) {
  40980. var cartesian = $this.getCatesian3FromPX(evt.position);
  40981. if ($this._positions.length == 0) {
  40982. $this._positions.push(cartesian.clone());
  40983. $this.floatingPoint = $this.createPoint(cartesian);
  40984. $this.createPoint(cartesian);
  40985. }
  40986. $this._positions.push(cartesian);
  40987. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40988. this.handler.setInputAction(function(evt) {
  40989. if ($this._positions.length < 3)
  40990. return;
  40991. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  40992. if (!$this.Cesium.defined($this._curveline)) {
  40993. $this._curveline = $this.createCurveline();
  40994. }
  40995. $this.floatingPoint.position.setValue(cartesian);
  40996. if ($this._curveline) {
  40997. $this._positions.pop();
  40998. $this._positions.push(cartesian);
  40999. }
  41000. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41001. this.handler.setInputAction(function(evt) {
  41002. if (!$this._curveline)
  41003. return;
  41004. var cartesian = $this.getCatesian3FromPX(evt.position);
  41005. $this._positions.pop();
  41006. $this._positions.push(cartesian);
  41007. $this.createPoint(cartesian);
  41008. $this._curvelineData = $this._positions.concat();
  41009. $this.viewer.entities.remove($this._curveline);
  41010. $this._curveline = null;
  41011. $this._positions = [];
  41012. $this.floatingPoint.position.setValue(cartesian);
  41013. let lnglatArr = [];
  41014. for (var i2 = 0; i2 < $this._curvelineData.length; i2++) {
  41015. var lnglat = $this.cartesianToLatlng($this._curvelineData[i2]);
  41016. lnglatArr.push(lnglat);
  41017. }
  41018. $this._curvelineData = lnglatArr;
  41019. var line = $this.addload($this._curvelineData);
  41020. $this._entities_line.push(line);
  41021. $this._curvelineLast = line;
  41022. $this.clearPoint();
  41023. $this.destroy();
  41024. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41025. }
  41026. createPoint(cartesian) {
  41027. var $this = this;
  41028. var point2 = this.viewer.entities.add({
  41029. position: cartesian,
  41030. point: {
  41031. pixelSize: 10,
  41032. color: $this.Cesium.Color.RED,
  41033. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41034. }
  41035. });
  41036. $this._entities_point.push(point2);
  41037. return point2;
  41038. }
  41039. createCurveline() {
  41040. var $this = this;
  41041. var polyline = this.viewer.entities.add({
  41042. polyline: {
  41043. positions: new $this.Cesium.CallbackProperty(function() {
  41044. let pnts = [];
  41045. for (let p = 0; p < $this._positions.length; p++) {
  41046. pnts.push($this.lonLatToMercator($this.cartesianToLatlng($this._positions[p])));
  41047. }
  41048. let CurvePoints = $this.getCurvePoints(pnts);
  41049. let point2 = [];
  41050. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  41051. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  41052. }
  41053. return point2;
  41054. }, false),
  41055. show: true,
  41056. material: $this.Cesium.Color.YELLOW,
  41057. width: 3,
  41058. clampToGround: true
  41059. }
  41060. });
  41061. $this._entities_line.push(polyline);
  41062. return polyline;
  41063. }
  41064. clearPoint() {
  41065. this.DrawEndEvent.raiseEvent(this._curvelineLast, this._curvelineData, this.drawType);
  41066. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41067. this.viewer.entities.remove(this._entities_point[i2]);
  41068. }
  41069. this._entities_point = [];
  41070. }
  41071. destroy() {
  41072. if (this.handler) {
  41073. this.handler.destroy();
  41074. this.handler = null;
  41075. }
  41076. }
  41077. clear() {
  41078. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41079. this.viewer.entities.remove(this._entities_point[i2]);
  41080. }
  41081. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  41082. this.viewer.entities.remove(this._entities_line[i2]);
  41083. }
  41084. this.floatingPoint = null;
  41085. this._curveline = null;
  41086. this._curvelineLast = null;
  41087. this._positions = [];
  41088. this._entities_point = [];
  41089. this._entities_line = [];
  41090. this._curvelineData = null;
  41091. }
  41092. getCatesian3FromPX(px) {
  41093. var cartesian;
  41094. var ray = this.viewer.camera.getPickRay(px);
  41095. if (!ray)
  41096. return null;
  41097. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41098. return cartesian;
  41099. }
  41100. cartesianToLatlng(cartesian) {
  41101. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41102. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41103. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41104. return [lng, lat];
  41105. }
  41106. LatlngTocartesian(latlng) {
  41107. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41108. return cartesian3;
  41109. }
  41110. lonLatToMercator(Latlng) {
  41111. var E2 = Latlng[0];
  41112. var N2 = Latlng[1];
  41113. var x = E2 * 2003750834e-2 / 180;
  41114. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  41115. y = y * 2003750834e-2 / 180;
  41116. return [x, y];
  41117. }
  41118. WebMercator2lonLat(mercator) {
  41119. let x = mercator[0] / 2003750834e-2 * 180;
  41120. let ly = mercator[1] / 2003750834e-2 * 180;
  41121. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  41122. return [x, y];
  41123. }
  41124. getCurvePoints(controlPoints) {
  41125. let leftControl = this.getLeftMostControlPoint(controlPoints, this.t);
  41126. let [pnt1, pnt2, pnt3, normals, points2] = [null, null, null, [leftControl], []];
  41127. for (let i2 = 0; i2 < controlPoints.length - 2; i2++) {
  41128. [pnt1, pnt2, pnt3] = [controlPoints[i2], controlPoints[i2 + 1], controlPoints[i2 + 2]];
  41129. let normalPoints = this.getBisectorNormals(this.t, pnt1, pnt2, pnt3);
  41130. normals = normals.concat(normalPoints);
  41131. }
  41132. let rightControl = this.getRightMostControlPoint(controlPoints, this.t);
  41133. if (rightControl) {
  41134. normals.push(rightControl);
  41135. }
  41136. for (let i2 = 0; i2 < controlPoints.length - 1; i2++) {
  41137. pnt1 = controlPoints[i2];
  41138. pnt2 = controlPoints[i2 + 1];
  41139. points2.push(pnt1);
  41140. for (let t2 = 0; t2 < this.FITTING_COUNT; t2++) {
  41141. let pnt = this.getCubicValue(t2 / this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  41142. points2.push(pnt);
  41143. }
  41144. points2.push(pnt2);
  41145. }
  41146. return points2;
  41147. }
  41148. getLeftMostControlPoint(controlPoints, t2) {
  41149. let [pnt1, pnt2, pnt3, controlX, controlY] = [controlPoints[0], controlPoints[1], controlPoints[2], null, null];
  41150. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41151. let normalRight = pnts[0];
  41152. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41153. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41154. if (dist > this.ZERO_TOLERANCE) {
  41155. let mid = this.Mid(pnt1, pnt2);
  41156. let pX = pnt1[0] - mid[0];
  41157. let pY = pnt1[1] - mid[1];
  41158. let d1 = this.MathDistance(pnt1, pnt2);
  41159. let n = 2 / d1;
  41160. let nX = -n * pY;
  41161. let nY = n * pX;
  41162. let a11 = nX * nX - nY * nY;
  41163. let a12 = 2 * nX * nY;
  41164. let a22 = nY * nY - nX * nX;
  41165. let dX = normalRight[0] - mid[0];
  41166. let dY = normalRight[1] - mid[1];
  41167. controlX = mid[0] + a11 * dX + a12 * dY;
  41168. controlY = mid[1] + a12 * dX + a22 * dY;
  41169. } else {
  41170. controlX = pnt1[0] + t2 * (pnt2[0] - pnt1[0]);
  41171. controlY = pnt1[1] + t2 * (pnt2[1] - pnt1[1]);
  41172. }
  41173. return [controlX, controlY];
  41174. }
  41175. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  41176. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41177. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  41178. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41179. let uX = normal[0] / dist;
  41180. let uY = normal[1] / dist;
  41181. let d1 = this.MathDistance(pnt1, pnt2);
  41182. let d2 = this.MathDistance(pnt2, pnt3);
  41183. if (dist > this.ZERO_TOLERANCE) {
  41184. if (this.isClockWise(pnt1, pnt2, pnt3)) {
  41185. dt2 = t2 * d1;
  41186. x = pnt2[0] - dt2 * uY;
  41187. y = pnt2[1] + dt2 * uX;
  41188. bisectorNormalRight = [x, y];
  41189. dt2 = t2 * d2;
  41190. x = pnt2[0] + dt2 * uY;
  41191. y = pnt2[1] - dt2 * uX;
  41192. bisectorNormalLeft = [x, y];
  41193. } else {
  41194. dt2 = t2 * d1;
  41195. x = pnt2[0] + dt2 * uY;
  41196. y = pnt2[1] - dt2 * uX;
  41197. bisectorNormalRight = [x, y];
  41198. dt2 = t2 * d2;
  41199. x = pnt2[0] - dt2 * uY;
  41200. y = pnt2[1] + dt2 * uX;
  41201. bisectorNormalLeft = [x, y];
  41202. }
  41203. } else {
  41204. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  41205. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  41206. bisectorNormalRight = [x, y];
  41207. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  41208. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  41209. bisectorNormalLeft = [x, y];
  41210. }
  41211. return [bisectorNormalRight, bisectorNormalLeft];
  41212. }
  41213. getNormal(pnt1, pnt2, pnt3) {
  41214. let dX1 = pnt1[0] - pnt2[0];
  41215. let dY1 = pnt1[1] - pnt2[1];
  41216. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  41217. dX1 /= d1;
  41218. dY1 /= d1;
  41219. let dX2 = pnt3[0] - pnt2[0];
  41220. let dY2 = pnt3[1] - pnt2[1];
  41221. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  41222. dX2 /= d2;
  41223. dY2 /= d2;
  41224. let uX = dX1 + dX2;
  41225. let uY = dY1 + dY2;
  41226. return [uX, uY];
  41227. }
  41228. isClockWise(pnt1, pnt2, pnt3) {
  41229. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  41230. }
  41231. Mid(point1, point2) {
  41232. return [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  41233. }
  41234. MathDistance(pnt1, pnt2) {
  41235. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  41236. }
  41237. getRightMostControlPoint(controlPoints, t2) {
  41238. let count = controlPoints.length;
  41239. let pnt1 = controlPoints[count - 3];
  41240. let pnt2 = controlPoints[count - 2];
  41241. let pnt3 = controlPoints[count - 1];
  41242. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41243. let normalLeft = pnts[1];
  41244. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41245. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41246. let [controlX, controlY] = [null, null];
  41247. if (dist > this.ZERO_TOLERANCE) {
  41248. let mid = this.Mid(pnt2, pnt3);
  41249. let pX = pnt3[0] - mid[0];
  41250. let pY = pnt3[1] - mid[1];
  41251. let d1 = this.MathDistance(pnt2, pnt3);
  41252. let n = 2 / d1;
  41253. let nX = -n * pY;
  41254. let nY = n * pX;
  41255. let a11 = nX * nX - nY * nY;
  41256. let a12 = 2 * nX * nY;
  41257. let a22 = nY * nY - nX * nX;
  41258. let dX = normalLeft[0] - mid[0];
  41259. let dY = normalLeft[1] - mid[1];
  41260. controlX = mid[0] + a11 * dX + a12 * dY;
  41261. controlY = mid[1] + a12 * dX + a22 * dY;
  41262. } else {
  41263. controlX = pnt3[0] + t2 * (pnt2[0] - pnt3[0]);
  41264. controlY = pnt3[1] + t2 * (pnt2[1] - pnt3[1]);
  41265. }
  41266. return [controlX, controlY];
  41267. }
  41268. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  41269. t2 = Math.max(Math.min(t2, 1), 0);
  41270. let [tp, t22] = [1 - t2, t2 * t2];
  41271. let t3 = t22 * t2;
  41272. let tp2 = tp * tp;
  41273. let tp3 = tp2 * tp;
  41274. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  41275. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  41276. return [x, y];
  41277. }
  41278. }
  41279. class DrawCurveFlag {
  41280. constructor(arg) {
  41281. this.viewer = arg.viewer;
  41282. this.Cesium = arg.Cesium;
  41283. this.identificationPoint = null;
  41284. this.CurveFlag = null;
  41285. this.CurveFlagLast = null;
  41286. this.positions = [];
  41287. this.entitiesPoint = [];
  41288. this.entitiesCurveFlag = [];
  41289. this.CurveFlagData = null;
  41290. this.DrawStartEvent = new Cesium.Event();
  41291. this.DrawEndEvent = new Cesium.Event();
  41292. this._param = {
  41293. id: "DrawStraightArrow",
  41294. polygonColor: "rgba(0,255,0,0.5)",
  41295. outlineColor: "rgba(255, 255, 255, 1)",
  41296. outlineWidth: 1
  41297. };
  41298. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41299. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41300. }
  41301. getData() {
  41302. return this.CurveFlagData;
  41303. }
  41304. computePosition(data) {
  41305. let $this = this;
  41306. var lnglatArr = [];
  41307. for (var i2 = 0; i2 < data.length; i2++) {
  41308. var lnglat = $this.cartesianToLatlng(data[i2]);
  41309. lnglatArr.push(lnglat);
  41310. }
  41311. let startPoint = lnglatArr[0];
  41312. let endPoint = lnglatArr[lnglatArr.length - 1];
  41313. let point1 = startPoint;
  41314. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41315. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41316. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41317. let point5 = [endPoint[0], startPoint[1]];
  41318. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41319. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41320. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41321. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41322. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41323. let point11 = [startPoint[0], endPoint[1]];
  41324. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41325. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41326. let componentspolygon = [];
  41327. componentspolygon = curve1.concat(curve2);
  41328. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41329. let componentspolyline = [];
  41330. componentspolyline = curve1.concat(curve2);
  41331. componentspolyline.push($this.LatlngTocartesian(point1));
  41332. componentspolyline.push($this.LatlngTocartesian(point11));
  41333. $this.CurveFlagData = lnglatArr;
  41334. return [PolygonHierarchy, componentspolyline];
  41335. }
  41336. addload(data) {
  41337. var $this = this;
  41338. if (data.length < 2)
  41339. return;
  41340. let startPoint = data[0];
  41341. let endPoint = data[data.length - 1];
  41342. let point1 = startPoint;
  41343. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41344. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41345. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41346. let point5 = [endPoint[0], startPoint[1]];
  41347. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41348. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41349. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41350. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41351. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41352. let point11 = [startPoint[0], endPoint[1]];
  41353. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41354. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41355. let componentspolygon = [];
  41356. componentspolygon = curve1.concat(curve2);
  41357. let componentspolyline = [];
  41358. componentspolyline = curve1.concat(curve2);
  41359. componentspolyline.push($this.LatlngTocartesian(point1));
  41360. componentspolyline.push($this.LatlngTocartesian(point11));
  41361. var shape = this.viewer.entities.add({
  41362. Type: "DrawCurveFlag",
  41363. Position: data,
  41364. id: data.id || $this.objId,
  41365. polygon: {
  41366. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41367. extrudedHeight: 1,
  41368. material: $this.Cesium.Color.RED
  41369. },
  41370. polyline: {
  41371. positions: componentspolyline,
  41372. show: true,
  41373. material: $this.Cesium.Color.YELLOW,
  41374. width: 5,
  41375. clampToGround: true
  41376. }
  41377. });
  41378. $this.entitiesCurveFlag.push(shape);
  41379. return shape;
  41380. }
  41381. startCreate(drawType) {
  41382. this.drawType = drawType;
  41383. var $this = this;
  41384. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41385. this.handler.setInputAction(function(evt) {
  41386. var cartesian = $this.getCatesian3FromPX(evt.position);
  41387. if ($this.positions.length == 0) {
  41388. $this.positions.push(cartesian.clone());
  41389. $this.identificationPoint = $this.createPoint(cartesian);
  41390. $this.createPoint(cartesian);
  41391. $this.positions.push(cartesian);
  41392. }
  41393. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41394. this.handler.setInputAction(function(evt) {
  41395. if ($this.positions.length < 2)
  41396. return;
  41397. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41398. if (!$this.Cesium.defined($this.CurveFlag)) {
  41399. $this.CurveFlag = $this.createCurveFlag();
  41400. }
  41401. $this.identificationPoint.position.setValue(cartesian);
  41402. if ($this.CurveFlag) {
  41403. $this.positions.pop();
  41404. $this.positions.push(cartesian);
  41405. }
  41406. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41407. this.handler.setInputAction(function(evt) {
  41408. if (!$this.CurveFlag)
  41409. return;
  41410. var cartesian = $this.getCatesian3FromPX(evt.position);
  41411. $this.positions.pop();
  41412. $this.positions.push(cartesian);
  41413. $this.createPoint(cartesian);
  41414. $this.CurveFlagData = $this.positions.concat();
  41415. $this.viewer.entities.remove($this.CurveFlag);
  41416. $this.CurveFlag = null;
  41417. $this.positions = [];
  41418. $this.identificationPoint.position.setValue(cartesian);
  41419. var lnglatArr = [];
  41420. for (var i2 = 0; i2 < $this.CurveFlagData.length; i2++) {
  41421. var lnglat = $this.cartesianToLatlng($this.CurveFlagData[i2]);
  41422. lnglatArr.push(lnglat);
  41423. }
  41424. $this.CurveFlagData = lnglatArr;
  41425. var CurveFlag = $this.addload([$this.CurveFlagData[0], $this.CurveFlagData[$this.CurveFlagData.length - 1]]);
  41426. $this.entitiesCurveFlag.push(CurveFlag);
  41427. $this.CurveFlagLast = CurveFlag;
  41428. $this.clearPoint();
  41429. $this.destroy();
  41430. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41431. }
  41432. createPoint(cartesian) {
  41433. var $this = this;
  41434. var point2 = this.viewer.entities.add({
  41435. position: cartesian,
  41436. point: {
  41437. pixelSize: 10,
  41438. color: $this.Cesium.Color.RED,
  41439. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41440. }
  41441. });
  41442. $this.entitiesPoint.push(point2);
  41443. return point2;
  41444. }
  41445. createCurveFlag() {
  41446. var $this = this;
  41447. var polygon2 = this.viewer.entities.add({
  41448. polygon: {
  41449. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41450. if ($this.positions.length < 2)
  41451. return;
  41452. let lonlat = [];
  41453. let components = [];
  41454. let length = $this.positions.length;
  41455. for (let i2 = 0; i2 < length; i2++) {
  41456. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41457. }
  41458. let startPoint = lonlat[0];
  41459. let endPoint = lonlat[lonlat.length - 1];
  41460. let point1 = startPoint;
  41461. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41462. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41463. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41464. let point5 = [endPoint[0], startPoint[1]];
  41465. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41466. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41467. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41468. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41469. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41470. [startPoint[0], endPoint[1]];
  41471. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41472. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41473. components = curve1.concat(curve2);
  41474. return new $this.Cesium.PolygonHierarchy(components);
  41475. }, false),
  41476. extrudedHeight: 1,
  41477. material: $this.Cesium.Color.RED
  41478. },
  41479. polyline: {
  41480. positions: new $this.Cesium.CallbackProperty(function() {
  41481. if ($this.positions.length < 2)
  41482. return;
  41483. let lonlat = [];
  41484. let components = [];
  41485. let length = $this.positions.length;
  41486. for (let i2 = 0; i2 < length; i2++) {
  41487. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41488. }
  41489. let startPoint = lonlat[0];
  41490. let endPoint = lonlat[lonlat.length - 1];
  41491. let point1 = startPoint;
  41492. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41493. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41494. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41495. let point5 = [endPoint[0], startPoint[1]];
  41496. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41497. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41498. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41499. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41500. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41501. let point11 = [startPoint[0], endPoint[1]];
  41502. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41503. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41504. components = curve1.concat(curve2);
  41505. components.push($this.LatlngTocartesian(point1));
  41506. components.push($this.LatlngTocartesian(point11));
  41507. return components;
  41508. }, false),
  41509. show: true,
  41510. material: $this.Cesium.Color.YELLOW,
  41511. width: 5,
  41512. clampToGround: true
  41513. }
  41514. });
  41515. $this.entitiesCurveFlag.push(polygon2);
  41516. return polygon2;
  41517. }
  41518. cartesianToLatlng(cartesian) {
  41519. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41520. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41521. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41522. return [lng, lat];
  41523. }
  41524. LatlngTocartesian(latlng) {
  41525. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41526. return cartesian3;
  41527. }
  41528. clearPoint() {
  41529. this.DrawEndEvent.raiseEvent(this.CurveFlagLast, [this.CurveFlagData[0], this.CurveFlagData[this.CurveFlagData.length - 1]], this.drawType);
  41530. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41531. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41532. }
  41533. this.entitiesPoint = [];
  41534. }
  41535. destroy() {
  41536. if (this.handler) {
  41537. this.handler.destroy();
  41538. this.handler = null;
  41539. }
  41540. }
  41541. clear() {
  41542. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41543. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41544. }
  41545. for (var i2 = 0; i2 < this.entitiesCurveFlag.length; i2++) {
  41546. this.viewer.entities.remove(this.entitiesCurveFlag[i2]);
  41547. }
  41548. this.identificationPoint = null;
  41549. this.CurveFlag = null;
  41550. this.CurveFlagLast = null;
  41551. this.positions = [];
  41552. this.entitiesPoint = [];
  41553. this.entitiesCurveFlag = [];
  41554. this.CurveFlagData = null;
  41555. }
  41556. getCatesian3FromPX(px) {
  41557. var cartesian;
  41558. var ray = this.viewer.camera.getPickRay(px);
  41559. if (!ray)
  41560. return null;
  41561. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41562. return cartesian;
  41563. }
  41564. getBezierPoints(points2) {
  41565. let $this = this;
  41566. if (points2.length <= 2) {
  41567. return points2;
  41568. } else {
  41569. let bezierPoints = [];
  41570. let n = points2.length - 1;
  41571. for (let t2 = 0; t2 <= 1; t2 += 0.01) {
  41572. let [x, y] = [0, 0];
  41573. for (let index2 = 0; index2 <= n; index2++) {
  41574. let factor = $this.getBinomialFactor(n, index2);
  41575. let a = Math.pow(t2, index2);
  41576. let b = Math.pow(1 - t2, n - index2);
  41577. x += factor * a * b * points2[index2][0];
  41578. y += factor * a * b * points2[index2][1];
  41579. }
  41580. bezierPoints.push($this.LatlngTocartesian([x, y]));
  41581. }
  41582. bezierPoints.push($this.LatlngTocartesian(points2[n]));
  41583. return bezierPoints;
  41584. }
  41585. }
  41586. getBinomialFactor(n, index2) {
  41587. return this.getFactorial(n) / (this.getFactorial(index2) * this.getFactorial(n - index2));
  41588. }
  41589. getFactorial(n) {
  41590. let result = 1;
  41591. switch (n) {
  41592. case n <= 1:
  41593. result = 1;
  41594. break;
  41595. case n === 2:
  41596. result = 2;
  41597. break;
  41598. case n === 3:
  41599. result = 6;
  41600. break;
  41601. case n === 24:
  41602. result = 24;
  41603. break;
  41604. case n === 5:
  41605. result = 120;
  41606. break;
  41607. default:
  41608. for (let i2 = 1; i2 <= n; i2++) {
  41609. result *= i2;
  41610. }
  41611. break;
  41612. }
  41613. return result;
  41614. }
  41615. }
  41616. class DrawRectFlag {
  41617. constructor(arg) {
  41618. this.viewer = arg.viewer;
  41619. this.Cesium = arg.Cesium;
  41620. this.identificationPoint = null;
  41621. this.RectFlag = null;
  41622. this.RectFlagLast = null;
  41623. this.positions = [];
  41624. this.entitiesPoint = [];
  41625. this.entitiesRectFlag = [];
  41626. this.RectFlagData = null;
  41627. this.DrawStartEvent = new Cesium.Event();
  41628. this.DrawEndEvent = new Cesium.Event();
  41629. this._param = {
  41630. id: "DrawStraightArrow",
  41631. polygonColor: "rgba(0,255,0,0.5)",
  41632. outlineColor: "rgba(255, 255, 255, 1)",
  41633. outlineWidth: 1
  41634. };
  41635. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41636. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41637. }
  41638. getData() {
  41639. return this.RectFlagData;
  41640. }
  41641. computePosition(data) {
  41642. let $this = this;
  41643. var lnglatArr = [];
  41644. for (var i2 = 0; i2 < data.length; i2++) {
  41645. var lnglat = $this.cartesianToLatlng(data[i2]);
  41646. lnglatArr.push(lnglat);
  41647. }
  41648. let startPoint = lnglatArr[0];
  41649. let endPoint = lnglatArr[lnglatArr.length - 1];
  41650. let point0 = lnglatArr[0];
  41651. var point1 = [endPoint[0], startPoint[1]];
  41652. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41653. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41654. var point4 = [startPoint[0], endPoint[1]];
  41655. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41656. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41657. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41658. $this.RectFlagData = lnglatArr;
  41659. console.log([PolygonHierarchy, componentspolyline]);
  41660. return [PolygonHierarchy, componentspolyline];
  41661. }
  41662. addload(data) {
  41663. var $this = this;
  41664. if (data.length < 2)
  41665. return;
  41666. let startPoint = data[0];
  41667. let endPoint = data[data.length - 1];
  41668. let point0 = data[0];
  41669. var point1 = [endPoint[0], startPoint[1]];
  41670. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41671. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41672. var point4 = [startPoint[0], endPoint[1]];
  41673. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41674. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41675. var shape = this.viewer.entities.add({
  41676. Type: "DrawRectFlag",
  41677. Position: data,
  41678. id: data.id || $this.objId,
  41679. polygon: {
  41680. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41681. extrudedHeight: 1,
  41682. material: $this.Cesium.Color.RED
  41683. },
  41684. polyline: {
  41685. positions: componentspolyline,
  41686. show: true,
  41687. material: $this.Cesium.Color.YELLOW,
  41688. width: 5,
  41689. clampToGround: true
  41690. }
  41691. });
  41692. $this.entitiesRectFlag.push(shape);
  41693. return shape;
  41694. }
  41695. startCreate(drawType) {
  41696. this.drawType = drawType;
  41697. var $this = this;
  41698. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41699. this.handler.setInputAction(function(evt) {
  41700. var cartesian = $this.getCatesian3FromPX(evt.position);
  41701. if ($this.positions.length == 0) {
  41702. $this.positions.push(cartesian.clone());
  41703. $this.identificationPoint = $this.createPoint(cartesian);
  41704. $this.createPoint(cartesian);
  41705. $this.positions.push(cartesian);
  41706. }
  41707. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41708. this.handler.setInputAction(function(evt) {
  41709. if ($this.positions.length < 2)
  41710. return;
  41711. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41712. if (!$this.Cesium.defined($this.RectFlag)) {
  41713. $this.RectFlag = $this.createRectFlag();
  41714. }
  41715. $this.identificationPoint.position.setValue(cartesian);
  41716. if ($this.RectFlag) {
  41717. $this.positions.pop();
  41718. $this.positions.push(cartesian);
  41719. }
  41720. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41721. this.handler.setInputAction(function(evt) {
  41722. if (!$this.RectFlag)
  41723. return;
  41724. var cartesian = $this.getCatesian3FromPX(evt.position);
  41725. $this.positions.pop();
  41726. $this.positions.push(cartesian);
  41727. $this.createPoint(cartesian);
  41728. $this.RectFlagData = $this.positions.concat();
  41729. $this.viewer.entities.remove($this.RectFlag);
  41730. $this.RectFlag = null;
  41731. $this.positions = [];
  41732. $this.identificationPoint.position.setValue(cartesian);
  41733. var lnglatArr = [];
  41734. for (var i2 = 0; i2 < $this.RectFlagData.length; i2++) {
  41735. var lnglat = $this.cartesianToLatlng($this.RectFlagData[i2]);
  41736. lnglatArr.push(lnglat);
  41737. }
  41738. $this.RectFlagData = lnglatArr;
  41739. var RectFlag = $this.addload([$this.RectFlagData[0], $this.RectFlagData[$this.RectFlagData.length - 1]]);
  41740. $this.entitiesRectFlag.push(RectFlag);
  41741. $this.RectFlagLast = RectFlag;
  41742. $this.clearPoint();
  41743. $this.destroy();
  41744. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41745. }
  41746. createPoint(cartesian) {
  41747. var $this = this;
  41748. var point2 = this.viewer.entities.add({
  41749. position: cartesian,
  41750. point: {
  41751. pixelSize: 10,
  41752. color: $this.Cesium.Color.RED,
  41753. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41754. }
  41755. });
  41756. $this.entitiesPoint.push(point2);
  41757. return point2;
  41758. }
  41759. createRectFlag() {
  41760. console.log("232323");
  41761. var $this = this;
  41762. var polygon2 = this.viewer.entities.add({
  41763. polygon: {
  41764. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41765. if ($this.positions.length < 2)
  41766. return;
  41767. let lonlat = [];
  41768. let length = $this.positions.length;
  41769. for (let i2 = 0; i2 < length; i2++) {
  41770. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41771. }
  41772. let startPoint = lonlat[0];
  41773. let endPoint = lonlat[lonlat.length - 1];
  41774. let point0 = lonlat[0];
  41775. var point1 = [endPoint[0], startPoint[1]];
  41776. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41777. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41778. [startPoint[0], endPoint[1]];
  41779. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41780. return new $this.Cesium.PolygonHierarchy(components);
  41781. }, false),
  41782. extrudedHeight: 1,
  41783. material: $this.Cesium.Color.RED
  41784. },
  41785. polyline: {
  41786. positions: new $this.Cesium.CallbackProperty(function() {
  41787. if ($this.positions.length < 2)
  41788. return;
  41789. let lonlat = [];
  41790. let length = $this.positions.length;
  41791. for (let i2 = 0; i2 < length; i2++) {
  41792. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41793. }
  41794. let startPoint = lonlat[0];
  41795. let endPoint = lonlat[lonlat.length - 1];
  41796. let point0 = lonlat[0];
  41797. var point1 = [endPoint[0], startPoint[1]];
  41798. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41799. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41800. var point4 = [startPoint[0], endPoint[1]];
  41801. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41802. return components;
  41803. }, false),
  41804. show: true,
  41805. material: $this.Cesium.Color.YELLOW,
  41806. width: 5,
  41807. clampToGround: true
  41808. }
  41809. });
  41810. $this.entitiesRectFlag.push(polygon2);
  41811. return polygon2;
  41812. }
  41813. cartesianToLatlng(cartesian) {
  41814. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41815. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41816. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41817. return [lng, lat];
  41818. }
  41819. LatlngTocartesian(latlng) {
  41820. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41821. return cartesian3;
  41822. }
  41823. clearPoint() {
  41824. this.DrawEndEvent.raiseEvent(this.RectFlagLast, [this.RectFlagData[0], this.RectFlagData[this.RectFlagData.length - 1]], this.drawType);
  41825. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41826. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41827. }
  41828. this.entitiesPoint = [];
  41829. }
  41830. destroy() {
  41831. if (this.handler) {
  41832. this.handler.destroy();
  41833. this.handler = null;
  41834. }
  41835. }
  41836. clear() {
  41837. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41838. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41839. }
  41840. for (var i2 = 0; i2 < this.entitiesRectFlag.length; i2++) {
  41841. this.viewer.entities.remove(this.entitiesRectFlag[i2]);
  41842. }
  41843. this.identificationPoint = null;
  41844. this.RectFlag = null;
  41845. this.RectFlagLast = null;
  41846. this.positions = [];
  41847. this.entitiesPoint = [];
  41848. this.entitiesRectFlag = [];
  41849. this.RectFlagData = null;
  41850. }
  41851. getCatesian3FromPX(px) {
  41852. var cartesian;
  41853. var ray = this.viewer.camera.getPickRay(px);
  41854. if (!ray)
  41855. return null;
  41856. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41857. return cartesian;
  41858. }
  41859. }
  41860. class DrawTriangleFlag {
  41861. constructor(arg) {
  41862. this.viewer = arg.viewer;
  41863. this.Cesium = arg.Cesium;
  41864. this.identificationPoint = null;
  41865. this.TriangleFlag = null;
  41866. this.TriangleFlagLast = null;
  41867. this.positions = [];
  41868. this.entitiesPoint = [];
  41869. this.entitiesTriangleFlag = [];
  41870. this.TriangleFlagData = null;
  41871. this.DrawStartEvent = new Cesium.Event();
  41872. this.DrawEndEvent = new Cesium.Event();
  41873. this._param = {
  41874. id: "DrawStraightArrow",
  41875. polygonColor: "rgba(0,255,0,0.5)",
  41876. outlineColor: "rgba(255, 255, 255, 1)",
  41877. outlineWidth: 1
  41878. };
  41879. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41880. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41881. }
  41882. getData() {
  41883. return this.TriangleFlagData;
  41884. }
  41885. computePosition(data) {
  41886. let $this = this;
  41887. var lnglatArr = [];
  41888. for (var i2 = 0; i2 < data.length; i2++) {
  41889. var lnglat = $this.cartesianToLatlng(data[i2]);
  41890. lnglatArr.push(lnglat);
  41891. }
  41892. let startPoint = lnglatArr[0];
  41893. let endPoint = lnglatArr[lnglatArr.length - 1];
  41894. let point0 = lnglatArr[0];
  41895. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41896. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41897. var point3 = [startPoint[0], endPoint[1]];
  41898. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41899. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41900. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41901. $this.TriangleFlagData = lnglatArr;
  41902. console.log([PolygonHierarchy, componentspolyline]);
  41903. return [PolygonHierarchy, componentspolyline];
  41904. }
  41905. addload(data) {
  41906. var $this = this;
  41907. if (data.length < 2)
  41908. return;
  41909. let startPoint = data[0];
  41910. let endPoint = data[data.length - 1];
  41911. let point0 = data[0];
  41912. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41913. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41914. var point3 = [startPoint[0], endPoint[1]];
  41915. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41916. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41917. var shape = this.viewer.entities.add({
  41918. Type: "DrawTriangleFlag",
  41919. Position: data,
  41920. id: data.id || $this.objId,
  41921. polygon: {
  41922. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41923. extrudedHeight: 1,
  41924. material: $this.Cesium.Color.RED
  41925. },
  41926. polyline: {
  41927. positions: componentspolyline,
  41928. show: true,
  41929. material: $this.Cesium.Color.YELLOW,
  41930. width: 5,
  41931. clampToGround: true
  41932. }
  41933. });
  41934. $this.entitiesTriangleFlag.push(shape);
  41935. return shape;
  41936. }
  41937. startCreate(drawType) {
  41938. this.drawType = drawType;
  41939. var $this = this;
  41940. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41941. this.handler.setInputAction(function(evt) {
  41942. var cartesian = $this.getCatesian3FromPX(evt.position);
  41943. if ($this.positions.length == 0) {
  41944. $this.positions.push(cartesian.clone());
  41945. $this.identificationPoint = $this.createPoint(cartesian);
  41946. $this.createPoint(cartesian);
  41947. $this.positions.push(cartesian);
  41948. }
  41949. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41950. this.handler.setInputAction(function(evt) {
  41951. if ($this.positions.length < 2)
  41952. return;
  41953. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41954. if (!$this.Cesium.defined($this.TriangleFlag)) {
  41955. $this.TriangleFlag = $this.createTriangleFlag();
  41956. }
  41957. $this.identificationPoint.position.setValue(cartesian);
  41958. if ($this.TriangleFlag) {
  41959. $this.positions.pop();
  41960. $this.positions.push(cartesian);
  41961. }
  41962. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41963. this.handler.setInputAction(function(evt) {
  41964. if (!$this.TriangleFlag)
  41965. return;
  41966. var cartesian = $this.getCatesian3FromPX(evt.position);
  41967. $this.positions.pop();
  41968. $this.positions.push(cartesian);
  41969. $this.createPoint(cartesian);
  41970. $this.TriangleFlagData = $this.positions.concat();
  41971. $this.viewer.entities.remove($this.TriangleFlag);
  41972. $this.TriangleFlag = null;
  41973. $this.positions = [];
  41974. $this.identificationPoint.position.setValue(cartesian);
  41975. var lnglatArr = [];
  41976. for (var i2 = 0; i2 < $this.TriangleFlagData.length; i2++) {
  41977. var lnglat = $this.cartesianToLatlng($this.TriangleFlagData[i2]);
  41978. lnglatArr.push(lnglat);
  41979. }
  41980. $this.TriangleFlagData = lnglatArr;
  41981. var TriangleFlag = $this.addload([$this.TriangleFlagData[0], $this.TriangleFlagData[$this.TriangleFlagData.length - 1]]);
  41982. $this.entitiesTriangleFlag.push(TriangleFlag);
  41983. $this.TriangleFlagLast = TriangleFlag;
  41984. $this.clearPoint();
  41985. $this.destroy();
  41986. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41987. }
  41988. createPoint(cartesian) {
  41989. var $this = this;
  41990. var point2 = this.viewer.entities.add({
  41991. position: cartesian,
  41992. point: {
  41993. pixelSize: 10,
  41994. color: $this.Cesium.Color.RED,
  41995. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41996. }
  41997. });
  41998. $this.entitiesPoint.push(point2);
  41999. return point2;
  42000. }
  42001. createTriangleFlag() {
  42002. console.log("232323");
  42003. var $this = this;
  42004. var polygon2 = this.viewer.entities.add({
  42005. polygon: {
  42006. hierarchy: new $this.Cesium.CallbackProperty(function() {
  42007. if ($this.positions.length < 2)
  42008. return;
  42009. let lonlat = [];
  42010. let length = $this.positions.length;
  42011. for (let i2 = 0; i2 < length; i2++) {
  42012. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  42013. }
  42014. let startPoint = lonlat[0];
  42015. let endPoint = lonlat[lonlat.length - 1];
  42016. let point0 = lonlat[0];
  42017. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  42018. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  42019. [startPoint[0], endPoint[1]];
  42020. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  42021. return new $this.Cesium.PolygonHierarchy(components);
  42022. }, false),
  42023. extrudedHeight: 1,
  42024. material: $this.Cesium.Color.RED
  42025. },
  42026. polyline: {
  42027. positions: new $this.Cesium.CallbackProperty(function() {
  42028. if ($this.positions.length < 2)
  42029. return;
  42030. let lonlat = [];
  42031. let length = $this.positions.length;
  42032. for (let i2 = 0; i2 < length; i2++) {
  42033. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  42034. }
  42035. let startPoint = lonlat[0];
  42036. let endPoint = lonlat[lonlat.length - 1];
  42037. let point0 = lonlat[0];
  42038. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  42039. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  42040. var point3 = [startPoint[0], endPoint[1]];
  42041. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  42042. return components;
  42043. }, false),
  42044. show: true,
  42045. material: $this.Cesium.Color.YELLOW,
  42046. width: 5,
  42047. clampToGround: true
  42048. }
  42049. });
  42050. $this.entitiesTriangleFlag.push(polygon2);
  42051. return polygon2;
  42052. }
  42053. cartesianToLatlng(cartesian) {
  42054. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42055. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42056. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42057. return [lng, lat];
  42058. }
  42059. LatlngTocartesian(latlng) {
  42060. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42061. return cartesian3;
  42062. }
  42063. clearPoint() {
  42064. this.DrawEndEvent.raiseEvent(this.TriangleFlagLast, [this.TriangleFlagData[0], this.TriangleFlagData[this.TriangleFlagData.length - 1]], this.drawType);
  42065. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42066. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42067. }
  42068. this.entitiesPoint = [];
  42069. }
  42070. destroy() {
  42071. if (this.handler) {
  42072. this.handler.destroy();
  42073. this.handler = null;
  42074. }
  42075. }
  42076. clear() {
  42077. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42078. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42079. }
  42080. for (var i2 = 0; i2 < this.entitiesTriangleFlag.length; i2++) {
  42081. this.viewer.entities.remove(this.entitiesTriangleFlag[i2]);
  42082. }
  42083. this.identificationPoint = null;
  42084. this.TriangleFlag = null;
  42085. this.TriangleFlagLast = null;
  42086. this.positions = [];
  42087. this.entitiesPoint = [];
  42088. this.entitiesTriangleFlag = [];
  42089. this.TriangleFlagData = null;
  42090. }
  42091. getCatesian3FromPX(px) {
  42092. var cartesian;
  42093. var ray = this.viewer.camera.getPickRay(px);
  42094. if (!ray)
  42095. return null;
  42096. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42097. return cartesian;
  42098. }
  42099. }
  42100. class DrawPoint$1 {
  42101. constructor(arg) {
  42102. this.viewer = arg.viewer;
  42103. this.Cesium = arg.Cesium;
  42104. this._point = null;
  42105. this._pointData = null;
  42106. this._entities = [];
  42107. this.DrawStartEvent = new Cesium.Event();
  42108. this.DrawEndEvent = new Cesium.Event();
  42109. this._param = {
  42110. id: "DrawStraightArrow",
  42111. polygonColor: "rgba(0,255,0,0.5)",
  42112. outlineColor: "rgba(255, 255, 255, 1)",
  42113. outlineWidth: 1
  42114. };
  42115. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42116. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42117. }
  42118. get point() {
  42119. return this._point;
  42120. }
  42121. addload(data) {
  42122. return this.createPoint(data);
  42123. }
  42124. getData() {
  42125. return this._pointData;
  42126. }
  42127. computePosition(data) {
  42128. let $this = this;
  42129. var lnglatArr = [];
  42130. for (var i2 = 0; i2 < data.length; i2++) {
  42131. var lnglat = $this.cartesianToLatlng(data[i2]);
  42132. lnglatArr.push(lnglat);
  42133. }
  42134. $this._pointData = lnglatArr;
  42135. let point2 = lnglatArr[0];
  42136. return $this.Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  42137. }
  42138. startCreate(drawType) {
  42139. this.drawType = drawType;
  42140. var $this = this;
  42141. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42142. this.handler.setInputAction(function(evt) {
  42143. var cartesian = $this.getCatesian3FromPX(evt.position);
  42144. if (!cartesian)
  42145. return;
  42146. let latlon = $this.cartesianToLatlng(cartesian);
  42147. var point2 = $this.createPoint(latlon);
  42148. $this._pointData = cartesian;
  42149. $this._point = point2;
  42150. $this.DrawEndEvent.raiseEvent($this._point, latlon, $this.drawType);
  42151. $this.destroy();
  42152. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42153. }
  42154. createPoint(cartesian) {
  42155. var $this = this;
  42156. var point2 = this.viewer.entities.add({
  42157. Type: "DrawPoint",
  42158. Position: [cartesian],
  42159. position: $this.Cesium.Cartesian3.fromDegrees(cartesian[0], cartesian[1]),
  42160. id: cartesian.id || $this.objId,
  42161. billboard: {
  42162. image: "./static/poi2.png",
  42163. verticalOrigin: Cesium.VerticalOrigin.BOTTOM
  42164. }
  42165. });
  42166. $this._entities.push(point2);
  42167. return point2;
  42168. }
  42169. cartesianToLatlng(cartesian) {
  42170. let ellipsoid = this.viewer.scene.globe.ellipsoid;
  42171. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  42172. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  42173. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  42174. return [lng, lat];
  42175. }
  42176. destroy() {
  42177. if (this.handler) {
  42178. this.handler.destroy();
  42179. this.handler = null;
  42180. }
  42181. }
  42182. clear() {
  42183. for (var i2 = 0; i2 < this._entities.length; i2++) {
  42184. this.viewer.entities.remove(this._entities[i2]);
  42185. }
  42186. this._entities = [];
  42187. this._point = null;
  42188. }
  42189. getCatesian3FromPX(px) {
  42190. var cartesian;
  42191. var ray = this.viewer.camera.getPickRay(px);
  42192. if (!ray)
  42193. return null;
  42194. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42195. return cartesian;
  42196. }
  42197. }
  42198. class DrawPolyline {
  42199. constructor(arg) {
  42200. this.viewer = arg.viewer;
  42201. this.Cesium = arg.Cesium;
  42202. this._polyline = null;
  42203. this._polylineLast = null;
  42204. this._positions = [];
  42205. this._entities_point = [];
  42206. this._entities_line = [];
  42207. this._polylineData = null;
  42208. this.DrawStartEvent = new Cesium.Event();
  42209. this.DrawEndEvent = new Cesium.Event();
  42210. this._param = {
  42211. id: "DrawStraightArrow",
  42212. polygonColor: "rgba(0,255,0,0.5)",
  42213. outlineColor: "rgba(255, 255, 255, 1)",
  42214. outlineWidth: 1
  42215. };
  42216. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42217. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42218. }
  42219. get line() {
  42220. return this._polylineLast;
  42221. }
  42222. getData() {
  42223. return this._polylineData;
  42224. }
  42225. computePosition(data) {
  42226. let $this = this;
  42227. var lnglatArr = [];
  42228. for (var i2 = 0; i2 < data.length; i2++) {
  42229. var lnglat = $this.cartesianToLatlng(data[i2]);
  42230. lnglatArr.push(lnglat);
  42231. }
  42232. $this._polylineData = lnglatArr;
  42233. return data;
  42234. }
  42235. addload(data) {
  42236. var $this = this;
  42237. var lnglatArr = [];
  42238. for (var i2 = 0; i2 < data.length; i2++) {
  42239. var lnglat = $this.LatlngTocartesian(data[i2]);
  42240. lnglatArr.push(lnglat);
  42241. }
  42242. var polyline = this.viewer.entities.add({
  42243. Type: "DrawPolyline",
  42244. Position: data,
  42245. id: data.id || $this.objId,
  42246. polyline: {
  42247. positions: lnglatArr,
  42248. show: true,
  42249. material: $this.Cesium.Color.RED,
  42250. width: 3,
  42251. clampToGround: true
  42252. }
  42253. });
  42254. return polyline;
  42255. }
  42256. startCreate(drawType) {
  42257. this.drawType = drawType;
  42258. var $this = this;
  42259. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42260. this.handler.setInputAction(function(evt) {
  42261. var cartesian = $this.getCatesian3FromPX(evt.position);
  42262. if ($this._positions.length == 0) {
  42263. $this._positions.push(cartesian.clone());
  42264. }
  42265. $this._positions.push(cartesian);
  42266. $this.createPoint(cartesian);
  42267. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42268. this.handler.setInputAction(function(evt) {
  42269. if ($this._positions.length < 1)
  42270. return;
  42271. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42272. if (!$this.Cesium.defined($this._polyline)) {
  42273. $this._polyline = $this.createPolyline();
  42274. }
  42275. if ($this._polyline) {
  42276. $this._positions.pop();
  42277. $this._positions.push(cartesian);
  42278. }
  42279. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42280. this.handler.setInputAction(function(evt) {
  42281. if (!$this._polyline)
  42282. return;
  42283. var cartesian = $this.getCatesian3FromPX(evt.position);
  42284. $this._positions.pop();
  42285. $this.createPoint(cartesian);
  42286. $this._polylineData = $this._positions.concat();
  42287. $this.viewer.entities.remove($this._polyline);
  42288. $this._polyline = null;
  42289. $this._positions = [];
  42290. var lnglatArr = [];
  42291. for (var i2 = 0; i2 < $this._polylineData.length; i2++) {
  42292. var lnglat = $this.cartesianToLatlng($this._polylineData[i2]);
  42293. lnglatArr.push(lnglat);
  42294. }
  42295. $this._polylineData = lnglatArr;
  42296. var line = $this.addload($this._polylineData);
  42297. $this._entities_line.push(line);
  42298. $this._polylineLast = line;
  42299. $this.clearPoint();
  42300. $this.destroy();
  42301. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42302. }
  42303. createPoint(cartesian) {
  42304. var $this = this;
  42305. var point2 = this.viewer.entities.add({
  42306. position: cartesian,
  42307. point: {
  42308. pixelSize: 10,
  42309. color: $this.Cesium.Color.RED,
  42310. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42311. }
  42312. });
  42313. $this._entities_point.push(point2);
  42314. return point2;
  42315. }
  42316. createPolyline() {
  42317. var $this = this;
  42318. var polyline = this.viewer.entities.add({
  42319. polyline: {
  42320. positions: new $this.Cesium.CallbackProperty(function() {
  42321. return $this._positions;
  42322. }, false),
  42323. show: true,
  42324. material: $this.Cesium.Color.RED,
  42325. width: 3,
  42326. clampToGround: true
  42327. }
  42328. });
  42329. $this._entities_line.push(polyline);
  42330. return polyline;
  42331. }
  42332. cartesianToLatlng(cartesian) {
  42333. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42334. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42335. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42336. return [lng, lat];
  42337. }
  42338. LatlngTocartesian(latlng) {
  42339. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42340. return cartesian3;
  42341. }
  42342. clearPoint() {
  42343. this.DrawEndEvent.raiseEvent(this._polylineLast, this._polylineData, this.drawType);
  42344. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42345. this.viewer.entities.remove(this._entities_point[i2]);
  42346. }
  42347. this._entities_point = [];
  42348. }
  42349. destroy() {
  42350. if (this.handler) {
  42351. this.handler.destroy();
  42352. this.handler = null;
  42353. }
  42354. }
  42355. clear() {
  42356. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42357. this.viewer.entities.remove(this._entities_point[i2]);
  42358. }
  42359. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  42360. this.viewer.entities.remove(this._entities_line[i2]);
  42361. }
  42362. this._polyline = null;
  42363. this._positions = [];
  42364. this._entities_point = [];
  42365. this._entities_line = [];
  42366. this._polylineData = null;
  42367. this._polylineLast = null;
  42368. }
  42369. getCatesian3FromPX(px) {
  42370. var cartesian;
  42371. var ray = this.viewer.camera.getPickRay(px);
  42372. if (!ray)
  42373. return null;
  42374. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42375. return cartesian;
  42376. }
  42377. }
  42378. class DrawPolygon {
  42379. constructor(arg) {
  42380. this.viewer = arg.viewer;
  42381. this.Cesium = arg.Cesium;
  42382. this._polygon = null;
  42383. this._polygonLast = null;
  42384. this._positions = [];
  42385. this._entities_point = [];
  42386. this._entities_polygon = [];
  42387. this._polygonData = null;
  42388. this.DrawStartEvent = new Cesium.Event();
  42389. this.DrawEndEvent = new Cesium.Event();
  42390. this._param = {
  42391. id: "DrawStraightArrow",
  42392. polygonColor: "rgba(0,255,0,0.5)",
  42393. outlineColor: "rgba(255, 255, 255, 1)",
  42394. outlineWidth: 1
  42395. };
  42396. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42397. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42398. }
  42399. get polygon() {
  42400. return this._polygonLast;
  42401. }
  42402. getData() {
  42403. return this._polygonData;
  42404. }
  42405. computePosition(data) {
  42406. let $this = this;
  42407. var lnglatArr = [];
  42408. for (var i2 = 0; i2 < data.length; i2++) {
  42409. var lnglat = $this.cartesianToLatlng(data[i2]);
  42410. lnglatArr.push(lnglat);
  42411. }
  42412. $this._polygonData = lnglatArr;
  42413. return new $this.Cesium.PolygonHierarchy(data);
  42414. }
  42415. addload(data) {
  42416. var $this = this;
  42417. var lnglatArr = [];
  42418. for (var i2 = 0; i2 < data.length; i2++) {
  42419. var lnglat = $this.LatlngTocartesian(data[i2]);
  42420. lnglatArr.push(lnglat);
  42421. }
  42422. return this.viewer.entities.add({
  42423. Type: "DrawPolygon",
  42424. Position: data,
  42425. id: data.id || $this.objId,
  42426. polygon: {
  42427. hierarchy: new $this.Cesium.PolygonHierarchy(lnglatArr),
  42428. clampToGround: true,
  42429. show: true,
  42430. fill: true,
  42431. material: $this.Cesium.Color.RED.withAlpha(0.9),
  42432. width: 3,
  42433. outlineColor: $this.Cesium.Color.BLACK,
  42434. outlineWidth: 1,
  42435. outline: false
  42436. }
  42437. });
  42438. }
  42439. startCreate(drawType) {
  42440. this.drawType = drawType;
  42441. var $this = this;
  42442. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42443. this.handler.setInputAction(function(evt) {
  42444. var cartesian = $this.getCatesian3FromPX(evt.position);
  42445. if ($this._positions.length == 0) {
  42446. $this._positions.push(cartesian.clone());
  42447. }
  42448. $this.createPoint(cartesian);
  42449. $this._positions.push(cartesian);
  42450. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42451. this.handler.setInputAction(function(evt) {
  42452. if ($this._positions.length < 1)
  42453. return;
  42454. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42455. if ($this._positions.length == 3) {
  42456. if (!$this.Cesium.defined($this._polygon)) {
  42457. $this._polygon = $this.createPolygon();
  42458. }
  42459. }
  42460. $this._positions.pop();
  42461. $this._positions.push(cartesian);
  42462. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42463. this.handler.setInputAction(function(evt) {
  42464. if (!$this._polygon)
  42465. return;
  42466. var cartesian = $this.getCatesian3FromPX(evt.position);
  42467. $this._positions.pop();
  42468. $this.createPoint(cartesian);
  42469. $this._polygonData = $this._positions.concat();
  42470. $this.viewer.entities.remove($this._positions);
  42471. $this._positions = null;
  42472. $this._positions = [];
  42473. var lnglatArr = [];
  42474. for (var i2 = 0; i2 < $this._polygonData.length; i2++) {
  42475. var lnglat = $this.cartesianToLatlng($this._polygonData[i2]);
  42476. lnglatArr.push(lnglat);
  42477. }
  42478. $this._polygonData = lnglatArr;
  42479. var Polygon = $this.addload($this._polygonData);
  42480. $this._entities_polygon.push(Polygon);
  42481. $this._polygonLast = Polygon;
  42482. $this.clearPoint();
  42483. $this.destroy();
  42484. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42485. }
  42486. createPolygon() {
  42487. var $this = this;
  42488. var polygon2 = this.viewer.entities.add({
  42489. polygon: {
  42490. hierarchy: new $this.Cesium.CallbackProperty(function() {
  42491. return new $this.Cesium.PolygonHierarchy($this._positions);
  42492. }, false),
  42493. clampToGround: true,
  42494. show: true,
  42495. fill: true,
  42496. material: $this.Cesium.Color.RED.withAlpha(0.5),
  42497. width: 3,
  42498. outlineColor: $this.Cesium.Color.BLACK,
  42499. outlineWidth: 1,
  42500. outline: false
  42501. }
  42502. });
  42503. $this._entities_polygon.push(polygon2);
  42504. return polygon2;
  42505. }
  42506. cartesianToLatlng(cartesian) {
  42507. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42508. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42509. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42510. return [lng, lat];
  42511. }
  42512. LatlngTocartesian(latlng) {
  42513. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42514. return cartesian3;
  42515. }
  42516. clearPoint() {
  42517. this.DrawEndEvent.raiseEvent(this._polygonLast, this._polygonData, this.drawType);
  42518. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42519. this.viewer.entities.remove(this._entities_point[i2]);
  42520. }
  42521. this._entities_point = [];
  42522. }
  42523. createPoint(cartesian) {
  42524. var $this = this;
  42525. var point2 = this.viewer.entities.add({
  42526. position: cartesian,
  42527. point: {
  42528. pixelSize: 10,
  42529. color: $this.Cesium.Color.RED,
  42530. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42531. }
  42532. });
  42533. $this._entities_point.push(point2);
  42534. return point2;
  42535. }
  42536. destroy() {
  42537. if (this.handler) {
  42538. this.handler.destroy();
  42539. this.handler = null;
  42540. }
  42541. }
  42542. clear() {
  42543. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42544. this.viewer.entities.remove(this._entities_point[i2]);
  42545. }
  42546. for (var i2 = 0; i2 < this._entities_polygon.length; i2++) {
  42547. this.viewer.entities.remove(this._entities_polygon[i2]);
  42548. }
  42549. this._polygon = null;
  42550. this._polygonLast = null;
  42551. this._positions = [];
  42552. this._entities_point = [];
  42553. this._entities_polygon = [];
  42554. this._polygonData = null;
  42555. }
  42556. getCatesian3FromPX(px) {
  42557. var cartesian;
  42558. var ray = this.viewer.camera.getPickRay(px);
  42559. if (!ray)
  42560. return null;
  42561. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42562. return cartesian;
  42563. }
  42564. }
  42565. class DrawRectangle {
  42566. constructor(arg) {
  42567. this.viewer = arg.viewer;
  42568. this.Cesium = arg.Cesium;
  42569. this.floatingPoint = null;
  42570. this._rectangle = null;
  42571. this._rectangleLast = null;
  42572. this._positions = [];
  42573. this._entities_point = [];
  42574. this._entities_rectangle = [];
  42575. this._rectangleData = null;
  42576. this.DrawStartEvent = new Cesium.Event();
  42577. this.DrawEndEvent = new Cesium.Event();
  42578. this._param = {
  42579. id: "DrawStraightArrow",
  42580. polygonColor: "rgba(0,255,0,0.5)",
  42581. outlineColor: "rgba(255, 255, 255, 1)",
  42582. outlineWidth: 1
  42583. };
  42584. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42585. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42586. }
  42587. get line() {
  42588. return this._rectangleLast;
  42589. }
  42590. getData() {
  42591. return this._rectangleData;
  42592. }
  42593. computePosition(data) {
  42594. let $this = this;
  42595. var lnglatArr = [];
  42596. for (var i2 = 0; i2 < data.length; i2++) {
  42597. var lnglat = $this.cartesianToLatlng(data[i2]);
  42598. lnglatArr.push(lnglat);
  42599. }
  42600. $this._rectangleData = lnglatArr;
  42601. return new $this.Cesium.Rectangle.fromCartesianArray(data);
  42602. }
  42603. addload(data) {
  42604. var $this = this;
  42605. var lnglatArr = [];
  42606. for (var i2 = 0; i2 < data.length; i2++) {
  42607. var lnglat = $this.LatlngTocartesian(data[i2]);
  42608. lnglatArr.push(lnglat);
  42609. }
  42610. var shape = this.viewer.entities.add({
  42611. Type: "DrawRectangle",
  42612. Position: data,
  42613. id: data.id || $this.objId,
  42614. rectangle: {
  42615. coordinates: $this.Cesium.Rectangle.fromCartesianArray(lnglatArr),
  42616. material: $this.Cesium.Color.RED.withAlpha(0.9)
  42617. }
  42618. });
  42619. $this._entities_rectangle.push(shape);
  42620. return shape;
  42621. }
  42622. startCreate(drawType) {
  42623. this.drawType = drawType;
  42624. var $this = this;
  42625. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42626. this.handler.setInputAction(function(evt) {
  42627. var cartesian = $this.getCatesian3FromPX(evt.position);
  42628. if ($this._positions.length == 0) {
  42629. $this._positions.push(cartesian.clone());
  42630. $this.floatingPoint = $this.createPoint(cartesian);
  42631. $this.createPoint(cartesian);
  42632. $this._positions.push(cartesian);
  42633. }
  42634. if ($this._positions.length == 2) {
  42635. $this._positions.push(cartesian);
  42636. }
  42637. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42638. this.handler.setInputAction(function(evt) {
  42639. if ($this._positions.length < 3)
  42640. return;
  42641. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42642. if (!$this.Cesium.defined($this._rectangle)) {
  42643. $this._rectangle = $this.createRectangle();
  42644. }
  42645. $this.floatingPoint.position.setValue(cartesian);
  42646. if ($this._rectangle) {
  42647. $this._positions.pop();
  42648. $this._positions.push(cartesian);
  42649. }
  42650. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42651. this.handler.setInputAction(function(evt) {
  42652. if (!$this._rectangle)
  42653. return;
  42654. var cartesian = $this.getCatesian3FromPX(evt.position);
  42655. $this._positions.pop();
  42656. $this._positions.push(cartesian);
  42657. $this.createPoint(cartesian);
  42658. $this._rectangleData = $this._positions.concat();
  42659. $this.viewer.entities.remove($this._rectangle);
  42660. $this._rectangle = null;
  42661. $this._positions = [];
  42662. $this.floatingPoint.position.setValue(cartesian);
  42663. var lnglatArr = [];
  42664. for (var i2 = 0; i2 < $this._rectangleData.length; i2++) {
  42665. var lnglat = $this.cartesianToLatlng($this._rectangleData[i2]);
  42666. lnglatArr.push(lnglat);
  42667. }
  42668. $this._rectangleData = lnglatArr;
  42669. var rectangle = $this.addload([$this._rectangleData[0], $this._rectangleData[$this._rectangleData.length - 1]]);
  42670. $this._entities_rectangle.push(rectangle);
  42671. $this._rectangleLast = rectangle;
  42672. $this.clearPoint();
  42673. $this.destroy();
  42674. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42675. }
  42676. createPoint(cartesian) {
  42677. var $this = this;
  42678. var point2 = this.viewer.entities.add({
  42679. position: cartesian,
  42680. point: {
  42681. pixelSize: 10,
  42682. color: $this.Cesium.Color.RED,
  42683. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42684. }
  42685. });
  42686. $this._entities_point.push(point2);
  42687. return point2;
  42688. }
  42689. createRectangle() {
  42690. var $this = this;
  42691. var shape = this.viewer.entities.add({
  42692. name: "rectangle",
  42693. rectangle: {
  42694. coordinates: new $this.Cesium.CallbackProperty(function() {
  42695. var obj = $this.Cesium.Rectangle.fromCartesianArray($this._positions);
  42696. return obj;
  42697. }, false),
  42698. material: $this.Cesium.Color.RED.withAlpha(0.5)
  42699. }
  42700. });
  42701. $this._entities_rectangle.push(shape);
  42702. return shape;
  42703. }
  42704. cartesianToLatlng(cartesian) {
  42705. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42706. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42707. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42708. return [lng, lat];
  42709. }
  42710. LatlngTocartesian(latlng) {
  42711. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42712. return cartesian3;
  42713. }
  42714. clearPoint() {
  42715. this.DrawEndEvent.raiseEvent(this._rectangleLast, [this._rectangleData[0], this._rectangleData[this._rectangleData.length - 1]], this.drawType);
  42716. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42717. this.viewer.entities.remove(this._entities_point[i2]);
  42718. }
  42719. this._entities_point = [];
  42720. }
  42721. destroy() {
  42722. if (this.handler) {
  42723. this.handler.destroy();
  42724. this.handler = null;
  42725. }
  42726. }
  42727. clear() {
  42728. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42729. this.viewer.entities.remove(this._entities_point[i2]);
  42730. }
  42731. for (var i2 = 0; i2 < this._entities_rectangle.length; i2++) {
  42732. this.viewer.entities.remove(this._entities_rectangle[i2]);
  42733. }
  42734. this.floatingPoint = null;
  42735. this._rectangle = null;
  42736. this._rectangleLast = null;
  42737. this._positions = [];
  42738. this._entities_point = [];
  42739. this._entities_rectangle = [];
  42740. this._rectangleData = null;
  42741. }
  42742. getCatesian3FromPX(px) {
  42743. var cartesian;
  42744. var ray = this.viewer.camera.getPickRay(px);
  42745. if (!ray)
  42746. return null;
  42747. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42748. return cartesian;
  42749. }
  42750. }
  42751. class DrawCircle {
  42752. constructor(arg) {
  42753. this.viewer = arg.viewer;
  42754. this.Cesium = arg.Cesium;
  42755. this._cicle = null;
  42756. this.floatingPoint = null;
  42757. this._cicleLast = null;
  42758. this._positions = [];
  42759. this._entities_point = [];
  42760. this._entities_cicle = [];
  42761. this._cicleData = null;
  42762. this.DrawStartEvent = new Cesium.Event();
  42763. this.DrawEndEvent = new Cesium.Event();
  42764. this._param = {
  42765. id: "DrawStraightArrow",
  42766. polygonColor: "rgba(0,255,0,0.5)",
  42767. outlineColor: "rgba(255, 255, 255, 1)",
  42768. outlineWidth: 1
  42769. };
  42770. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42771. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42772. }
  42773. get cicle() {
  42774. return this._cicleLast;
  42775. }
  42776. addload(data) {
  42777. var that = this;
  42778. let lnglatArr = [];
  42779. for (var i2 = 0; i2 < data.length; i2++) {
  42780. var lnglat = that.LatlngTocartesian(data[i2]);
  42781. lnglatArr.push(lnglat);
  42782. }
  42783. var value = lnglatArr;
  42784. var r2 = Math.sqrt(
  42785. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42786. );
  42787. var position2 = value[0];
  42788. var shape = that.viewer.entities.add({
  42789. Type: "DrawCircle",
  42790. Position: [data[0], data[data.length - 1]],
  42791. position: position2,
  42792. id: data.id || that.objId,
  42793. ellipse: {
  42794. semiMinorAxis: r2,
  42795. semiMajorAxis: r2,
  42796. material: that.Cesium.Color.RED.withAlpha(0.9),
  42797. show: true,
  42798. clampToGround: true
  42799. }
  42800. });
  42801. return shape;
  42802. }
  42803. getData() {
  42804. return this._cicleData;
  42805. }
  42806. computePosition(data) {
  42807. var that = this;
  42808. let lnglatArr = [];
  42809. for (var i2 = 0; i2 < data.length; i2++) {
  42810. var lnglat = that.cartesianToLatlng(data[i2]);
  42811. lnglatArr.push(lnglat);
  42812. }
  42813. that._cicleData = lnglatArr;
  42814. var value = data;
  42815. var r2 = Math.sqrt(
  42816. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42817. );
  42818. var position2 = value[0];
  42819. return { position: position2, r: r2 };
  42820. }
  42821. startCreate(drawType) {
  42822. this.drawType = drawType;
  42823. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42824. this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42825. var $this = this;
  42826. this.handler.setInputAction(function(evt) {
  42827. $this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42828. var cartesian = $this.getCatesian3FromPX(evt.position);
  42829. if ($this._positions.length == 0) {
  42830. $this._positions.push(cartesian.clone());
  42831. $this.floatingPoint = $this.createPoint(cartesian);
  42832. $this._positions.push(cartesian);
  42833. }
  42834. if (!$this._cicle) {
  42835. $this.createPoint(cartesian);
  42836. }
  42837. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42838. this.handler.setInputAction(function(evt) {
  42839. if ($this._positions.length < 1)
  42840. return;
  42841. var cartesian = $this.viewer.scene.pickPosition(evt.endPosition);
  42842. if (!$this.Cesium.defined($this._cicle)) {
  42843. $this._cicle = $this.createCicle();
  42844. }
  42845. $this.floatingPoint.position.setValue(cartesian);
  42846. if ($this._cicle) {
  42847. $this._positions.pop();
  42848. $this._positions.push(cartesian);
  42849. }
  42850. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42851. this.handler.setInputAction(function(evt) {
  42852. if (!$this._cicle)
  42853. return;
  42854. $this.viewer.scene.globe.depthTestAgainstTerrain = false;
  42855. var cartesian = $this.viewer.scene.pickPosition(evt.position);
  42856. $this._positions.pop();
  42857. $this._positions.push(cartesian);
  42858. $this._cicleData = $this._positions.concat();
  42859. $this.viewer.entities.remove($this._cicle);
  42860. $this._cicle = null;
  42861. $this._positions = [];
  42862. $this.floatingPoint.position.setValue(cartesian);
  42863. let lnglatArr = [];
  42864. for (var i2 = 0; i2 < $this._cicleData.length; i2++) {
  42865. var lnglat = $this.cartesianToLatlng($this._cicleData[i2]);
  42866. lnglatArr.push(lnglat);
  42867. }
  42868. $this._cicleData = lnglatArr;
  42869. var cicle = $this.addload($this._cicleData);
  42870. $this._entities_cicle.push(cicle);
  42871. $this._cicleLast = cicle;
  42872. $this.clearPoint();
  42873. $this.destroy();
  42874. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42875. }
  42876. createCicle() {
  42877. var that = this;
  42878. var shape = this.viewer.entities.add({
  42879. position: that._positions[0],
  42880. ellipse: {
  42881. semiMinorAxis: new that.Cesium.CallbackProperty(function() {
  42882. var r2 = Math.sqrt(
  42883. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42884. );
  42885. return r2 ? r2 : r2 + 1;
  42886. }, false),
  42887. semiMajorAxis: new that.Cesium.CallbackProperty(function() {
  42888. var r2 = Math.sqrt(
  42889. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42890. );
  42891. return r2 ? r2 : r2 + 1;
  42892. }, false),
  42893. material: that.Cesium.Color.RED.withAlpha(0.5),
  42894. outline: true
  42895. }
  42896. });
  42897. that._entities_cicle.push(shape);
  42898. return shape;
  42899. }
  42900. createPoint(cartesian) {
  42901. var $this = this;
  42902. var point2 = this.viewer.entities.add({
  42903. position: cartesian,
  42904. point: {
  42905. pixelSize: 10,
  42906. color: $this.Cesium.Color.RED,
  42907. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42908. }
  42909. });
  42910. $this._entities_point.push(point2);
  42911. return point2;
  42912. }
  42913. getCatesian3FromPX(px) {
  42914. var cartesian;
  42915. var ray = this.viewer.camera.getPickRay(px);
  42916. if (!ray)
  42917. return null;
  42918. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42919. return cartesian;
  42920. }
  42921. cartesianToLatlng(cartesian) {
  42922. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42923. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  42924. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  42925. cartographic.height;
  42926. return [lng, lat];
  42927. }
  42928. LatlngTocartesian(latlng) {
  42929. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1], 0);
  42930. return cartesian3;
  42931. }
  42932. destroy() {
  42933. if (this.handler) {
  42934. this.handler.destroy();
  42935. this.handler = null;
  42936. }
  42937. }
  42938. clearPoint() {
  42939. this.DrawEndEvent.raiseEvent(this._cicleLast, this._cicleData, this.drawType);
  42940. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42941. this.viewer.entities.remove(this._entities_point[i2]);
  42942. }
  42943. this._entities_point = [];
  42944. }
  42945. clear() {
  42946. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42947. this.viewer.entities.remove(this._entities_point[i2]);
  42948. }
  42949. for (var i2 = 0; i2 < this._entities_cicle.length; i2++) {
  42950. this.viewer.entities.remove(this._entities_cicle[i2]);
  42951. }
  42952. this._cicle = null;
  42953. this.floatingPoint = null;
  42954. this._cicleLast = null;
  42955. this._positions = [];
  42956. this._entities_point = [];
  42957. this._entities_cicle = [];
  42958. this._cicleData = null;
  42959. }
  42960. }
  42961. let MilitaryPlot = {
  42962. DrawStraightArrow,
  42963. DrawAttackArrow,
  42964. DrawPincerArrow,
  42965. DrawGatheringPlace,
  42966. DrawClosedCurve,
  42967. DrawSector,
  42968. DrawBowLine,
  42969. DrawBowPlane,
  42970. DrawCurve,
  42971. DrawCurveFlag,
  42972. DrawRectFlag,
  42973. DrawTriangleFlag,
  42974. DrawPoint: DrawPoint$1,
  42975. DrawPolyline,
  42976. DrawPolygon,
  42977. DrawRectangle,
  42978. DrawCircle
  42979. };
  42980. class EntityEdit {
  42981. constructor(viewer2) {
  42982. this.viewer = viewer2;
  42983. this.DrawExample = "";
  42984. this.midVertexEntities = [];
  42985. this.initEventHandler();
  42986. }
  42987. initEventHandler() {
  42988. this.eventHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42989. this.EditEndEvent = new Cesium.Event();
  42990. this.EditEndEntity = new Cesium.Event();
  42991. }
  42992. activate() {
  42993. this.deactivate();
  42994. this.initLeftClickEventHandler();
  42995. }
  42996. deactivate() {
  42997. this.DrawExample = "";
  42998. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42999. this.unRegisterEvents();
  43000. this.clearAllEditVertex();
  43001. }
  43002. clearAllEditVertex() {
  43003. this.clearEditVertex();
  43004. this.clearMidVertex();
  43005. }
  43006. initLeftClickEventHandler() {
  43007. this.eventHandler.setInputAction((e) => {
  43008. let id = this.viewer.scene.pick(e.position);
  43009. if (!id || !id.id) {
  43010. this.handleEditEntity();
  43011. return;
  43012. }
  43013. if (!id.id || !id.id.Type)
  43014. return;
  43015. if (this.editEntity && this.editEntity.id == id.id.id)
  43016. return;
  43017. this.handleEditEntity();
  43018. this.handlePickEditEntity(id.id);
  43019. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  43020. }
  43021. handleEditEntity() {
  43022. this.unRegisterEvents();
  43023. this.clearAllEditVertex();
  43024. let editEntity = this.editEntity;
  43025. if (!editEntity)
  43026. return;
  43027. this.closeEntityEditMode();
  43028. this.editEntity = void 0;
  43029. if (!this.isEdited)
  43030. return;
  43031. this.EditEndEvent.raiseEvent(editEntity);
  43032. this.isEdited = false;
  43033. this.isEditing = false;
  43034. }
  43035. handlePickEditEntity(pickId) {
  43036. const EditableTypes = ["DrawAttackArrow", "DrawCircle", "DrawCurve", "DrawPincerArrow", "DrawPoint", "DrawPolygon", "DrawPolyline", "DrawRectangle", "DrawStraightArrow", "DrawGatheringPlace", "DrawSector", "DrawClosedCurve", "DrawBowLine", "DrawBowPlane", "DrawRectFlag", "DrawTriangleFlag", "DrawCurveFlag"];
  43037. if (EditableTypes.indexOf(pickId.Type) == -1)
  43038. return;
  43039. this.editEntity = pickId;
  43040. this.EditEndEntity.raiseEvent(this.editEntity);
  43041. this.isEditing = false;
  43042. this.isEdited = false;
  43043. this.editPositions = this.getEditEntityPositions();
  43044. this.EditMoveCenterPositoin = this.getCenterPosition();
  43045. this.openEntityEditModel();
  43046. this.clearAllEditVertex();
  43047. this.unRegisterEvents();
  43048. this.createEditVertex();
  43049. this.createMidVertex();
  43050. this.registerEvents();
  43051. }
  43052. openEntityEditModel() {
  43053. if (this.DrawExample == "")
  43054. return;
  43055. switch (this.editEntity.Type) {
  43056. case "DrawStraightArrow":
  43057. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43058. return this.DrawExample.computePosition(this.editPositions);
  43059. }, false);
  43060. break;
  43061. case "DrawAttackArrow":
  43062. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43063. return this.DrawExample.computePosition(this.editPositions);
  43064. }, false);
  43065. break;
  43066. case "DrawPincerArrow":
  43067. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43068. return this.DrawExample.computePosition(this.editPositions);
  43069. }, false);
  43070. break;
  43071. case "DrawGatheringPlace":
  43072. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43073. return this.DrawExample.computePosition(this.editPositions);
  43074. }, false);
  43075. break;
  43076. case "DrawClosedCurve":
  43077. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43078. return this.DrawExample.computePosition(this.editPositions).PolygonHierarchy;
  43079. }, false);
  43080. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43081. return this.DrawExample.computePosition(this.editPositions).pList;
  43082. }, false);
  43083. break;
  43084. case "DrawCircle":
  43085. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43086. return this.DrawExample.computePosition(this.editPositions).position;
  43087. }, false);
  43088. this.editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty((e) => {
  43089. return this.DrawExample.computePosition(this.editPositions).r;
  43090. }, false);
  43091. this.editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty((e) => {
  43092. return this.DrawExample.computePosition(this.editPositions).r;
  43093. }, false);
  43094. break;
  43095. case "DrawCurve":
  43096. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43097. return this.DrawExample.computePosition(this.editPositions);
  43098. }, false);
  43099. break;
  43100. case "DrawPoint":
  43101. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43102. return this.editPositions[0];
  43103. }, false);
  43104. break;
  43105. case "DrawPolygon":
  43106. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43107. return this.DrawExample.computePosition(this.editPositions);
  43108. }, false);
  43109. break;
  43110. case "DrawPolyline":
  43111. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43112. return this.DrawExample.computePosition(this.editPositions);
  43113. }, false);
  43114. break;
  43115. case "DrawRectangle":
  43116. this.editEntity.rectangle.coordinates = new Cesium.CallbackProperty((e) => {
  43117. return this.DrawExample.computePosition(this.editPositions);
  43118. }, false);
  43119. break;
  43120. case "DrawSector":
  43121. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43122. return this.DrawExample.computePosition(this.editPositions);
  43123. }, false);
  43124. break;
  43125. case "DrawBowLine":
  43126. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43127. return this.DrawExample.computePosition(this.editPositions);
  43128. }, false);
  43129. break;
  43130. case "DrawBowPlane":
  43131. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43132. return this.DrawExample.computePosition(this.editPositions);
  43133. }, false);
  43134. break;
  43135. case "DrawRectFlag":
  43136. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43137. return this.DrawExample.computePosition(this.editPositions)[0];
  43138. }, false);
  43139. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43140. return this.DrawExample.computePosition(this.editPositions)[1];
  43141. }, false);
  43142. break;
  43143. case "DrawTriangleFlag":
  43144. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43145. return this.DrawExample.computePosition(this.editPositions)[0];
  43146. }, false);
  43147. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43148. return this.DrawExample.computePosition(this.editPositions)[1];
  43149. }, false);
  43150. break;
  43151. case "DrawCurveFlag":
  43152. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43153. return this.DrawExample.computePosition(this.editPositions)[0];
  43154. }, false);
  43155. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43156. return this.DrawExample.computePosition(this.editPositions)[1];
  43157. }, false);
  43158. break;
  43159. }
  43160. }
  43161. closeEntityEditMode() {
  43162. if (this.DrawExample == "")
  43163. return;
  43164. let position2 = "";
  43165. switch (this.editEntity.Type) {
  43166. case "DrawStraightArrow":
  43167. position2 = this.DrawExample.computePosition(this.editPositions);
  43168. this.editEntity.polygon.hierarchy = position2;
  43169. this.editEntity.Position = this.DrawExample.getData();
  43170. break;
  43171. case "DrawAttackArrow":
  43172. position2 = this.DrawExample.computePosition(this.editPositions);
  43173. this.editEntity.polygon.hierarchy = position2;
  43174. this.editEntity.Position = this.DrawExample.getData();
  43175. break;
  43176. case "DrawPincerArrow":
  43177. position2 = this.DrawExample.computePosition(this.editPositions);
  43178. this.editEntity.polygon.hierarchy = position2;
  43179. this.editEntity.Position = this.DrawExample.getData();
  43180. break;
  43181. case "DrawGatheringPlace":
  43182. position2 = this.DrawExample.computePosition(this.editPositions);
  43183. this.editEntity.polygon.hierarchy = position2;
  43184. this.editEntity.Position = this.DrawExample.getData();
  43185. break;
  43186. case "DrawClosedCurve":
  43187. position2 = this.DrawExample.computePosition(this.editPositions);
  43188. this.editEntity.polygon.hierarchy = position2.PolygonHierarchy;
  43189. this.editEntity.polyline.positions = position2.pList;
  43190. this.editEntity.Position = this.DrawExample.getData();
  43191. break;
  43192. case "DrawCircle":
  43193. position2 = this.DrawExample.computePosition(this.editPositions);
  43194. this.editEntity.position = position2.position;
  43195. this.editEntity.ellipse.semiMinorAxis = position2.r;
  43196. this.editEntity.ellipse.semiMajorAxis = position2.r;
  43197. this.editEntity.Position = this.DrawExample.getData();
  43198. break;
  43199. case "DrawCurve":
  43200. position2 = this.DrawExample.computePosition(this.editPositions);
  43201. this.editEntity.polyline.positions = position2;
  43202. this.editEntity.Position = this.DrawExample.getData();
  43203. break;
  43204. case "DrawPoint":
  43205. position2 = this.DrawExample.computePosition(this.editPositions);
  43206. this.editEntity.position = position2;
  43207. this.editEntity.Position = this.DrawExample.getData();
  43208. break;
  43209. case "DrawPolygon":
  43210. position2 = this.DrawExample.computePosition(this.editPositions);
  43211. this.editEntity.polygon.hierarchy = position2;
  43212. this.editEntity.Position = this.DrawExample.getData();
  43213. break;
  43214. case "DrawPolyline":
  43215. position2 = this.DrawExample.computePosition(this.editPositions);
  43216. this.editEntity.polyline.positions = position2;
  43217. this.editEntity.Position = this.DrawExample.getData();
  43218. break;
  43219. case "DrawRectangle":
  43220. position2 = this.DrawExample.computePosition(this.editPositions);
  43221. this.editEntity.rectangle.coordinates = position2;
  43222. this.editEntity.Position = this.DrawExample.getData();
  43223. break;
  43224. case "DrawSector":
  43225. position2 = this.DrawExample.computePosition(this.editPositions);
  43226. this.editEntity.polygon.hierarchy = position2;
  43227. this.editEntity.Position = this.DrawExample.getData();
  43228. break;
  43229. case "DrawBowLine":
  43230. position2 = this.DrawExample.computePosition(this.editPositions);
  43231. this.editEntity.polyline.positions = position2;
  43232. this.editEntity.Position = this.DrawExample.getData();
  43233. break;
  43234. case "DrawBowPlane":
  43235. position2 = this.DrawExample.computePosition(this.editPositions);
  43236. this.editEntity.polygon.hierarchy = position2;
  43237. this.editEntity.Position = this.DrawExample.getData();
  43238. break;
  43239. case "DrawRectFlag":
  43240. position2 = this.DrawExample.computePosition(this.editPositions);
  43241. this.editEntity.polygon.hierarchy = position2[0];
  43242. this.editEntity.polyline.positions = position2[1];
  43243. this.editEntity.Position = this.DrawExample.getData();
  43244. break;
  43245. case "DrawTriangleFlag":
  43246. position2 = this.DrawExample.computePosition(this.editPositions);
  43247. this.editEntity.polygon.hierarchy = position2[0];
  43248. this.editEntity.polyline.positions = position2[1];
  43249. this.editEntity.Position = this.DrawExample.getData();
  43250. break;
  43251. case "DrawCurveFlag":
  43252. position2 = this.DrawExample.computePosition(this.editPositions);
  43253. this.editEntity.polygon.hierarchy = position2[0];
  43254. this.editEntity.polyline.positions = position2[1];
  43255. this.editEntity.Position = this.DrawExample.getData();
  43256. break;
  43257. }
  43258. }
  43259. getEditEntityPositions() {
  43260. let position2 = this.editEntity.Position;
  43261. let positionArr = [];
  43262. switch (this.editEntity.Type) {
  43263. case "DrawAttackArrow":
  43264. for (let i2 = 0; i2 < position2.length; i2++) {
  43265. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43266. }
  43267. return positionArr;
  43268. case "DrawCircle":
  43269. for (let i2 = 0; i2 < position2.length; i2++) {
  43270. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43271. }
  43272. return positionArr;
  43273. case "DrawCurve":
  43274. for (let i2 = 0; i2 < position2.length; i2++) {
  43275. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43276. }
  43277. return positionArr;
  43278. case "DrawPincerArrow":
  43279. for (let i2 = 0; i2 < position2.length; i2++) {
  43280. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43281. }
  43282. return positionArr;
  43283. case "DrawPoint":
  43284. for (let i2 = 0; i2 < position2.length; i2++) {
  43285. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43286. }
  43287. return positionArr;
  43288. case "DrawPolygon":
  43289. for (let i2 = 0; i2 < position2.length; i2++) {
  43290. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43291. }
  43292. return positionArr;
  43293. case "DrawPolyline":
  43294. for (let i2 = 0; i2 < position2.length; i2++) {
  43295. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43296. }
  43297. return positionArr;
  43298. case "DrawRectangle":
  43299. for (let i2 = 0; i2 < position2.length; i2++) {
  43300. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43301. }
  43302. return positionArr;
  43303. case "DrawStraightArrow":
  43304. for (let i2 = 0; i2 < position2.length; i2++) {
  43305. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43306. }
  43307. return positionArr;
  43308. case "DrawGatheringPlace":
  43309. for (let i2 = 0; i2 < position2.length; i2++) {
  43310. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43311. }
  43312. return positionArr;
  43313. case "DrawSector":
  43314. for (let i2 = 0; i2 < position2.length; i2++) {
  43315. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43316. }
  43317. return positionArr;
  43318. case "DrawClosedCurve":
  43319. for (let i2 = 0; i2 < position2.length; i2++) {
  43320. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43321. }
  43322. return positionArr;
  43323. case "DrawBowLine":
  43324. for (let i2 = 0; i2 < position2.length; i2++) {
  43325. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43326. }
  43327. return positionArr;
  43328. case "DrawBowPlane":
  43329. for (let i2 = 0; i2 < position2.length; i2++) {
  43330. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43331. }
  43332. return positionArr;
  43333. case "DrawRectFlag":
  43334. for (let i2 = 0; i2 < position2.length; i2++) {
  43335. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43336. }
  43337. return positionArr;
  43338. case "DrawTriangleFlag":
  43339. for (let i2 = 0; i2 < position2.length; i2++) {
  43340. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43341. }
  43342. return positionArr;
  43343. case "DrawCurveFlag":
  43344. for (let i2 = 0; i2 < position2.length; i2++) {
  43345. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43346. }
  43347. return positionArr;
  43348. }
  43349. }
  43350. registerEvents() {
  43351. this.initLeftDownEventHandler();
  43352. this.initMouseMoveEventHandler();
  43353. this.initLeftUpEventHandler();
  43354. }
  43355. unRegisterEvents() {
  43356. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43357. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  43358. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43359. }
  43360. initLeftDownEventHandler() {
  43361. this.eventHandler.setInputAction((e) => {
  43362. let id = this.viewer.scene.pick(e.position);
  43363. if (!id || !id.id || !id.id.type)
  43364. return;
  43365. if (id.id.type == "EditVertex" || id.id.type == "EditMove") {
  43366. this.isEditing = true;
  43367. this.viewer.scene.screenSpaceCameraController.enableRotate = false;
  43368. this.viewer.enableCursorStyle = false;
  43369. this.viewer._element.style.cursor = "";
  43370. document.body.style.cursor = "move";
  43371. this.editVertext = id.id;
  43372. this.editVertext.show = false;
  43373. this.clearMidVertex();
  43374. } else if (id.id.type == "EditMidVertex") {
  43375. this.editPositions.splice(id.id.vertexIndex, 0, id.id.position._value);
  43376. this.clearAllEditVertex();
  43377. this.createEditVertex();
  43378. this.createMidVertex();
  43379. this.isEdited = true;
  43380. } else {
  43381. return;
  43382. }
  43383. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43384. }
  43385. initLeftUpEventHandler() {
  43386. this.eventHandler.setInputAction((e) => {
  43387. if (!this.isEditing)
  43388. return;
  43389. this.viewer.enableCursorStyle = true;
  43390. document.body.style.cursor = "default";
  43391. this.viewer.scene.screenSpaceCameraController.enableRotate = true;
  43392. this.editVertext.show = true;
  43393. this.isEditing = false;
  43394. this.clearMidVertex();
  43395. this.createMidVertex();
  43396. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  43397. }
  43398. initMouseMoveEventHandler() {
  43399. this.eventHandler.setInputAction((e) => {
  43400. var position2 = e.endPosition;
  43401. var ray = this.viewer.scene.camera.getPickRay(position2);
  43402. var cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  43403. if (!cartesian)
  43404. return;
  43405. if (!this.isEditing)
  43406. return;
  43407. if (this.editVertext.type == "EditMove") {
  43408. let startPosition = this.EditMoveCenterPositoin;
  43409. if (!startPosition)
  43410. return;
  43411. this.moveEntityByOffset(startPosition, cartesian);
  43412. } else if (this.editVertext.type == "EditVertex" || this.editVertext.type == "EditMidVertex") {
  43413. this.editPositions[this.editVertext.vertexIndex] = cartesian;
  43414. }
  43415. this.isEdited = true;
  43416. this.EditMoveCenterPositoin = this.getCenterPosition();
  43417. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43418. }
  43419. getCenterPosition() {
  43420. let points2 = [];
  43421. let maxHeight = 0;
  43422. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPoint" || this.editEntity.Type == "DrawSector") {
  43423. return this.editPositions[0];
  43424. }
  43425. this.editPositions.forEach((position2) => {
  43426. const point3d = this.cartesian3ToPoint3D(position2);
  43427. points2.push([point3d.x, point3d.y]);
  43428. if (maxHeight < point3d.z)
  43429. maxHeight = point3d.z;
  43430. });
  43431. let geo = lineString(points2);
  43432. let bbox2 = bbox$1(geo);
  43433. let bboxPolygon$1 = bboxPolygon(bbox2);
  43434. let pointOnFeature = center(bboxPolygon$1);
  43435. let lonLat = pointOnFeature.geometry.coordinates;
  43436. return Cesium.Cartesian3.fromDegrees(lonLat[0], lonLat[1], maxHeight);
  43437. }
  43438. moveEntityByOffset(startPosition, endPosition) {
  43439. let startPoint3d = this.cartesian3ToPoint3D(startPosition);
  43440. let endPoint3d = this.cartesian3ToPoint3D(endPosition);
  43441. let offsetX = endPoint3d.x - startPoint3d.x;
  43442. let offsetY = endPoint3d.y - startPoint3d.y;
  43443. let element;
  43444. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43445. element = this.cartesian3ToPoint3D(this.editPositions[i2]);
  43446. element.x += offsetX;
  43447. element.y += offsetY;
  43448. this.editPositions[i2] = Cesium.Cartesian3.fromDegrees(element.x, element.y, element.z);
  43449. }
  43450. }
  43451. createEditVertex() {
  43452. this.vertexEntities = [];
  43453. this.editPositions.forEach((p, index2) => {
  43454. const entity = this.viewer.entities.add({
  43455. position: new Cesium.CallbackProperty((e) => {
  43456. return this.editPositions[index2];
  43457. }, false),
  43458. type: "EditVertex",
  43459. vertexIndex: index2,
  43460. point: {
  43461. show: true,
  43462. pixelSize: 10,
  43463. color: new Cesium.Color(0, 0, 1, 1),
  43464. outlineWidth: 1,
  43465. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43466. disableDepthTestDistance: 15e11,
  43467. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43468. }
  43469. });
  43470. this.vertexEntities.push(entity);
  43471. });
  43472. if (this.editEntity.Type == "DrawCircle") {
  43473. this.vertexEntities[0].show = false;
  43474. }
  43475. if (this.editPositions.length == 1) {
  43476. return;
  43477. }
  43478. this.createEditMoveCenterEntity();
  43479. }
  43480. createEditMoveCenterEntity() {
  43481. this.EditMoveCenterEntity = this.viewer.entities.add({
  43482. position: new Cesium.CallbackProperty((e) => {
  43483. return this.EditMoveCenterPositoin;
  43484. }, false),
  43485. type: "EditMove",
  43486. point: {
  43487. show: true,
  43488. pixelSize: 12,
  43489. color: new Cesium.Color(0, 1, 0, 0.1),
  43490. outlineWidth: 2,
  43491. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43492. disableDepthTestDistance: 15e11,
  43493. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43494. }
  43495. });
  43496. }
  43497. clearEditVertex() {
  43498. if (this.vertexEntities) {
  43499. this.vertexEntities.forEach((item) => {
  43500. this.viewer.entities.remove(item);
  43501. });
  43502. }
  43503. this.vertexEntities = [];
  43504. this.viewer.entities.remove(this.EditMoveCenterEntity);
  43505. }
  43506. createMidVertex() {
  43507. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPincerArrow" || this.editEntity.Type == "DrawRectangle" || this.editEntity.Type == "DrawStraightArrow" || this.editEntity.Type == "DrawGatheringPlace" || this.editEntity.Type == "DrawSector" || this.editEntity.Type == "DrawBowLine" || this.editEntity.Type == "DrawBowPlane" || this.editEntity.Type == "DrawRectFlag" || this.editEntity.Type == "DrawTriangleFlag" || this.editEntity.Type == "DrawCurveFlag") {
  43508. return;
  43509. }
  43510. this.midVertexEntities = [];
  43511. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43512. const p1 = this.editPositions[i2];
  43513. const p2 = this.editPositions[i2 + 1];
  43514. let mideP = this.midPosition(p1, p2);
  43515. const entity = this.viewer.entities.add({
  43516. position: mideP,
  43517. type: "EditMidVertex",
  43518. vertexIndex: i2 + 1,
  43519. point: {
  43520. show: true,
  43521. pixelSize: 10,
  43522. color: new Cesium.Color(0, 1, 0, 1),
  43523. outlineWidth: 1,
  43524. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43525. disableDepthTestDistance: 15e11,
  43526. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43527. }
  43528. });
  43529. this.midVertexEntities.push(entity);
  43530. }
  43531. }
  43532. clearMidVertex() {
  43533. if (this.midVertexEntities) {
  43534. this.midVertexEntities.forEach((item) => {
  43535. this.viewer.entities.remove(item);
  43536. });
  43537. }
  43538. this.midVertexEntities = [];
  43539. }
  43540. cartesian3ToPoint3D(position2) {
  43541. const cartographic = Cesium.Cartographic.fromCartesian(position2);
  43542. const lon = Cesium.Math.toDegrees(cartographic.longitude);
  43543. const lat = Cesium.Math.toDegrees(cartographic.latitude);
  43544. return {
  43545. x: lon,
  43546. y: lat,
  43547. z: cartographic.height
  43548. };
  43549. }
  43550. midPosition(first, second) {
  43551. if (!first || !second)
  43552. return null;
  43553. let point3d1 = this.cartesian3ToPoint3D(first);
  43554. let point3d2 = this.cartesian3ToPoint3D(second);
  43555. let midLonLat = {
  43556. x: (point3d1.x + point3d2.x) / 2,
  43557. y: (point3d1.y + point3d2.y) / 2,
  43558. z: (point3d1.z + point3d2.z) / 2
  43559. };
  43560. return Cesium.Cartesian3.fromDegrees(midLonLat.x, midLonLat.y, midLonLat.z);
  43561. }
  43562. cartesianToLatlng(cartesian) {
  43563. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  43564. let lat = new Cesium.Math.toDegrees(cartographic.latitude);
  43565. let lng = new Cesium.Math.toDegrees(cartographic.longitude);
  43566. cartographic.height;
  43567. return [lng, lat];
  43568. }
  43569. LatlngTocartesian(latlng) {
  43570. let cartesian3 = new Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  43571. return cartesian3;
  43572. }
  43573. }
  43574. var _style_0$1 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  43575. `;
  43576. const _hoisted_1$1 = { class: "jt-drawing-dialog" };
  43577. const _hoisted_2$1 = {
  43578. slot: "title",
  43579. class: "header-title"
  43580. };
  43581. const _hoisted_3$1 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  43582. const _hoisted_4$1 = { class: "odin-dialog__content" };
  43583. const _hoisted_5$1 = { class: "jt-drawing-row" };
  43584. const _hoisted_6$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  43585. const _hoisted_7$1 = { class: "col-main" };
  43586. const _hoisted_8$1 = { class: "el-body-foot" };
  43587. const _sfc_main$1 = {
  43588. __name: "CrEditProperty_MilitaryPlot.ce",
  43589. props: {
  43590. params: {
  43591. id: {
  43592. type: String,
  43593. default: () => void 0
  43594. },
  43595. color: {
  43596. type: String,
  43597. default: () => "255,255,0,0.9"
  43598. },
  43599. outlineWidth: {
  43600. type: Number,
  43601. default: () => 0
  43602. },
  43603. outlineColor: {
  43604. type: String,
  43605. default: () => "255,255,0,0.9"
  43606. }
  43607. },
  43608. showDialog: {
  43609. type: Boolean,
  43610. default: () => false
  43611. }
  43612. },
  43613. emits: ["submit", "update:showDialog", "update:params", "remove"],
  43614. setup(__props, { expose: __expose, emit }) {
  43615. const props = __props;
  43616. const language = ref("zh-cn");
  43617. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  43618. const {
  43619. proxy
  43620. } = getCurrentInstance();
  43621. const predefineColors = ref([
  43622. "#ff4500",
  43623. "#ff8c00",
  43624. "#ffd700",
  43625. "#90ee90",
  43626. "#00ced1",
  43627. "#1e90ff",
  43628. "#c71585",
  43629. "rgba(255, 69, 0, 0.68)",
  43630. "rgb(255, 120, 0)",
  43631. "hsv(51, 100, 98)",
  43632. "hsva(120, 40, 94, 0.5)",
  43633. "hsl(181, 100%, 37%)",
  43634. "hsla(209, 100%, 56%, 0.73)",
  43635. "#c7158577"
  43636. ]);
  43637. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  43638. const dialogVisible = ref(props.showDialog);
  43639. ref(false);
  43640. const color2 = ref(props.params.color);
  43641. const outlineWidth = ref(0);
  43642. const outlineColor = ref(props.params.outlineColor);
  43643. updateParams(props.params);
  43644. function updateParams(params) {
  43645. proxy._params = params;
  43646. switch (params.id) {
  43647. case "DrawStraightArrow":
  43648. title.value = "\u7ED8\u5236\u76F4\u7EBF\u7BAD\u5934";
  43649. break;
  43650. case "DrawAttackArrow":
  43651. title.value = "\u7ED8\u5236\u653B\u51FB\u7BAD\u5934";
  43652. break;
  43653. case "DrawPincerArrow":
  43654. title.value = "\u7ED8\u5236\u94B3\u51FB\u7BAD\u5934";
  43655. break;
  43656. case "DrawGatheringPlace":
  43657. title.value = "\u7ED8\u5236\u96C6\u7ED3\u5730";
  43658. break;
  43659. case "DrawClosedCurve":
  43660. title.value = "\u7ED8\u5236\u95ED\u5408\u66F2\u9762";
  43661. break;
  43662. case "DrawSector":
  43663. title.value = "\u7ED8\u5236\u6247\u5F62";
  43664. break;
  43665. case "DrawBowLine":
  43666. title.value = "\u7ED8\u5236\u5F13\u5F62\u7EBF";
  43667. break;
  43668. case "DrawLune":
  43669. title.value = "\u7ED8\u5236\u5F13\u5F62\u9762";
  43670. break;
  43671. case "DrawCurve":
  43672. title.value = "\u7ED8\u5236\u66F2\u7EBF";
  43673. break;
  43674. case "DrawCurveFlag":
  43675. title.value = "\u7ED8\u5236\u66F2\u7EBF\u65D7\u5E1C";
  43676. break;
  43677. case "DrawRectFlag":
  43678. title.value = "\u7ED8\u5236\u77E9\u5F62\u76F4\u89D2\u65D7\u5E1C";
  43679. break;
  43680. case "DrawTriangleFlag":
  43681. title.value = "\u7ED8\u5236\u4E09\u89D2\u65D7\u5E1C";
  43682. break;
  43683. }
  43684. color2.value = params.color;
  43685. outlineColor.value = params.outlineColor;
  43686. outlineWidth.value = params.outlineWidth;
  43687. }
  43688. __expose({});
  43689. function submit() {
  43690. let outParam = proxy._params;
  43691. outParam.color = color2.value;
  43692. outParam.outlineColor = outlineColor.value;
  43693. outParam.outlineWidth = outlineWidth.value;
  43694. emit("submit", outParam);
  43695. }
  43696. function close() {
  43697. dialogVisible.value = false;
  43698. }
  43699. function remove2() {
  43700. emit("remove", {});
  43701. dialogVisible.value = false;
  43702. }
  43703. function closeDialog() {
  43704. emit("update:showDialog", false);
  43705. }
  43706. function openDialog() {
  43707. updateParams(props.params);
  43708. }
  43709. return (_ctx, _cache) => {
  43710. return openBlock(), createElementBlock("div", _hoisted_1$1, [
  43711. createVNode(unref(ElDialog), {
  43712. modal: false,
  43713. "destroy-on-close": false,
  43714. modelValue: dialogVisible.value,
  43715. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dialogVisible.value = $event),
  43716. title: title.value,
  43717. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  43718. onClose: closeDialog,
  43719. onOpen: openDialog,
  43720. "show-close": false
  43721. }, {
  43722. header: withCtx(() => [
  43723. createElementVNode("div", _hoisted_2$1, [
  43724. createElementVNode("span", _hoisted_3$1, toDisplayString(title.value), 1)
  43725. ])
  43726. ]),
  43727. default: withCtx(() => [
  43728. createElementVNode("div", _hoisted_4$1, [
  43729. createElementVNode("div", _hoisted_5$1, [
  43730. _hoisted_6$1,
  43731. createElementVNode("div", _hoisted_7$1, [
  43732. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  43733. default: withCtx(() => [
  43734. createVNode(unref(ElColorPicker), {
  43735. modelValue: color2.value,
  43736. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => color2.value = $event),
  43737. "show-alpha": "",
  43738. predefine: predefineColors.value,
  43739. label: "12"
  43740. }, null, 8, ["modelValue", "predefine"])
  43741. ]),
  43742. _: 1
  43743. }, 8, ["locale"])
  43744. ])
  43745. ]),
  43746. createElementVNode("div", _hoisted_8$1, [
  43747. createVNode(unref(ElButtonGroup), null, {
  43748. default: withCtx(() => [
  43749. createVNode(unref(ElButton), {
  43750. type: "primary",
  43751. icon: unref(edit_default),
  43752. onClick: _cache[1] || (_cache[1] = ($event) => submit())
  43753. }, {
  43754. default: withCtx(() => [
  43755. createTextVNode("\u4FEE\u6539")
  43756. ]),
  43757. _: 1
  43758. }, 8, ["icon"]),
  43759. createVNode(unref(ElButton), {
  43760. type: "primary",
  43761. style: { "background-color": "rgb(222, 146, 47)" },
  43762. icon: unref(delete_default),
  43763. onClick: _cache[2] || (_cache[2] = ($event) => remove2())
  43764. }, {
  43765. default: withCtx(() => [
  43766. createTextVNode("\u5220\u9664")
  43767. ]),
  43768. _: 1
  43769. }, 8, ["icon"]),
  43770. createVNode(unref(ElButton), {
  43771. type: "primary",
  43772. style: { "background-color": "rgb(126, 128, 135)" },
  43773. icon: unref(close_default),
  43774. onClick: _cache[3] || (_cache[3] = ($event) => close())
  43775. }, {
  43776. default: withCtx(() => [
  43777. createTextVNode("\u5173\u95ED")
  43778. ]),
  43779. _: 1
  43780. }, 8, ["icon"])
  43781. ]),
  43782. _: 1
  43783. })
  43784. ])
  43785. ])
  43786. ]),
  43787. _: 1
  43788. }, 8, ["modelValue", "title", "style"])
  43789. ]);
  43790. };
  43791. }
  43792. };
  43793. var DialogEditProperty$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["styles", [_style_0$1]]]);
  43794. Cesium.Entity.prototype.setParams = function(params) {
  43795. this._params = params;
  43796. };
  43797. Cesium.Entity.prototype.getParams = function() {
  43798. return this._params;
  43799. };
  43800. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  43801. this._isEdit = isEdit;
  43802. };
  43803. Cesium.Entity.prototype.getIsEdit = function() {
  43804. return this._isEdit;
  43805. };
  43806. class DrawMilitaryPlot {
  43807. constructor(options2) {
  43808. if (!options2.viewer)
  43809. throw new DeveloperError("no options.viewer object!");
  43810. if (!options2.Cesium)
  43811. throw new DeveloperError("no options.Cesium object!");
  43812. this._viewer = options2.viewer;
  43813. this.cesium = options2.Cesium;
  43814. this.drawArr = [];
  43815. this.Draw = "";
  43816. this.edit = new EntityEdit(this._viewer);
  43817. this.edit.activate();
  43818. this.edit.EditEndEntity.addEventListener((result) => {
  43819. if (result.Type) {
  43820. this.handleFirstPosition(result.Type);
  43821. this.edit.DrawExample = this.Draw;
  43822. }
  43823. this._editEntity = result;
  43824. });
  43825. }
  43826. static initEditPropertyParams() {
  43827. return {
  43828. id: void 0,
  43829. color: "rgba(0,255,0,0.75)",
  43830. outlineWidth: 0,
  43831. outlineColor: "rgba(255,255,255,1)"
  43832. };
  43833. }
  43834. editActivate() {
  43835. return this.edit;
  43836. }
  43837. handleFirstPosition(type2) {
  43838. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  43839. switch (type2) {
  43840. case "DrawStraightArrow":
  43841. this.Draw = new MilitaryPlot.DrawStraightArrow({
  43842. viewer: this._viewer,
  43843. Cesium: this.cesium
  43844. });
  43845. break;
  43846. case "DrawAttackArrow":
  43847. this.Draw = new MilitaryPlot.DrawAttackArrow({
  43848. viewer: this._viewer,
  43849. Cesium: this.cesium
  43850. });
  43851. break;
  43852. case "DrawPincerArrow":
  43853. this.Draw = new MilitaryPlot.DrawPincerArrow({
  43854. viewer: this._viewer,
  43855. Cesium: this.cesium
  43856. });
  43857. break;
  43858. case "DrawGatheringPlace":
  43859. this.Draw = new MilitaryPlot.DrawGatheringPlace({
  43860. viewer: this._viewer,
  43861. Cesium: this.cesium
  43862. });
  43863. break;
  43864. case "DrawClosedCurve":
  43865. this.Draw = new MilitaryPlot.DrawClosedCurve({
  43866. viewer: this._viewer,
  43867. Cesium: this.cesium
  43868. });
  43869. break;
  43870. case "DrawSector":
  43871. this.Draw = new MilitaryPlot.DrawSector({
  43872. viewer: this._viewer,
  43873. Cesium: this.cesium
  43874. });
  43875. break;
  43876. case "DrawBowLine":
  43877. this.Draw = new MilitaryPlot.DrawBowLine({
  43878. viewer: this._viewer,
  43879. Cesium: this.cesium
  43880. });
  43881. break;
  43882. case "DrawBowPlane":
  43883. this.Draw = new MilitaryPlot.DrawBowPlane({
  43884. viewer: this._viewer,
  43885. Cesium: this.cesium
  43886. });
  43887. break;
  43888. case "DrawCurve":
  43889. this.Draw = new MilitaryPlot.DrawCurve({
  43890. viewer: this._viewer,
  43891. Cesium: this.cesium
  43892. });
  43893. break;
  43894. case "DrawCurveFlag":
  43895. this.Draw = new MilitaryPlot.DrawCurveFlag({
  43896. viewer: this._viewer,
  43897. Cesium: this.cesium
  43898. });
  43899. break;
  43900. case "DrawRectFlag":
  43901. this.Draw = new MilitaryPlot.DrawRectFlag({
  43902. viewer: this._viewer,
  43903. Cesium: this.cesium
  43904. });
  43905. break;
  43906. case "DrawTriangleFlag":
  43907. this.Draw = new MilitaryPlot.DrawTriangleFlag({
  43908. viewer: this._viewer,
  43909. Cesium: this.cesium
  43910. });
  43911. break;
  43912. case "DrawPoint":
  43913. this.Draw = new MilitaryPlot.DrawPoint({
  43914. viewer: this._viewer,
  43915. Cesium: this.cesium
  43916. });
  43917. break;
  43918. case "DrawPolyline":
  43919. this.Draw = new MilitaryPlot.DrawPolyline({
  43920. viewer: this._viewer,
  43921. Cesium: this.cesium
  43922. });
  43923. break;
  43924. case "DrawPolygon":
  43925. this.Draw = new MilitaryPlot.DrawPolygon({
  43926. viewer: this._viewer,
  43927. Cesium: this.cesium
  43928. });
  43929. break;
  43930. case "DrawRectangle":
  43931. this.Draw = new MilitaryPlot.DrawRectangle({
  43932. viewer: this._viewer,
  43933. Cesium: this.cesium
  43934. });
  43935. break;
  43936. case "DrawCircle":
  43937. this.Draw = new MilitaryPlot.DrawCircle({
  43938. viewer: this._viewer,
  43939. Cesium: this.cesium
  43940. });
  43941. break;
  43942. }
  43943. }
  43944. addEntity(data) {
  43945. this.handleFirstPosition(data.type);
  43946. if (this.Draw) {
  43947. let entity = this.Draw.addload(data.position);
  43948. entity._id = data.id;
  43949. return entity;
  43950. }
  43951. }
  43952. }
  43953. Object.assign(DrawMilitaryPlot.prototype, {
  43954. _setMousePointerStyle() {
  43955. document.querySelector("body").style.cursor = "crosshair";
  43956. },
  43957. _setMouseDefaultStyle() {
  43958. document.querySelector("body").style.cursor = "default";
  43959. },
  43960. _registerLeftClickEvent(handler, callChange) {
  43961. let _self = this;
  43962. if (!handler)
  43963. return;
  43964. handler.setInputAction(function(event2) {
  43965. _self._lock = true;
  43966. clearTimeout(_self._timer);
  43967. _self._timer = setTimeout(function() {
  43968. if (callChange)
  43969. callChange(event2);
  43970. _self._lock = false;
  43971. }, 200);
  43972. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  43973. },
  43974. _registerMouseMoveEvent(handler, callChange) {
  43975. let _self = this;
  43976. if (!handler)
  43977. return;
  43978. handler.setInputAction(function(event2) {
  43979. if (_self._lock === void 0 || _self._lock === false) {
  43980. if (callChange)
  43981. callChange(event2);
  43982. }
  43983. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43984. },
  43985. _registerLeftDownEvent(handler, callChange) {
  43986. if (!handler)
  43987. return;
  43988. handler.setInputAction(function(event2) {
  43989. if (callChange)
  43990. callChange(event2);
  43991. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43992. },
  43993. _registerLeftUpEvent(handler, callChange) {
  43994. if (!handler)
  43995. return;
  43996. handler.setInputAction(function(event2) {
  43997. if (callChange)
  43998. callChange(event2);
  43999. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  44000. },
  44001. _clearEvent(handler) {
  44002. if (!handler)
  44003. return;
  44004. handler.destroy();
  44005. handler = null;
  44006. }
  44007. });
  44008. Object.assign(DrawMilitaryPlot.prototype, {
  44009. _setEntityIsEdit(entity) {
  44010. let _self = this;
  44011. this._closePropertyEditDialog();
  44012. entity.setIsEdit(true);
  44013. this.edit.handlePickEditEntity(entity);
  44014. this._sendShowPropertyDialog(entity);
  44015. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  44016. this._registerLeftClickEvent(handler, function(event2) {
  44017. _self._closePropertyEditDialog();
  44018. let feature2 = _self._viewer.scene.pick(event2.position);
  44019. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  44020. let editEntity = feature2.id;
  44021. if (editEntity.Type == "DrawStraightArrow" || editEntity.Type == "DrawAttackArrow" || editEntity.Type == "DrawPincerArrow" || editEntity.Type == "DrawGatheringPlace" || editEntity.Type == "DrawClosedCurve" || editEntity.Type == "DrawSector" || editEntity.Type == "DrawBowLine" || editEntity.Type == "DrawBowPlane" || editEntity.Type == "DrawCurve" || editEntity.Type == "DrawCurveFlag" || editEntity.Type == "DrawRectFlag" || editEntity.Type == "DrawTriangleFlag" || editEntity.Type == "DrawPoint" || editEntity.Type == "DrawPolyline" || editEntity.Type == "DrawPolygon" || editEntity.Type == "DrawRectangle" || editEntity.Type == "DrawCircle") {
  44022. _self._sendShowPropertyDialog(feature2.id);
  44023. }
  44024. }
  44025. });
  44026. },
  44027. _sendShowPropertyDialog(entity) {
  44028. let _self = this;
  44029. let editEntityType = entity.Type;
  44030. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  44031. return;
  44032. }
  44033. let editProperty = entity.getParams();
  44034. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  44035. editProperty.id = editEntityType;
  44036. _self._openPropertyEditDialog(
  44037. editProperty,
  44038. function(params) {
  44039. _self.updateEditEntityProperty(params);
  44040. },
  44041. function() {
  44042. _self._viewer.entities.remove(entity);
  44043. _self.edit.clearAllEditVertex();
  44044. }
  44045. );
  44046. }
  44047. },
  44048. updateEditEntityProperty: function(params) {
  44049. if (this._editEntity === void 0)
  44050. return;
  44051. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  44052. return;
  44053. let editEntityType = this._editEntity.Type;
  44054. if (editEntityType === void 0)
  44055. return;
  44056. let material = this._editEntity.polygon.material;
  44057. if (material instanceof Cesium.ColorMaterialProperty) {
  44058. let newMaterial = this._materialColorProperty({
  44059. color: params.color
  44060. });
  44061. this._editEntity.polygon.material = newMaterial;
  44062. }
  44063. if (this._editEntity.polyline !== void 0) {
  44064. let newMaterial = this._materialColorProperty({
  44065. color: params.outlineColor
  44066. });
  44067. this._editEntity.polyline.material = newMaterial;
  44068. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  44069. }
  44070. this._editEntity.setParams(params);
  44071. },
  44072. _materialColorProperty(options2) {
  44073. let mColor = "rgba(0,255,0,1)";
  44074. if (options2 !== void 0 && options2.color !== void 0)
  44075. mColor = options2.color;
  44076. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  44077. colorMaterial._param = {
  44078. color: mColor
  44079. };
  44080. return colorMaterial;
  44081. }
  44082. });
  44083. Object.assign(DrawMilitaryPlot.prototype, {
  44084. drawActivate(type2) {
  44085. this._setMousePointerStyle();
  44086. this.handleFirstPosition(type2);
  44087. this.Draw.startCreate(type2);
  44088. this.Draw.DrawEndEvent.addEventListener((entity, positions, drawType) => {
  44089. console.log({
  44090. entity,
  44091. positions,
  44092. drawType
  44093. });
  44094. this._setMouseDefaultStyle();
  44095. if (entity) {
  44096. let entityParam = DrawMilitaryPlot.initEditPropertyParams();
  44097. entity.setParams(entityParam);
  44098. this._setEntityIsEdit(entity);
  44099. }
  44100. });
  44101. this.drawArr.push(this.Draw);
  44102. return this.Draw;
  44103. },
  44104. clearOne: function() {
  44105. this.Draw.clear();
  44106. },
  44107. clearAll: function() {
  44108. for (var i2 = 0; i2 < this.drawArr.length; i2++) {
  44109. this.drawArr[i2].clear();
  44110. }
  44111. this.edit.deactivate();
  44112. this._closePropertyEditDialog();
  44113. let buttonDiv = document.getElementById("drawButtonDiv");
  44114. if (buttonDiv) {
  44115. document.body.removeChild(buttonDiv);
  44116. }
  44117. }
  44118. });
  44119. Object.assign(DrawMilitaryPlot.prototype, {
  44120. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  44121. this._editPropertyDialogDomId = "dialog-property-dom-militaryplot";
  44122. this._registerDOMPropertyEdit = "dialog-edit-property-militaryplot";
  44123. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  44124. if (PropertyEditComponent === void 0) {
  44125. PropertyEditComponent = defineCustomElement(DialogEditProperty$1);
  44126. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  44127. }
  44128. this._closePropertyEditDialog();
  44129. let dialogPropertyElement = new PropertyEditComponent({
  44130. params
  44131. });
  44132. dialogPropertyElement.id = this._editPropertyDialogDomId;
  44133. dialogPropertyElement.showDialog = true;
  44134. document.body.appendChild(dialogPropertyElement);
  44135. dialogPropertyElement.addEventListener(
  44136. "submit",
  44137. (e) => {
  44138. if (callEdit)
  44139. callEdit(e.detail[0]);
  44140. },
  44141. false
  44142. );
  44143. dialogPropertyElement.addEventListener(
  44144. "remove",
  44145. (e) => {
  44146. if (callRemove)
  44147. callRemove();
  44148. },
  44149. false
  44150. );
  44151. },
  44152. _closePropertyEditDialog() {
  44153. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  44154. if (dom2 !== null && dom2 !== void 0) {
  44155. document.body.removeChild(dom2);
  44156. }
  44157. }
  44158. });
  44159. var _style_0 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.el-input-number{line-height:30rem!important;width:150rem}.el-input-number__decrease,.el-input-number__increase{top:1rem!important;bottom:1rem!important;width:32rem!important;font-size:13rem!important;background-color:#409eff}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.el-scrollbar{color:#fff!important;background-color:#052d73!important;overflow:visible!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#409eff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;left:10rem;background:rgba(0,44,126,.68);height:calc(100% - 175rem);width:180rem;top:125rem;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .content{height:calc(100% - 120rem);width:92%;overflow-y:auto;padding:5rem 0 0;position:absolute}.jt-drawing-dialog .el-dialog .el-collapse{--el-collapse-border-color: rgb(0 44 126 / 0%);--el-collapse-header-text-color: #ffffff;--el-collapse-header-font-size: 13rem;--el-collapse-content-bg-color: rgb(0 44 126 / 0%);--el-collapse-content-font-size: 13rem;--el-collapse-content-text-color: rgb(216 240 255);--el-collapse-header-height: 40rem;--el-collapse-header-bg-color: rgb(30 130 255)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__header{background-color:#409eff;border-bottom:2px solid rgb(22,90,190)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__content{padding:10rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  44160. `;
  44161. const _hoisted_1 = { class: "jt-drawing-dialog" };
  44162. const _hoisted_2 = {
  44163. slot: "title",
  44164. class: "header-title"
  44165. };
  44166. const _hoisted_3 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  44167. const _hoisted_4 = { class: "content" };
  44168. const _hoisted_5 = {
  44169. class: "jt-drawing-row",
  44170. style: { "height": "60rem" }
  44171. };
  44172. const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5185\u5BB9", -1);
  44173. const _hoisted_7 = { class: "col-main" };
  44174. const _hoisted_8 = { class: "jt-drawing-row" };
  44175. const _hoisted_9 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53", -1);
  44176. const _hoisted_10 = { class: "col-main" };
  44177. const _hoisted_11 = { class: "jt-drawing-row" };
  44178. const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53\u5927\u5C0F", -1);
  44179. const _hoisted_13 = { class: "col-main" };
  44180. const _hoisted_14 = { class: "jt-drawing-row" };
  44181. const _hoisted_15 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u52A0\u7C97", -1);
  44182. const _hoisted_16 = { class: "col-main" };
  44183. const _hoisted_17 = { class: "jt-drawing-row" };
  44184. const _hoisted_18 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u659C\u4F53", -1);
  44185. const _hoisted_19 = { class: "col-main" };
  44186. const _hoisted_20 = { class: "jt-drawing-row" };
  44187. const _hoisted_21 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44188. const _hoisted_22 = { class: "col-main" };
  44189. const _hoisted_23 = { class: "jt-drawing-row" };
  44190. const _hoisted_24 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44191. const _hoisted_25 = { class: "col-main" };
  44192. const _hoisted_26 = { class: "jt-drawing-row" };
  44193. const _hoisted_27 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44194. const _hoisted_28 = { class: "col-main" };
  44195. const _hoisted_29 = { class: "jt-drawing-row" };
  44196. const _hoisted_30 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44197. const _hoisted_31 = { class: "col-main" };
  44198. const _hoisted_32 = { class: "jt-drawing-row" };
  44199. const _hoisted_33 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u80CC\u666F", -1);
  44200. const _hoisted_34 = { class: "col-main" };
  44201. const _hoisted_35 = { class: "jt-drawing-row" };
  44202. const _hoisted_36 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u989C\u8272", -1);
  44203. const _hoisted_37 = { class: "col-main" };
  44204. const _hoisted_38 = { class: "jt-drawing-row" };
  44205. const _hoisted_39 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u5185\u8FB9\u8DDD", -1);
  44206. const _hoisted_40 = { class: "col-main" };
  44207. const _hoisted_41 = { class: "jt-drawing-row" };
  44208. const _hoisted_42 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A2A\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44209. const _hoisted_43 = { class: "col-main" };
  44210. const _hoisted_44 = { class: "jt-drawing-row" };
  44211. const _hoisted_45 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EB5\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44212. const _hoisted_46 = { class: "col-main" };
  44213. const _hoisted_47 = { class: "jt-drawing-row" };
  44214. const _hoisted_48 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u50CF\u7D20\u5927\u5C0F", -1);
  44215. const _hoisted_49 = { class: "col-main" };
  44216. const _hoisted_50 = { class: "jt-drawing-row" };
  44217. const _hoisted_51 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44218. const _hoisted_52 = { class: "col-main" };
  44219. const _hoisted_53 = { class: "jt-drawing-row" };
  44220. const _hoisted_54 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44221. const _hoisted_55 = { class: "col-main" };
  44222. const _hoisted_56 = { class: "jt-drawing-row" };
  44223. const _hoisted_57 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44224. const _hoisted_58 = { class: "col-main" };
  44225. const _hoisted_59 = { class: "jt-drawing-row" };
  44226. const _hoisted_60 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44227. const _hoisted_61 = { class: "col-main" };
  44228. const _hoisted_62 = {
  44229. class: "jt-drawing-row",
  44230. style: { "height": "60rem" }
  44231. };
  44232. const _hoisted_63 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u56FE\u6807", -1);
  44233. const _hoisted_64 = { class: "col-main" };
  44234. const _hoisted_65 = { class: "jt-drawing-row" };
  44235. const _hoisted_66 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5927\u5C0F\u6BD4\u4F8B", -1);
  44236. const _hoisted_67 = { class: "col-main" };
  44237. const _hoisted_68 = {
  44238. class: "jt-drawing-row",
  44239. style: { "height": "60rem" }
  44240. };
  44241. const _hoisted_69 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A21\u578B\u8DEF\u5F84", -1);
  44242. const _hoisted_70 = { class: "col-main" };
  44243. const _hoisted_71 = { class: "jt-drawing-row" };
  44244. const _hoisted_72 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u900F\u660E\u5EA6", -1);
  44245. const _hoisted_73 = { class: "col-main" };
  44246. const _hoisted_74 = { class: "jt-drawing-row" };
  44247. const _hoisted_75 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6700\u5C0F\u50CF\u7D20\u5927\u5C0F", -1);
  44248. const _hoisted_76 = { class: "col-main" };
  44249. const _hoisted_77 = { class: "jt-drawing-row" };
  44250. const _hoisted_78 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44251. const _hoisted_79 = { class: "col-main" };
  44252. const _hoisted_80 = { class: "jt-drawing-row" };
  44253. const _hoisted_81 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44254. const _hoisted_82 = { class: "col-main" };
  44255. const _hoisted_83 = { class: "jt-drawing-row" };
  44256. const _hoisted_84 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44257. const _hoisted_85 = { class: "col-main" };
  44258. const _hoisted_86 = { class: "el-body-foot" };
  44259. const _sfc_main = {
  44260. __name: "CrEditProperty_Point.ce",
  44261. props: {
  44262. params: {
  44263. id: {
  44264. type: String,
  44265. default: () => void 0
  44266. },
  44267. text: {
  44268. type: String,
  44269. default: () => ""
  44270. },
  44271. font: {
  44272. type: String,
  44273. default: () => ""
  44274. },
  44275. fontSize: {
  44276. type: Number,
  44277. default: () => 24
  44278. },
  44279. color: {
  44280. type: String,
  44281. default: () => "255,255,0,0.9"
  44282. }
  44283. },
  44284. showDialog: {
  44285. type: Boolean,
  44286. default: () => false
  44287. }
  44288. },
  44289. emits: ["submit", "update:showDialog", "update:params", "remove"],
  44290. setup(__props, { emit }) {
  44291. const props = __props;
  44292. const language = ref("zh-cn");
  44293. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  44294. const {
  44295. proxy
  44296. } = getCurrentInstance();
  44297. const predefineColors = ref([
  44298. "#ff4500",
  44299. "#ff8c00",
  44300. "#ffd700",
  44301. "#90ee90",
  44302. "#00ced1",
  44303. "#1e90ff",
  44304. "#c71585",
  44305. "rgba(255, 69, 0, 0.68)",
  44306. "rgb(255, 120, 0)",
  44307. "hsv(51, 100, 98)",
  44308. "hsva(120, 40, 94, 0.5)",
  44309. "hsl(181, 100%, 37%)",
  44310. "hsla(209, 100%, 56%, 0.73)",
  44311. "#c7158577"
  44312. ]);
  44313. const selectOptionsFont = [
  44314. {
  44315. value: "Helvetica",
  44316. label: "\u9ED8\u8BA4\u5B57\u4F53"
  44317. },
  44318. {
  44319. value: "Microsoft YaHei",
  44320. label: "\u5FAE\u8F6F\u96C5\u9ED1"
  44321. },
  44322. {
  44323. value: "\u5B8B\u4F53",
  44324. label: "\u5B8B\u4F53"
  44325. },
  44326. {
  44327. value: "\u6977\u4F53",
  44328. label: "\u6977\u4F53"
  44329. },
  44330. {
  44331. value: "\u96B6\u4E66",
  44332. label: "\u96B6\u4E66"
  44333. },
  44334. {
  44335. value: "\u9ED1\u4F53",
  44336. label: "\u9ED1\u4F53"
  44337. }
  44338. ];
  44339. const activeNames = ref(["1"]);
  44340. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  44341. const dialogVisible = ref(props.showDialog);
  44342. const isShowLabelStyle = ref(false);
  44343. const isShowPointStyle = ref(false);
  44344. const isShowBillboardStyle = ref(false);
  44345. const isShowModelStyle = ref(false);
  44346. const label2 = ref({
  44347. content: "",
  44348. font: "",
  44349. fontSize: 0,
  44350. bolder: false,
  44351. italic: false,
  44352. fillColor: "",
  44353. showOutline: false,
  44354. outlineColor: "",
  44355. outlineWidth: 0,
  44356. showBackground: false,
  44357. backgroundColor: "",
  44358. backgroundPadding: 0,
  44359. pixelOffsetX: 0,
  44360. pixelOffsetY: 0
  44361. });
  44362. const point2 = ref({
  44363. color: "",
  44364. pixelSize: 10,
  44365. showOutline: false,
  44366. outlineColor: "",
  44367. outlineWidth: 0
  44368. });
  44369. const billboard = ref({
  44370. imgUrl: "",
  44371. alpha: 1,
  44372. scale: 1
  44373. });
  44374. const model = ref({
  44375. url: "",
  44376. alpha: 1,
  44377. showSilhouette: false,
  44378. silhouetteSize: 0,
  44379. silhouetteColor: "rgba(255,255,255,1)",
  44380. minimumPixelSize: 1,
  44381. maximumScale: 1,
  44382. heading: 0,
  44383. pitch: 0,
  44384. roll: 0
  44385. });
  44386. updateParams(props.params);
  44387. function updateParams(params) {
  44388. proxy._params = params;
  44389. _setShowControls(false);
  44390. if (params.id === DrawPoint.DrawType.Label) {
  44391. title.value = "\u6587\u5B57\u7F16\u8F91";
  44392. activeNames.value = ["\u6807\u6CE8\u6837\u5F0F"];
  44393. isShowLabelStyle.value = true;
  44394. label2.value.content = params.label.text;
  44395. label2.value.font = params.label.font;
  44396. label2.value.fontSize = params.label.fontSize;
  44397. label2.value.fillColor = params.label.fillColor;
  44398. label2.value.showOutline = params.label.showOutline;
  44399. label2.value.outlineColor = params.label.outlineColor;
  44400. label2.value.outlineWidth = params.label.outlineWidth;
  44401. label2.value.showBackground = params.label.showBackground;
  44402. label2.value.backgroundColor = params.label.backgroundColor;
  44403. label2.value.backgroundPadding = params.label.backgroundPadding;
  44404. label2.value.pixelOffsetX = params.label.pixelOffsetX;
  44405. label2.value.pixelOffsetY = params.label.pixelOffsetY;
  44406. } else if (params.id === DrawPoint.DrawType.Point) {
  44407. title.value = "\u70B9\u7F16\u8F91";
  44408. activeNames.value = ["\u70B9\u6837\u5F0F"];
  44409. isShowPointStyle.value = true;
  44410. point2.value.color = params.point.color;
  44411. point2.value.pixelSize = params.point.pixelSize;
  44412. point2.value.showOutline = params.point.showOutline;
  44413. point2.value.outlineColor = params.point.outlineColor;
  44414. point2.value.outlineWidth = params.point.outlineWidth;
  44415. } else if (params.id === DrawPoint.DrawType.Point2Label) {
  44416. title.value = "\u70B9\u53CA\u6587\u5B57\u7F16\u8F91";
  44417. activeNames.value = ["\u70B9\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44418. isShowPointStyle.value = true;
  44419. isShowLabelStyle.value = true;
  44420. point2.value.color = params.point.color;
  44421. point2.value.pixelSize = params.point.pixelSize;
  44422. point2.value.showOutline = params.point.showOutline;
  44423. point2.value.outlineColor = params.point.outlineColor;
  44424. point2.value.outlineWidth = params.point.outlineWidth;
  44425. label2.value.content = params.label.text;
  44426. label2.value.font = params.label.font;
  44427. label2.value.fontSize = params.label.fontSize;
  44428. label2.value.fillColor = params.label.fillColor;
  44429. label2.value.showOutline = params.label.showOutline;
  44430. label2.value.outlineColor = params.label.outlineColor;
  44431. label2.value.outlineWidth = params.label.outlineWidth;
  44432. label2.value.showBackground = params.label.showBackground;
  44433. label2.value.backgroundColor = params.label.backgroundColor;
  44434. label2.value.backgroundPadding = params.label.backgroundPadding;
  44435. label2.value.pixelOffsetX = params.label.pixelOffsetX;
  44436. label2.value.pixelOffsetY = params.label.pixelOffsetY;
  44437. } else if (params.id === DrawPoint.DrawType.Billboard) {
  44438. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  44439. activeNames.value = ["\u56FE\u7247\u6837\u5F0F"];
  44440. isShowBillboardStyle.value = true;
  44441. billboard.value.imgUrl = params.billboard.imgUrl;
  44442. billboard.value.alpha = params.billboard.alpha;
  44443. billboard.value.scale = params.billboard.scale;
  44444. } else if (params.id === DrawPoint.DrawType.Billboard2Label) {
  44445. title.value = "\u5E7F\u544A\u724C\u53CA\u6587\u5B57\u5706\u7F16\u8F91";
  44446. activeNames.value = ["\u56FE\u7247\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44447. isShowBillboardStyle.value = true;
  44448. isShowLabelStyle.value = true;
  44449. billboard.value.imgUrl = params.billboard.imgUrl;
  44450. billboard.value.alpha = params.billboard.alpha;
  44451. billboard.value.scale = params.billboard.scale;
  44452. label2.value.content = params.label.text;
  44453. label2.value.font = params.label.font;
  44454. label2.value.fontSize = params.label.fontSize;
  44455. label2.value.fillColor = params.label.fillColor;
  44456. label2.value.showOutline = params.label.showOutline;
  44457. label2.value.outlineColor = params.label.outlineColor;
  44458. label2.value.outlineWidth = params.label.outlineWidth;
  44459. label2.value.showBackground = params.label.showBackground;
  44460. label2.value.backgroundColor = params.label.backgroundColor;
  44461. label2.value.backgroundPadding = params.label.backgroundPadding;
  44462. label2.value.pixelOffsetX = params.label.pixelOffsetX;
  44463. label2.value.pixelOffsetY = params.label.pixelOffsetY;
  44464. } else if (params.id === DrawPoint.DrawType.Model) {
  44465. title.value = "\u5C0F\u6A21\u578B\u7F16\u8F91";
  44466. activeNames.value = ["\u5C0F\u6A21\u578B\u6837\u5F0F"];
  44467. isShowModelStyle.value = true;
  44468. model.value.url = params.model.url;
  44469. model.value.alpha = params.model.alpha;
  44470. model.value.showSilhouette = params.model.showSilhouette;
  44471. model.value.silhouetteColor = params.model.silhouetteColor;
  44472. model.value.silhouetteSize = params.model.silhouetteSize;
  44473. model.value.minimumPixelSize = params.model.minimumPixelSize;
  44474. model.value.maximumScale = params.model.maximumScale;
  44475. model.value.heading = params.model.heading;
  44476. model.value.pitch = params.model.pitch;
  44477. model.value.roll = params.model.roll;
  44478. }
  44479. }
  44480. function _setShowControls(isShow) {
  44481. isShowLabelStyle.value = isShow;
  44482. isShowPointStyle.value = isShow;
  44483. isShowBillboardStyle.value = isShow;
  44484. isShowModelStyle.value = isShow;
  44485. }
  44486. function submit() {
  44487. let outParam = proxy._params;
  44488. outParam = {
  44489. id: outParam.id,
  44490. label: {
  44491. text: label2.value.content,
  44492. font: label2.value.font,
  44493. fontSize: label2.value.fontSize,
  44494. bolder: label2.value.bolder,
  44495. italic: label2.value.italic,
  44496. fillColor: label2.value.fillColor,
  44497. showOutline: label2.value.showOutline,
  44498. outlineWidth: label2.value.outlineWidth,
  44499. outlineColor: label2.value.outlineColor,
  44500. showBackground: label2.value.showBackground,
  44501. backgroundColor: label2.value.backgroundColor,
  44502. backgroundPadding: label2.value.backgroundPadding,
  44503. pixelOffsetX: label2.value.pixelOffsetX,
  44504. pixelOffsetY: label2.value.pixelOffsetY
  44505. },
  44506. point: {
  44507. color: point2.value.color,
  44508. pixelSize: point2.value.pixelSize,
  44509. showOutline: point2.value.showOutline,
  44510. outlineWidth: point2.value.outlineWidth,
  44511. outlineColor: point2.value.outlineColor
  44512. },
  44513. billboard: {
  44514. imgUrl: billboard.value.imgUrl,
  44515. alpha: billboard.value.alpha,
  44516. scale: billboard.value.scale
  44517. },
  44518. model: {
  44519. url: model.value.url,
  44520. alpha: model.value.alpha,
  44521. showSilhouette: model.value.showSilhouette,
  44522. silhouetteColor: model.value.silhouetteColor,
  44523. silhouetteSize: model.value.silhouetteSize,
  44524. minimumPixelSize: model.value.minimumPixelSize,
  44525. maximumScale: model.value.maximumScale,
  44526. heading: model.value.heading,
  44527. pitch: model.value.pitch,
  44528. roll: model.value.roll
  44529. }
  44530. };
  44531. emit("submit", outParam);
  44532. }
  44533. function close() {
  44534. dialogVisible.value = false;
  44535. }
  44536. function remove2() {
  44537. emit("remove", {});
  44538. dialogVisible.value = false;
  44539. }
  44540. function closeDialog() {
  44541. emit("update:showDialog", false);
  44542. }
  44543. function openDialog() {
  44544. updateParams(props.params);
  44545. }
  44546. return (_ctx, _cache) => {
  44547. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  44548. return openBlock(), createElementBlock("div", _hoisted_1, [
  44549. createVNode(unref(ElDialog), {
  44550. modal: false,
  44551. "destroy-on-close": false,
  44552. modelValue: dialogVisible.value,
  44553. "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => dialogVisible.value = $event),
  44554. title: title.value,
  44555. onClose: closeDialog,
  44556. onOpen: openDialog,
  44557. "show-close": false
  44558. }, {
  44559. header: withCtx(() => [
  44560. createElementVNode("div", _hoisted_2, [
  44561. createElementVNode("span", _hoisted_3, toDisplayString(title.value), 1)
  44562. ])
  44563. ]),
  44564. default: withCtx(() => [
  44565. createVNode(_component_el_scrollbar, null, {
  44566. default: withCtx(() => [
  44567. createElementVNode("div", _hoisted_4, [
  44568. createVNode(unref(ElCollapse), {
  44569. modelValue: activeNames.value,
  44570. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => activeNames.value = $event)
  44571. }, {
  44572. default: withCtx(() => [
  44573. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u6807\u6CE8\u6837\u5F0F" }, {
  44574. title: withCtx(() => [
  44575. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44576. default: withCtx(() => [
  44577. createVNode(unref(setting_default))
  44578. ]),
  44579. _: 1
  44580. }),
  44581. createTextVNode("\u6807\u6CE8\u6837\u5F0F ")
  44582. ]),
  44583. default: withCtx(() => [
  44584. createElementVNode("div", _hoisted_5, [
  44585. _hoisted_6,
  44586. createElementVNode("div", _hoisted_7, [
  44587. createVNode(unref(ElInput), {
  44588. modelValue: label2.value.content,
  44589. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label2.value.content = $event),
  44590. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  44591. clearable: "",
  44592. type: "textarea",
  44593. rows: 2
  44594. }, null, 8, ["modelValue"])
  44595. ])
  44596. ]),
  44597. createElementVNode("div", _hoisted_8, [
  44598. _hoisted_9,
  44599. createElementVNode("div", _hoisted_10, [
  44600. createVNode(unref(ElSelect), {
  44601. modelValue: label2.value.font,
  44602. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => label2.value.font = $event),
  44603. placeholder: "\u8BF7\u9009\u62E9"
  44604. }, {
  44605. default: withCtx(() => [
  44606. (openBlock(), createElementBlock(Fragment, null, renderList(selectOptionsFont, (item) => {
  44607. return createVNode(unref(ElOption), {
  44608. key: item.value,
  44609. label: item.label,
  44610. value: item.value
  44611. }, null, 8, ["label", "value"]);
  44612. }), 64))
  44613. ]),
  44614. _: 1
  44615. }, 8, ["modelValue"])
  44616. ])
  44617. ]),
  44618. createElementVNode("div", _hoisted_11, [
  44619. _hoisted_12,
  44620. createElementVNode("div", _hoisted_13, [
  44621. createVNode(unref(ElInputNumber), {
  44622. modelValue: label2.value.fontSize,
  44623. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => label2.value.fontSize = $event),
  44624. min: 0,
  44625. max: 100
  44626. }, null, 8, ["modelValue"])
  44627. ])
  44628. ]),
  44629. createElementVNode("div", _hoisted_14, [
  44630. _hoisted_15,
  44631. createElementVNode("div", _hoisted_16, [
  44632. createVNode(unref(ElSwitch), {
  44633. modelValue: label2.value.bolder,
  44634. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => label2.value.bolder = $event)
  44635. }, null, 8, ["modelValue"])
  44636. ])
  44637. ]),
  44638. createElementVNode("div", _hoisted_17, [
  44639. _hoisted_18,
  44640. createElementVNode("div", _hoisted_19, [
  44641. createVNode(unref(ElSwitch), {
  44642. modelValue: label2.value.italic,
  44643. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => label2.value.italic = $event)
  44644. }, null, 8, ["modelValue"])
  44645. ])
  44646. ]),
  44647. createElementVNode("div", _hoisted_20, [
  44648. _hoisted_21,
  44649. createElementVNode("div", _hoisted_22, [
  44650. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44651. default: withCtx(() => [
  44652. createVNode(unref(ElColorPicker), {
  44653. modelValue: label2.value.fillColor,
  44654. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => label2.value.fillColor = $event),
  44655. "show-alpha": "",
  44656. predefine: predefineColors.value,
  44657. label: "12"
  44658. }, null, 8, ["modelValue", "predefine"])
  44659. ]),
  44660. _: 1
  44661. }, 8, ["locale"])
  44662. ])
  44663. ]),
  44664. createElementVNode("div", _hoisted_23, [
  44665. _hoisted_24,
  44666. createElementVNode("div", _hoisted_25, [
  44667. createVNode(unref(ElSwitch), {
  44668. modelValue: label2.value.showOutline,
  44669. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => label2.value.showOutline = $event)
  44670. }, null, 8, ["modelValue"])
  44671. ])
  44672. ]),
  44673. withDirectives(createElementVNode("div", _hoisted_26, [
  44674. _hoisted_27,
  44675. createElementVNode("div", _hoisted_28, [
  44676. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44677. default: withCtx(() => [
  44678. createVNode(unref(ElColorPicker), {
  44679. modelValue: label2.value.outlineColor,
  44680. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => label2.value.outlineColor = $event),
  44681. "show-alpha": "",
  44682. predefine: predefineColors.value,
  44683. label: "12"
  44684. }, null, 8, ["modelValue", "predefine"])
  44685. ]),
  44686. _: 1
  44687. }, 8, ["locale"])
  44688. ])
  44689. ], 512), [
  44690. [vShow, label2.value.showOutline]
  44691. ]),
  44692. withDirectives(createElementVNode("div", _hoisted_29, [
  44693. _hoisted_30,
  44694. createElementVNode("div", _hoisted_31, [
  44695. createVNode(unref(ElInputNumber), {
  44696. modelValue: label2.value.outlineWidth,
  44697. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => label2.value.outlineWidth = $event),
  44698. min: 0,
  44699. max: 100
  44700. }, null, 8, ["modelValue"])
  44701. ])
  44702. ], 512), [
  44703. [vShow, label2.value.showOutline]
  44704. ]),
  44705. createElementVNode("div", _hoisted_32, [
  44706. _hoisted_33,
  44707. createElementVNode("div", _hoisted_34, [
  44708. createVNode(unref(ElSwitch), {
  44709. modelValue: label2.value.showBackground,
  44710. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => label2.value.showBackground = $event)
  44711. }, null, 8, ["modelValue"])
  44712. ])
  44713. ]),
  44714. withDirectives(createElementVNode("div", _hoisted_35, [
  44715. _hoisted_36,
  44716. createElementVNode("div", _hoisted_37, [
  44717. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44718. default: withCtx(() => [
  44719. createVNode(unref(ElColorPicker), {
  44720. modelValue: label2.value.backgroundColor,
  44721. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => label2.value.backgroundColor = $event),
  44722. "show-alpha": "",
  44723. predefine: predefineColors.value,
  44724. label: "12"
  44725. }, null, 8, ["modelValue", "predefine"])
  44726. ]),
  44727. _: 1
  44728. }, 8, ["locale"])
  44729. ])
  44730. ], 512), [
  44731. [vShow, label2.value.showBackground]
  44732. ]),
  44733. withDirectives(createElementVNode("div", _hoisted_38, [
  44734. _hoisted_39,
  44735. createElementVNode("div", _hoisted_40, [
  44736. createVNode(unref(ElInputNumber), {
  44737. modelValue: label2.value.backgroundPadding,
  44738. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => label2.value.backgroundPadding = $event),
  44739. min: -100,
  44740. max: 100
  44741. }, null, 8, ["modelValue"])
  44742. ])
  44743. ], 512), [
  44744. [vShow, label2.value.showBackground]
  44745. ]),
  44746. createElementVNode("div", _hoisted_41, [
  44747. _hoisted_42,
  44748. createElementVNode("div", _hoisted_43, [
  44749. createVNode(unref(ElInputNumber), {
  44750. modelValue: label2.value.pixelOffsetX,
  44751. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => label2.value.pixelOffsetX = $event),
  44752. min: -100,
  44753. max: 100
  44754. }, null, 8, ["modelValue"])
  44755. ])
  44756. ]),
  44757. createElementVNode("div", _hoisted_44, [
  44758. _hoisted_45,
  44759. createElementVNode("div", _hoisted_46, [
  44760. createVNode(unref(ElInputNumber), {
  44761. modelValue: label2.value.pixelOffsetY,
  44762. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => label2.value.pixelOffsetY = $event),
  44763. min: -100,
  44764. max: 100
  44765. }, null, 8, ["modelValue"])
  44766. ])
  44767. ])
  44768. ]),
  44769. _: 1
  44770. }, 512), [
  44771. [vShow, isShowLabelStyle.value]
  44772. ]),
  44773. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u70B9\u6837\u5F0F" }, {
  44774. title: withCtx(() => [
  44775. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44776. default: withCtx(() => [
  44777. createVNode(unref(setting_default))
  44778. ]),
  44779. _: 1
  44780. }),
  44781. createTextVNode("\u70B9\u6837\u5F0F ")
  44782. ]),
  44783. default: withCtx(() => [
  44784. createElementVNode("div", _hoisted_47, [
  44785. _hoisted_48,
  44786. createElementVNode("div", _hoisted_49, [
  44787. createVNode(unref(ElInputNumber), {
  44788. modelValue: point2.value.pixelSize,
  44789. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => point2.value.pixelSize = $event),
  44790. min: 0,
  44791. max: 100
  44792. }, null, 8, ["modelValue"])
  44793. ])
  44794. ]),
  44795. createElementVNode("div", _hoisted_50, [
  44796. _hoisted_51,
  44797. createElementVNode("div", _hoisted_52, [
  44798. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44799. default: withCtx(() => [
  44800. createVNode(unref(ElColorPicker), {
  44801. modelValue: point2.value.color,
  44802. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => point2.value.color = $event),
  44803. "show-alpha": "",
  44804. predefine: predefineColors.value,
  44805. label: "12"
  44806. }, null, 8, ["modelValue", "predefine"])
  44807. ]),
  44808. _: 1
  44809. }, 8, ["locale"])
  44810. ])
  44811. ]),
  44812. createElementVNode("div", _hoisted_53, [
  44813. _hoisted_54,
  44814. createElementVNode("div", _hoisted_55, [
  44815. createVNode(unref(ElSwitch), {
  44816. modelValue: point2.value.showOutline,
  44817. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => point2.value.showOutline = $event)
  44818. }, null, 8, ["modelValue"])
  44819. ])
  44820. ]),
  44821. withDirectives(createElementVNode("div", _hoisted_56, [
  44822. _hoisted_57,
  44823. createElementVNode("div", _hoisted_58, [
  44824. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44825. default: withCtx(() => [
  44826. createVNode(unref(ElColorPicker), {
  44827. modelValue: point2.value.outlineColor,
  44828. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => point2.value.outlineColor = $event),
  44829. "show-alpha": "",
  44830. predefine: predefineColors.value,
  44831. label: "12"
  44832. }, null, 8, ["modelValue", "predefine"])
  44833. ]),
  44834. _: 1
  44835. }, 8, ["locale"])
  44836. ])
  44837. ], 512), [
  44838. [vShow, point2.value.showOutline]
  44839. ]),
  44840. withDirectives(createElementVNode("div", _hoisted_59, [
  44841. _hoisted_60,
  44842. createElementVNode("div", _hoisted_61, [
  44843. createVNode(unref(ElInputNumber), {
  44844. modelValue: point2.value.outlineWidth,
  44845. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => point2.value.outlineWidth = $event),
  44846. min: 0,
  44847. max: 100
  44848. }, null, 8, ["modelValue"])
  44849. ])
  44850. ], 512), [
  44851. [vShow, point2.value.showOutline]
  44852. ])
  44853. ]),
  44854. _: 1
  44855. }, 512), [
  44856. [vShow, isShowPointStyle.value]
  44857. ]),
  44858. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u56FE\u7247\u6837\u5F0F" }, {
  44859. title: withCtx(() => [
  44860. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44861. default: withCtx(() => [
  44862. createVNode(unref(setting_default))
  44863. ]),
  44864. _: 1
  44865. }),
  44866. createTextVNode("\u56FE\u7247\u6837\u5F0F ")
  44867. ]),
  44868. default: withCtx(() => [
  44869. createElementVNode("div", _hoisted_62, [
  44870. _hoisted_63,
  44871. createElementVNode("div", _hoisted_64, [
  44872. createVNode(unref(ElInput), {
  44873. modelValue: billboard.value.imgUrl,
  44874. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => billboard.value.imgUrl = $event),
  44875. placeholder: "\u8F93\u5165\u56FE\u6807\u8DEF\u5F84",
  44876. clearable: "",
  44877. type: "textarea",
  44878. rows: 2
  44879. }, null, 8, ["modelValue"])
  44880. ])
  44881. ]),
  44882. createElementVNode("div", _hoisted_65, [
  44883. _hoisted_66,
  44884. createElementVNode("div", _hoisted_67, [
  44885. createVNode(unref(ElInputNumber), {
  44886. modelValue: billboard.value.scale,
  44887. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => billboard.value.scale = $event),
  44888. min: 1,
  44889. max: 100
  44890. }, null, 8, ["modelValue"])
  44891. ])
  44892. ])
  44893. ]),
  44894. _: 1
  44895. }, 512), [
  44896. [vShow, isShowBillboardStyle.value]
  44897. ]),
  44898. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u5C0F\u6A21\u578B\u6837\u5F0F" }, {
  44899. title: withCtx(() => [
  44900. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44901. default: withCtx(() => [
  44902. createVNode(unref(setting_default))
  44903. ]),
  44904. _: 1
  44905. }),
  44906. createTextVNode("\u5C0F\u6A21\u578B\u6837\u5F0F ")
  44907. ]),
  44908. default: withCtx(() => [
  44909. createElementVNode("div", _hoisted_68, [
  44910. _hoisted_69,
  44911. createElementVNode("div", _hoisted_70, [
  44912. createVNode(unref(ElInput), {
  44913. modelValue: model.value.url,
  44914. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => model.value.url = $event),
  44915. placeholder: "\u8F93\u5165\u6A21\u578B\u8DEF\u5F84",
  44916. clearable: "",
  44917. type: "textarea",
  44918. rows: 2
  44919. }, null, 8, ["modelValue"])
  44920. ])
  44921. ]),
  44922. createElementVNode("div", _hoisted_71, [
  44923. _hoisted_72,
  44924. createElementVNode("div", _hoisted_73, [
  44925. createVNode(unref(ElInputNumber), {
  44926. modelValue: model.value.alpha,
  44927. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => model.value.alpha = $event),
  44928. step: 0.1,
  44929. min: 0,
  44930. max: 1
  44931. }, null, 8, ["modelValue"])
  44932. ])
  44933. ]),
  44934. createElementVNode("div", _hoisted_74, [
  44935. _hoisted_75,
  44936. createElementVNode("div", _hoisted_76, [
  44937. createVNode(unref(ElInputNumber), {
  44938. modelValue: model.value.minimumPixelSize,
  44939. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => model.value.minimumPixelSize = $event),
  44940. step: 1,
  44941. min: 0,
  44942. max: 2e4
  44943. }, null, 8, ["modelValue"])
  44944. ])
  44945. ]),
  44946. createElementVNode("div", _hoisted_77, [
  44947. _hoisted_78,
  44948. createElementVNode("div", _hoisted_79, [
  44949. createVNode(unref(ElSwitch), {
  44950. modelValue: model.value.showSilhouette,
  44951. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => model.value.showSilhouette = $event)
  44952. }, null, 8, ["modelValue"])
  44953. ])
  44954. ]),
  44955. withDirectives(createElementVNode("div", _hoisted_80, [
  44956. _hoisted_81,
  44957. createElementVNode("div", _hoisted_82, [
  44958. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44959. default: withCtx(() => [
  44960. createVNode(unref(ElColorPicker), {
  44961. modelValue: model.value.silhouetteColor,
  44962. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => model.value.silhouetteColor = $event),
  44963. "show-alpha": "",
  44964. predefine: predefineColors.value,
  44965. label: "12"
  44966. }, null, 8, ["modelValue", "predefine"])
  44967. ]),
  44968. _: 1
  44969. }, 8, ["locale"])
  44970. ])
  44971. ], 512), [
  44972. [vShow, model.value.showSilhouette]
  44973. ]),
  44974. withDirectives(createElementVNode("div", _hoisted_83, [
  44975. _hoisted_84,
  44976. createElementVNode("div", _hoisted_85, [
  44977. createVNode(unref(ElInputNumber), {
  44978. modelValue: model.value.silhouetteSize,
  44979. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => model.value.silhouetteSize = $event),
  44980. step: 1,
  44981. min: 0,
  44982. max: 100
  44983. }, null, 8, ["modelValue"])
  44984. ])
  44985. ], 512), [
  44986. [vShow, model.value.showSilhouette]
  44987. ])
  44988. ]),
  44989. _: 1
  44990. }, 512), [
  44991. [vShow, isShowModelStyle.value]
  44992. ])
  44993. ]),
  44994. _: 1
  44995. }, 8, ["modelValue"])
  44996. ]),
  44997. createElementVNode("div", _hoisted_86, [
  44998. createVNode(unref(ElButtonGroup), null, {
  44999. default: withCtx(() => [
  45000. createVNode(unref(ElButton), {
  45001. type: "primary",
  45002. icon: unref(edit_default),
  45003. onClick: _cache[28] || (_cache[28] = ($event) => submit())
  45004. }, {
  45005. default: withCtx(() => [
  45006. createTextVNode("\u4FEE\u6539")
  45007. ]),
  45008. _: 1
  45009. }, 8, ["icon"]),
  45010. createVNode(unref(ElButton), {
  45011. type: "primary",
  45012. style: { "background-color": "rgb(222, 146, 47)" },
  45013. icon: unref(delete_default),
  45014. onClick: _cache[29] || (_cache[29] = ($event) => remove2())
  45015. }, {
  45016. default: withCtx(() => [
  45017. createTextVNode("\u5220\u9664")
  45018. ]),
  45019. _: 1
  45020. }, 8, ["icon"]),
  45021. createVNode(unref(ElButton), {
  45022. type: "primary",
  45023. style: { "background-color": "rgb(126, 128, 135)" },
  45024. icon: unref(close_default),
  45025. onClick: _cache[30] || (_cache[30] = ($event) => close())
  45026. }, {
  45027. default: withCtx(() => [
  45028. createTextVNode("\u5173\u95ED")
  45029. ]),
  45030. _: 1
  45031. }, 8, ["icon"])
  45032. ]),
  45033. _: 1
  45034. })
  45035. ])
  45036. ]),
  45037. _: 1
  45038. })
  45039. ]),
  45040. _: 1
  45041. }, 8, ["modelValue", "title"])
  45042. ]);
  45043. };
  45044. }
  45045. };
  45046. var DialogEditProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["styles", [_style_0]]]);
  45047. Cesium.Entity.prototype.setParams = function(params) {
  45048. this._params = params;
  45049. };
  45050. Cesium.Entity.prototype.getParams = function() {
  45051. return this._params;
  45052. };
  45053. Cesium.Entity.prototype.setEntityType = function(entityType) {
  45054. this._entityType = entityType;
  45055. };
  45056. Cesium.Entity.prototype.getEntityType = function(entityType) {
  45057. return this._entityType;
  45058. };
  45059. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  45060. this._isEdit = isEdit;
  45061. };
  45062. Cesium.Entity.prototype.getIsEdit = function() {
  45063. return this._isEdit;
  45064. };
  45065. class DrawPoint {
  45066. constructor(viewer2) {
  45067. if (!viewer2)
  45068. throw new Cesium.DeveloperError("no viewer object!");
  45069. this._viewer = viewer2;
  45070. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  45071. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  45072. this._entities = [];
  45073. this._pointObject = new PointObject(viewer2);
  45074. }
  45075. static initEditPropertyParams() {
  45076. return {
  45077. id: void 0,
  45078. label: {
  45079. text: "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0",
  45080. font: "Helvetica",
  45081. fontSize: 24,
  45082. bolder: false,
  45083. italic: false,
  45084. fillColor: "rgba(0,255,0,0.75)",
  45085. showOutline: false,
  45086. outlineWidth: 0,
  45087. outlineColor: "rgba(255,255,255,1)",
  45088. showBackground: false,
  45089. backgroundPadding: 0,
  45090. backgroundColor: "rgba(255,255,255,1)",
  45091. pixelOffsetX: 0,
  45092. pixelOffsetY: 0
  45093. },
  45094. point: {
  45095. color: "rgba(0,255,0,0.75)",
  45096. pixelSize: 10,
  45097. showOutline: false,
  45098. outlineWidth: 0,
  45099. outlineColor: "rgba(255,255,255,1)"
  45100. },
  45101. billboard: {
  45102. imgUrl: "jt3dSDK/imgs/point/point3.png",
  45103. alpha: 1,
  45104. scale: 1
  45105. },
  45106. model: {
  45107. url: "jt3dSDK/gltf/pyramid.glb",
  45108. alpha: 1,
  45109. showSilhouette: false,
  45110. silhouetteColor: "rgba(255,255,255,1)",
  45111. silhouetteSize: 0,
  45112. minimumPixelSize: 128,
  45113. maximumScale: 2e4,
  45114. heading: 0,
  45115. pitch: 0,
  45116. roll: 0
  45117. }
  45118. };
  45119. }
  45120. _cartesian3ToGeo(position2) {
  45121. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45122. return {
  45123. longitude: Cesium.Math.toDegrees(g.longitude),
  45124. latitude: Cesium.Math.toDegrees(g.latitude),
  45125. height: g.height
  45126. };
  45127. }
  45128. _arcToDegree(arc) {
  45129. return arc / Math.PI * 180;
  45130. }
  45131. _getScreenClickPositionAndHeight(screenPoint) {
  45132. var lng = void 0, lat = void 0, height2 = void 0;
  45133. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  45134. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  45135. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45136. var feature2 = this._viewer.scene.pick(screenPoint);
  45137. if (feature2 == void 0) {
  45138. lng = this._arcToDegree(cartographic.longitude);
  45139. lat = this._arcToDegree(cartographic.latitude);
  45140. height2 = cartographic.height;
  45141. } else {
  45142. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  45143. if (Cesium.defined(cartesian)) {
  45144. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  45145. lng = this._arcToDegree(cartographic.longitude);
  45146. lat = this._arcToDegree(cartographic.latitude);
  45147. height2 = cartographic.height;
  45148. }
  45149. }
  45150. return {
  45151. lng,
  45152. lat,
  45153. height: height2
  45154. };
  45155. }
  45156. _transfromFromScreenPoint(screenPosition) {
  45157. let location = this._getScreenClickPositionAndHeight(screenPosition);
  45158. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  45159. return {
  45160. gLocation: location,
  45161. sLocation: cartesian
  45162. };
  45163. }
  45164. }
  45165. Object.assign(DrawPoint.prototype, {
  45166. _setMousePointerStyle() {
  45167. document.querySelector("body").style.cursor = "crosshair";
  45168. },
  45169. _setMouseDefaultStyle() {
  45170. document.querySelector("body").style.cursor = "default";
  45171. },
  45172. _registerLeftClickEvent(handler, callChange) {
  45173. let _self = this;
  45174. if (!handler)
  45175. return;
  45176. handler.setInputAction(function(event2) {
  45177. _self._lock = true;
  45178. clearTimeout(_self._timer);
  45179. _self._timer = setTimeout(function() {
  45180. if (callChange)
  45181. callChange(event2);
  45182. _self._lock = false;
  45183. }, 200);
  45184. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  45185. },
  45186. _registerMouseMoveEvent(handler, callChange) {
  45187. let _self = this;
  45188. if (!handler)
  45189. return;
  45190. handler.setInputAction(function(event2) {
  45191. if (_self._lock === void 0 || _self._lock === false) {
  45192. if (callChange)
  45193. callChange(event2);
  45194. }
  45195. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45196. },
  45197. _registerLeftDownEvent(handler, callChange) {
  45198. if (!handler)
  45199. return;
  45200. handler.setInputAction(function(event2) {
  45201. if (callChange)
  45202. callChange(event2);
  45203. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45204. },
  45205. _registerLeftUpEvent(handler, callChange) {
  45206. if (!handler)
  45207. return;
  45208. handler.setInputAction(function(event2) {
  45209. if (callChange)
  45210. callChange(event2);
  45211. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  45212. },
  45213. _clearEvent(handler) {
  45214. if (!handler)
  45215. return;
  45216. handler.destroy();
  45217. handler = null;
  45218. }
  45219. });
  45220. Object.assign(DrawPoint.prototype, {
  45221. draw: function(type2, options2) {
  45222. let _self = this;
  45223. _self._unActivateEdit();
  45224. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45225. this._drawType = type2;
  45226. switch (type2) {
  45227. case DrawPoint.DrawType.Model:
  45228. _self._sketchDrawModel(_self._drawEventHandler, options2);
  45229. break;
  45230. case DrawPoint.DrawType.Label:
  45231. _self._sketchDrawLabel(_self._drawEventHandler, options2);
  45232. break;
  45233. case DrawPoint.DrawType.Point:
  45234. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  45235. break;
  45236. case DrawPoint.DrawType.Point2Label:
  45237. _self._sketchDrawPoint2Label(_self._drawEventHandler, options2);
  45238. break;
  45239. case DrawPoint.DrawType.Billboard:
  45240. _self._sketchDrawBillboard(_self._drawEventHandler, options2);
  45241. break;
  45242. case DrawPoint.DrawType.Billboard2Label:
  45243. _self._sketchDrawBillboard2Label(_self._drawEventHandler, options2);
  45244. break;
  45245. }
  45246. },
  45247. clearAll() {
  45248. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45249. var getById = viewer.entities.getById(this._entities[i2]);
  45250. if (getById) {
  45251. this._viewer.entities.remove(getById);
  45252. }
  45253. }
  45254. this._closePropertyEditDialog();
  45255. },
  45256. _sketchDrawLabel(handler, options2) {
  45257. let _self = this;
  45258. this._registerLeftClickEvent(handler, function(event2) {
  45259. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45260. if (!Cesium.defined(loc2.sLocation))
  45261. return;
  45262. let entityParam = DrawPoint.initEditPropertyParams();
  45263. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45264. entityParam.label.pixelOffset = {
  45265. x: entityParam.label.pixelOffsetX,
  45266. y: entityParam.label.pixelOffsetY
  45267. };
  45268. _self._pointObject.addLabel(loc2.sLocation, {
  45269. label: entityParam.label
  45270. }).then((entity) => {
  45271. _self._viewer.entities.add(entity);
  45272. _self._entities.push(entity.id);
  45273. entityParam = DrawPoint.initEditPropertyParams();
  45274. _self._drawEntity = entity;
  45275. _self._drawEntity.setParams(entityParam);
  45276. _self._drawEntity.setEntityType(DrawPoint.DrawType.Label);
  45277. _self._setEntityIsEdit(_self._drawEntity);
  45278. _self._clearEvent(handler);
  45279. if (options2.onComplete)
  45280. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45281. });
  45282. });
  45283. },
  45284. _sketchDrawPoint(handler, options2) {
  45285. let _self = this;
  45286. this._registerLeftClickEvent(handler, function(event2) {
  45287. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45288. if (!Cesium.defined(loc2.sLocation))
  45289. return;
  45290. let entityParam = DrawPoint.initEditPropertyParams();
  45291. _self._pointObject.addPoint(loc2.sLocation, {
  45292. point: entityParam.point
  45293. }).then((entity) => {
  45294. _self._viewer.entities.add(entity);
  45295. _self._entities.push(entity.id);
  45296. entityParam = DrawPoint.initEditPropertyParams();
  45297. _self._drawEntity = entity;
  45298. _self._drawEntity.setParams(entityParam);
  45299. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point);
  45300. _self._setEntityIsEdit(_self._drawEntity);
  45301. _self._clearEvent(handler);
  45302. if (options2.onComplete)
  45303. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45304. });
  45305. });
  45306. },
  45307. _sketchDrawPoint2Label(handler, options2) {
  45308. let _self = this;
  45309. this._registerLeftClickEvent(handler, function(event2) {
  45310. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45311. if (!Cesium.defined(loc2.sLocation))
  45312. return;
  45313. let entityParam = DrawPoint.initEditPropertyParams();
  45314. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45315. entityParam.label.pixelOffset = {
  45316. x: entityParam.label.pixelOffsetX,
  45317. y: entityParam.label.pixelOffsetY - 10
  45318. };
  45319. _self._pointObject.addPoint(loc2.sLocation, {
  45320. point: entityParam.point,
  45321. label: entityParam.label
  45322. }).then((entity) => {
  45323. _self._viewer.entities.add(entity);
  45324. _self._entities.push(entity.id);
  45325. entityParam = DrawPoint.initEditPropertyParams();
  45326. entityParam.label.pixelOffsetY = -10;
  45327. _self._drawEntity = entity;
  45328. _self._drawEntity.setParams(entityParam);
  45329. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point2Label);
  45330. _self._setEntityIsEdit(_self._drawEntity);
  45331. _self._clearEvent(handler);
  45332. if (options2.onComplete)
  45333. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45334. });
  45335. });
  45336. },
  45337. _sketchDrawBillboard(handler, options2) {
  45338. let _self = this;
  45339. this._registerLeftClickEvent(handler, function(event2) {
  45340. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45341. if (!Cesium.defined(loc2.sLocation))
  45342. return;
  45343. let entityParam = DrawPoint.initEditPropertyParams();
  45344. _self._pointObject.addBillboard(loc2.sLocation, {
  45345. billboard: entityParam.billboard
  45346. }).then((entity) => {
  45347. _self._viewer.entities.add(entity);
  45348. _self._entities.push(entity.id);
  45349. entityParam = DrawPoint.initEditPropertyParams();
  45350. entityParam.label.pixelOffsetY = -50;
  45351. _self._drawEntity = entity;
  45352. _self._drawEntity.setParams(entityParam);
  45353. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard);
  45354. _self._setEntityIsEdit(_self._drawEntity);
  45355. _self._clearEvent(handler);
  45356. if (options2.onComplete)
  45357. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45358. });
  45359. });
  45360. },
  45361. _sketchDrawBillboard2Label(handler, options2) {
  45362. let _self = this;
  45363. this._registerLeftClickEvent(handler, function(event2) {
  45364. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45365. if (!Cesium.defined(loc2.sLocation))
  45366. return;
  45367. let entityParam = DrawPoint.initEditPropertyParams();
  45368. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45369. entityParam.label.pixelOffset = {
  45370. x: entityParam.label.pixelOffsetX,
  45371. y: entityParam.label.pixelOffsetY - 50
  45372. };
  45373. _self._pointObject.addBillboard(loc2.sLocation, {
  45374. billboard: entityParam.billboard,
  45375. label: entityParam.label
  45376. }).then((entity) => {
  45377. _self._viewer.entities.add(entity);
  45378. _self._entities.push(entity.id);
  45379. entityParam = DrawPoint.initEditPropertyParams();
  45380. _self._drawEntity = entity;
  45381. _self._drawEntity.setParams(entityParam);
  45382. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard2Label);
  45383. _self._setEntityIsEdit(_self._drawEntity);
  45384. _self._clearEvent(handler);
  45385. if (options2.onComplete)
  45386. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45387. });
  45388. });
  45389. },
  45390. _sketchDrawModel(handler, options2) {
  45391. let _self = this;
  45392. this._registerLeftClickEvent(handler, function(event2) {
  45393. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45394. if (!Cesium.defined(loc2.sLocation))
  45395. return;
  45396. let entityParam = DrawPoint.initEditPropertyParams();
  45397. _self._pointObject.addModel(loc2.sLocation, {
  45398. model: entityParam.model
  45399. }).then((entity) => {
  45400. _self._viewer.entities.add(entity);
  45401. _self._entities.push(entity.id);
  45402. entityParam = DrawPoint.initEditPropertyParams();
  45403. _self._drawEntity = entity;
  45404. _self._drawEntity.setParams(entityParam);
  45405. _self._drawEntity.setEntityType(DrawPoint.DrawType.Model);
  45406. _self._setEntityIsEdit(_self._drawEntity);
  45407. _self._clearEvent(handler);
  45408. if (options2.onComplete)
  45409. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45410. });
  45411. });
  45412. },
  45413. updateEditEntityProperty: function(params) {
  45414. if (this._editEntity === void 0)
  45415. return;
  45416. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  45417. return;
  45418. let editEntityType = this._editEntity.getEntityType();
  45419. if (editEntityType === void 0)
  45420. return;
  45421. if (editEntityType === DrawPoint.DrawType.Label) {
  45422. this._updateLabelProperty(params);
  45423. } else if (editEntityType === DrawPoint.DrawType.Point) {
  45424. this._updatePointProperty(params);
  45425. } else if (editEntityType === DrawPoint.DrawType.Point2Label) {
  45426. this._updatePoint2LabelProperty(params);
  45427. } else if (editEntityType === DrawPoint.DrawType.Billboard) {
  45428. this._updateBillboardProperty(params);
  45429. } else if (editEntityType === DrawPoint.DrawType.Billboard2Label) {
  45430. this._updateBillboard2LabelProperty(params);
  45431. } else if (editEntityType === DrawPoint.DrawType.Model) {
  45432. this._updateModelProperty(params);
  45433. }
  45434. },
  45435. _updateLabelProperty(params) {
  45436. let label2 = params.label;
  45437. this._editEntity.label.text = label2.text;
  45438. let font = "";
  45439. if (label2.italic) {
  45440. font += "italic ";
  45441. }
  45442. if (label2.bolder) {
  45443. font += " bolder ";
  45444. }
  45445. font += label2.fontSize + "px " + label2.font;
  45446. this._editEntity.label.font = font;
  45447. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label2.fillColor);
  45448. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label2.outlineColor);
  45449. this._editEntity.label.outlineWidth = parseFloat(label2.outlineWidth);
  45450. this._editEntity.label.showBackground = label2.showBackground;
  45451. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label2.backgroundColor);
  45452. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label2.backgroundPadding), parseFloat(label2.backgroundPadding));
  45453. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label2.pixelOffsetX), parseFloat(label2.pixelOffsetY));
  45454. this._editEntity.setParams(params);
  45455. },
  45456. _updatePointProperty(params) {
  45457. let point2 = params.point;
  45458. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45459. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45460. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45461. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45462. this._editEntity.setParams(params);
  45463. },
  45464. _updatePoint2LabelProperty(params) {
  45465. let label2 = params.label;
  45466. this._editEntity.label.text = label2.text;
  45467. let font = "";
  45468. if (label2.italic) {
  45469. font += "italic ";
  45470. }
  45471. if (label2.bolder) {
  45472. font += " bolder ";
  45473. }
  45474. font += label2.fontSize + "px " + label2.font;
  45475. this._editEntity.label.font = font;
  45476. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label2.fillColor);
  45477. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label2.outlineColor);
  45478. this._editEntity.label.outlineWidth = parseFloat(label2.outlineWidth);
  45479. this._editEntity.label.showBackground = label2.showBackground;
  45480. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label2.backgroundColor);
  45481. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label2.backgroundPadding), parseFloat(label2.backgroundPadding));
  45482. let point2 = params.point;
  45483. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45484. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45485. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45486. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45487. this._editEntity.setParams(params);
  45488. },
  45489. _updateBillboardProperty(params) {
  45490. let billboard = params.billboard;
  45491. this._editEntity.billboard.image = billboard.imgUrl;
  45492. this._editEntity.billboard.scale = billboard.scale;
  45493. this._editEntity.setParams(params);
  45494. },
  45495. _updateBillboard2LabelProperty(params) {
  45496. let label2 = params.label;
  45497. this._editEntity.label.text = label2.text;
  45498. let font = "";
  45499. if (label2.italic) {
  45500. font += "italic ";
  45501. }
  45502. if (label2.bolder) {
  45503. font += " bolder ";
  45504. }
  45505. font += label2.fontSize + "px " + label2.font;
  45506. this._editEntity.label.font = font;
  45507. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label2.fillColor);
  45508. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label2.outlineColor);
  45509. this._editEntity.label.outlineWidth = parseFloat(label2.outlineWidth);
  45510. this._editEntity.label.showBackground = label2.showBackground;
  45511. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label2.backgroundColor);
  45512. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label2.backgroundPadding), parseFloat(label2.backgroundPadding));
  45513. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label2.pixelOffsetX), parseFloat(label2.pixelOffsetY));
  45514. let billboard = params.billboard;
  45515. this._editEntity.billboard.image = billboard.imgUrl;
  45516. this._editEntity.billboard.scale = billboard.scale;
  45517. this._editEntity.setParams(params);
  45518. }
  45519. });
  45520. Object.assign(DrawPoint.prototype, {
  45521. _setEntityIsEdit(entity) {
  45522. let _self = this;
  45523. this._unActivateEdit();
  45524. entity.setIsEdit(true);
  45525. this._sendShowPropertyDialog(entity);
  45526. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45527. this._registerLeftClickEvent(handler, function(event2) {
  45528. _self._unActivateEdit();
  45529. let feature2 = _self._viewer.scene.pick(event2.position);
  45530. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45531. let editEntityType = feature2.id.getEntityType();
  45532. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45533. feature2.id.setIsEdit(true);
  45534. _self._sendShowPropertyDialog(feature2.id);
  45535. }
  45536. }
  45537. });
  45538. this._registerMouseMoveEvent(handler, function(event2) {
  45539. let toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45540. let feature2 = _self._viewer.scene.pick(event2.endPosition);
  45541. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45542. let editEntityType = feature2.id.getEntityType();
  45543. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45544. if (feature2.id.getIsEdit()) {
  45545. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45546. CreateRemindertip(toolTip, event2.endPosition, true);
  45547. } else {
  45548. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027";
  45549. CreateRemindertip(toolTip, event2.endPosition, true);
  45550. }
  45551. }
  45552. } else {
  45553. CreateRemindertip(toolTip, event2.endPosition, false);
  45554. }
  45555. });
  45556. },
  45557. _unActivateEdit: function() {
  45558. if (this._sketchEditHandler != void 0) {
  45559. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45560. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45561. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45562. }
  45563. this._editEntity = void 0;
  45564. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45565. var getById = this._viewer.entities.getById(this._entities[i2]);
  45566. if (getById) {
  45567. getById.setIsEdit(false);
  45568. }
  45569. }
  45570. this._closePropertyEditDialog();
  45571. },
  45572. _sendShowPropertyDialog(entity) {
  45573. let _self = this;
  45574. let editEntityType = entity.getEntityType();
  45575. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  45576. this._unActivateEdit();
  45577. return;
  45578. }
  45579. let editProperty = entity.getParams();
  45580. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  45581. editProperty.id = editEntityType;
  45582. _self._openPropertyEditDialog(
  45583. editProperty,
  45584. function(params) {
  45585. _self.updateEditEntityProperty(params);
  45586. },
  45587. function() {
  45588. _self._viewer.entities.remove(entity);
  45589. _self._editEntity = void 0;
  45590. }
  45591. );
  45592. }
  45593. this._activeteNormalEdit(entity);
  45594. },
  45595. _activeteNormalEdit: function(editEntity) {
  45596. let _self = this;
  45597. editEntity.getEntityType();
  45598. this._editEntity = editEntity;
  45599. if (this._sketchEditHandler === void 0) {
  45600. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45601. }
  45602. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  45603. const pickInfo = _self._viewer.scene.pick(event2.position);
  45604. console.log(pickInfo);
  45605. if (!pickInfo) {
  45606. return;
  45607. }
  45608. console.log("\u6309\u4E0B");
  45609. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  45610. _self._registerMouseMoveEvent(_self._sketchEditHandler, function(event3) {
  45611. console.log("\u79FB\u52A8");
  45612. const position2 = event3.endPosition;
  45613. const cartesian = _self._viewer.scene.globe.pick(_self._viewer.camera.getPickRay(position2), _self._viewer.scene);
  45614. const selectedEntity = _self._editEntity;
  45615. if (!selectedEntity) {
  45616. return false;
  45617. }
  45618. selectedEntity.position = cartesian;
  45619. });
  45620. _self._registerLeftUpEvent(_self._sketchEditHandler, function(event3) {
  45621. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45622. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45623. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  45624. console.log("\u62AC\u8D77");
  45625. });
  45626. });
  45627. },
  45628. _updateModelProperty(params) {
  45629. let model = params.model;
  45630. this._editEntity.model.uri = model.url;
  45631. this._editEntity.model.color = Cesium.Color.WHITE.withAlpha(model.alpha);
  45632. this._editEntity.model.minimumPixelSize = model.minimumPixelSize;
  45633. this._editEntity.model.maximumScale = model.maximumScale;
  45634. this._editEntity.model.silhouetteSize = model.silhouetteSize;
  45635. this._editEntity.model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  45636. var heading = Cesium.Math.toRadians(model.heading);
  45637. var pitch = model.pitch;
  45638. var roll = model.roll;
  45639. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  45640. this._editEntity.setParams(params);
  45641. }
  45642. });
  45643. Object.assign(DrawPoint.prototype, {
  45644. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  45645. this._editPropertyDialogDomId = "dialog-property-dom-point";
  45646. this._registerDOMPropertyEdit = "dialog-edit-property-point";
  45647. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  45648. if (PropertyEditComponent === void 0) {
  45649. PropertyEditComponent = defineCustomElement(DialogEditProperty);
  45650. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  45651. }
  45652. this._closePropertyEditDialog();
  45653. let dialogPropertyElement = new PropertyEditComponent({
  45654. params
  45655. });
  45656. dialogPropertyElement.id = this._editPropertyDialogDomId;
  45657. dialogPropertyElement.showDialog = true;
  45658. document.body.appendChild(dialogPropertyElement);
  45659. dialogPropertyElement.addEventListener(
  45660. "submit",
  45661. (e) => {
  45662. if (callEdit)
  45663. callEdit(e.detail[0]);
  45664. },
  45665. false
  45666. );
  45667. dialogPropertyElement.addEventListener(
  45668. "remove",
  45669. (e) => {
  45670. if (callRemove)
  45671. callRemove();
  45672. },
  45673. false
  45674. );
  45675. },
  45676. _closePropertyEditDialog() {
  45677. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  45678. if (dom2 !== null && dom2 !== void 0) {
  45679. document.body.removeChild(dom2);
  45680. }
  45681. }
  45682. });
  45683. DrawPoint.DrawType = Object.freeze({
  45684. Model: "model",
  45685. Label: "label",
  45686. Point: "point",
  45687. Point2Label: "point2Label",
  45688. Billboard: "billboard",
  45689. Billboard2Label: "billboard2Label"
  45690. });
  45691. var MultiFieldAdaptWindow$1 = "";
  45692. class MultiFieldAdaptWindow {
  45693. constructor(viewer2, position2, title, properties, offsetHeight) {
  45694. if (!viewer2)
  45695. throw new Cesium.DeveloperError("no viewer object!");
  45696. if (!position2)
  45697. throw new Cesium.DeveloperError("no position object!");
  45698. this.viewer = viewer2;
  45699. this.position = position2;
  45700. this.offsetHeight = offsetHeight;
  45701. if (position2 instanceof Cesium.Cartesian3) {
  45702. this.position = position2;
  45703. } else {
  45704. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  45705. }
  45706. if (document.getElementsByClassName("MultiField-popup").length > 0) {
  45707. document.getElementsByClassName("MultiField-popup")[0].remove();
  45708. viewer2.entities.remove(viewer2.entities.getById("MultiFieldPopupPoint"));
  45709. }
  45710. this.id = "popup_" + getGuid();
  45711. this.popupDiv = document.createElement("div");
  45712. this.popupDiv.classList.add("MultiField-popup");
  45713. this.popupDiv.id = this.id;
  45714. this.viewer.container.append(this.popupDiv);
  45715. this.popupDiv.innerHTML = this._createHtml(title, properties);
  45716. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  45717. this.initPoint();
  45718. document.getElementsByClassName("leaflet-popup-close-button")[0].onclick = () => {
  45719. this.close();
  45720. };
  45721. }
  45722. postRender() {
  45723. this.viewer.scene.canvas.height;
  45724. const windowPosition = new Cesium.Cartesian2();
  45725. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  45726. this.viewer.scene,
  45727. this.position,
  45728. windowPosition
  45729. );
  45730. let elWidth = this.popupDiv.offsetWidth;
  45731. let elHeight = this.popupDiv.offsetHeight;
  45732. if (!!this.offsetHeight) {
  45733. elHeight += this.offsetHeight;
  45734. }
  45735. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  45736. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  45737. const camerPosition = this.viewer.camera.position;
  45738. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  45739. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  45740. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  45741. this.popupDiv.style.display = "block";
  45742. } else {
  45743. this.popupDiv.style.display = "none";
  45744. }
  45745. }
  45746. _createHtml(header, content) {
  45747. let html = `
  45748. <div class="MultiField-popup-header">
  45749. ` + header + `
  45750. <span class="leaflet-popup-close-button">\xD7</span>
  45751. </div>
  45752. <div class="MultiField-popup-content">
  45753. ` + this._createTable(content) + `
  45754. </div>
  45755. <div class="MultiField-popup-tip">
  45756. </div>
  45757. `;
  45758. return html;
  45759. }
  45760. _createTable(content) {
  45761. let html = '<table class="table-popup">';
  45762. for (let key in content) {
  45763. html += `<tr><td class="title-popup">${key}</td>
  45764. <td class="value-popup">${content[key]}</td></tr>`;
  45765. }
  45766. html += "</table>";
  45767. return html;
  45768. }
  45769. initPoint() {
  45770. this.billboard = new Cesium.Entity({
  45771. id: "MultiFieldPopupPoint",
  45772. name: "popupPoint",
  45773. position: this.position,
  45774. billboard: {
  45775. image: "jt3dSDK/imgs/point/point.png",
  45776. horizontalOrigin: Cesium.HorizontalOrigin.center,
  45777. verticalOrigin: Cesium.VerticalOrigin.bottom,
  45778. scale: 1,
  45779. pixelOffset: new Cesium.Cartesian2(0, 0),
  45780. disableDepthTestDistance: Number.POSITIVE_INFINITY
  45781. }
  45782. });
  45783. this.viewer.entities.add(this.billboard);
  45784. }
  45785. }
  45786. Object.assign(MultiFieldAdaptWindow.prototype, {
  45787. close() {
  45788. this.popupDiv.remove();
  45789. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  45790. this.viewer.entities.remove(this.billboard);
  45791. }
  45792. });
  45793. var win;
  45794. if (typeof window !== "undefined") {
  45795. win = window;
  45796. } else if (typeof commonjsGlobal !== "undefined") {
  45797. win = commonjsGlobal;
  45798. } else if (typeof self !== "undefined") {
  45799. win = self;
  45800. } else {
  45801. win = {};
  45802. }
  45803. var window_1 = win;
  45804. var __viteBrowserExternal = {};
  45805. var __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45806. __proto__: null,
  45807. "default": __viteBrowserExternal
  45808. }, Symbol.toStringTag, { value: "Module" }));
  45809. var require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
  45810. var topLevel = typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : {};
  45811. var minDoc = require$$0;
  45812. var doccy;
  45813. if (typeof document !== "undefined") {
  45814. doccy = document;
  45815. } else {
  45816. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"];
  45817. if (!doccy) {
  45818. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"] = minDoc;
  45819. }
  45820. }
  45821. var document_1 = doccy;
  45822. var keycode$1 = { exports: {} };
  45823. (function(module2, exports2) {
  45824. function keyCode(searchInput) {
  45825. if (searchInput && "object" === typeof searchInput) {
  45826. var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
  45827. if (hasKeyCode)
  45828. searchInput = hasKeyCode;
  45829. }
  45830. if ("number" === typeof searchInput)
  45831. return names2[searchInput];
  45832. var search = String(searchInput);
  45833. var foundNamedKey = codes[search.toLowerCase()];
  45834. if (foundNamedKey)
  45835. return foundNamedKey;
  45836. var foundNamedKey = aliases[search.toLowerCase()];
  45837. if (foundNamedKey)
  45838. return foundNamedKey;
  45839. if (search.length === 1)
  45840. return search.charCodeAt(0);
  45841. return void 0;
  45842. }
  45843. keyCode.isEventKey = function isEventKey(event2, nameOrCode) {
  45844. if (event2 && "object" === typeof event2) {
  45845. var keyCode2 = event2.which || event2.keyCode || event2.charCode;
  45846. if (keyCode2 === null || keyCode2 === void 0) {
  45847. return false;
  45848. }
  45849. if (typeof nameOrCode === "string") {
  45850. var foundNamedKey = codes[nameOrCode.toLowerCase()];
  45851. if (foundNamedKey) {
  45852. return foundNamedKey === keyCode2;
  45853. }
  45854. var foundNamedKey = aliases[nameOrCode.toLowerCase()];
  45855. if (foundNamedKey) {
  45856. return foundNamedKey === keyCode2;
  45857. }
  45858. } else if (typeof nameOrCode === "number") {
  45859. return nameOrCode === keyCode2;
  45860. }
  45861. return false;
  45862. }
  45863. };
  45864. exports2 = module2.exports = keyCode;
  45865. var codes = exports2.code = exports2.codes = {
  45866. "backspace": 8,
  45867. "tab": 9,
  45868. "enter": 13,
  45869. "shift": 16,
  45870. "ctrl": 17,
  45871. "alt": 18,
  45872. "pause/break": 19,
  45873. "caps lock": 20,
  45874. "esc": 27,
  45875. "space": 32,
  45876. "page up": 33,
  45877. "page down": 34,
  45878. "end": 35,
  45879. "home": 36,
  45880. "left": 37,
  45881. "up": 38,
  45882. "right": 39,
  45883. "down": 40,
  45884. "insert": 45,
  45885. "delete": 46,
  45886. "command": 91,
  45887. "left command": 91,
  45888. "right command": 93,
  45889. "numpad *": 106,
  45890. "numpad +": 107,
  45891. "numpad -": 109,
  45892. "numpad .": 110,
  45893. "numpad /": 111,
  45894. "num lock": 144,
  45895. "scroll lock": 145,
  45896. "my computer": 182,
  45897. "my calculator": 183,
  45898. ";": 186,
  45899. "=": 187,
  45900. ",": 188,
  45901. "-": 189,
  45902. ".": 190,
  45903. "/": 191,
  45904. "`": 192,
  45905. "[": 219,
  45906. "\\": 220,
  45907. "]": 221,
  45908. "'": 222
  45909. };
  45910. var aliases = exports2.aliases = {
  45911. "windows": 91,
  45912. "\u21E7": 16,
  45913. "\u2325": 18,
  45914. "\u2303": 17,
  45915. "\u2318": 91,
  45916. "ctl": 17,
  45917. "control": 17,
  45918. "option": 18,
  45919. "pause": 19,
  45920. "break": 19,
  45921. "caps": 20,
  45922. "return": 13,
  45923. "escape": 27,
  45924. "spc": 32,
  45925. "spacebar": 32,
  45926. "pgup": 33,
  45927. "pgdn": 34,
  45928. "ins": 45,
  45929. "del": 46,
  45930. "cmd": 91
  45931. };
  45932. /*!
  45933. * Programatically add the following
  45934. */
  45935. for (i2 = 97; i2 < 123; i2++)
  45936. codes[String.fromCharCode(i2)] = i2 - 32;
  45937. for (var i2 = 48; i2 < 58; i2++)
  45938. codes[i2 - 48] = i2;
  45939. for (i2 = 1; i2 < 13; i2++)
  45940. codes["f" + i2] = i2 + 111;
  45941. for (i2 = 0; i2 < 10; i2++)
  45942. codes["numpad " + i2] = i2 + 96;
  45943. var names2 = exports2.names = exports2.title = {};
  45944. for (i2 in codes)
  45945. names2[codes[i2]] = i2;
  45946. for (var alias in aliases) {
  45947. codes[alias] = aliases[alias];
  45948. }
  45949. })(keycode$1, keycode$1.exports);
  45950. var keycode = keycode$1.exports;
  45951. var tuple = SafeParseTuple;
  45952. function SafeParseTuple(obj, reviver) {
  45953. var json;
  45954. var error = null;
  45955. try {
  45956. json = JSON.parse(obj, reviver);
  45957. } catch (err) {
  45958. error = err;
  45959. }
  45960. return [error, json];
  45961. }
  45962. var lib = { exports: {} };
  45963. function _extends$2() {
  45964. _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
  45965. for (var i2 = 1; i2 < arguments.length; i2++) {
  45966. var source = arguments[i2];
  45967. for (var key in source) {
  45968. if (Object.prototype.hasOwnProperty.call(source, key)) {
  45969. target[key] = source[key];
  45970. }
  45971. }
  45972. }
  45973. return target;
  45974. };
  45975. return _extends$2.apply(this, arguments);
  45976. }
  45977. var _extends$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45978. __proto__: null,
  45979. "default": _extends$2
  45980. }, Symbol.toStringTag, { value: "Module" }));
  45981. var require$$1 = /* @__PURE__ */ getAugmentedNamespace(_extends$3);
  45982. var isFunction_1 = isFunction$1;
  45983. var toString$2 = Object.prototype.toString;
  45984. function isFunction$1(fn2) {
  45985. if (!fn2) {
  45986. return false;
  45987. }
  45988. var string = toString$2.call(fn2);
  45989. return string === "[object Function]" || typeof fn2 === "function" && string !== "[object RegExp]" || typeof window !== "undefined" && (fn2 === window.setTimeout || fn2 === window.alert || fn2 === window.confirm || fn2 === window.prompt);
  45990. }
  45991. var window$3 = window_1;
  45992. var httpResponseHandler = function httpResponseHandler2(callback2, decodeResponseBody) {
  45993. if (decodeResponseBody === void 0) {
  45994. decodeResponseBody = false;
  45995. }
  45996. return function(err, response, responseBody) {
  45997. if (err) {
  45998. callback2(err);
  45999. return;
  46000. }
  46001. if (response.statusCode >= 400 && response.statusCode <= 599) {
  46002. var cause = responseBody;
  46003. if (decodeResponseBody) {
  46004. if (window$3.TextDecoder) {
  46005. var charset = getCharset(response.headers && response.headers["content-type"]);
  46006. try {
  46007. cause = new TextDecoder(charset).decode(responseBody);
  46008. } catch (e) {
  46009. }
  46010. } else {
  46011. cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));
  46012. }
  46013. }
  46014. callback2({
  46015. cause
  46016. });
  46017. return;
  46018. }
  46019. callback2(null, responseBody);
  46020. };
  46021. };
  46022. function getCharset(contentTypeHeader) {
  46023. if (contentTypeHeader === void 0) {
  46024. contentTypeHeader = "";
  46025. }
  46026. return contentTypeHeader.toLowerCase().split(";").reduce(function(charset, contentType) {
  46027. var _contentType$split = contentType.split("="), type2 = _contentType$split[0], value = _contentType$split[1];
  46028. if (type2.trim() === "charset") {
  46029. return value.trim();
  46030. }
  46031. return charset;
  46032. }, "utf-8");
  46033. }
  46034. var httpHandler = httpResponseHandler;
  46035. var window$2 = window_1;
  46036. var _extends$1 = require$$1;
  46037. var isFunction = isFunction_1;
  46038. createXHR.httpHandler = httpHandler;
  46039. /**
  46040. * @license
  46041. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  46042. * Copyright (c) 2014 David Björklund
  46043. * Available under the MIT license
  46044. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  46045. */
  46046. var parseHeaders = function parseHeaders2(headers) {
  46047. var result = {};
  46048. if (!headers) {
  46049. return result;
  46050. }
  46051. headers.trim().split("\n").forEach(function(row) {
  46052. var index2 = row.indexOf(":");
  46053. var key = row.slice(0, index2).trim().toLowerCase();
  46054. var value = row.slice(index2 + 1).trim();
  46055. if (typeof result[key] === "undefined") {
  46056. result[key] = value;
  46057. } else if (Array.isArray(result[key])) {
  46058. result[key].push(value);
  46059. } else {
  46060. result[key] = [result[key], value];
  46061. }
  46062. });
  46063. return result;
  46064. };
  46065. lib.exports = createXHR;
  46066. lib.exports.default = createXHR;
  46067. createXHR.XMLHttpRequest = window$2.XMLHttpRequest || noop$2;
  46068. createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window$2.XDomainRequest;
  46069. forEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) {
  46070. createXHR[method === "delete" ? "del" : method] = function(uri, options2, callback2) {
  46071. options2 = initParams(uri, options2, callback2);
  46072. options2.method = method.toUpperCase();
  46073. return _createXHR(options2);
  46074. };
  46075. });
  46076. function forEachArray(array, iterator) {
  46077. for (var i2 = 0; i2 < array.length; i2++) {
  46078. iterator(array[i2]);
  46079. }
  46080. }
  46081. function isEmpty(obj) {
  46082. for (var i2 in obj) {
  46083. if (obj.hasOwnProperty(i2))
  46084. return false;
  46085. }
  46086. return true;
  46087. }
  46088. function initParams(uri, options2, callback2) {
  46089. var params = uri;
  46090. if (isFunction(options2)) {
  46091. callback2 = options2;
  46092. if (typeof uri === "string") {
  46093. params = {
  46094. uri
  46095. };
  46096. }
  46097. } else {
  46098. params = _extends$1({}, options2, {
  46099. uri
  46100. });
  46101. }
  46102. params.callback = callback2;
  46103. return params;
  46104. }
  46105. function createXHR(uri, options2, callback2) {
  46106. options2 = initParams(uri, options2, callback2);
  46107. return _createXHR(options2);
  46108. }
  46109. function _createXHR(options2) {
  46110. if (typeof options2.callback === "undefined") {
  46111. throw new Error("callback argument missing");
  46112. }
  46113. var called = false;
  46114. var callback2 = function cbOnce(err, response, body2) {
  46115. if (!called) {
  46116. called = true;
  46117. options2.callback(err, response, body2);
  46118. }
  46119. };
  46120. function readystatechange() {
  46121. if (xhr.readyState === 4) {
  46122. setTimeout(loadFunc, 0);
  46123. }
  46124. }
  46125. function getBody() {
  46126. var body2 = void 0;
  46127. if (xhr.response) {
  46128. body2 = xhr.response;
  46129. } else {
  46130. body2 = xhr.responseText || getXml(xhr);
  46131. }
  46132. if (isJson) {
  46133. try {
  46134. body2 = JSON.parse(body2);
  46135. } catch (e) {
  46136. }
  46137. }
  46138. return body2;
  46139. }
  46140. function errorFunc(evt) {
  46141. clearTimeout(timeoutTimer);
  46142. if (!(evt instanceof Error)) {
  46143. evt = new Error("" + (evt || "Unknown XMLHttpRequest Error"));
  46144. }
  46145. evt.statusCode = 0;
  46146. return callback2(evt, failureResponse);
  46147. }
  46148. function loadFunc() {
  46149. if (aborted)
  46150. return;
  46151. var status;
  46152. clearTimeout(timeoutTimer);
  46153. if (options2.useXDR && xhr.status === void 0) {
  46154. status = 200;
  46155. } else {
  46156. status = xhr.status === 1223 ? 204 : xhr.status;
  46157. }
  46158. var response = failureResponse;
  46159. var err = null;
  46160. if (status !== 0) {
  46161. response = {
  46162. body: getBody(),
  46163. statusCode: status,
  46164. method,
  46165. headers: {},
  46166. url: uri,
  46167. rawRequest: xhr
  46168. };
  46169. if (xhr.getAllResponseHeaders) {
  46170. response.headers = parseHeaders(xhr.getAllResponseHeaders());
  46171. }
  46172. } else {
  46173. err = new Error("Internal XMLHttpRequest Error");
  46174. }
  46175. return callback2(err, response, response.body);
  46176. }
  46177. var xhr = options2.xhr || null;
  46178. if (!xhr) {
  46179. if (options2.cors || options2.useXDR) {
  46180. xhr = new createXHR.XDomainRequest();
  46181. } else {
  46182. xhr = new createXHR.XMLHttpRequest();
  46183. }
  46184. }
  46185. var key;
  46186. var aborted;
  46187. var uri = xhr.url = options2.uri || options2.url;
  46188. var method = xhr.method = options2.method || "GET";
  46189. var body = options2.body || options2.data;
  46190. var headers = xhr.headers = options2.headers || {};
  46191. var sync = !!options2.sync;
  46192. var isJson = false;
  46193. var timeoutTimer;
  46194. var failureResponse = {
  46195. body: void 0,
  46196. headers: {},
  46197. statusCode: 0,
  46198. method,
  46199. url: uri,
  46200. rawRequest: xhr
  46201. };
  46202. if ("json" in options2 && options2.json !== false) {
  46203. isJson = true;
  46204. headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json");
  46205. if (method !== "GET" && method !== "HEAD") {
  46206. headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json");
  46207. body = JSON.stringify(options2.json === true ? body : options2.json);
  46208. }
  46209. }
  46210. xhr.onreadystatechange = readystatechange;
  46211. xhr.onload = loadFunc;
  46212. xhr.onerror = errorFunc;
  46213. xhr.onprogress = function() {
  46214. };
  46215. xhr.onabort = function() {
  46216. aborted = true;
  46217. };
  46218. xhr.ontimeout = errorFunc;
  46219. xhr.open(method, uri, !sync, options2.username, options2.password);
  46220. if (!sync) {
  46221. xhr.withCredentials = !!options2.withCredentials;
  46222. }
  46223. if (!sync && options2.timeout > 0) {
  46224. timeoutTimer = setTimeout(function() {
  46225. if (aborted)
  46226. return;
  46227. aborted = true;
  46228. xhr.abort("timeout");
  46229. var e = new Error("XMLHttpRequest timeout");
  46230. e.code = "ETIMEDOUT";
  46231. errorFunc(e);
  46232. }, options2.timeout);
  46233. }
  46234. if (xhr.setRequestHeader) {
  46235. for (key in headers) {
  46236. if (headers.hasOwnProperty(key)) {
  46237. xhr.setRequestHeader(key, headers[key]);
  46238. }
  46239. }
  46240. } else if (options2.headers && !isEmpty(options2.headers)) {
  46241. throw new Error("Headers cannot be set on an XDomainRequest object");
  46242. }
  46243. if ("responseType" in options2) {
  46244. xhr.responseType = options2.responseType;
  46245. }
  46246. if ("beforeSend" in options2 && typeof options2.beforeSend === "function") {
  46247. options2.beforeSend(xhr);
  46248. }
  46249. xhr.send(body || null);
  46250. return xhr;
  46251. }
  46252. function getXml(xhr) {
  46253. try {
  46254. if (xhr.responseType === "document") {
  46255. return xhr.responseXML;
  46256. }
  46257. var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror";
  46258. if (xhr.responseType === "" && !firefoxBugTakenEffect) {
  46259. return xhr.responseXML;
  46260. }
  46261. } catch (e) {
  46262. }
  46263. return null;
  46264. }
  46265. function noop$2() {
  46266. }
  46267. var XHR = lib.exports;
  46268. var browserIndex = { exports: {} };
  46269. var document$1 = document_1;
  46270. var _objCreate = Object.create || function() {
  46271. function F() {
  46272. }
  46273. return function(o) {
  46274. if (arguments.length !== 1) {
  46275. throw new Error("Object.create shim only accepts one parameter.");
  46276. }
  46277. F.prototype = o;
  46278. return new F();
  46279. };
  46280. }();
  46281. function ParsingError(errorData, message) {
  46282. this.name = "ParsingError";
  46283. this.code = errorData.code;
  46284. this.message = message || errorData.message;
  46285. }
  46286. ParsingError.prototype = _objCreate(Error.prototype);
  46287. ParsingError.prototype.constructor = ParsingError;
  46288. ParsingError.Errors = {
  46289. BadSignature: {
  46290. code: 0,
  46291. message: "Malformed WebVTT signature."
  46292. },
  46293. BadTimeStamp: {
  46294. code: 1,
  46295. message: "Malformed time stamp."
  46296. }
  46297. };
  46298. function parseTimeStamp(input) {
  46299. function computeSeconds(h2, m2, s, f) {
  46300. return (h2 | 0) * 3600 + (m2 | 0) * 60 + (s | 0) + (f | 0) / 1e3;
  46301. }
  46302. var m = input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
  46303. if (!m) {
  46304. return null;
  46305. }
  46306. if (m[3]) {
  46307. return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]);
  46308. } else if (m[1] > 59) {
  46309. return computeSeconds(m[1], m[2], 0, m[4]);
  46310. } else {
  46311. return computeSeconds(0, m[1], m[2], m[4]);
  46312. }
  46313. }
  46314. function Settings() {
  46315. this.values = _objCreate(null);
  46316. }
  46317. Settings.prototype = {
  46318. set: function(k, v) {
  46319. if (!this.get(k) && v !== "") {
  46320. this.values[k] = v;
  46321. }
  46322. },
  46323. get: function(k, dflt, defaultKey) {
  46324. if (defaultKey) {
  46325. return this.has(k) ? this.values[k] : dflt[defaultKey];
  46326. }
  46327. return this.has(k) ? this.values[k] : dflt;
  46328. },
  46329. has: function(k) {
  46330. return k in this.values;
  46331. },
  46332. alt: function(k, v, a) {
  46333. for (var n = 0; n < a.length; ++n) {
  46334. if (v === a[n]) {
  46335. this.set(k, v);
  46336. break;
  46337. }
  46338. }
  46339. },
  46340. integer: function(k, v) {
  46341. if (/^-?\d+$/.test(v)) {
  46342. this.set(k, parseInt(v, 10));
  46343. }
  46344. },
  46345. percent: function(k, v) {
  46346. if (v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) {
  46347. v = parseFloat(v);
  46348. if (v >= 0 && v <= 100) {
  46349. this.set(k, v);
  46350. return true;
  46351. }
  46352. }
  46353. return false;
  46354. }
  46355. };
  46356. function parseOptions(input, callback2, keyValueDelim, groupDelim) {
  46357. var groups = groupDelim ? input.split(groupDelim) : [input];
  46358. for (var i2 in groups) {
  46359. if (typeof groups[i2] !== "string") {
  46360. continue;
  46361. }
  46362. var kv = groups[i2].split(keyValueDelim);
  46363. if (kv.length !== 2) {
  46364. continue;
  46365. }
  46366. var k = kv[0].trim();
  46367. var v = kv[1].trim();
  46368. callback2(k, v);
  46369. }
  46370. }
  46371. function parseCue(input, cue, regionList) {
  46372. var oInput = input;
  46373. function consumeTimeStamp() {
  46374. var ts3 = parseTimeStamp(input);
  46375. if (ts3 === null) {
  46376. throw new ParsingError(
  46377. ParsingError.Errors.BadTimeStamp,
  46378. "Malformed timestamp: " + oInput
  46379. );
  46380. }
  46381. input = input.replace(/^[^\sa-zA-Z-]+/, "");
  46382. return ts3;
  46383. }
  46384. function consumeCueSettings(input2, cue2) {
  46385. var settings = new Settings();
  46386. parseOptions(input2, function(k, v) {
  46387. switch (k) {
  46388. case "region":
  46389. for (var i2 = regionList.length - 1; i2 >= 0; i2--) {
  46390. if (regionList[i2].id === v) {
  46391. settings.set(k, regionList[i2].region);
  46392. break;
  46393. }
  46394. }
  46395. break;
  46396. case "vertical":
  46397. settings.alt(k, v, ["rl", "lr"]);
  46398. break;
  46399. case "line":
  46400. var vals = v.split(","), vals0 = vals[0];
  46401. settings.integer(k, vals0);
  46402. settings.percent(k, vals0) ? settings.set("snapToLines", false) : null;
  46403. settings.alt(k, vals0, ["auto"]);
  46404. if (vals.length === 2) {
  46405. settings.alt("lineAlign", vals[1], ["start", "center", "end"]);
  46406. }
  46407. break;
  46408. case "position":
  46409. vals = v.split(",");
  46410. settings.percent(k, vals[0]);
  46411. if (vals.length === 2) {
  46412. settings.alt("positionAlign", vals[1], ["start", "center", "end"]);
  46413. }
  46414. break;
  46415. case "size":
  46416. settings.percent(k, v);
  46417. break;
  46418. case "align":
  46419. settings.alt(k, v, ["start", "center", "end", "left", "right"]);
  46420. break;
  46421. }
  46422. }, /:/, /\s/);
  46423. cue2.region = settings.get("region", null);
  46424. cue2.vertical = settings.get("vertical", "");
  46425. try {
  46426. cue2.line = settings.get("line", "auto");
  46427. } catch (e) {
  46428. }
  46429. cue2.lineAlign = settings.get("lineAlign", "start");
  46430. cue2.snapToLines = settings.get("snapToLines", true);
  46431. cue2.size = settings.get("size", 100);
  46432. try {
  46433. cue2.align = settings.get("align", "center");
  46434. } catch (e) {
  46435. cue2.align = settings.get("align", "middle");
  46436. }
  46437. try {
  46438. cue2.position = settings.get("position", "auto");
  46439. } catch (e) {
  46440. cue2.position = settings.get("position", {
  46441. start: 0,
  46442. left: 0,
  46443. center: 50,
  46444. middle: 50,
  46445. end: 100,
  46446. right: 100
  46447. }, cue2.align);
  46448. }
  46449. cue2.positionAlign = settings.get("positionAlign", {
  46450. start: "start",
  46451. left: "start",
  46452. center: "center",
  46453. middle: "center",
  46454. end: "end",
  46455. right: "end"
  46456. }, cue2.align);
  46457. }
  46458. function skipWhitespace() {
  46459. input = input.replace(/^\s+/, "");
  46460. }
  46461. skipWhitespace();
  46462. cue.startTime = consumeTimeStamp();
  46463. skipWhitespace();
  46464. if (input.substr(0, 3) !== "-->") {
  46465. throw new ParsingError(
  46466. ParsingError.Errors.BadTimeStamp,
  46467. "Malformed time stamp (time stamps must be separated by '-->'): " + oInput
  46468. );
  46469. }
  46470. input = input.substr(3);
  46471. skipWhitespace();
  46472. cue.endTime = consumeTimeStamp();
  46473. skipWhitespace();
  46474. consumeCueSettings(input, cue);
  46475. }
  46476. var TEXTAREA_ELEMENT = document$1.createElement && document$1.createElement("textarea");
  46477. var TAG_NAME = {
  46478. c: "span",
  46479. i: "i",
  46480. b: "b",
  46481. u: "u",
  46482. ruby: "ruby",
  46483. rt: "rt",
  46484. v: "span",
  46485. lang: "span"
  46486. };
  46487. var DEFAULT_COLOR_CLASS = {
  46488. white: "rgba(255,255,255,1)",
  46489. lime: "rgba(0,255,0,1)",
  46490. cyan: "rgba(0,255,255,1)",
  46491. red: "rgba(255,0,0,1)",
  46492. yellow: "rgba(255,255,0,1)",
  46493. magenta: "rgba(255,0,255,1)",
  46494. blue: "rgba(0,0,255,1)",
  46495. black: "rgba(0,0,0,1)"
  46496. };
  46497. var TAG_ANNOTATION = {
  46498. v: "title",
  46499. lang: "lang"
  46500. };
  46501. var NEEDS_PARENT = {
  46502. rt: "ruby"
  46503. };
  46504. function parseContent(window2, input) {
  46505. function nextToken() {
  46506. if (!input) {
  46507. return null;
  46508. }
  46509. function consume(result) {
  46510. input = input.substr(result.length);
  46511. return result;
  46512. }
  46513. var m2 = input.match(/^([^<]*)(<[^>]*>?)?/);
  46514. return consume(m2[1] ? m2[1] : m2[2]);
  46515. }
  46516. function unescape2(s) {
  46517. TEXTAREA_ELEMENT.innerHTML = s;
  46518. s = TEXTAREA_ELEMENT.textContent;
  46519. TEXTAREA_ELEMENT.textContent = "";
  46520. return s;
  46521. }
  46522. function shouldAdd(current2, element) {
  46523. return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current2.localName;
  46524. }
  46525. function createElement(type2, annotation) {
  46526. var tagName = TAG_NAME[type2];
  46527. if (!tagName) {
  46528. return null;
  46529. }
  46530. var element = window2.document.createElement(tagName);
  46531. var name = TAG_ANNOTATION[type2];
  46532. if (name && annotation) {
  46533. element[name] = annotation.trim();
  46534. }
  46535. return element;
  46536. }
  46537. var rootDiv = window2.document.createElement("div"), current = rootDiv, t2, tagStack = [];
  46538. while ((t2 = nextToken()) !== null) {
  46539. if (t2[0] === "<") {
  46540. if (t2[1] === "/") {
  46541. if (tagStack.length && tagStack[tagStack.length - 1] === t2.substr(2).replace(">", "")) {
  46542. tagStack.pop();
  46543. current = current.parentNode;
  46544. }
  46545. continue;
  46546. }
  46547. var ts3 = parseTimeStamp(t2.substr(1, t2.length - 2));
  46548. var node;
  46549. if (ts3) {
  46550. node = window2.document.createProcessingInstruction("timestamp", ts3);
  46551. current.appendChild(node);
  46552. continue;
  46553. }
  46554. var m = t2.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
  46555. if (!m) {
  46556. continue;
  46557. }
  46558. node = createElement(m[1], m[3]);
  46559. if (!node) {
  46560. continue;
  46561. }
  46562. if (!shouldAdd(current, node)) {
  46563. continue;
  46564. }
  46565. if (m[2]) {
  46566. var classes = m[2].split(".");
  46567. classes.forEach(function(cl) {
  46568. var bgColor = /^bg_/.test(cl);
  46569. var colorName = bgColor ? cl.slice(3) : cl;
  46570. if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {
  46571. var propName = bgColor ? "background-color" : "color";
  46572. var propValue = DEFAULT_COLOR_CLASS[colorName];
  46573. node.style[propName] = propValue;
  46574. }
  46575. });
  46576. node.className = classes.join(" ");
  46577. }
  46578. tagStack.push(m[1]);
  46579. current.appendChild(node);
  46580. current = node;
  46581. continue;
  46582. }
  46583. current.appendChild(window2.document.createTextNode(unescape2(t2)));
  46584. }
  46585. return rootDiv;
  46586. }
  46587. var strongRTLRanges = [
  46588. [1470, 1470],
  46589. [1472, 1472],
  46590. [1475, 1475],
  46591. [1478, 1478],
  46592. [1488, 1514],
  46593. [1520, 1524],
  46594. [1544, 1544],
  46595. [1547, 1547],
  46596. [1549, 1549],
  46597. [1563, 1563],
  46598. [1566, 1610],
  46599. [1645, 1647],
  46600. [1649, 1749],
  46601. [1765, 1766],
  46602. [1774, 1775],
  46603. [1786, 1805],
  46604. [1807, 1808],
  46605. [1810, 1839],
  46606. [1869, 1957],
  46607. [1969, 1969],
  46608. [1984, 2026],
  46609. [2036, 2037],
  46610. [2042, 2042],
  46611. [2048, 2069],
  46612. [2074, 2074],
  46613. [2084, 2084],
  46614. [2088, 2088],
  46615. [2096, 2110],
  46616. [2112, 2136],
  46617. [2142, 2142],
  46618. [2208, 2208],
  46619. [2210, 2220],
  46620. [8207, 8207],
  46621. [64285, 64285],
  46622. [64287, 64296],
  46623. [64298, 64310],
  46624. [64312, 64316],
  46625. [64318, 64318],
  46626. [64320, 64321],
  46627. [64323, 64324],
  46628. [64326, 64449],
  46629. [64467, 64829],
  46630. [64848, 64911],
  46631. [64914, 64967],
  46632. [65008, 65020],
  46633. [65136, 65140],
  46634. [65142, 65276],
  46635. [67584, 67589],
  46636. [67592, 67592],
  46637. [67594, 67637],
  46638. [67639, 67640],
  46639. [67644, 67644],
  46640. [67647, 67669],
  46641. [67671, 67679],
  46642. [67840, 67867],
  46643. [67872, 67897],
  46644. [67903, 67903],
  46645. [67968, 68023],
  46646. [68030, 68031],
  46647. [68096, 68096],
  46648. [68112, 68115],
  46649. [68117, 68119],
  46650. [68121, 68147],
  46651. [68160, 68167],
  46652. [68176, 68184],
  46653. [68192, 68223],
  46654. [68352, 68405],
  46655. [68416, 68437],
  46656. [68440, 68466],
  46657. [68472, 68479],
  46658. [68608, 68680],
  46659. [126464, 126467],
  46660. [126469, 126495],
  46661. [126497, 126498],
  46662. [126500, 126500],
  46663. [126503, 126503],
  46664. [126505, 126514],
  46665. [126516, 126519],
  46666. [126521, 126521],
  46667. [126523, 126523],
  46668. [126530, 126530],
  46669. [126535, 126535],
  46670. [126537, 126537],
  46671. [126539, 126539],
  46672. [126541, 126543],
  46673. [126545, 126546],
  46674. [126548, 126548],
  46675. [126551, 126551],
  46676. [126553, 126553],
  46677. [126555, 126555],
  46678. [126557, 126557],
  46679. [126559, 126559],
  46680. [126561, 126562],
  46681. [126564, 126564],
  46682. [126567, 126570],
  46683. [126572, 126578],
  46684. [126580, 126583],
  46685. [126585, 126588],
  46686. [126590, 126590],
  46687. [126592, 126601],
  46688. [126603, 126619],
  46689. [126625, 126627],
  46690. [126629, 126633],
  46691. [126635, 126651],
  46692. [1114109, 1114109]
  46693. ];
  46694. function isStrongRTLChar(charCode) {
  46695. for (var i2 = 0; i2 < strongRTLRanges.length; i2++) {
  46696. var currentRange = strongRTLRanges[i2];
  46697. if (charCode >= currentRange[0] && charCode <= currentRange[1]) {
  46698. return true;
  46699. }
  46700. }
  46701. return false;
  46702. }
  46703. function determineBidi(cueDiv) {
  46704. var nodeStack = [], text = "", charCode;
  46705. if (!cueDiv || !cueDiv.childNodes) {
  46706. return "ltr";
  46707. }
  46708. function pushNodes(nodeStack2, node) {
  46709. for (var i3 = node.childNodes.length - 1; i3 >= 0; i3--) {
  46710. nodeStack2.push(node.childNodes[i3]);
  46711. }
  46712. }
  46713. function nextTextNode(nodeStack2) {
  46714. if (!nodeStack2 || !nodeStack2.length) {
  46715. return null;
  46716. }
  46717. var node = nodeStack2.pop(), text2 = node.textContent || node.innerText;
  46718. if (text2) {
  46719. var m = text2.match(/^.*(\n|\r)/);
  46720. if (m) {
  46721. nodeStack2.length = 0;
  46722. return m[0];
  46723. }
  46724. return text2;
  46725. }
  46726. if (node.tagName === "ruby") {
  46727. return nextTextNode(nodeStack2);
  46728. }
  46729. if (node.childNodes) {
  46730. pushNodes(nodeStack2, node);
  46731. return nextTextNode(nodeStack2);
  46732. }
  46733. }
  46734. pushNodes(nodeStack, cueDiv);
  46735. while (text = nextTextNode(nodeStack)) {
  46736. for (var i2 = 0; i2 < text.length; i2++) {
  46737. charCode = text.charCodeAt(i2);
  46738. if (isStrongRTLChar(charCode)) {
  46739. return "rtl";
  46740. }
  46741. }
  46742. }
  46743. return "ltr";
  46744. }
  46745. function computeLinePos(cue) {
  46746. if (typeof cue.line === "number" && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) {
  46747. return cue.line;
  46748. }
  46749. if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) {
  46750. return -1;
  46751. }
  46752. var track = cue.track, trackList = track.textTrackList, count = 0;
  46753. for (var i2 = 0; i2 < trackList.length && trackList[i2] !== track; i2++) {
  46754. if (trackList[i2].mode === "showing") {
  46755. count++;
  46756. }
  46757. }
  46758. return ++count * -1;
  46759. }
  46760. function StyleBox() {
  46761. }
  46762. StyleBox.prototype.applyStyles = function(styles, div) {
  46763. div = div || this.div;
  46764. for (var prop in styles) {
  46765. if (styles.hasOwnProperty(prop)) {
  46766. div.style[prop] = styles[prop];
  46767. }
  46768. }
  46769. };
  46770. StyleBox.prototype.formatStyle = function(val, unit) {
  46771. return val === 0 ? 0 : val + unit;
  46772. };
  46773. function CueStyleBox(window2, cue, styleOptions) {
  46774. StyleBox.call(this);
  46775. this.cue = cue;
  46776. this.cueDiv = parseContent(window2, cue.text);
  46777. var styles = {
  46778. color: "rgba(255, 255, 255, 1)",
  46779. backgroundColor: "rgba(0, 0, 0, 0.8)",
  46780. position: "relative",
  46781. left: 0,
  46782. right: 0,
  46783. top: 0,
  46784. bottom: 0,
  46785. display: "inline",
  46786. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46787. unicodeBidi: "plaintext"
  46788. };
  46789. this.applyStyles(styles, this.cueDiv);
  46790. this.div = window2.document.createElement("div");
  46791. styles = {
  46792. direction: determineBidi(this.cueDiv),
  46793. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46794. unicodeBidi: "plaintext",
  46795. textAlign: cue.align === "middle" ? "center" : cue.align,
  46796. font: styleOptions.font,
  46797. whiteSpace: "pre-line",
  46798. position: "absolute"
  46799. };
  46800. this.applyStyles(styles);
  46801. this.div.appendChild(this.cueDiv);
  46802. var textPos = 0;
  46803. switch (cue.positionAlign) {
  46804. case "start":
  46805. textPos = cue.position;
  46806. break;
  46807. case "center":
  46808. textPos = cue.position - cue.size / 2;
  46809. break;
  46810. case "end":
  46811. textPos = cue.position - cue.size;
  46812. break;
  46813. }
  46814. if (cue.vertical === "") {
  46815. this.applyStyles({
  46816. left: this.formatStyle(textPos, "%"),
  46817. width: this.formatStyle(cue.size, "%")
  46818. });
  46819. } else {
  46820. this.applyStyles({
  46821. top: this.formatStyle(textPos, "%"),
  46822. height: this.formatStyle(cue.size, "%")
  46823. });
  46824. }
  46825. this.move = function(box) {
  46826. this.applyStyles({
  46827. top: this.formatStyle(box.top, "px"),
  46828. bottom: this.formatStyle(box.bottom, "px"),
  46829. left: this.formatStyle(box.left, "px"),
  46830. right: this.formatStyle(box.right, "px"),
  46831. height: this.formatStyle(box.height, "px"),
  46832. width: this.formatStyle(box.width, "px")
  46833. });
  46834. };
  46835. }
  46836. CueStyleBox.prototype = _objCreate(StyleBox.prototype);
  46837. CueStyleBox.prototype.constructor = CueStyleBox;
  46838. function BoxPosition(obj) {
  46839. var lh, height2, width2, top;
  46840. if (obj.div) {
  46841. height2 = obj.div.offsetHeight;
  46842. width2 = obj.div.offsetWidth;
  46843. top = obj.div.offsetTop;
  46844. var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();
  46845. obj = obj.div.getBoundingClientRect();
  46846. lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;
  46847. }
  46848. this.left = obj.left;
  46849. this.right = obj.right;
  46850. this.top = obj.top || top;
  46851. this.height = obj.height || height2;
  46852. this.bottom = obj.bottom || top + (obj.height || height2);
  46853. this.width = obj.width || width2;
  46854. this.lineHeight = lh !== void 0 ? lh : obj.lineHeight;
  46855. }
  46856. BoxPosition.prototype.move = function(axis, toMove) {
  46857. toMove = toMove !== void 0 ? toMove : this.lineHeight;
  46858. switch (axis) {
  46859. case "+x":
  46860. this.left += toMove;
  46861. this.right += toMove;
  46862. break;
  46863. case "-x":
  46864. this.left -= toMove;
  46865. this.right -= toMove;
  46866. break;
  46867. case "+y":
  46868. this.top += toMove;
  46869. this.bottom += toMove;
  46870. break;
  46871. case "-y":
  46872. this.top -= toMove;
  46873. this.bottom -= toMove;
  46874. break;
  46875. }
  46876. };
  46877. BoxPosition.prototype.overlaps = function(b2) {
  46878. return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top;
  46879. };
  46880. BoxPosition.prototype.overlapsAny = function(boxes) {
  46881. for (var i2 = 0; i2 < boxes.length; i2++) {
  46882. if (this.overlaps(boxes[i2])) {
  46883. return true;
  46884. }
  46885. }
  46886. return false;
  46887. };
  46888. BoxPosition.prototype.within = function(container) {
  46889. return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right;
  46890. };
  46891. BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {
  46892. switch (axis) {
  46893. case "+x":
  46894. return this.left < container.left;
  46895. case "-x":
  46896. return this.right > container.right;
  46897. case "+y":
  46898. return this.top < container.top;
  46899. case "-y":
  46900. return this.bottom > container.bottom;
  46901. }
  46902. };
  46903. BoxPosition.prototype.intersectPercentage = function(b2) {
  46904. var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)), y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)), intersectArea = x * y;
  46905. return intersectArea / (this.height * this.width);
  46906. };
  46907. BoxPosition.prototype.toCSSCompatValues = function(reference) {
  46908. return {
  46909. top: this.top - reference.top,
  46910. bottom: reference.bottom - this.bottom,
  46911. left: this.left - reference.left,
  46912. right: reference.right - this.right,
  46913. height: this.height,
  46914. width: this.width
  46915. };
  46916. };
  46917. BoxPosition.getSimpleBoxPosition = function(obj) {
  46918. var height2 = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;
  46919. var width2 = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;
  46920. var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;
  46921. obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj;
  46922. var ret = {
  46923. left: obj.left,
  46924. right: obj.right,
  46925. top: obj.top || top,
  46926. height: obj.height || height2,
  46927. bottom: obj.bottom || top + (obj.height || height2),
  46928. width: obj.width || width2
  46929. };
  46930. return ret;
  46931. };
  46932. function moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions) {
  46933. function findBestPosition(b, axis2) {
  46934. var bestPosition2, specifiedPosition = new BoxPosition(b), percentage = 1;
  46935. for (var i2 = 0; i2 < axis2.length; i2++) {
  46936. while (b.overlapsOppositeAxis(containerBox, axis2[i2]) || b.within(containerBox) && b.overlapsAny(boxPositions)) {
  46937. b.move(axis2[i2]);
  46938. }
  46939. if (b.within(containerBox)) {
  46940. return b;
  46941. }
  46942. var p = b.intersectPercentage(containerBox);
  46943. if (percentage > p) {
  46944. bestPosition2 = new BoxPosition(b);
  46945. percentage = p;
  46946. }
  46947. b = new BoxPosition(specifiedPosition);
  46948. }
  46949. return bestPosition2 || specifiedPosition;
  46950. }
  46951. var boxPosition = new BoxPosition(styleBox), cue = styleBox.cue, linePos = computeLinePos(cue), axis = [];
  46952. if (cue.snapToLines) {
  46953. var size;
  46954. switch (cue.vertical) {
  46955. case "":
  46956. axis = ["+y", "-y"];
  46957. size = "height";
  46958. break;
  46959. case "rl":
  46960. axis = ["+x", "-x"];
  46961. size = "width";
  46962. break;
  46963. case "lr":
  46964. axis = ["-x", "+x"];
  46965. size = "width";
  46966. break;
  46967. }
  46968. var step = boxPosition.lineHeight, position2 = step * Math.round(linePos), maxPosition = containerBox[size] + step, initialAxis = axis[0];
  46969. if (Math.abs(position2) > maxPosition) {
  46970. position2 = position2 < 0 ? -1 : 1;
  46971. position2 *= Math.ceil(maxPosition / step) * step;
  46972. }
  46973. if (linePos < 0) {
  46974. position2 += cue.vertical === "" ? containerBox.height : containerBox.width;
  46975. axis = axis.reverse();
  46976. }
  46977. boxPosition.move(initialAxis, position2);
  46978. } else {
  46979. var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100;
  46980. switch (cue.lineAlign) {
  46981. case "center":
  46982. linePos -= calculatedPercentage / 2;
  46983. break;
  46984. case "end":
  46985. linePos -= calculatedPercentage;
  46986. break;
  46987. }
  46988. switch (cue.vertical) {
  46989. case "":
  46990. styleBox.applyStyles({
  46991. top: styleBox.formatStyle(linePos, "%")
  46992. });
  46993. break;
  46994. case "rl":
  46995. styleBox.applyStyles({
  46996. left: styleBox.formatStyle(linePos, "%")
  46997. });
  46998. break;
  46999. case "lr":
  47000. styleBox.applyStyles({
  47001. right: styleBox.formatStyle(linePos, "%")
  47002. });
  47003. break;
  47004. }
  47005. axis = ["+y", "-x", "+x", "-y"];
  47006. boxPosition = new BoxPosition(styleBox);
  47007. }
  47008. var bestPosition = findBestPosition(boxPosition, axis);
  47009. styleBox.move(bestPosition.toCSSCompatValues(containerBox));
  47010. }
  47011. function WebVTT$1() {
  47012. }
  47013. WebVTT$1.StringDecoder = function() {
  47014. return {
  47015. decode: function(data) {
  47016. if (!data) {
  47017. return "";
  47018. }
  47019. if (typeof data !== "string") {
  47020. throw new Error("Error - expected string data.");
  47021. }
  47022. return decodeURIComponent(encodeURIComponent(data));
  47023. }
  47024. };
  47025. };
  47026. WebVTT$1.convertCueToDOMTree = function(window2, cuetext) {
  47027. if (!window2 || !cuetext) {
  47028. return null;
  47029. }
  47030. return parseContent(window2, cuetext);
  47031. };
  47032. var FONT_SIZE_PERCENT = 0.05;
  47033. var FONT_STYLE = "sans-serif";
  47034. var CUE_BACKGROUND_PADDING = "1.5%";
  47035. WebVTT$1.processCues = function(window2, cues, overlay) {
  47036. if (!window2 || !cues || !overlay) {
  47037. return null;
  47038. }
  47039. while (overlay.firstChild) {
  47040. overlay.removeChild(overlay.firstChild);
  47041. }
  47042. var paddedOverlay = window2.document.createElement("div");
  47043. paddedOverlay.style.position = "absolute";
  47044. paddedOverlay.style.left = "0";
  47045. paddedOverlay.style.right = "0";
  47046. paddedOverlay.style.top = "0";
  47047. paddedOverlay.style.bottom = "0";
  47048. paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;
  47049. overlay.appendChild(paddedOverlay);
  47050. function shouldCompute(cues2) {
  47051. for (var i3 = 0; i3 < cues2.length; i3++) {
  47052. if (cues2[i3].hasBeenReset || !cues2[i3].displayState) {
  47053. return true;
  47054. }
  47055. }
  47056. return false;
  47057. }
  47058. if (!shouldCompute(cues)) {
  47059. for (var i2 = 0; i2 < cues.length; i2++) {
  47060. paddedOverlay.appendChild(cues[i2].displayState);
  47061. }
  47062. return;
  47063. }
  47064. var boxPositions = [], containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay), fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;
  47065. var styleOptions = {
  47066. font: fontSize + "px " + FONT_STYLE
  47067. };
  47068. (function() {
  47069. var styleBox, cue;
  47070. for (var i3 = 0; i3 < cues.length; i3++) {
  47071. cue = cues[i3];
  47072. styleBox = new CueStyleBox(window2, cue, styleOptions);
  47073. paddedOverlay.appendChild(styleBox.div);
  47074. moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions);
  47075. cue.displayState = styleBox.div;
  47076. boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));
  47077. }
  47078. })();
  47079. };
  47080. WebVTT$1.Parser = function(window2, vttjs2, decoder) {
  47081. if (!decoder) {
  47082. decoder = vttjs2;
  47083. vttjs2 = {};
  47084. }
  47085. if (!vttjs2) {
  47086. vttjs2 = {};
  47087. }
  47088. this.window = window2;
  47089. this.vttjs = vttjs2;
  47090. this.state = "INITIAL";
  47091. this.buffer = "";
  47092. this.decoder = decoder || new TextDecoder("utf8");
  47093. this.regionList = [];
  47094. };
  47095. WebVTT$1.Parser.prototype = {
  47096. reportOrThrowError: function(e) {
  47097. if (e instanceof ParsingError) {
  47098. this.onparsingerror && this.onparsingerror(e);
  47099. } else {
  47100. throw e;
  47101. }
  47102. },
  47103. parse: function(data) {
  47104. var self2 = this;
  47105. if (data) {
  47106. self2.buffer += self2.decoder.decode(data, { stream: true });
  47107. }
  47108. function collectNextLine() {
  47109. var buffer = self2.buffer;
  47110. var pos = 0;
  47111. while (pos < buffer.length && buffer[pos] !== "\r" && buffer[pos] !== "\n") {
  47112. ++pos;
  47113. }
  47114. var line2 = buffer.substr(0, pos);
  47115. if (buffer[pos] === "\r") {
  47116. ++pos;
  47117. }
  47118. if (buffer[pos] === "\n") {
  47119. ++pos;
  47120. }
  47121. self2.buffer = buffer.substr(pos);
  47122. return line2;
  47123. }
  47124. function parseRegion(input) {
  47125. var settings = new Settings();
  47126. parseOptions(input, function(k, v) {
  47127. switch (k) {
  47128. case "id":
  47129. settings.set(k, v);
  47130. break;
  47131. case "width":
  47132. settings.percent(k, v);
  47133. break;
  47134. case "lines":
  47135. settings.integer(k, v);
  47136. break;
  47137. case "regionanchor":
  47138. case "viewportanchor":
  47139. var xy = v.split(",");
  47140. if (xy.length !== 2) {
  47141. break;
  47142. }
  47143. var anchor = new Settings();
  47144. anchor.percent("x", xy[0]);
  47145. anchor.percent("y", xy[1]);
  47146. if (!anchor.has("x") || !anchor.has("y")) {
  47147. break;
  47148. }
  47149. settings.set(k + "X", anchor.get("x"));
  47150. settings.set(k + "Y", anchor.get("y"));
  47151. break;
  47152. case "scroll":
  47153. settings.alt(k, v, ["up"]);
  47154. break;
  47155. }
  47156. }, /=/, /\s/);
  47157. if (settings.has("id")) {
  47158. var region = new (self2.vttjs.VTTRegion || self2.window.VTTRegion)();
  47159. region.width = settings.get("width", 100);
  47160. region.lines = settings.get("lines", 3);
  47161. region.regionAnchorX = settings.get("regionanchorX", 0);
  47162. region.regionAnchorY = settings.get("regionanchorY", 100);
  47163. region.viewportAnchorX = settings.get("viewportanchorX", 0);
  47164. region.viewportAnchorY = settings.get("viewportanchorY", 100);
  47165. region.scroll = settings.get("scroll", "");
  47166. self2.onregion && self2.onregion(region);
  47167. self2.regionList.push({
  47168. id: settings.get("id"),
  47169. region
  47170. });
  47171. }
  47172. }
  47173. function parseTimestampMap(input) {
  47174. var settings = new Settings();
  47175. parseOptions(input, function(k, v) {
  47176. switch (k) {
  47177. case "MPEGT":
  47178. settings.integer(k + "S", v);
  47179. break;
  47180. case "LOCA":
  47181. settings.set(k + "L", parseTimeStamp(v));
  47182. break;
  47183. }
  47184. }, /[^\d]:/, /,/);
  47185. self2.ontimestampmap && self2.ontimestampmap({
  47186. "MPEGTS": settings.get("MPEGTS"),
  47187. "LOCAL": settings.get("LOCAL")
  47188. });
  47189. }
  47190. function parseHeader(input) {
  47191. if (input.match(/X-TIMESTAMP-MAP/)) {
  47192. parseOptions(input, function(k, v) {
  47193. switch (k) {
  47194. case "X-TIMESTAMP-MAP":
  47195. parseTimestampMap(v);
  47196. break;
  47197. }
  47198. }, /=/);
  47199. } else {
  47200. parseOptions(input, function(k, v) {
  47201. switch (k) {
  47202. case "Region":
  47203. parseRegion(v);
  47204. break;
  47205. }
  47206. }, /:/);
  47207. }
  47208. }
  47209. try {
  47210. var line;
  47211. if (self2.state === "INITIAL") {
  47212. if (!/\r\n|\n/.test(self2.buffer)) {
  47213. return this;
  47214. }
  47215. line = collectNextLine();
  47216. var m = line.match(/^WEBVTT([ \t].*)?$/);
  47217. if (!m || !m[0]) {
  47218. throw new ParsingError(ParsingError.Errors.BadSignature);
  47219. }
  47220. self2.state = "HEADER";
  47221. }
  47222. var alreadyCollectedLine = false;
  47223. while (self2.buffer) {
  47224. if (!/\r\n|\n/.test(self2.buffer)) {
  47225. return this;
  47226. }
  47227. if (!alreadyCollectedLine) {
  47228. line = collectNextLine();
  47229. } else {
  47230. alreadyCollectedLine = false;
  47231. }
  47232. switch (self2.state) {
  47233. case "HEADER":
  47234. if (/:/.test(line)) {
  47235. parseHeader(line);
  47236. } else if (!line) {
  47237. self2.state = "ID";
  47238. }
  47239. continue;
  47240. case "NOTE":
  47241. if (!line) {
  47242. self2.state = "ID";
  47243. }
  47244. continue;
  47245. case "ID":
  47246. if (/^NOTE($|[ \t])/.test(line)) {
  47247. self2.state = "NOTE";
  47248. break;
  47249. }
  47250. if (!line) {
  47251. continue;
  47252. }
  47253. self2.cue = new (self2.vttjs.VTTCue || self2.window.VTTCue)(0, 0, "");
  47254. try {
  47255. self2.cue.align = "center";
  47256. } catch (e) {
  47257. self2.cue.align = "middle";
  47258. }
  47259. self2.state = "CUE";
  47260. if (line.indexOf("-->") === -1) {
  47261. self2.cue.id = line;
  47262. continue;
  47263. }
  47264. case "CUE":
  47265. try {
  47266. parseCue(line, self2.cue, self2.regionList);
  47267. } catch (e) {
  47268. self2.reportOrThrowError(e);
  47269. self2.cue = null;
  47270. self2.state = "BADCUE";
  47271. continue;
  47272. }
  47273. self2.state = "CUETEXT";
  47274. continue;
  47275. case "CUETEXT":
  47276. var hasSubstring = line.indexOf("-->") !== -1;
  47277. if (!line || hasSubstring && (alreadyCollectedLine = true)) {
  47278. self2.oncue && self2.oncue(self2.cue);
  47279. self2.cue = null;
  47280. self2.state = "ID";
  47281. continue;
  47282. }
  47283. if (self2.cue.text) {
  47284. self2.cue.text += "\n";
  47285. }
  47286. self2.cue.text += line.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
  47287. continue;
  47288. case "BADCUE":
  47289. if (!line) {
  47290. self2.state = "ID";
  47291. }
  47292. continue;
  47293. }
  47294. }
  47295. } catch (e) {
  47296. self2.reportOrThrowError(e);
  47297. if (self2.state === "CUETEXT" && self2.cue && self2.oncue) {
  47298. self2.oncue(self2.cue);
  47299. }
  47300. self2.cue = null;
  47301. self2.state = self2.state === "INITIAL" ? "BADWEBVTT" : "BADCUE";
  47302. }
  47303. return this;
  47304. },
  47305. flush: function() {
  47306. var self2 = this;
  47307. try {
  47308. self2.buffer += self2.decoder.decode();
  47309. if (self2.cue || self2.state === "HEADER") {
  47310. self2.buffer += "\n\n";
  47311. self2.parse();
  47312. }
  47313. if (self2.state === "INITIAL") {
  47314. throw new ParsingError(ParsingError.Errors.BadSignature);
  47315. }
  47316. } catch (e) {
  47317. self2.reportOrThrowError(e);
  47318. }
  47319. self2.onflush && self2.onflush();
  47320. return this;
  47321. }
  47322. };
  47323. var vtt$1 = WebVTT$1;
  47324. var autoKeyword = "auto";
  47325. var directionSetting = {
  47326. "": 1,
  47327. "lr": 1,
  47328. "rl": 1
  47329. };
  47330. var alignSetting = {
  47331. "start": 1,
  47332. "center": 1,
  47333. "end": 1,
  47334. "left": 1,
  47335. "right": 1,
  47336. "auto": 1,
  47337. "line-left": 1,
  47338. "line-right": 1
  47339. };
  47340. function findDirectionSetting(value) {
  47341. if (typeof value !== "string") {
  47342. return false;
  47343. }
  47344. var dir = directionSetting[value.toLowerCase()];
  47345. return dir ? value.toLowerCase() : false;
  47346. }
  47347. function findAlignSetting(value) {
  47348. if (typeof value !== "string") {
  47349. return false;
  47350. }
  47351. var align = alignSetting[value.toLowerCase()];
  47352. return align ? value.toLowerCase() : false;
  47353. }
  47354. function VTTCue(startTime, endTime, text) {
  47355. this.hasBeenReset = false;
  47356. var _id = "";
  47357. var _pauseOnExit = false;
  47358. var _startTime = startTime;
  47359. var _endTime = endTime;
  47360. var _text = text;
  47361. var _region = null;
  47362. var _vertical = "";
  47363. var _snapToLines = true;
  47364. var _line = "auto";
  47365. var _lineAlign = "start";
  47366. var _position = "auto";
  47367. var _positionAlign = "auto";
  47368. var _size = 100;
  47369. var _align = "center";
  47370. Object.defineProperties(this, {
  47371. "id": {
  47372. enumerable: true,
  47373. get: function() {
  47374. return _id;
  47375. },
  47376. set: function(value) {
  47377. _id = "" + value;
  47378. }
  47379. },
  47380. "pauseOnExit": {
  47381. enumerable: true,
  47382. get: function() {
  47383. return _pauseOnExit;
  47384. },
  47385. set: function(value) {
  47386. _pauseOnExit = !!value;
  47387. }
  47388. },
  47389. "startTime": {
  47390. enumerable: true,
  47391. get: function() {
  47392. return _startTime;
  47393. },
  47394. set: function(value) {
  47395. if (typeof value !== "number") {
  47396. throw new TypeError("Start time must be set to a number.");
  47397. }
  47398. _startTime = value;
  47399. this.hasBeenReset = true;
  47400. }
  47401. },
  47402. "endTime": {
  47403. enumerable: true,
  47404. get: function() {
  47405. return _endTime;
  47406. },
  47407. set: function(value) {
  47408. if (typeof value !== "number") {
  47409. throw new TypeError("End time must be set to a number.");
  47410. }
  47411. _endTime = value;
  47412. this.hasBeenReset = true;
  47413. }
  47414. },
  47415. "text": {
  47416. enumerable: true,
  47417. get: function() {
  47418. return _text;
  47419. },
  47420. set: function(value) {
  47421. _text = "" + value;
  47422. this.hasBeenReset = true;
  47423. }
  47424. },
  47425. "region": {
  47426. enumerable: true,
  47427. get: function() {
  47428. return _region;
  47429. },
  47430. set: function(value) {
  47431. _region = value;
  47432. this.hasBeenReset = true;
  47433. }
  47434. },
  47435. "vertical": {
  47436. enumerable: true,
  47437. get: function() {
  47438. return _vertical;
  47439. },
  47440. set: function(value) {
  47441. var setting = findDirectionSetting(value);
  47442. if (setting === false) {
  47443. throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
  47444. }
  47445. _vertical = setting;
  47446. this.hasBeenReset = true;
  47447. }
  47448. },
  47449. "snapToLines": {
  47450. enumerable: true,
  47451. get: function() {
  47452. return _snapToLines;
  47453. },
  47454. set: function(value) {
  47455. _snapToLines = !!value;
  47456. this.hasBeenReset = true;
  47457. }
  47458. },
  47459. "line": {
  47460. enumerable: true,
  47461. get: function() {
  47462. return _line;
  47463. },
  47464. set: function(value) {
  47465. if (typeof value !== "number" && value !== autoKeyword) {
  47466. throw new SyntaxError("Line: an invalid number or illegal string was specified.");
  47467. }
  47468. _line = value;
  47469. this.hasBeenReset = true;
  47470. }
  47471. },
  47472. "lineAlign": {
  47473. enumerable: true,
  47474. get: function() {
  47475. return _lineAlign;
  47476. },
  47477. set: function(value) {
  47478. var setting = findAlignSetting(value);
  47479. if (!setting) {
  47480. console.warn("lineAlign: an invalid or illegal string was specified.");
  47481. } else {
  47482. _lineAlign = setting;
  47483. this.hasBeenReset = true;
  47484. }
  47485. }
  47486. },
  47487. "position": {
  47488. enumerable: true,
  47489. get: function() {
  47490. return _position;
  47491. },
  47492. set: function(value) {
  47493. if (value < 0 || value > 100) {
  47494. throw new Error("Position must be between 0 and 100.");
  47495. }
  47496. _position = value;
  47497. this.hasBeenReset = true;
  47498. }
  47499. },
  47500. "positionAlign": {
  47501. enumerable: true,
  47502. get: function() {
  47503. return _positionAlign;
  47504. },
  47505. set: function(value) {
  47506. var setting = findAlignSetting(value);
  47507. if (!setting) {
  47508. console.warn("positionAlign: an invalid or illegal string was specified.");
  47509. } else {
  47510. _positionAlign = setting;
  47511. this.hasBeenReset = true;
  47512. }
  47513. }
  47514. },
  47515. "size": {
  47516. enumerable: true,
  47517. get: function() {
  47518. return _size;
  47519. },
  47520. set: function(value) {
  47521. if (value < 0 || value > 100) {
  47522. throw new Error("Size must be between 0 and 100.");
  47523. }
  47524. _size = value;
  47525. this.hasBeenReset = true;
  47526. }
  47527. },
  47528. "align": {
  47529. enumerable: true,
  47530. get: function() {
  47531. return _align;
  47532. },
  47533. set: function(value) {
  47534. var setting = findAlignSetting(value);
  47535. if (!setting) {
  47536. throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
  47537. }
  47538. _align = setting;
  47539. this.hasBeenReset = true;
  47540. }
  47541. }
  47542. });
  47543. this.displayState = void 0;
  47544. }
  47545. VTTCue.prototype.getCueAsHTML = function() {
  47546. return WebVTT.convertCueToDOMTree(window, this.text);
  47547. };
  47548. var vttcue = VTTCue;
  47549. var scrollSetting = {
  47550. "": true,
  47551. "up": true
  47552. };
  47553. function findScrollSetting(value) {
  47554. if (typeof value !== "string") {
  47555. return false;
  47556. }
  47557. var scroll = scrollSetting[value.toLowerCase()];
  47558. return scroll ? value.toLowerCase() : false;
  47559. }
  47560. function isValidPercentValue(value) {
  47561. return typeof value === "number" && (value >= 0 && value <= 100);
  47562. }
  47563. function VTTRegion() {
  47564. var _width = 100;
  47565. var _lines = 3;
  47566. var _regionAnchorX = 0;
  47567. var _regionAnchorY = 100;
  47568. var _viewportAnchorX = 0;
  47569. var _viewportAnchorY = 100;
  47570. var _scroll = "";
  47571. Object.defineProperties(this, {
  47572. "width": {
  47573. enumerable: true,
  47574. get: function() {
  47575. return _width;
  47576. },
  47577. set: function(value) {
  47578. if (!isValidPercentValue(value)) {
  47579. throw new Error("Width must be between 0 and 100.");
  47580. }
  47581. _width = value;
  47582. }
  47583. },
  47584. "lines": {
  47585. enumerable: true,
  47586. get: function() {
  47587. return _lines;
  47588. },
  47589. set: function(value) {
  47590. if (typeof value !== "number") {
  47591. throw new TypeError("Lines must be set to a number.");
  47592. }
  47593. _lines = value;
  47594. }
  47595. },
  47596. "regionAnchorY": {
  47597. enumerable: true,
  47598. get: function() {
  47599. return _regionAnchorY;
  47600. },
  47601. set: function(value) {
  47602. if (!isValidPercentValue(value)) {
  47603. throw new Error("RegionAnchorX must be between 0 and 100.");
  47604. }
  47605. _regionAnchorY = value;
  47606. }
  47607. },
  47608. "regionAnchorX": {
  47609. enumerable: true,
  47610. get: function() {
  47611. return _regionAnchorX;
  47612. },
  47613. set: function(value) {
  47614. if (!isValidPercentValue(value)) {
  47615. throw new Error("RegionAnchorY must be between 0 and 100.");
  47616. }
  47617. _regionAnchorX = value;
  47618. }
  47619. },
  47620. "viewportAnchorY": {
  47621. enumerable: true,
  47622. get: function() {
  47623. return _viewportAnchorY;
  47624. },
  47625. set: function(value) {
  47626. if (!isValidPercentValue(value)) {
  47627. throw new Error("ViewportAnchorY must be between 0 and 100.");
  47628. }
  47629. _viewportAnchorY = value;
  47630. }
  47631. },
  47632. "viewportAnchorX": {
  47633. enumerable: true,
  47634. get: function() {
  47635. return _viewportAnchorX;
  47636. },
  47637. set: function(value) {
  47638. if (!isValidPercentValue(value)) {
  47639. throw new Error("ViewportAnchorX must be between 0 and 100.");
  47640. }
  47641. _viewportAnchorX = value;
  47642. }
  47643. },
  47644. "scroll": {
  47645. enumerable: true,
  47646. get: function() {
  47647. return _scroll;
  47648. },
  47649. set: function(value) {
  47650. var setting = findScrollSetting(value);
  47651. if (setting === false) {
  47652. console.warn("Scroll: an invalid or illegal string was specified.");
  47653. } else {
  47654. _scroll = setting;
  47655. }
  47656. }
  47657. }
  47658. });
  47659. }
  47660. var vttregion = VTTRegion;
  47661. var window$1 = window_1;
  47662. var vttjs = browserIndex.exports = {
  47663. WebVTT: vtt$1,
  47664. VTTCue: vttcue,
  47665. VTTRegion: vttregion
  47666. };
  47667. window$1.vttjs = vttjs;
  47668. window$1.WebVTT = vttjs.WebVTT;
  47669. var cueShim = vttjs.VTTCue;
  47670. var regionShim = vttjs.VTTRegion;
  47671. var nativeVTTCue = window$1.VTTCue;
  47672. var nativeVTTRegion = window$1.VTTRegion;
  47673. vttjs.shim = function() {
  47674. window$1.VTTCue = cueShim;
  47675. window$1.VTTRegion = regionShim;
  47676. };
  47677. vttjs.restore = function() {
  47678. window$1.VTTCue = nativeVTTCue;
  47679. window$1.VTTRegion = nativeVTTRegion;
  47680. };
  47681. if (!window$1.VTTCue) {
  47682. vttjs.shim();
  47683. }
  47684. var vtt = browserIndex.exports;
  47685. var urlToolkit = { exports: {} };
  47686. (function(module2, exports2) {
  47687. (function(root2) {
  47688. var URL_REGEX = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;
  47689. var FIRST_SEGMENT_REGEX = /^(?=([^\/?#]*))\1([^]*)$/;
  47690. var SLASH_DOT_REGEX = /(?:\/|^)\.(?=\/)/g;
  47691. var SLASH_DOT_DOT_REGEX = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;
  47692. var URLToolkit2 = {
  47693. buildAbsoluteURL: function(baseURL, relativeURL, opts) {
  47694. opts = opts || {};
  47695. baseURL = baseURL.trim();
  47696. relativeURL = relativeURL.trim();
  47697. if (!relativeURL) {
  47698. if (!opts.alwaysNormalize) {
  47699. return baseURL;
  47700. }
  47701. var basePartsForNormalise = URLToolkit2.parseURL(baseURL);
  47702. if (!basePartsForNormalise) {
  47703. throw new Error("Error trying to parse base URL.");
  47704. }
  47705. basePartsForNormalise.path = URLToolkit2.normalizePath(
  47706. basePartsForNormalise.path
  47707. );
  47708. return URLToolkit2.buildURLFromParts(basePartsForNormalise);
  47709. }
  47710. var relativeParts = URLToolkit2.parseURL(relativeURL);
  47711. if (!relativeParts) {
  47712. throw new Error("Error trying to parse relative URL.");
  47713. }
  47714. if (relativeParts.scheme) {
  47715. if (!opts.alwaysNormalize) {
  47716. return relativeURL;
  47717. }
  47718. relativeParts.path = URLToolkit2.normalizePath(relativeParts.path);
  47719. return URLToolkit2.buildURLFromParts(relativeParts);
  47720. }
  47721. var baseParts = URLToolkit2.parseURL(baseURL);
  47722. if (!baseParts) {
  47723. throw new Error("Error trying to parse base URL.");
  47724. }
  47725. if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== "/") {
  47726. var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);
  47727. baseParts.netLoc = pathParts[1];
  47728. baseParts.path = pathParts[2];
  47729. }
  47730. if (baseParts.netLoc && !baseParts.path) {
  47731. baseParts.path = "/";
  47732. }
  47733. var builtParts = {
  47734. scheme: baseParts.scheme,
  47735. netLoc: relativeParts.netLoc,
  47736. path: null,
  47737. params: relativeParts.params,
  47738. query: relativeParts.query,
  47739. fragment: relativeParts.fragment
  47740. };
  47741. if (!relativeParts.netLoc) {
  47742. builtParts.netLoc = baseParts.netLoc;
  47743. if (relativeParts.path[0] !== "/") {
  47744. if (!relativeParts.path) {
  47745. builtParts.path = baseParts.path;
  47746. if (!relativeParts.params) {
  47747. builtParts.params = baseParts.params;
  47748. if (!relativeParts.query) {
  47749. builtParts.query = baseParts.query;
  47750. }
  47751. }
  47752. } else {
  47753. var baseURLPath = baseParts.path;
  47754. var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf("/") + 1) + relativeParts.path;
  47755. builtParts.path = URLToolkit2.normalizePath(newPath);
  47756. }
  47757. }
  47758. }
  47759. if (builtParts.path === null) {
  47760. builtParts.path = opts.alwaysNormalize ? URLToolkit2.normalizePath(relativeParts.path) : relativeParts.path;
  47761. }
  47762. return URLToolkit2.buildURLFromParts(builtParts);
  47763. },
  47764. parseURL: function(url) {
  47765. var parts = URL_REGEX.exec(url);
  47766. if (!parts) {
  47767. return null;
  47768. }
  47769. return {
  47770. scheme: parts[1] || "",
  47771. netLoc: parts[2] || "",
  47772. path: parts[3] || "",
  47773. params: parts[4] || "",
  47774. query: parts[5] || "",
  47775. fragment: parts[6] || ""
  47776. };
  47777. },
  47778. normalizePath: function(path) {
  47779. path = path.split("").reverse().join("").replace(SLASH_DOT_REGEX, "");
  47780. while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, "")).length) {
  47781. }
  47782. return path.split("").reverse().join("");
  47783. },
  47784. buildURLFromParts: function(parts) {
  47785. return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;
  47786. }
  47787. };
  47788. module2.exports = URLToolkit2;
  47789. })();
  47790. })(urlToolkit);
  47791. var URLToolkit = urlToolkit.exports;
  47792. var DEFAULT_LOCATION$2 = "http://example.com";
  47793. var resolveUrl$4 = function resolveUrl(baseUrl, relativeUrl) {
  47794. if (/^[a-z]+:/i.test(relativeUrl)) {
  47795. return relativeUrl;
  47796. }
  47797. if (/^data:/.test(baseUrl)) {
  47798. baseUrl = window_1.location && window_1.location.href || "";
  47799. }
  47800. var nativeURL = typeof window_1.URL === "function";
  47801. var protocolLess = /^\/\//.test(baseUrl);
  47802. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  47803. if (nativeURL) {
  47804. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$2);
  47805. } else if (!/\/\//i.test(baseUrl)) {
  47806. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  47807. }
  47808. if (nativeURL) {
  47809. var newUrl = new URL(relativeUrl, baseUrl);
  47810. if (removeLocation) {
  47811. return newUrl.href.slice(DEFAULT_LOCATION$2.length);
  47812. } else if (protocolLess) {
  47813. return newUrl.href.slice(newUrl.protocol.length);
  47814. }
  47815. return newUrl.href;
  47816. }
  47817. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  47818. };
  47819. var Stream$1 = /* @__PURE__ */ function() {
  47820. function Stream2() {
  47821. this.listeners = {};
  47822. }
  47823. var _proto = Stream2.prototype;
  47824. _proto.on = function on3(type2, listener) {
  47825. if (!this.listeners[type2]) {
  47826. this.listeners[type2] = [];
  47827. }
  47828. this.listeners[type2].push(listener);
  47829. };
  47830. _proto.off = function off2(type2, listener) {
  47831. if (!this.listeners[type2]) {
  47832. return false;
  47833. }
  47834. var index2 = this.listeners[type2].indexOf(listener);
  47835. this.listeners[type2] = this.listeners[type2].slice(0);
  47836. this.listeners[type2].splice(index2, 1);
  47837. return index2 > -1;
  47838. };
  47839. _proto.trigger = function trigger2(type2) {
  47840. var callbacks = this.listeners[type2];
  47841. if (!callbacks) {
  47842. return;
  47843. }
  47844. if (arguments.length === 2) {
  47845. var length = callbacks.length;
  47846. for (var i2 = 0; i2 < length; ++i2) {
  47847. callbacks[i2].call(this, arguments[1]);
  47848. }
  47849. } else {
  47850. var args = Array.prototype.slice.call(arguments, 1);
  47851. var _length = callbacks.length;
  47852. for (var _i = 0; _i < _length; ++_i) {
  47853. callbacks[_i].apply(this, args);
  47854. }
  47855. }
  47856. };
  47857. _proto.dispose = function dispose() {
  47858. this.listeners = {};
  47859. };
  47860. _proto.pipe = function pipe(destination2) {
  47861. this.on("data", function(data) {
  47862. destination2.push(data);
  47863. });
  47864. };
  47865. return Stream2;
  47866. }();
  47867. var atob$2 = function atob(s) {
  47868. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  47869. };
  47870. function decodeB64ToUint8Array$2(b64Text) {
  47871. var decodedString = atob$2(b64Text);
  47872. var array = new Uint8Array(decodedString.length);
  47873. for (var i2 = 0; i2 < decodedString.length; i2++) {
  47874. array[i2] = decodedString.charCodeAt(i2);
  47875. }
  47876. return array;
  47877. }
  47878. /*! @name m3u8-parser @version 6.1.0 @license Apache-2.0 */
  47879. class LineStream$1 extends Stream$1 {
  47880. constructor() {
  47881. super();
  47882. this.buffer = "";
  47883. }
  47884. push(data) {
  47885. let nextNewline;
  47886. this.buffer += data;
  47887. nextNewline = this.buffer.indexOf("\n");
  47888. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  47889. this.trigger("data", this.buffer.substring(0, nextNewline));
  47890. this.buffer = this.buffer.substring(nextNewline + 1);
  47891. }
  47892. }
  47893. }
  47894. const TAB$1 = String.fromCharCode(9);
  47895. const parseByterange$1 = function(byterangeString) {
  47896. const match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  47897. const result = {};
  47898. if (match[1]) {
  47899. result.length = parseInt(match[1], 10);
  47900. }
  47901. if (match[2]) {
  47902. result.offset = parseInt(match[2], 10);
  47903. }
  47904. return result;
  47905. };
  47906. const attributeSeparator$1 = function() {
  47907. const key = "[^=]*";
  47908. const value = '"[^"]*"|[^,]*';
  47909. const keyvalue = "(?:" + key + ")=(?:" + value + ")";
  47910. return new RegExp("(?:^|,)(" + keyvalue + ")");
  47911. };
  47912. const parseAttributes$3 = function(attributes) {
  47913. const result = {};
  47914. if (!attributes) {
  47915. return result;
  47916. }
  47917. const attrs = attributes.split(attributeSeparator$1());
  47918. let i2 = attrs.length;
  47919. let attr;
  47920. while (i2--) {
  47921. if (attrs[i2] === "") {
  47922. continue;
  47923. }
  47924. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  47925. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  47926. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  47927. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  47928. result[attr[0]] = attr[1];
  47929. }
  47930. return result;
  47931. };
  47932. class ParseStream$1 extends Stream$1 {
  47933. constructor() {
  47934. super();
  47935. this.customParsers = [];
  47936. this.tagMappers = [];
  47937. }
  47938. push(line) {
  47939. let match;
  47940. let event2;
  47941. line = line.trim();
  47942. if (line.length === 0) {
  47943. return;
  47944. }
  47945. if (line[0] !== "#") {
  47946. this.trigger("data", {
  47947. type: "uri",
  47948. uri: line
  47949. });
  47950. return;
  47951. }
  47952. const newLines = this.tagMappers.reduce((acc, mapper) => {
  47953. const mappedLine = mapper(line);
  47954. if (mappedLine === line) {
  47955. return acc;
  47956. }
  47957. return acc.concat([mappedLine]);
  47958. }, [line]);
  47959. newLines.forEach((newLine) => {
  47960. for (let i2 = 0; i2 < this.customParsers.length; i2++) {
  47961. if (this.customParsers[i2].call(this, newLine)) {
  47962. return;
  47963. }
  47964. }
  47965. if (newLine.indexOf("#EXT") !== 0) {
  47966. this.trigger("data", {
  47967. type: "comment",
  47968. text: newLine.slice(1)
  47969. });
  47970. return;
  47971. }
  47972. newLine = newLine.replace("\r", "");
  47973. match = /^#EXTM3U/.exec(newLine);
  47974. if (match) {
  47975. this.trigger("data", {
  47976. type: "tag",
  47977. tagType: "m3u"
  47978. });
  47979. return;
  47980. }
  47981. match = /^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(newLine);
  47982. if (match) {
  47983. event2 = {
  47984. type: "tag",
  47985. tagType: "inf"
  47986. };
  47987. if (match[1]) {
  47988. event2.duration = parseFloat(match[1]);
  47989. }
  47990. if (match[2]) {
  47991. event2.title = match[2];
  47992. }
  47993. this.trigger("data", event2);
  47994. return;
  47995. }
  47996. match = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(newLine);
  47997. if (match) {
  47998. event2 = {
  47999. type: "tag",
  48000. tagType: "targetduration"
  48001. };
  48002. if (match[1]) {
  48003. event2.duration = parseInt(match[1], 10);
  48004. }
  48005. this.trigger("data", event2);
  48006. return;
  48007. }
  48008. match = /^#EXT-X-VERSION:([0-9.]*)?/.exec(newLine);
  48009. if (match) {
  48010. event2 = {
  48011. type: "tag",
  48012. tagType: "version"
  48013. };
  48014. if (match[1]) {
  48015. event2.version = parseInt(match[1], 10);
  48016. }
  48017. this.trigger("data", event2);
  48018. return;
  48019. }
  48020. match = /^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  48021. if (match) {
  48022. event2 = {
  48023. type: "tag",
  48024. tagType: "media-sequence"
  48025. };
  48026. if (match[1]) {
  48027. event2.number = parseInt(match[1], 10);
  48028. }
  48029. this.trigger("data", event2);
  48030. return;
  48031. }
  48032. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  48033. if (match) {
  48034. event2 = {
  48035. type: "tag",
  48036. tagType: "discontinuity-sequence"
  48037. };
  48038. if (match[1]) {
  48039. event2.number = parseInt(match[1], 10);
  48040. }
  48041. this.trigger("data", event2);
  48042. return;
  48043. }
  48044. match = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(newLine);
  48045. if (match) {
  48046. event2 = {
  48047. type: "tag",
  48048. tagType: "playlist-type"
  48049. };
  48050. if (match[1]) {
  48051. event2.playlistType = match[1];
  48052. }
  48053. this.trigger("data", event2);
  48054. return;
  48055. }
  48056. match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);
  48057. if (match) {
  48058. event2 = _extends$2(parseByterange$1(match[1]), {
  48059. type: "tag",
  48060. tagType: "byterange"
  48061. });
  48062. this.trigger("data", event2);
  48063. return;
  48064. }
  48065. match = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(newLine);
  48066. if (match) {
  48067. event2 = {
  48068. type: "tag",
  48069. tagType: "allow-cache"
  48070. };
  48071. if (match[1]) {
  48072. event2.allowed = !/NO/.test(match[1]);
  48073. }
  48074. this.trigger("data", event2);
  48075. return;
  48076. }
  48077. match = /^#EXT-X-MAP:(.*)$/.exec(newLine);
  48078. if (match) {
  48079. event2 = {
  48080. type: "tag",
  48081. tagType: "map"
  48082. };
  48083. if (match[1]) {
  48084. const attributes = parseAttributes$3(match[1]);
  48085. if (attributes.URI) {
  48086. event2.uri = attributes.URI;
  48087. }
  48088. if (attributes.BYTERANGE) {
  48089. event2.byterange = parseByterange$1(attributes.BYTERANGE);
  48090. }
  48091. }
  48092. this.trigger("data", event2);
  48093. return;
  48094. }
  48095. match = /^#EXT-X-STREAM-INF:(.*)$/.exec(newLine);
  48096. if (match) {
  48097. event2 = {
  48098. type: "tag",
  48099. tagType: "stream-inf"
  48100. };
  48101. if (match[1]) {
  48102. event2.attributes = parseAttributes$3(match[1]);
  48103. if (event2.attributes.RESOLUTION) {
  48104. const split2 = event2.attributes.RESOLUTION.split("x");
  48105. const resolution = {};
  48106. if (split2[0]) {
  48107. resolution.width = parseInt(split2[0], 10);
  48108. }
  48109. if (split2[1]) {
  48110. resolution.height = parseInt(split2[1], 10);
  48111. }
  48112. event2.attributes.RESOLUTION = resolution;
  48113. }
  48114. if (event2.attributes.BANDWIDTH) {
  48115. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  48116. }
  48117. if (event2.attributes["FRAME-RATE"]) {
  48118. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  48119. }
  48120. if (event2.attributes["PROGRAM-ID"]) {
  48121. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  48122. }
  48123. }
  48124. this.trigger("data", event2);
  48125. return;
  48126. }
  48127. match = /^#EXT-X-MEDIA:(.*)$/.exec(newLine);
  48128. if (match) {
  48129. event2 = {
  48130. type: "tag",
  48131. tagType: "media"
  48132. };
  48133. if (match[1]) {
  48134. event2.attributes = parseAttributes$3(match[1]);
  48135. }
  48136. this.trigger("data", event2);
  48137. return;
  48138. }
  48139. match = /^#EXT-X-ENDLIST/.exec(newLine);
  48140. if (match) {
  48141. this.trigger("data", {
  48142. type: "tag",
  48143. tagType: "endlist"
  48144. });
  48145. return;
  48146. }
  48147. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  48148. if (match) {
  48149. this.trigger("data", {
  48150. type: "tag",
  48151. tagType: "discontinuity"
  48152. });
  48153. return;
  48154. }
  48155. match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);
  48156. if (match) {
  48157. event2 = {
  48158. type: "tag",
  48159. tagType: "program-date-time"
  48160. };
  48161. if (match[1]) {
  48162. event2.dateTimeString = match[1];
  48163. event2.dateTimeObject = new Date(match[1]);
  48164. }
  48165. this.trigger("data", event2);
  48166. return;
  48167. }
  48168. match = /^#EXT-X-KEY:(.*)$/.exec(newLine);
  48169. if (match) {
  48170. event2 = {
  48171. type: "tag",
  48172. tagType: "key"
  48173. };
  48174. if (match[1]) {
  48175. event2.attributes = parseAttributes$3(match[1]);
  48176. if (event2.attributes.IV) {
  48177. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  48178. event2.attributes.IV = event2.attributes.IV.substring(2);
  48179. }
  48180. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  48181. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  48182. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  48183. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  48184. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  48185. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  48186. }
  48187. }
  48188. this.trigger("data", event2);
  48189. return;
  48190. }
  48191. match = /^#EXT-X-START:(.*)$/.exec(newLine);
  48192. if (match) {
  48193. event2 = {
  48194. type: "tag",
  48195. tagType: "start"
  48196. };
  48197. if (match[1]) {
  48198. event2.attributes = parseAttributes$3(match[1]);
  48199. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  48200. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  48201. }
  48202. this.trigger("data", event2);
  48203. return;
  48204. }
  48205. match = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(newLine);
  48206. if (match) {
  48207. event2 = {
  48208. type: "tag",
  48209. tagType: "cue-out-cont"
  48210. };
  48211. if (match[1]) {
  48212. event2.data = match[1];
  48213. } else {
  48214. event2.data = "";
  48215. }
  48216. this.trigger("data", event2);
  48217. return;
  48218. }
  48219. match = /^#EXT-X-CUE-OUT:(.*)?$/.exec(newLine);
  48220. if (match) {
  48221. event2 = {
  48222. type: "tag",
  48223. tagType: "cue-out"
  48224. };
  48225. if (match[1]) {
  48226. event2.data = match[1];
  48227. } else {
  48228. event2.data = "";
  48229. }
  48230. this.trigger("data", event2);
  48231. return;
  48232. }
  48233. match = /^#EXT-X-CUE-IN:(.*)?$/.exec(newLine);
  48234. if (match) {
  48235. event2 = {
  48236. type: "tag",
  48237. tagType: "cue-in"
  48238. };
  48239. if (match[1]) {
  48240. event2.data = match[1];
  48241. } else {
  48242. event2.data = "";
  48243. }
  48244. this.trigger("data", event2);
  48245. return;
  48246. }
  48247. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  48248. if (match && match[1]) {
  48249. event2 = {
  48250. type: "tag",
  48251. tagType: "skip"
  48252. };
  48253. event2.attributes = parseAttributes$3(match[1]);
  48254. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  48255. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  48256. }
  48257. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  48258. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB$1);
  48259. }
  48260. this.trigger("data", event2);
  48261. return;
  48262. }
  48263. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  48264. if (match && match[1]) {
  48265. event2 = {
  48266. type: "tag",
  48267. tagType: "part"
  48268. };
  48269. event2.attributes = parseAttributes$3(match[1]);
  48270. ["DURATION"].forEach(function(key) {
  48271. if (event2.attributes.hasOwnProperty(key)) {
  48272. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48273. }
  48274. });
  48275. ["INDEPENDENT", "GAP"].forEach(function(key) {
  48276. if (event2.attributes.hasOwnProperty(key)) {
  48277. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48278. }
  48279. });
  48280. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  48281. event2.attributes.byterange = parseByterange$1(event2.attributes.BYTERANGE);
  48282. }
  48283. this.trigger("data", event2);
  48284. return;
  48285. }
  48286. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  48287. if (match && match[1]) {
  48288. event2 = {
  48289. type: "tag",
  48290. tagType: "server-control"
  48291. };
  48292. event2.attributes = parseAttributes$3(match[1]);
  48293. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  48294. if (event2.attributes.hasOwnProperty(key)) {
  48295. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48296. }
  48297. });
  48298. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  48299. if (event2.attributes.hasOwnProperty(key)) {
  48300. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48301. }
  48302. });
  48303. this.trigger("data", event2);
  48304. return;
  48305. }
  48306. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  48307. if (match && match[1]) {
  48308. event2 = {
  48309. type: "tag",
  48310. tagType: "part-inf"
  48311. };
  48312. event2.attributes = parseAttributes$3(match[1]);
  48313. ["PART-TARGET"].forEach(function(key) {
  48314. if (event2.attributes.hasOwnProperty(key)) {
  48315. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48316. }
  48317. });
  48318. this.trigger("data", event2);
  48319. return;
  48320. }
  48321. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  48322. if (match && match[1]) {
  48323. event2 = {
  48324. type: "tag",
  48325. tagType: "preload-hint"
  48326. };
  48327. event2.attributes = parseAttributes$3(match[1]);
  48328. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  48329. if (event2.attributes.hasOwnProperty(key)) {
  48330. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48331. const subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  48332. event2.attributes.byterange = event2.attributes.byterange || {};
  48333. event2.attributes.byterange[subkey] = event2.attributes[key];
  48334. delete event2.attributes[key];
  48335. }
  48336. });
  48337. this.trigger("data", event2);
  48338. return;
  48339. }
  48340. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  48341. if (match && match[1]) {
  48342. event2 = {
  48343. type: "tag",
  48344. tagType: "rendition-report"
  48345. };
  48346. event2.attributes = parseAttributes$3(match[1]);
  48347. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  48348. if (event2.attributes.hasOwnProperty(key)) {
  48349. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48350. }
  48351. });
  48352. this.trigger("data", event2);
  48353. return;
  48354. }
  48355. match = /^#EXT-X-DATERANGE:(.*)$/.exec(newLine);
  48356. if (match && match[1]) {
  48357. event2 = {
  48358. type: "tag",
  48359. tagType: "daterange"
  48360. };
  48361. event2.attributes = parseAttributes$3(match[1]);
  48362. ["ID", "CLASS"].forEach(function(key) {
  48363. if (event2.attributes.hasOwnProperty(key)) {
  48364. event2.attributes[key] = String(event2.attributes[key]);
  48365. }
  48366. });
  48367. ["START-DATE", "END-DATE"].forEach(function(key) {
  48368. if (event2.attributes.hasOwnProperty(key)) {
  48369. event2.attributes[key] = new Date(event2.attributes[key]);
  48370. }
  48371. });
  48372. ["DURATION", "PLANNED-DURATION"].forEach(function(key) {
  48373. if (event2.attributes.hasOwnProperty(key)) {
  48374. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48375. }
  48376. });
  48377. ["END-ON-NEXT"].forEach(function(key) {
  48378. if (event2.attributes.hasOwnProperty(key)) {
  48379. event2.attributes[key] = /YES/i.test(event2.attributes[key]);
  48380. }
  48381. });
  48382. ["SCTE35-CMD", " SCTE35-OUT", "SCTE35-IN"].forEach(function(key) {
  48383. if (event2.attributes.hasOwnProperty(key)) {
  48384. event2.attributes[key] = event2.attributes[key].toString(16);
  48385. }
  48386. });
  48387. const clientAttributePattern = /^X-([A-Z]+-)+[A-Z]+$/;
  48388. for (const key in event2.attributes) {
  48389. if (!clientAttributePattern.test(key)) {
  48390. continue;
  48391. }
  48392. const isHexaDecimal = /[0-9A-Fa-f]{6}/g.test(event2.attributes[key]);
  48393. const isDecimalFloating = /^\d+(\.\d+)?$/.test(event2.attributes[key]);
  48394. event2.attributes[key] = isHexaDecimal ? event2.attributes[key].toString(16) : isDecimalFloating ? parseFloat(event2.attributes[key]) : String(event2.attributes[key]);
  48395. }
  48396. this.trigger("data", event2);
  48397. return;
  48398. }
  48399. this.trigger("data", {
  48400. type: "tag",
  48401. data: newLine.slice(4)
  48402. });
  48403. });
  48404. }
  48405. addParser({
  48406. expression,
  48407. customType,
  48408. dataParser,
  48409. segment
  48410. }) {
  48411. if (typeof dataParser !== "function") {
  48412. dataParser = (line) => line;
  48413. }
  48414. this.customParsers.push((line) => {
  48415. const match = expression.exec(line);
  48416. if (match) {
  48417. this.trigger("data", {
  48418. type: "custom",
  48419. data: dataParser(line),
  48420. customType,
  48421. segment
  48422. });
  48423. return true;
  48424. }
  48425. });
  48426. }
  48427. addTagMapper({
  48428. expression,
  48429. map
  48430. }) {
  48431. const mapFn = (line) => {
  48432. if (expression.test(line)) {
  48433. return map(line);
  48434. }
  48435. return line;
  48436. };
  48437. this.tagMappers.push(mapFn);
  48438. }
  48439. }
  48440. const camelCase$1 = (str) => str.toLowerCase().replace(/-(\w)/g, (a) => a[1].toUpperCase());
  48441. const camelCaseKeys$1 = function(attributes) {
  48442. const result = {};
  48443. Object.keys(attributes).forEach(function(key) {
  48444. result[camelCase$1(key)] = attributes[key];
  48445. });
  48446. return result;
  48447. };
  48448. const setHoldBack$1 = function(manifest) {
  48449. const {
  48450. serverControl,
  48451. targetDuration,
  48452. partTargetDuration
  48453. } = manifest;
  48454. if (!serverControl) {
  48455. return;
  48456. }
  48457. const tag = "#EXT-X-SERVER-CONTROL";
  48458. const hb = "holdBack";
  48459. const phb = "partHoldBack";
  48460. const minTargetDuration = targetDuration && targetDuration * 3;
  48461. const minPartDuration = partTargetDuration && partTargetDuration * 2;
  48462. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  48463. serverControl[hb] = minTargetDuration;
  48464. this.trigger("info", {
  48465. message: `${tag} defaulting HOLD-BACK to targetDuration * 3 (${minTargetDuration}).`
  48466. });
  48467. }
  48468. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  48469. this.trigger("warn", {
  48470. message: `${tag} clamping HOLD-BACK (${serverControl[hb]}) to targetDuration * 3 (${minTargetDuration})`
  48471. });
  48472. serverControl[hb] = minTargetDuration;
  48473. }
  48474. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  48475. serverControl[phb] = partTargetDuration * 3;
  48476. this.trigger("info", {
  48477. message: `${tag} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${serverControl[phb]}).`
  48478. });
  48479. }
  48480. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  48481. this.trigger("warn", {
  48482. message: `${tag} clamping PART-HOLD-BACK (${serverControl[phb]}) to partTargetDuration * 2 (${minPartDuration}).`
  48483. });
  48484. serverControl[phb] = minPartDuration;
  48485. }
  48486. };
  48487. class Parser$1 extends Stream$1 {
  48488. constructor() {
  48489. super();
  48490. this.lineStream = new LineStream$1();
  48491. this.parseStream = new ParseStream$1();
  48492. this.lineStream.pipe(this.parseStream);
  48493. const self2 = this;
  48494. const uris = [];
  48495. let currentUri = {};
  48496. let currentMap;
  48497. let key;
  48498. let hasParts = false;
  48499. const noop2 = function() {
  48500. };
  48501. const defaultMediaGroups = {
  48502. "AUDIO": {},
  48503. "VIDEO": {},
  48504. "CLOSED-CAPTIONS": {},
  48505. "SUBTITLES": {}
  48506. };
  48507. const widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  48508. let currentTimeline = 0;
  48509. this.manifest = {
  48510. allowCache: true,
  48511. discontinuityStarts: [],
  48512. segments: []
  48513. };
  48514. let lastByterangeEnd = 0;
  48515. let lastPartByterangeEnd = 0;
  48516. const daterangeTags = {};
  48517. this.on("end", () => {
  48518. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  48519. return;
  48520. }
  48521. if (!currentUri.map && currentMap) {
  48522. currentUri.map = currentMap;
  48523. }
  48524. if (!currentUri.key && key) {
  48525. currentUri.key = key;
  48526. }
  48527. if (!currentUri.timeline && typeof currentTimeline === "number") {
  48528. currentUri.timeline = currentTimeline;
  48529. }
  48530. this.manifest.preloadSegment = currentUri;
  48531. });
  48532. this.parseStream.on("data", function(entry) {
  48533. let mediaGroup;
  48534. let rendition;
  48535. ({
  48536. tag() {
  48537. ({
  48538. version() {
  48539. if (entry.version) {
  48540. this.manifest.version = entry.version;
  48541. }
  48542. },
  48543. "allow-cache"() {
  48544. this.manifest.allowCache = entry.allowed;
  48545. if (!("allowed" in entry)) {
  48546. this.trigger("info", {
  48547. message: "defaulting allowCache to YES"
  48548. });
  48549. this.manifest.allowCache = true;
  48550. }
  48551. },
  48552. byterange() {
  48553. const byterange = {};
  48554. if ("length" in entry) {
  48555. currentUri.byterange = byterange;
  48556. byterange.length = entry.length;
  48557. if (!("offset" in entry)) {
  48558. entry.offset = lastByterangeEnd;
  48559. }
  48560. }
  48561. if ("offset" in entry) {
  48562. currentUri.byterange = byterange;
  48563. byterange.offset = entry.offset;
  48564. }
  48565. lastByterangeEnd = byterange.offset + byterange.length;
  48566. },
  48567. endlist() {
  48568. this.manifest.endList = true;
  48569. },
  48570. inf() {
  48571. if (!("mediaSequence" in this.manifest)) {
  48572. this.manifest.mediaSequence = 0;
  48573. this.trigger("info", {
  48574. message: "defaulting media sequence to zero"
  48575. });
  48576. }
  48577. if (!("discontinuitySequence" in this.manifest)) {
  48578. this.manifest.discontinuitySequence = 0;
  48579. this.trigger("info", {
  48580. message: "defaulting discontinuity sequence to zero"
  48581. });
  48582. }
  48583. if (entry.duration > 0) {
  48584. currentUri.duration = entry.duration;
  48585. }
  48586. if (entry.duration === 0) {
  48587. currentUri.duration = 0.01;
  48588. this.trigger("info", {
  48589. message: "updating zero segment duration to a small value"
  48590. });
  48591. }
  48592. this.manifest.segments = uris;
  48593. },
  48594. key() {
  48595. if (!entry.attributes) {
  48596. this.trigger("warn", {
  48597. message: "ignoring key declaration without attribute list"
  48598. });
  48599. return;
  48600. }
  48601. if (entry.attributes.METHOD === "NONE") {
  48602. key = null;
  48603. return;
  48604. }
  48605. if (!entry.attributes.URI) {
  48606. this.trigger("warn", {
  48607. message: "ignoring key declaration without URI"
  48608. });
  48609. return;
  48610. }
  48611. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  48612. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48613. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  48614. attributes: entry.attributes
  48615. };
  48616. return;
  48617. }
  48618. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  48619. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48620. this.manifest.contentProtection["com.microsoft.playready"] = {
  48621. uri: entry.attributes.URI
  48622. };
  48623. return;
  48624. }
  48625. if (entry.attributes.KEYFORMAT === widevineUuid) {
  48626. const VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  48627. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  48628. this.trigger("warn", {
  48629. message: "invalid key method provided for Widevine"
  48630. });
  48631. return;
  48632. }
  48633. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  48634. this.trigger("warn", {
  48635. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  48636. });
  48637. }
  48638. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  48639. this.trigger("warn", {
  48640. message: "invalid key URI provided for Widevine"
  48641. });
  48642. return;
  48643. }
  48644. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  48645. this.trigger("warn", {
  48646. message: "invalid key ID provided for Widevine"
  48647. });
  48648. return;
  48649. }
  48650. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48651. this.manifest.contentProtection["com.widevine.alpha"] = {
  48652. attributes: {
  48653. schemeIdUri: entry.attributes.KEYFORMAT,
  48654. keyId: entry.attributes.KEYID.substring(2)
  48655. },
  48656. pssh: decodeB64ToUint8Array$2(entry.attributes.URI.split(",")[1])
  48657. };
  48658. return;
  48659. }
  48660. if (!entry.attributes.METHOD) {
  48661. this.trigger("warn", {
  48662. message: "defaulting key method to AES-128"
  48663. });
  48664. }
  48665. key = {
  48666. method: entry.attributes.METHOD || "AES-128",
  48667. uri: entry.attributes.URI
  48668. };
  48669. if (typeof entry.attributes.IV !== "undefined") {
  48670. key.iv = entry.attributes.IV;
  48671. }
  48672. },
  48673. "media-sequence"() {
  48674. if (!isFinite(entry.number)) {
  48675. this.trigger("warn", {
  48676. message: "ignoring invalid media sequence: " + entry.number
  48677. });
  48678. return;
  48679. }
  48680. this.manifest.mediaSequence = entry.number;
  48681. },
  48682. "discontinuity-sequence"() {
  48683. if (!isFinite(entry.number)) {
  48684. this.trigger("warn", {
  48685. message: "ignoring invalid discontinuity sequence: " + entry.number
  48686. });
  48687. return;
  48688. }
  48689. this.manifest.discontinuitySequence = entry.number;
  48690. currentTimeline = entry.number;
  48691. },
  48692. "playlist-type"() {
  48693. if (!/VOD|EVENT/.test(entry.playlistType)) {
  48694. this.trigger("warn", {
  48695. message: "ignoring unknown playlist type: " + entry.playlist
  48696. });
  48697. return;
  48698. }
  48699. this.manifest.playlistType = entry.playlistType;
  48700. },
  48701. map() {
  48702. currentMap = {};
  48703. if (entry.uri) {
  48704. currentMap.uri = entry.uri;
  48705. }
  48706. if (entry.byterange) {
  48707. currentMap.byterange = entry.byterange;
  48708. }
  48709. if (key) {
  48710. currentMap.key = key;
  48711. }
  48712. },
  48713. "stream-inf"() {
  48714. this.manifest.playlists = uris;
  48715. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48716. if (!entry.attributes) {
  48717. this.trigger("warn", {
  48718. message: "ignoring empty stream-inf attributes"
  48719. });
  48720. return;
  48721. }
  48722. if (!currentUri.attributes) {
  48723. currentUri.attributes = {};
  48724. }
  48725. _extends$2(currentUri.attributes, entry.attributes);
  48726. },
  48727. media() {
  48728. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48729. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  48730. this.trigger("warn", {
  48731. message: "ignoring incomplete or missing media group"
  48732. });
  48733. return;
  48734. }
  48735. const mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  48736. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  48737. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  48738. rendition = {
  48739. default: /yes/i.test(entry.attributes.DEFAULT)
  48740. };
  48741. if (rendition.default) {
  48742. rendition.autoselect = true;
  48743. } else {
  48744. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  48745. }
  48746. if (entry.attributes.LANGUAGE) {
  48747. rendition.language = entry.attributes.LANGUAGE;
  48748. }
  48749. if (entry.attributes.URI) {
  48750. rendition.uri = entry.attributes.URI;
  48751. }
  48752. if (entry.attributes["INSTREAM-ID"]) {
  48753. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  48754. }
  48755. if (entry.attributes.CHARACTERISTICS) {
  48756. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  48757. }
  48758. if (entry.attributes.FORCED) {
  48759. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  48760. }
  48761. mediaGroup[entry.attributes.NAME] = rendition;
  48762. },
  48763. discontinuity() {
  48764. currentTimeline += 1;
  48765. currentUri.discontinuity = true;
  48766. this.manifest.discontinuityStarts.push(uris.length);
  48767. },
  48768. "program-date-time"() {
  48769. if (typeof this.manifest.dateTimeString === "undefined") {
  48770. this.manifest.dateTimeString = entry.dateTimeString;
  48771. this.manifest.dateTimeObject = entry.dateTimeObject;
  48772. }
  48773. currentUri.dateTimeString = entry.dateTimeString;
  48774. currentUri.dateTimeObject = entry.dateTimeObject;
  48775. },
  48776. targetduration() {
  48777. if (!isFinite(entry.duration) || entry.duration < 0) {
  48778. this.trigger("warn", {
  48779. message: "ignoring invalid target duration: " + entry.duration
  48780. });
  48781. return;
  48782. }
  48783. this.manifest.targetDuration = entry.duration;
  48784. setHoldBack$1.call(this, this.manifest);
  48785. },
  48786. start() {
  48787. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  48788. this.trigger("warn", {
  48789. message: "ignoring start declaration without appropriate attribute list"
  48790. });
  48791. return;
  48792. }
  48793. this.manifest.start = {
  48794. timeOffset: entry.attributes["TIME-OFFSET"],
  48795. precise: entry.attributes.PRECISE
  48796. };
  48797. },
  48798. "cue-out"() {
  48799. currentUri.cueOut = entry.data;
  48800. },
  48801. "cue-out-cont"() {
  48802. currentUri.cueOutCont = entry.data;
  48803. },
  48804. "cue-in"() {
  48805. currentUri.cueIn = entry.data;
  48806. },
  48807. "skip"() {
  48808. this.manifest.skip = camelCaseKeys$1(entry.attributes);
  48809. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  48810. },
  48811. "part"() {
  48812. hasParts = true;
  48813. const segmentIndex = this.manifest.segments.length;
  48814. const part = camelCaseKeys$1(entry.attributes);
  48815. currentUri.parts = currentUri.parts || [];
  48816. currentUri.parts.push(part);
  48817. if (part.byterange) {
  48818. if (!part.byterange.hasOwnProperty("offset")) {
  48819. part.byterange.offset = lastPartByterangeEnd;
  48820. }
  48821. lastPartByterangeEnd = part.byterange.offset + part.byterange.length;
  48822. }
  48823. const partIndex = currentUri.parts.length - 1;
  48824. this.warnOnMissingAttributes_(`#EXT-X-PART #${partIndex} for segment #${segmentIndex}`, entry.attributes, ["URI", "DURATION"]);
  48825. if (this.manifest.renditionReports) {
  48826. this.manifest.renditionReports.forEach((r2, i2) => {
  48827. if (!r2.hasOwnProperty("lastPart")) {
  48828. this.trigger("warn", {
  48829. message: `#EXT-X-RENDITION-REPORT #${i2} lacks required attribute(s): LAST-PART`
  48830. });
  48831. }
  48832. });
  48833. }
  48834. },
  48835. "server-control"() {
  48836. const attrs = this.manifest.serverControl = camelCaseKeys$1(entry.attributes);
  48837. if (!attrs.hasOwnProperty("canBlockReload")) {
  48838. attrs.canBlockReload = false;
  48839. this.trigger("info", {
  48840. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  48841. });
  48842. }
  48843. setHoldBack$1.call(this, this.manifest);
  48844. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  48845. this.trigger("warn", {
  48846. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  48847. });
  48848. }
  48849. },
  48850. "preload-hint"() {
  48851. const segmentIndex = this.manifest.segments.length;
  48852. const hint = camelCaseKeys$1(entry.attributes);
  48853. const isPart = hint.type && hint.type === "PART";
  48854. currentUri.preloadHints = currentUri.preloadHints || [];
  48855. currentUri.preloadHints.push(hint);
  48856. if (hint.byterange) {
  48857. if (!hint.byterange.hasOwnProperty("offset")) {
  48858. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  48859. if (isPart) {
  48860. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  48861. }
  48862. }
  48863. }
  48864. const index2 = currentUri.preloadHints.length - 1;
  48865. this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex}`, entry.attributes, ["TYPE", "URI"]);
  48866. if (!hint.type) {
  48867. return;
  48868. }
  48869. for (let i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  48870. const otherHint = currentUri.preloadHints[i2];
  48871. if (!otherHint.type) {
  48872. continue;
  48873. }
  48874. if (otherHint.type === hint.type) {
  48875. this.trigger("warn", {
  48876. message: `#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex} has the same TYPE ${hint.type} as preload hint #${i2}`
  48877. });
  48878. }
  48879. }
  48880. },
  48881. "rendition-report"() {
  48882. const report = camelCaseKeys$1(entry.attributes);
  48883. this.manifest.renditionReports = this.manifest.renditionReports || [];
  48884. this.manifest.renditionReports.push(report);
  48885. const index2 = this.manifest.renditionReports.length - 1;
  48886. const required = ["LAST-MSN", "URI"];
  48887. if (hasParts) {
  48888. required.push("LAST-PART");
  48889. }
  48890. this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${index2}`, entry.attributes, required);
  48891. },
  48892. "part-inf"() {
  48893. this.manifest.partInf = camelCaseKeys$1(entry.attributes);
  48894. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  48895. if (this.manifest.partInf.partTarget) {
  48896. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  48897. }
  48898. setHoldBack$1.call(this, this.manifest);
  48899. },
  48900. "daterange"() {
  48901. this.manifest.daterange = this.manifest.daterange || [];
  48902. this.manifest.daterange.push(camelCaseKeys$1(entry.attributes));
  48903. const index2 = this.manifest.daterange.length - 1;
  48904. this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${index2}`, entry.attributes, ["ID", "START-DATE"]);
  48905. const daterange = this.manifest.daterange[index2];
  48906. if (daterange.endDate && daterange.startDate && new Date(daterange.endDate) < new Date(daterange.startDate)) {
  48907. this.trigger("warn", {
  48908. message: "EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"
  48909. });
  48910. }
  48911. if (daterange.duration && daterange.duration < 0) {
  48912. this.trigger("warn", {
  48913. message: "EXT-X-DATERANGE DURATION must not be negative"
  48914. });
  48915. }
  48916. if (daterange.plannedDuration && daterange.plannedDuration < 0) {
  48917. this.trigger("warn", {
  48918. message: "EXT-X-DATERANGE PLANNED-DURATION must not be negative"
  48919. });
  48920. }
  48921. const endOnNextYes = !!daterange.endOnNext;
  48922. if (endOnNextYes && !daterange.class) {
  48923. this.trigger("warn", {
  48924. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"
  48925. });
  48926. }
  48927. if (endOnNextYes && (daterange.duration || daterange.endDate)) {
  48928. this.trigger("warn", {
  48929. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"
  48930. });
  48931. }
  48932. if (daterange.duration && daterange.endDate) {
  48933. const startDate = daterange.startDate;
  48934. const newDateInSeconds = startDate.setSeconds(startDate.getSeconds() + daterange.duration);
  48935. this.manifest.daterange[index2].endDate = new Date(newDateInSeconds);
  48936. }
  48937. if (daterange && !this.manifest.dateTimeString) {
  48938. this.trigger("warn", {
  48939. message: "A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"
  48940. });
  48941. }
  48942. if (!daterangeTags[daterange.id]) {
  48943. daterangeTags[daterange.id] = daterange;
  48944. } else {
  48945. for (const attribute in daterangeTags[daterange.id]) {
  48946. if (daterangeTags[daterange.id][attribute] !== daterange[attribute]) {
  48947. this.trigger("warn", {
  48948. message: "EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values"
  48949. });
  48950. break;
  48951. }
  48952. }
  48953. }
  48954. }
  48955. }[entry.tagType] || noop2).call(self2);
  48956. },
  48957. uri() {
  48958. currentUri.uri = entry.uri;
  48959. uris.push(currentUri);
  48960. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  48961. this.trigger("warn", {
  48962. message: "defaulting segment duration to the target duration"
  48963. });
  48964. currentUri.duration = this.manifest.targetDuration;
  48965. }
  48966. if (key) {
  48967. currentUri.key = key;
  48968. }
  48969. currentUri.timeline = currentTimeline;
  48970. if (currentMap) {
  48971. currentUri.map = currentMap;
  48972. }
  48973. lastPartByterangeEnd = 0;
  48974. currentUri = {};
  48975. },
  48976. comment() {
  48977. },
  48978. custom() {
  48979. if (entry.segment) {
  48980. currentUri.custom = currentUri.custom || {};
  48981. currentUri.custom[entry.customType] = entry.data;
  48982. } else {
  48983. this.manifest.custom = this.manifest.custom || {};
  48984. this.manifest.custom[entry.customType] = entry.data;
  48985. }
  48986. }
  48987. })[entry.type].call(self2);
  48988. });
  48989. }
  48990. warnOnMissingAttributes_(identifier, attributes, required) {
  48991. const missing = [];
  48992. required.forEach(function(key) {
  48993. if (!attributes.hasOwnProperty(key)) {
  48994. missing.push(key);
  48995. }
  48996. });
  48997. if (missing.length) {
  48998. this.trigger("warn", {
  48999. message: `${identifier} lacks required attribute(s): ${missing.join(", ")}`
  49000. });
  49001. }
  49002. }
  49003. push(chunk) {
  49004. this.lineStream.push(chunk);
  49005. }
  49006. end() {
  49007. this.lineStream.push("\n");
  49008. this.trigger("end");
  49009. }
  49010. addParser(options2) {
  49011. this.parseStream.addParser(options2);
  49012. }
  49013. addTagMapper(options2) {
  49014. this.parseStream.addTagMapper(options2);
  49015. }
  49016. }
  49017. var regexs$1 = {
  49018. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  49019. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  49020. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  49021. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  49022. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  49023. text: /^(stpp.ttml.im1t)/,
  49024. muxerVideo: /^(avc0?1)/,
  49025. muxerAudio: /^(mp4a)/,
  49026. muxerText: /a^/
  49027. };
  49028. var mediaTypes$1 = ["video", "audio", "text"];
  49029. var upperMediaTypes$1 = ["Video", "Audio", "Text"];
  49030. var translateLegacyCodec$1 = function translateLegacyCodec(codec) {
  49031. if (!codec) {
  49032. return codec;
  49033. }
  49034. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  49035. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  49036. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  49037. return "avc1." + profileHex + "00" + avcLevelHex;
  49038. });
  49039. };
  49040. var parseCodecs$1 = function parseCodecs(codecString) {
  49041. if (codecString === void 0) {
  49042. codecString = "";
  49043. }
  49044. var codecs = codecString.split(",");
  49045. var result = [];
  49046. codecs.forEach(function(codec) {
  49047. codec = codec.trim();
  49048. var codecType;
  49049. mediaTypes$1.forEach(function(name) {
  49050. var match = regexs$1[name].exec(codec.toLowerCase());
  49051. if (!match || match.length <= 1) {
  49052. return;
  49053. }
  49054. codecType = name;
  49055. var type2 = codec.substring(0, match[1].length);
  49056. var details = codec.replace(type2, "");
  49057. result.push({
  49058. type: type2,
  49059. details,
  49060. mediaType: name
  49061. });
  49062. });
  49063. if (!codecType) {
  49064. result.push({
  49065. type: codec,
  49066. details: "",
  49067. mediaType: "unknown"
  49068. });
  49069. }
  49070. });
  49071. return result;
  49072. };
  49073. var codecsFromDefault$1 = function codecsFromDefault(master, audioGroupId) {
  49074. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  49075. return null;
  49076. }
  49077. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  49078. if (!audioGroup) {
  49079. return null;
  49080. }
  49081. for (var name in audioGroup) {
  49082. var audioType = audioGroup[name];
  49083. if (audioType.default && audioType.playlists) {
  49084. return parseCodecs$1(audioType.playlists[0].attributes.CODECS);
  49085. }
  49086. }
  49087. return null;
  49088. };
  49089. var isAudioCodec$1 = function isAudioCodec(codec) {
  49090. if (codec === void 0) {
  49091. codec = "";
  49092. }
  49093. return regexs$1.audio.test(codec.trim().toLowerCase());
  49094. };
  49095. var isTextCodec$1 = function isTextCodec(codec) {
  49096. if (codec === void 0) {
  49097. codec = "";
  49098. }
  49099. return regexs$1.text.test(codec.trim().toLowerCase());
  49100. };
  49101. var getMimeForCodec$1 = function getMimeForCodec(codecString) {
  49102. if (!codecString || typeof codecString !== "string") {
  49103. return;
  49104. }
  49105. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  49106. return translateLegacyCodec$1(c.trim());
  49107. });
  49108. var type2 = "video";
  49109. if (codecs.length === 1 && isAudioCodec$1(codecs[0])) {
  49110. type2 = "audio";
  49111. } else if (codecs.length === 1 && isTextCodec$1(codecs[0])) {
  49112. type2 = "application";
  49113. }
  49114. var container = "mp4";
  49115. if (codecs.every(function(c) {
  49116. return regexs$1.mp4.test(c);
  49117. })) {
  49118. container = "mp4";
  49119. } else if (codecs.every(function(c) {
  49120. return regexs$1.webm.test(c);
  49121. })) {
  49122. container = "webm";
  49123. } else if (codecs.every(function(c) {
  49124. return regexs$1.ogg.test(c);
  49125. })) {
  49126. container = "ogg";
  49127. }
  49128. return type2 + "/" + container + ';codecs="' + codecString + '"';
  49129. };
  49130. var browserSupportsCodec$1 = function browserSupportsCodec(codecString) {
  49131. if (codecString === void 0) {
  49132. codecString = "";
  49133. }
  49134. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec$1(codecString)) || false;
  49135. };
  49136. var muxerSupportsCodec$1 = function muxerSupportsCodec(codecString) {
  49137. if (codecString === void 0) {
  49138. codecString = "";
  49139. }
  49140. return codecString.toLowerCase().split(",").every(function(codec) {
  49141. codec = codec.trim();
  49142. for (var i2 = 0; i2 < upperMediaTypes$1.length; i2++) {
  49143. var type2 = upperMediaTypes$1[i2];
  49144. if (regexs$1["muxer" + type2].test(codec)) {
  49145. return true;
  49146. }
  49147. }
  49148. return false;
  49149. });
  49150. };
  49151. var DEFAULT_AUDIO_CODEC$1 = "mp4a.40.2";
  49152. var DEFAULT_VIDEO_CODEC$1 = "avc1.4d400d";
  49153. var MPEGURL_REGEX$1 = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  49154. var DASH_REGEX$1 = /^application\/dash\+xml/i;
  49155. var simpleTypeFromSourceType$1 = function simpleTypeFromSourceType(type2) {
  49156. if (MPEGURL_REGEX$1.test(type2)) {
  49157. return "hls";
  49158. }
  49159. if (DASH_REGEX$1.test(type2)) {
  49160. return "dash";
  49161. }
  49162. if (type2 === "application/vnd.videojs.vhs+json") {
  49163. return "vhs-json";
  49164. }
  49165. return null;
  49166. };
  49167. var countBits$1 = function countBits(x) {
  49168. return x.toString(2).length;
  49169. };
  49170. var countBytes$1 = function countBytes(x) {
  49171. return Math.ceil(countBits$1(x) / 8);
  49172. };
  49173. var isArrayBufferView$1 = function isArrayBufferView(obj) {
  49174. if (ArrayBuffer.isView === "function") {
  49175. return ArrayBuffer.isView(obj);
  49176. }
  49177. return obj && obj.buffer instanceof ArrayBuffer;
  49178. };
  49179. var isTypedArray$1 = function isTypedArray(obj) {
  49180. return isArrayBufferView$1(obj);
  49181. };
  49182. var toUint8$1 = function toUint8(bytes) {
  49183. if (bytes instanceof Uint8Array) {
  49184. return bytes;
  49185. }
  49186. if (!Array.isArray(bytes) && !isTypedArray$1(bytes) && !(bytes instanceof ArrayBuffer)) {
  49187. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  49188. bytes = 0;
  49189. } else {
  49190. bytes = [bytes];
  49191. }
  49192. }
  49193. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  49194. };
  49195. var BigInt$1 = window_1.BigInt || Number;
  49196. var BYTE_TABLE$1 = [BigInt$1("0x1"), BigInt$1("0x100"), BigInt$1("0x10000"), BigInt$1("0x1000000"), BigInt$1("0x100000000"), BigInt$1("0x10000000000"), BigInt$1("0x1000000000000"), BigInt$1("0x100000000000000"), BigInt$1("0x10000000000000000")];
  49197. (function() {
  49198. var a = new Uint16Array([65484]);
  49199. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  49200. if (b[0] === 255) {
  49201. return "big";
  49202. }
  49203. if (b[0] === 204) {
  49204. return "little";
  49205. }
  49206. return "unknown";
  49207. })();
  49208. var bytesToNumber$1 = function bytesToNumber(bytes, _temp) {
  49209. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  49210. bytes = toUint8$1(bytes);
  49211. var fn2 = le ? "reduce" : "reduceRight";
  49212. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  49213. var number = obj.call(bytes, function(total, byte, i2) {
  49214. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49215. return total + BigInt$1(byte) * BYTE_TABLE$1[exponent];
  49216. }, BigInt$1(0));
  49217. if (signed) {
  49218. var max2 = BYTE_TABLE$1[bytes.length] / BigInt$1(2) - BigInt$1(1);
  49219. number = BigInt$1(number);
  49220. if (number > max2) {
  49221. number -= max2;
  49222. number -= max2;
  49223. number -= BigInt$1(2);
  49224. }
  49225. }
  49226. return Number(number);
  49227. };
  49228. var numberToBytes$1 = function numberToBytes(number, _temp2) {
  49229. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  49230. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  49231. number = 0;
  49232. }
  49233. number = BigInt$1(number);
  49234. var byteCount = countBytes$1(number);
  49235. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  49236. for (var i2 = 0; i2 < byteCount; i2++) {
  49237. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49238. bytes[byteIndex] = Number(number / BYTE_TABLE$1[i2] & BigInt$1(255));
  49239. if (number < 0) {
  49240. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  49241. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  49242. }
  49243. }
  49244. return bytes;
  49245. };
  49246. var stringToBytes$1 = function stringToBytes(string, stringIsBytes) {
  49247. if (typeof string !== "string" && string && typeof string.toString === "function") {
  49248. string = string.toString();
  49249. }
  49250. if (typeof string !== "string") {
  49251. return new Uint8Array();
  49252. }
  49253. if (!stringIsBytes) {
  49254. string = unescape(encodeURIComponent(string));
  49255. }
  49256. var view = new Uint8Array(string.length);
  49257. for (var i2 = 0; i2 < string.length; i2++) {
  49258. view[i2] = string.charCodeAt(i2);
  49259. }
  49260. return view;
  49261. };
  49262. var concatTypedArrays$1 = function concatTypedArrays() {
  49263. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  49264. buffers[_key] = arguments[_key];
  49265. }
  49266. buffers = buffers.filter(function(b) {
  49267. return b && (b.byteLength || b.length) && typeof b !== "string";
  49268. });
  49269. if (buffers.length <= 1) {
  49270. return toUint8$1(buffers[0]);
  49271. }
  49272. var totalLen = buffers.reduce(function(total, buf, i2) {
  49273. return total + (buf.byteLength || buf.length);
  49274. }, 0);
  49275. var tempBuffer = new Uint8Array(totalLen);
  49276. var offset = 0;
  49277. buffers.forEach(function(buf) {
  49278. buf = toUint8$1(buf);
  49279. tempBuffer.set(buf, offset);
  49280. offset += buf.byteLength;
  49281. });
  49282. return tempBuffer;
  49283. };
  49284. var bytesMatch$1 = function bytesMatch(a, b, _temp3) {
  49285. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  49286. a = toUint8$1(a);
  49287. b = toUint8$1(b);
  49288. var fn2 = b.every ? b.every : Array.prototype.every;
  49289. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  49290. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  49291. return bByte === aByte;
  49292. });
  49293. };
  49294. var DEFAULT_LOCATION$1 = "http://example.com";
  49295. var resolveUrl$3 = function resolveUrl2(baseUrl, relativeUrl) {
  49296. if (/^[a-z]+:/i.test(relativeUrl)) {
  49297. return relativeUrl;
  49298. }
  49299. if (/^data:/.test(baseUrl)) {
  49300. baseUrl = window_1.location && window_1.location.href || "";
  49301. }
  49302. var nativeURL = typeof window_1.URL === "function";
  49303. var protocolLess = /^\/\//.test(baseUrl);
  49304. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  49305. if (nativeURL) {
  49306. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$1);
  49307. } else if (!/\/\//i.test(baseUrl)) {
  49308. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  49309. }
  49310. if (nativeURL) {
  49311. var newUrl = new URL(relativeUrl, baseUrl);
  49312. if (removeLocation) {
  49313. return newUrl.href.slice(DEFAULT_LOCATION$1.length);
  49314. } else if (protocolLess) {
  49315. return newUrl.href.slice(newUrl.protocol.length);
  49316. }
  49317. return newUrl.href;
  49318. }
  49319. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  49320. };
  49321. var forEachMediaGroup$3 = function forEachMediaGroup(master, groups, callback2) {
  49322. groups.forEach(function(mediaType) {
  49323. for (var groupKey in master.mediaGroups[mediaType]) {
  49324. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  49325. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  49326. callback2(mediaProperties, mediaType, groupKey, labelKey);
  49327. }
  49328. }
  49329. });
  49330. };
  49331. var atob$1 = function atob2(s) {
  49332. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  49333. };
  49334. function decodeB64ToUint8Array$1(b64Text) {
  49335. var decodedString = atob$1(b64Text);
  49336. var array = new Uint8Array(decodedString.length);
  49337. for (var i2 = 0; i2 < decodedString.length; i2++) {
  49338. array[i2] = decodedString.charCodeAt(i2);
  49339. }
  49340. return array;
  49341. }
  49342. var dom$1 = {};
  49343. var conventions$2 = {};
  49344. function find$1(list, predicate, ac) {
  49345. if (ac === void 0) {
  49346. ac = Array.prototype;
  49347. }
  49348. if (list && typeof ac.find === "function") {
  49349. return ac.find.call(list, predicate);
  49350. }
  49351. for (var i2 = 0; i2 < list.length; i2++) {
  49352. if (Object.prototype.hasOwnProperty.call(list, i2)) {
  49353. var item = list[i2];
  49354. if (predicate.call(void 0, item, i2, list)) {
  49355. return item;
  49356. }
  49357. }
  49358. }
  49359. }
  49360. function freeze(object, oc) {
  49361. if (oc === void 0) {
  49362. oc = Object;
  49363. }
  49364. return oc && typeof oc.freeze === "function" ? oc.freeze(object) : object;
  49365. }
  49366. function assign$1(target, source) {
  49367. if (target === null || typeof target !== "object") {
  49368. throw new TypeError("target is not an object");
  49369. }
  49370. for (var key in source) {
  49371. if (Object.prototype.hasOwnProperty.call(source, key)) {
  49372. target[key] = source[key];
  49373. }
  49374. }
  49375. return target;
  49376. }
  49377. var MIME_TYPE = freeze({
  49378. HTML: "text/html",
  49379. isHTML: function(value) {
  49380. return value === MIME_TYPE.HTML;
  49381. },
  49382. XML_APPLICATION: "application/xml",
  49383. XML_TEXT: "text/xml",
  49384. XML_XHTML_APPLICATION: "application/xhtml+xml",
  49385. XML_SVG_IMAGE: "image/svg+xml"
  49386. });
  49387. var NAMESPACE$3 = freeze({
  49388. HTML: "http://www.w3.org/1999/xhtml",
  49389. isHTML: function(uri) {
  49390. return uri === NAMESPACE$3.HTML;
  49391. },
  49392. SVG: "http://www.w3.org/2000/svg",
  49393. XML: "http://www.w3.org/XML/1998/namespace",
  49394. XMLNS: "http://www.w3.org/2000/xmlns/"
  49395. });
  49396. conventions$2.assign = assign$1;
  49397. conventions$2.find = find$1;
  49398. conventions$2.freeze = freeze;
  49399. conventions$2.MIME_TYPE = MIME_TYPE;
  49400. conventions$2.NAMESPACE = NAMESPACE$3;
  49401. var conventions$1 = conventions$2;
  49402. var find = conventions$1.find;
  49403. var NAMESPACE$2 = conventions$1.NAMESPACE;
  49404. function notEmptyString(input) {
  49405. return input !== "";
  49406. }
  49407. function splitOnASCIIWhitespace(input) {
  49408. return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : [];
  49409. }
  49410. function orderedSetReducer(current, element) {
  49411. if (!current.hasOwnProperty(element)) {
  49412. current[element] = true;
  49413. }
  49414. return current;
  49415. }
  49416. function toOrderedSet(input) {
  49417. if (!input)
  49418. return [];
  49419. var list = splitOnASCIIWhitespace(input);
  49420. return Object.keys(list.reduce(orderedSetReducer, {}));
  49421. }
  49422. function arrayIncludes(list) {
  49423. return function(element) {
  49424. return list && list.indexOf(element) !== -1;
  49425. };
  49426. }
  49427. function copy(src, dest) {
  49428. for (var p in src) {
  49429. if (Object.prototype.hasOwnProperty.call(src, p)) {
  49430. dest[p] = src[p];
  49431. }
  49432. }
  49433. }
  49434. function _extends(Class, Super) {
  49435. var pt2 = Class.prototype;
  49436. if (!(pt2 instanceof Super)) {
  49437. let t2 = function() {
  49438. };
  49439. t2.prototype = Super.prototype;
  49440. t2 = new t2();
  49441. copy(pt2, t2);
  49442. Class.prototype = pt2 = t2;
  49443. }
  49444. if (pt2.constructor != Class) {
  49445. if (typeof Class != "function") {
  49446. console.error("unknown Class:" + Class);
  49447. }
  49448. pt2.constructor = Class;
  49449. }
  49450. }
  49451. var NodeType = {};
  49452. var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
  49453. var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
  49454. var TEXT_NODE = NodeType.TEXT_NODE = 3;
  49455. var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
  49456. var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
  49457. var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
  49458. var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
  49459. var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
  49460. var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
  49461. var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
  49462. var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
  49463. var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
  49464. var ExceptionCode = {};
  49465. var ExceptionMessage = {};
  49466. ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1);
  49467. ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2);
  49468. var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3);
  49469. ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4);
  49470. ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5);
  49471. ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6);
  49472. ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7);
  49473. var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8);
  49474. ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9);
  49475. var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10);
  49476. ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11);
  49477. ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12);
  49478. ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13);
  49479. ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14);
  49480. ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15);
  49481. function DOMException(code, message) {
  49482. if (message instanceof Error) {
  49483. var error = message;
  49484. } else {
  49485. error = this;
  49486. Error.call(this, ExceptionMessage[code]);
  49487. this.message = ExceptionMessage[code];
  49488. if (Error.captureStackTrace)
  49489. Error.captureStackTrace(this, DOMException);
  49490. }
  49491. error.code = code;
  49492. if (message)
  49493. this.message = this.message + ": " + message;
  49494. return error;
  49495. }
  49496. DOMException.prototype = Error.prototype;
  49497. copy(ExceptionCode, DOMException);
  49498. function NodeList() {
  49499. }
  49500. NodeList.prototype = {
  49501. length: 0,
  49502. item: function(index2) {
  49503. return this[index2] || null;
  49504. },
  49505. toString: function(isHTML, nodeFilter) {
  49506. for (var buf = [], i2 = 0; i2 < this.length; i2++) {
  49507. serializeToString(this[i2], buf, isHTML, nodeFilter);
  49508. }
  49509. return buf.join("");
  49510. },
  49511. filter: function(predicate) {
  49512. return Array.prototype.filter.call(this, predicate);
  49513. },
  49514. indexOf: function(item) {
  49515. return Array.prototype.indexOf.call(this, item);
  49516. }
  49517. };
  49518. function LiveNodeList(node, refresh) {
  49519. this._node = node;
  49520. this._refresh = refresh;
  49521. _updateLiveList(this);
  49522. }
  49523. function _updateLiveList(list) {
  49524. var inc = list._node._inc || list._node.ownerDocument._inc;
  49525. if (list._inc != inc) {
  49526. var ls = list._refresh(list._node);
  49527. __set__(list, "length", ls.length);
  49528. copy(ls, list);
  49529. list._inc = inc;
  49530. }
  49531. }
  49532. LiveNodeList.prototype.item = function(i2) {
  49533. _updateLiveList(this);
  49534. return this[i2];
  49535. };
  49536. _extends(LiveNodeList, NodeList);
  49537. function NamedNodeMap() {
  49538. }
  49539. function _findNodeIndex(list, node) {
  49540. var i2 = list.length;
  49541. while (i2--) {
  49542. if (list[i2] === node) {
  49543. return i2;
  49544. }
  49545. }
  49546. }
  49547. function _addNamedNode(el, list, newAttr, oldAttr) {
  49548. if (oldAttr) {
  49549. list[_findNodeIndex(list, oldAttr)] = newAttr;
  49550. } else {
  49551. list[list.length++] = newAttr;
  49552. }
  49553. if (el) {
  49554. newAttr.ownerElement = el;
  49555. var doc = el.ownerDocument;
  49556. if (doc) {
  49557. oldAttr && _onRemoveAttribute(doc, el, oldAttr);
  49558. _onAddAttribute(doc, el, newAttr);
  49559. }
  49560. }
  49561. }
  49562. function _removeNamedNode(el, list, attr) {
  49563. var i2 = _findNodeIndex(list, attr);
  49564. if (i2 >= 0) {
  49565. var lastIndex = list.length - 1;
  49566. while (i2 < lastIndex) {
  49567. list[i2] = list[++i2];
  49568. }
  49569. list.length = lastIndex;
  49570. if (el) {
  49571. var doc = el.ownerDocument;
  49572. if (doc) {
  49573. _onRemoveAttribute(doc, el, attr);
  49574. attr.ownerElement = null;
  49575. }
  49576. }
  49577. } else {
  49578. throw new DOMException(NOT_FOUND_ERR, new Error(el.tagName + "@" + attr));
  49579. }
  49580. }
  49581. NamedNodeMap.prototype = {
  49582. length: 0,
  49583. item: NodeList.prototype.item,
  49584. getNamedItem: function(key) {
  49585. var i2 = this.length;
  49586. while (i2--) {
  49587. var attr = this[i2];
  49588. if (attr.nodeName == key) {
  49589. return attr;
  49590. }
  49591. }
  49592. },
  49593. setNamedItem: function(attr) {
  49594. var el = attr.ownerElement;
  49595. if (el && el != this._ownerElement) {
  49596. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49597. }
  49598. var oldAttr = this.getNamedItem(attr.nodeName);
  49599. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49600. return oldAttr;
  49601. },
  49602. setNamedItemNS: function(attr) {
  49603. var el = attr.ownerElement, oldAttr;
  49604. if (el && el != this._ownerElement) {
  49605. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49606. }
  49607. oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);
  49608. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49609. return oldAttr;
  49610. },
  49611. removeNamedItem: function(key) {
  49612. var attr = this.getNamedItem(key);
  49613. _removeNamedNode(this._ownerElement, this, attr);
  49614. return attr;
  49615. },
  49616. removeNamedItemNS: function(namespaceURI, localName) {
  49617. var attr = this.getNamedItemNS(namespaceURI, localName);
  49618. _removeNamedNode(this._ownerElement, this, attr);
  49619. return attr;
  49620. },
  49621. getNamedItemNS: function(namespaceURI, localName) {
  49622. var i2 = this.length;
  49623. while (i2--) {
  49624. var node = this[i2];
  49625. if (node.localName == localName && node.namespaceURI == namespaceURI) {
  49626. return node;
  49627. }
  49628. }
  49629. return null;
  49630. }
  49631. };
  49632. function DOMImplementation$1() {
  49633. }
  49634. DOMImplementation$1.prototype = {
  49635. hasFeature: function(feature2, version2) {
  49636. return true;
  49637. },
  49638. createDocument: function(namespaceURI, qualifiedName, doctype) {
  49639. var doc = new Document();
  49640. doc.implementation = this;
  49641. doc.childNodes = new NodeList();
  49642. doc.doctype = doctype || null;
  49643. if (doctype) {
  49644. doc.appendChild(doctype);
  49645. }
  49646. if (qualifiedName) {
  49647. var root2 = doc.createElementNS(namespaceURI, qualifiedName);
  49648. doc.appendChild(root2);
  49649. }
  49650. return doc;
  49651. },
  49652. createDocumentType: function(qualifiedName, publicId, systemId) {
  49653. var node = new DocumentType();
  49654. node.name = qualifiedName;
  49655. node.nodeName = qualifiedName;
  49656. node.publicId = publicId || "";
  49657. node.systemId = systemId || "";
  49658. return node;
  49659. }
  49660. };
  49661. function Node() {
  49662. }
  49663. Node.prototype = {
  49664. firstChild: null,
  49665. lastChild: null,
  49666. previousSibling: null,
  49667. nextSibling: null,
  49668. attributes: null,
  49669. parentNode: null,
  49670. childNodes: null,
  49671. ownerDocument: null,
  49672. nodeValue: null,
  49673. namespaceURI: null,
  49674. prefix: null,
  49675. localName: null,
  49676. insertBefore: function(newChild, refChild) {
  49677. return _insertBefore(this, newChild, refChild);
  49678. },
  49679. replaceChild: function(newChild, oldChild) {
  49680. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  49681. if (oldChild) {
  49682. this.removeChild(oldChild);
  49683. }
  49684. },
  49685. removeChild: function(oldChild) {
  49686. return _removeChild(this, oldChild);
  49687. },
  49688. appendChild: function(newChild) {
  49689. return this.insertBefore(newChild, null);
  49690. },
  49691. hasChildNodes: function() {
  49692. return this.firstChild != null;
  49693. },
  49694. cloneNode: function(deep) {
  49695. return cloneNode(this.ownerDocument || this, this, deep);
  49696. },
  49697. normalize: function() {
  49698. var child = this.firstChild;
  49699. while (child) {
  49700. var next = child.nextSibling;
  49701. if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {
  49702. this.removeChild(next);
  49703. child.appendData(next.data);
  49704. } else {
  49705. child.normalize();
  49706. child = next;
  49707. }
  49708. }
  49709. },
  49710. isSupported: function(feature2, version2) {
  49711. return this.ownerDocument.implementation.hasFeature(feature2, version2);
  49712. },
  49713. hasAttributes: function() {
  49714. return this.attributes.length > 0;
  49715. },
  49716. lookupPrefix: function(namespaceURI) {
  49717. var el = this;
  49718. while (el) {
  49719. var map = el._nsMap;
  49720. if (map) {
  49721. for (var n in map) {
  49722. if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
  49723. return n;
  49724. }
  49725. }
  49726. }
  49727. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49728. }
  49729. return null;
  49730. },
  49731. lookupNamespaceURI: function(prefix) {
  49732. var el = this;
  49733. while (el) {
  49734. var map = el._nsMap;
  49735. if (map) {
  49736. if (Object.prototype.hasOwnProperty.call(map, prefix)) {
  49737. return map[prefix];
  49738. }
  49739. }
  49740. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49741. }
  49742. return null;
  49743. },
  49744. isDefaultNamespace: function(namespaceURI) {
  49745. var prefix = this.lookupPrefix(namespaceURI);
  49746. return prefix == null;
  49747. }
  49748. };
  49749. function _xmlEncoder(c) {
  49750. return c == "<" && "&lt;" || c == ">" && "&gt;" || c == "&" && "&amp;" || c == '"' && "&quot;" || "&#" + c.charCodeAt() + ";";
  49751. }
  49752. copy(NodeType, Node);
  49753. copy(NodeType, Node.prototype);
  49754. function _visitNode(node, callback2) {
  49755. if (callback2(node)) {
  49756. return true;
  49757. }
  49758. if (node = node.firstChild) {
  49759. do {
  49760. if (_visitNode(node, callback2)) {
  49761. return true;
  49762. }
  49763. } while (node = node.nextSibling);
  49764. }
  49765. }
  49766. function Document() {
  49767. this.ownerDocument = this;
  49768. }
  49769. function _onAddAttribute(doc, el, newAttr) {
  49770. doc && doc._inc++;
  49771. var ns = newAttr.namespaceURI;
  49772. if (ns === NAMESPACE$2.XMLNS) {
  49773. el._nsMap[newAttr.prefix ? newAttr.localName : ""] = newAttr.value;
  49774. }
  49775. }
  49776. function _onRemoveAttribute(doc, el, newAttr, remove2) {
  49777. doc && doc._inc++;
  49778. var ns = newAttr.namespaceURI;
  49779. if (ns === NAMESPACE$2.XMLNS) {
  49780. delete el._nsMap[newAttr.prefix ? newAttr.localName : ""];
  49781. }
  49782. }
  49783. function _onUpdateChild(doc, el, newChild) {
  49784. if (doc && doc._inc) {
  49785. doc._inc++;
  49786. var cs = el.childNodes;
  49787. if (newChild) {
  49788. cs[cs.length++] = newChild;
  49789. } else {
  49790. var child = el.firstChild;
  49791. var i2 = 0;
  49792. while (child) {
  49793. cs[i2++] = child;
  49794. child = child.nextSibling;
  49795. }
  49796. cs.length = i2;
  49797. delete cs[cs.length];
  49798. }
  49799. }
  49800. }
  49801. function _removeChild(parentNode, child) {
  49802. var previous = child.previousSibling;
  49803. var next = child.nextSibling;
  49804. if (previous) {
  49805. previous.nextSibling = next;
  49806. } else {
  49807. parentNode.firstChild = next;
  49808. }
  49809. if (next) {
  49810. next.previousSibling = previous;
  49811. } else {
  49812. parentNode.lastChild = previous;
  49813. }
  49814. child.parentNode = null;
  49815. child.previousSibling = null;
  49816. child.nextSibling = null;
  49817. _onUpdateChild(parentNode.ownerDocument, parentNode);
  49818. return child;
  49819. }
  49820. function hasValidParentNodeType(node) {
  49821. return node && (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE);
  49822. }
  49823. function hasInsertableNodeType(node) {
  49824. return node && (isElementNode(node) || isTextNode$2(node) || isDocTypeNode(node) || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE);
  49825. }
  49826. function isDocTypeNode(node) {
  49827. return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
  49828. }
  49829. function isElementNode(node) {
  49830. return node && node.nodeType === Node.ELEMENT_NODE;
  49831. }
  49832. function isTextNode$2(node) {
  49833. return node && node.nodeType === Node.TEXT_NODE;
  49834. }
  49835. function isElementInsertionPossible(doc, child) {
  49836. var parentChildNodes = doc.childNodes || [];
  49837. if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
  49838. return false;
  49839. }
  49840. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49841. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49842. }
  49843. function isElementReplacementPossible(doc, child) {
  49844. var parentChildNodes = doc.childNodes || [];
  49845. function hasElementChildThatIsNotChild(node) {
  49846. return isElementNode(node) && node !== child;
  49847. }
  49848. if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
  49849. return false;
  49850. }
  49851. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49852. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49853. }
  49854. function assertPreInsertionValidity1to5(parent, node, child) {
  49855. if (!hasValidParentNodeType(parent)) {
  49856. throw new DOMException(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent.nodeType);
  49857. }
  49858. if (child && child.parentNode !== parent) {
  49859. throw new DOMException(NOT_FOUND_ERR, "child not in parent");
  49860. }
  49861. if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE) {
  49862. throw new DOMException(
  49863. HIERARCHY_REQUEST_ERR,
  49864. "Unexpected node type " + node.nodeType + " for parent node type " + parent.nodeType
  49865. );
  49866. }
  49867. }
  49868. function assertPreInsertionValidityInDocument(parent, node, child) {
  49869. var parentChildNodes = parent.childNodes || [];
  49870. var nodeChildNodes = node.childNodes || [];
  49871. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49872. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49873. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49874. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49875. }
  49876. if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
  49877. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49878. }
  49879. }
  49880. if (isElementNode(node)) {
  49881. if (!isElementInsertionPossible(parent, child)) {
  49882. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49883. }
  49884. }
  49885. if (isDocTypeNode(node)) {
  49886. if (find(parentChildNodes, isDocTypeNode)) {
  49887. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49888. }
  49889. var parentElementChild = find(parentChildNodes, isElementNode);
  49890. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49891. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49892. }
  49893. if (!child && parentElementChild) {
  49894. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
  49895. }
  49896. }
  49897. }
  49898. function assertPreReplacementValidityInDocument(parent, node, child) {
  49899. var parentChildNodes = parent.childNodes || [];
  49900. var nodeChildNodes = node.childNodes || [];
  49901. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49902. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49903. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49904. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49905. }
  49906. if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
  49907. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49908. }
  49909. }
  49910. if (isElementNode(node)) {
  49911. if (!isElementReplacementPossible(parent, child)) {
  49912. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49913. }
  49914. }
  49915. if (isDocTypeNode(node)) {
  49916. let hasDoctypeChildThatIsNotChild = function(node2) {
  49917. return isDocTypeNode(node2) && node2 !== child;
  49918. };
  49919. if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
  49920. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49921. }
  49922. var parentElementChild = find(parentChildNodes, isElementNode);
  49923. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49924. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49925. }
  49926. }
  49927. }
  49928. function _insertBefore(parent, node, child, _inDocumentAssertion) {
  49929. assertPreInsertionValidity1to5(parent, node, child);
  49930. if (parent.nodeType === Node.DOCUMENT_NODE) {
  49931. (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
  49932. }
  49933. var cp = node.parentNode;
  49934. if (cp) {
  49935. cp.removeChild(node);
  49936. }
  49937. if (node.nodeType === DOCUMENT_FRAGMENT_NODE) {
  49938. var newFirst = node.firstChild;
  49939. if (newFirst == null) {
  49940. return node;
  49941. }
  49942. var newLast = node.lastChild;
  49943. } else {
  49944. newFirst = newLast = node;
  49945. }
  49946. var pre = child ? child.previousSibling : parent.lastChild;
  49947. newFirst.previousSibling = pre;
  49948. newLast.nextSibling = child;
  49949. if (pre) {
  49950. pre.nextSibling = newFirst;
  49951. } else {
  49952. parent.firstChild = newFirst;
  49953. }
  49954. if (child == null) {
  49955. parent.lastChild = newLast;
  49956. } else {
  49957. child.previousSibling = newLast;
  49958. }
  49959. do {
  49960. newFirst.parentNode = parent;
  49961. } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));
  49962. _onUpdateChild(parent.ownerDocument || parent, parent);
  49963. if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49964. node.firstChild = node.lastChild = null;
  49965. }
  49966. return node;
  49967. }
  49968. function _appendSingleChild(parentNode, newChild) {
  49969. if (newChild.parentNode) {
  49970. newChild.parentNode.removeChild(newChild);
  49971. }
  49972. newChild.parentNode = parentNode;
  49973. newChild.previousSibling = parentNode.lastChild;
  49974. newChild.nextSibling = null;
  49975. if (newChild.previousSibling) {
  49976. newChild.previousSibling.nextSibling = newChild;
  49977. } else {
  49978. parentNode.firstChild = newChild;
  49979. }
  49980. parentNode.lastChild = newChild;
  49981. _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
  49982. return newChild;
  49983. }
  49984. Document.prototype = {
  49985. nodeName: "#document",
  49986. nodeType: DOCUMENT_NODE,
  49987. doctype: null,
  49988. documentElement: null,
  49989. _inc: 1,
  49990. insertBefore: function(newChild, refChild) {
  49991. if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49992. var child = newChild.firstChild;
  49993. while (child) {
  49994. var next = child.nextSibling;
  49995. this.insertBefore(child, refChild);
  49996. child = next;
  49997. }
  49998. return newChild;
  49999. }
  50000. _insertBefore(this, newChild, refChild);
  50001. newChild.ownerDocument = this;
  50002. if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
  50003. this.documentElement = newChild;
  50004. }
  50005. return newChild;
  50006. },
  50007. removeChild: function(oldChild) {
  50008. if (this.documentElement == oldChild) {
  50009. this.documentElement = null;
  50010. }
  50011. return _removeChild(this, oldChild);
  50012. },
  50013. replaceChild: function(newChild, oldChild) {
  50014. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  50015. newChild.ownerDocument = this;
  50016. if (oldChild) {
  50017. this.removeChild(oldChild);
  50018. }
  50019. if (isElementNode(newChild)) {
  50020. this.documentElement = newChild;
  50021. }
  50022. },
  50023. importNode: function(importedNode, deep) {
  50024. return importNode(this, importedNode, deep);
  50025. },
  50026. getElementById: function(id) {
  50027. var rtv = null;
  50028. _visitNode(this.documentElement, function(node) {
  50029. if (node.nodeType == ELEMENT_NODE) {
  50030. if (node.getAttribute("id") == id) {
  50031. rtv = node;
  50032. return true;
  50033. }
  50034. }
  50035. });
  50036. return rtv;
  50037. },
  50038. getElementsByClassName: function(classNames) {
  50039. var classNamesSet = toOrderedSet(classNames);
  50040. return new LiveNodeList(this, function(base2) {
  50041. var ls = [];
  50042. if (classNamesSet.length > 0) {
  50043. _visitNode(base2.documentElement, function(node) {
  50044. if (node !== base2 && node.nodeType === ELEMENT_NODE) {
  50045. var nodeClassNames = node.getAttribute("class");
  50046. if (nodeClassNames) {
  50047. var matches = classNames === nodeClassNames;
  50048. if (!matches) {
  50049. var nodeClassNamesSet = toOrderedSet(nodeClassNames);
  50050. matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));
  50051. }
  50052. if (matches) {
  50053. ls.push(node);
  50054. }
  50055. }
  50056. }
  50057. });
  50058. }
  50059. return ls;
  50060. });
  50061. },
  50062. createElement: function(tagName) {
  50063. var node = new Element$1();
  50064. node.ownerDocument = this;
  50065. node.nodeName = tagName;
  50066. node.tagName = tagName;
  50067. node.localName = tagName;
  50068. node.childNodes = new NodeList();
  50069. var attrs = node.attributes = new NamedNodeMap();
  50070. attrs._ownerElement = node;
  50071. return node;
  50072. },
  50073. createDocumentFragment: function() {
  50074. var node = new DocumentFragment();
  50075. node.ownerDocument = this;
  50076. node.childNodes = new NodeList();
  50077. return node;
  50078. },
  50079. createTextNode: function(data) {
  50080. var node = new Text();
  50081. node.ownerDocument = this;
  50082. node.appendData(data);
  50083. return node;
  50084. },
  50085. createComment: function(data) {
  50086. var node = new Comment();
  50087. node.ownerDocument = this;
  50088. node.appendData(data);
  50089. return node;
  50090. },
  50091. createCDATASection: function(data) {
  50092. var node = new CDATASection();
  50093. node.ownerDocument = this;
  50094. node.appendData(data);
  50095. return node;
  50096. },
  50097. createProcessingInstruction: function(target, data) {
  50098. var node = new ProcessingInstruction();
  50099. node.ownerDocument = this;
  50100. node.tagName = node.target = target;
  50101. node.nodeValue = node.data = data;
  50102. return node;
  50103. },
  50104. createAttribute: function(name) {
  50105. var node = new Attr();
  50106. node.ownerDocument = this;
  50107. node.name = name;
  50108. node.nodeName = name;
  50109. node.localName = name;
  50110. node.specified = true;
  50111. return node;
  50112. },
  50113. createEntityReference: function(name) {
  50114. var node = new EntityReference();
  50115. node.ownerDocument = this;
  50116. node.nodeName = name;
  50117. return node;
  50118. },
  50119. createElementNS: function(namespaceURI, qualifiedName) {
  50120. var node = new Element$1();
  50121. var pl = qualifiedName.split(":");
  50122. var attrs = node.attributes = new NamedNodeMap();
  50123. node.childNodes = new NodeList();
  50124. node.ownerDocument = this;
  50125. node.nodeName = qualifiedName;
  50126. node.tagName = qualifiedName;
  50127. node.namespaceURI = namespaceURI;
  50128. if (pl.length == 2) {
  50129. node.prefix = pl[0];
  50130. node.localName = pl[1];
  50131. } else {
  50132. node.localName = qualifiedName;
  50133. }
  50134. attrs._ownerElement = node;
  50135. return node;
  50136. },
  50137. createAttributeNS: function(namespaceURI, qualifiedName) {
  50138. var node = new Attr();
  50139. var pl = qualifiedName.split(":");
  50140. node.ownerDocument = this;
  50141. node.nodeName = qualifiedName;
  50142. node.name = qualifiedName;
  50143. node.namespaceURI = namespaceURI;
  50144. node.specified = true;
  50145. if (pl.length == 2) {
  50146. node.prefix = pl[0];
  50147. node.localName = pl[1];
  50148. } else {
  50149. node.localName = qualifiedName;
  50150. }
  50151. return node;
  50152. }
  50153. };
  50154. _extends(Document, Node);
  50155. function Element$1() {
  50156. this._nsMap = {};
  50157. }
  50158. Element$1.prototype = {
  50159. nodeType: ELEMENT_NODE,
  50160. hasAttribute: function(name) {
  50161. return this.getAttributeNode(name) != null;
  50162. },
  50163. getAttribute: function(name) {
  50164. var attr = this.getAttributeNode(name);
  50165. return attr && attr.value || "";
  50166. },
  50167. getAttributeNode: function(name) {
  50168. return this.attributes.getNamedItem(name);
  50169. },
  50170. setAttribute: function(name, value) {
  50171. var attr = this.ownerDocument.createAttribute(name);
  50172. attr.value = attr.nodeValue = "" + value;
  50173. this.setAttributeNode(attr);
  50174. },
  50175. removeAttribute: function(name) {
  50176. var attr = this.getAttributeNode(name);
  50177. attr && this.removeAttributeNode(attr);
  50178. },
  50179. appendChild: function(newChild) {
  50180. if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
  50181. return this.insertBefore(newChild, null);
  50182. } else {
  50183. return _appendSingleChild(this, newChild);
  50184. }
  50185. },
  50186. setAttributeNode: function(newAttr) {
  50187. return this.attributes.setNamedItem(newAttr);
  50188. },
  50189. setAttributeNodeNS: function(newAttr) {
  50190. return this.attributes.setNamedItemNS(newAttr);
  50191. },
  50192. removeAttributeNode: function(oldAttr) {
  50193. return this.attributes.removeNamedItem(oldAttr.nodeName);
  50194. },
  50195. removeAttributeNS: function(namespaceURI, localName) {
  50196. var old = this.getAttributeNodeNS(namespaceURI, localName);
  50197. old && this.removeAttributeNode(old);
  50198. },
  50199. hasAttributeNS: function(namespaceURI, localName) {
  50200. return this.getAttributeNodeNS(namespaceURI, localName) != null;
  50201. },
  50202. getAttributeNS: function(namespaceURI, localName) {
  50203. var attr = this.getAttributeNodeNS(namespaceURI, localName);
  50204. return attr && attr.value || "";
  50205. },
  50206. setAttributeNS: function(namespaceURI, qualifiedName, value) {
  50207. var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
  50208. attr.value = attr.nodeValue = "" + value;
  50209. this.setAttributeNode(attr);
  50210. },
  50211. getAttributeNodeNS: function(namespaceURI, localName) {
  50212. return this.attributes.getNamedItemNS(namespaceURI, localName);
  50213. },
  50214. getElementsByTagName: function(tagName) {
  50215. return new LiveNodeList(this, function(base2) {
  50216. var ls = [];
  50217. _visitNode(base2, function(node) {
  50218. if (node !== base2 && node.nodeType == ELEMENT_NODE && (tagName === "*" || node.tagName == tagName)) {
  50219. ls.push(node);
  50220. }
  50221. });
  50222. return ls;
  50223. });
  50224. },
  50225. getElementsByTagNameNS: function(namespaceURI, localName) {
  50226. return new LiveNodeList(this, function(base2) {
  50227. var ls = [];
  50228. _visitNode(base2, function(node) {
  50229. if (node !== base2 && node.nodeType === ELEMENT_NODE && (namespaceURI === "*" || node.namespaceURI === namespaceURI) && (localName === "*" || node.localName == localName)) {
  50230. ls.push(node);
  50231. }
  50232. });
  50233. return ls;
  50234. });
  50235. }
  50236. };
  50237. Document.prototype.getElementsByTagName = Element$1.prototype.getElementsByTagName;
  50238. Document.prototype.getElementsByTagNameNS = Element$1.prototype.getElementsByTagNameNS;
  50239. _extends(Element$1, Node);
  50240. function Attr() {
  50241. }
  50242. Attr.prototype.nodeType = ATTRIBUTE_NODE;
  50243. _extends(Attr, Node);
  50244. function CharacterData() {
  50245. }
  50246. CharacterData.prototype = {
  50247. data: "",
  50248. substringData: function(offset, count) {
  50249. return this.data.substring(offset, offset + count);
  50250. },
  50251. appendData: function(text) {
  50252. text = this.data + text;
  50253. this.nodeValue = this.data = text;
  50254. this.length = text.length;
  50255. },
  50256. insertData: function(offset, text) {
  50257. this.replaceData(offset, 0, text);
  50258. },
  50259. appendChild: function(newChild) {
  50260. throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);
  50261. },
  50262. deleteData: function(offset, count) {
  50263. this.replaceData(offset, count, "");
  50264. },
  50265. replaceData: function(offset, count, text) {
  50266. var start2 = this.data.substring(0, offset);
  50267. var end = this.data.substring(offset + count);
  50268. text = start2 + text + end;
  50269. this.nodeValue = this.data = text;
  50270. this.length = text.length;
  50271. }
  50272. };
  50273. _extends(CharacterData, Node);
  50274. function Text() {
  50275. }
  50276. Text.prototype = {
  50277. nodeName: "#text",
  50278. nodeType: TEXT_NODE,
  50279. splitText: function(offset) {
  50280. var text = this.data;
  50281. var newText = text.substring(offset);
  50282. text = text.substring(0, offset);
  50283. this.data = this.nodeValue = text;
  50284. this.length = text.length;
  50285. var newNode = this.ownerDocument.createTextNode(newText);
  50286. if (this.parentNode) {
  50287. this.parentNode.insertBefore(newNode, this.nextSibling);
  50288. }
  50289. return newNode;
  50290. }
  50291. };
  50292. _extends(Text, CharacterData);
  50293. function Comment() {
  50294. }
  50295. Comment.prototype = {
  50296. nodeName: "#comment",
  50297. nodeType: COMMENT_NODE
  50298. };
  50299. _extends(Comment, CharacterData);
  50300. function CDATASection() {
  50301. }
  50302. CDATASection.prototype = {
  50303. nodeName: "#cdata-section",
  50304. nodeType: CDATA_SECTION_NODE
  50305. };
  50306. _extends(CDATASection, CharacterData);
  50307. function DocumentType() {
  50308. }
  50309. DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
  50310. _extends(DocumentType, Node);
  50311. function Notation() {
  50312. }
  50313. Notation.prototype.nodeType = NOTATION_NODE;
  50314. _extends(Notation, Node);
  50315. function Entity() {
  50316. }
  50317. Entity.prototype.nodeType = ENTITY_NODE;
  50318. _extends(Entity, Node);
  50319. function EntityReference() {
  50320. }
  50321. EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
  50322. _extends(EntityReference, Node);
  50323. function DocumentFragment() {
  50324. }
  50325. DocumentFragment.prototype.nodeName = "#document-fragment";
  50326. DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
  50327. _extends(DocumentFragment, Node);
  50328. function ProcessingInstruction() {
  50329. }
  50330. ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
  50331. _extends(ProcessingInstruction, Node);
  50332. function XMLSerializer() {
  50333. }
  50334. XMLSerializer.prototype.serializeToString = function(node, isHtml, nodeFilter) {
  50335. return nodeSerializeToString.call(node, isHtml, nodeFilter);
  50336. };
  50337. Node.prototype.toString = nodeSerializeToString;
  50338. function nodeSerializeToString(isHtml, nodeFilter) {
  50339. var buf = [];
  50340. var refNode = this.nodeType == 9 && this.documentElement || this;
  50341. var prefix = refNode.prefix;
  50342. var uri = refNode.namespaceURI;
  50343. if (uri && prefix == null) {
  50344. var prefix = refNode.lookupPrefix(uri);
  50345. if (prefix == null) {
  50346. var visibleNamespaces = [
  50347. { namespace: uri, prefix: null }
  50348. ];
  50349. }
  50350. }
  50351. serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces);
  50352. return buf.join("");
  50353. }
  50354. function needNamespaceDefine(node, isHTML, visibleNamespaces) {
  50355. var prefix = node.prefix || "";
  50356. var uri = node.namespaceURI;
  50357. if (!uri) {
  50358. return false;
  50359. }
  50360. if (prefix === "xml" && uri === NAMESPACE$2.XML || uri === NAMESPACE$2.XMLNS) {
  50361. return false;
  50362. }
  50363. var i2 = visibleNamespaces.length;
  50364. while (i2--) {
  50365. var ns = visibleNamespaces[i2];
  50366. if (ns.prefix === prefix) {
  50367. return ns.namespace !== uri;
  50368. }
  50369. }
  50370. return true;
  50371. }
  50372. function addSerializedAttribute(buf, qualifiedName, value) {
  50373. buf.push(" ", qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
  50374. }
  50375. function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) {
  50376. if (!visibleNamespaces) {
  50377. visibleNamespaces = [];
  50378. }
  50379. if (nodeFilter) {
  50380. node = nodeFilter(node);
  50381. if (node) {
  50382. if (typeof node == "string") {
  50383. buf.push(node);
  50384. return;
  50385. }
  50386. } else {
  50387. return;
  50388. }
  50389. }
  50390. switch (node.nodeType) {
  50391. case ELEMENT_NODE:
  50392. var attrs = node.attributes;
  50393. var len = attrs.length;
  50394. var child = node.firstChild;
  50395. var nodeName = node.tagName;
  50396. isHTML = NAMESPACE$2.isHTML(node.namespaceURI) || isHTML;
  50397. var prefixedNodeName = nodeName;
  50398. if (!isHTML && !node.prefix && node.namespaceURI) {
  50399. var defaultNS;
  50400. for (var ai = 0; ai < attrs.length; ai++) {
  50401. if (attrs.item(ai).name === "xmlns") {
  50402. defaultNS = attrs.item(ai).value;
  50403. break;
  50404. }
  50405. }
  50406. if (!defaultNS) {
  50407. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50408. var namespace = visibleNamespaces[nsi];
  50409. if (namespace.prefix === "" && namespace.namespace === node.namespaceURI) {
  50410. defaultNS = namespace.namespace;
  50411. break;
  50412. }
  50413. }
  50414. }
  50415. if (defaultNS !== node.namespaceURI) {
  50416. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50417. var namespace = visibleNamespaces[nsi];
  50418. if (namespace.namespace === node.namespaceURI) {
  50419. if (namespace.prefix) {
  50420. prefixedNodeName = namespace.prefix + ":" + nodeName;
  50421. }
  50422. break;
  50423. }
  50424. }
  50425. }
  50426. }
  50427. buf.push("<", prefixedNodeName);
  50428. for (var i2 = 0; i2 < len; i2++) {
  50429. var attr = attrs.item(i2);
  50430. if (attr.prefix == "xmlns") {
  50431. visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
  50432. } else if (attr.nodeName == "xmlns") {
  50433. visibleNamespaces.push({ prefix: "", namespace: attr.value });
  50434. }
  50435. }
  50436. for (var i2 = 0; i2 < len; i2++) {
  50437. var attr = attrs.item(i2);
  50438. if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) {
  50439. var prefix = attr.prefix || "";
  50440. var uri = attr.namespaceURI;
  50441. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50442. visibleNamespaces.push({ prefix, namespace: uri });
  50443. }
  50444. serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces);
  50445. }
  50446. if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
  50447. var prefix = node.prefix || "";
  50448. var uri = node.namespaceURI;
  50449. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50450. visibleNamespaces.push({ prefix, namespace: uri });
  50451. }
  50452. if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
  50453. buf.push(">");
  50454. if (isHTML && /^script$/i.test(nodeName)) {
  50455. while (child) {
  50456. if (child.data) {
  50457. buf.push(child.data);
  50458. } else {
  50459. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50460. }
  50461. child = child.nextSibling;
  50462. }
  50463. } else {
  50464. while (child) {
  50465. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50466. child = child.nextSibling;
  50467. }
  50468. }
  50469. buf.push("</", prefixedNodeName, ">");
  50470. } else {
  50471. buf.push("/>");
  50472. }
  50473. return;
  50474. case DOCUMENT_NODE:
  50475. case DOCUMENT_FRAGMENT_NODE:
  50476. var child = node.firstChild;
  50477. while (child) {
  50478. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50479. child = child.nextSibling;
  50480. }
  50481. return;
  50482. case ATTRIBUTE_NODE:
  50483. return addSerializedAttribute(buf, node.name, node.value);
  50484. case TEXT_NODE:
  50485. return buf.push(
  50486. node.data.replace(/[<&>]/g, _xmlEncoder)
  50487. );
  50488. case CDATA_SECTION_NODE:
  50489. return buf.push("<![CDATA[", node.data, "]]>");
  50490. case COMMENT_NODE:
  50491. return buf.push("<!--", node.data, "-->");
  50492. case DOCUMENT_TYPE_NODE:
  50493. var pubid = node.publicId;
  50494. var sysid = node.systemId;
  50495. buf.push("<!DOCTYPE ", node.name);
  50496. if (pubid) {
  50497. buf.push(" PUBLIC ", pubid);
  50498. if (sysid && sysid != ".") {
  50499. buf.push(" ", sysid);
  50500. }
  50501. buf.push(">");
  50502. } else if (sysid && sysid != ".") {
  50503. buf.push(" SYSTEM ", sysid, ">");
  50504. } else {
  50505. var sub = node.internalSubset;
  50506. if (sub) {
  50507. buf.push(" [", sub, "]");
  50508. }
  50509. buf.push(">");
  50510. }
  50511. return;
  50512. case PROCESSING_INSTRUCTION_NODE:
  50513. return buf.push("<?", node.target, " ", node.data, "?>");
  50514. case ENTITY_REFERENCE_NODE:
  50515. return buf.push("&", node.nodeName, ";");
  50516. default:
  50517. buf.push("??", node.nodeName);
  50518. }
  50519. }
  50520. function importNode(doc, node, deep) {
  50521. var node2;
  50522. switch (node.nodeType) {
  50523. case ELEMENT_NODE:
  50524. node2 = node.cloneNode(false);
  50525. node2.ownerDocument = doc;
  50526. case DOCUMENT_FRAGMENT_NODE:
  50527. break;
  50528. case ATTRIBUTE_NODE:
  50529. deep = true;
  50530. break;
  50531. }
  50532. if (!node2) {
  50533. node2 = node.cloneNode(false);
  50534. }
  50535. node2.ownerDocument = doc;
  50536. node2.parentNode = null;
  50537. if (deep) {
  50538. var child = node.firstChild;
  50539. while (child) {
  50540. node2.appendChild(importNode(doc, child, deep));
  50541. child = child.nextSibling;
  50542. }
  50543. }
  50544. return node2;
  50545. }
  50546. function cloneNode(doc, node, deep) {
  50547. var node2 = new node.constructor();
  50548. for (var n in node) {
  50549. if (Object.prototype.hasOwnProperty.call(node, n)) {
  50550. var v = node[n];
  50551. if (typeof v != "object") {
  50552. if (v != node2[n]) {
  50553. node2[n] = v;
  50554. }
  50555. }
  50556. }
  50557. }
  50558. if (node.childNodes) {
  50559. node2.childNodes = new NodeList();
  50560. }
  50561. node2.ownerDocument = doc;
  50562. switch (node2.nodeType) {
  50563. case ELEMENT_NODE:
  50564. var attrs = node.attributes;
  50565. var attrs2 = node2.attributes = new NamedNodeMap();
  50566. var len = attrs.length;
  50567. attrs2._ownerElement = node2;
  50568. for (var i2 = 0; i2 < len; i2++) {
  50569. node2.setAttributeNode(cloneNode(doc, attrs.item(i2), true));
  50570. }
  50571. break;
  50572. case ATTRIBUTE_NODE:
  50573. deep = true;
  50574. }
  50575. if (deep) {
  50576. var child = node.firstChild;
  50577. while (child) {
  50578. node2.appendChild(cloneNode(doc, child, deep));
  50579. child = child.nextSibling;
  50580. }
  50581. }
  50582. return node2;
  50583. }
  50584. function __set__(object, key, value) {
  50585. object[key] = value;
  50586. }
  50587. try {
  50588. if (Object.defineProperty) {
  50589. let getTextContent = function(node) {
  50590. switch (node.nodeType) {
  50591. case ELEMENT_NODE:
  50592. case DOCUMENT_FRAGMENT_NODE:
  50593. var buf = [];
  50594. node = node.firstChild;
  50595. while (node) {
  50596. if (node.nodeType !== 7 && node.nodeType !== 8) {
  50597. buf.push(getTextContent(node));
  50598. }
  50599. node = node.nextSibling;
  50600. }
  50601. return buf.join("");
  50602. default:
  50603. return node.nodeValue;
  50604. }
  50605. };
  50606. Object.defineProperty(LiveNodeList.prototype, "length", {
  50607. get: function() {
  50608. _updateLiveList(this);
  50609. return this.$$length;
  50610. }
  50611. });
  50612. Object.defineProperty(Node.prototype, "textContent", {
  50613. get: function() {
  50614. return getTextContent(this);
  50615. },
  50616. set: function(data) {
  50617. switch (this.nodeType) {
  50618. case ELEMENT_NODE:
  50619. case DOCUMENT_FRAGMENT_NODE:
  50620. while (this.firstChild) {
  50621. this.removeChild(this.firstChild);
  50622. }
  50623. if (data || String(data)) {
  50624. this.appendChild(this.ownerDocument.createTextNode(data));
  50625. }
  50626. break;
  50627. default:
  50628. this.data = data;
  50629. this.value = data;
  50630. this.nodeValue = data;
  50631. }
  50632. }
  50633. });
  50634. __set__ = function(object, key, value) {
  50635. object["$$" + key] = value;
  50636. };
  50637. }
  50638. } catch (e) {
  50639. }
  50640. dom$1.DocumentType = DocumentType;
  50641. dom$1.DOMException = DOMException;
  50642. dom$1.DOMImplementation = DOMImplementation$1;
  50643. dom$1.Element = Element$1;
  50644. dom$1.Node = Node;
  50645. dom$1.NodeList = NodeList;
  50646. dom$1.XMLSerializer = XMLSerializer;
  50647. var domParser = {};
  50648. var entities$1 = {};
  50649. (function(exports2) {
  50650. var freeze2 = conventions$2.freeze;
  50651. exports2.XML_ENTITIES = freeze2({ amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' });
  50652. exports2.HTML_ENTITIES = freeze2({
  50653. lt: "<",
  50654. gt: ">",
  50655. amp: "&",
  50656. quot: '"',
  50657. apos: "'",
  50658. Agrave: "\xC0",
  50659. Aacute: "\xC1",
  50660. Acirc: "\xC2",
  50661. Atilde: "\xC3",
  50662. Auml: "\xC4",
  50663. Aring: "\xC5",
  50664. AElig: "\xC6",
  50665. Ccedil: "\xC7",
  50666. Egrave: "\xC8",
  50667. Eacute: "\xC9",
  50668. Ecirc: "\xCA",
  50669. Euml: "\xCB",
  50670. Igrave: "\xCC",
  50671. Iacute: "\xCD",
  50672. Icirc: "\xCE",
  50673. Iuml: "\xCF",
  50674. ETH: "\xD0",
  50675. Ntilde: "\xD1",
  50676. Ograve: "\xD2",
  50677. Oacute: "\xD3",
  50678. Ocirc: "\xD4",
  50679. Otilde: "\xD5",
  50680. Ouml: "\xD6",
  50681. Oslash: "\xD8",
  50682. Ugrave: "\xD9",
  50683. Uacute: "\xDA",
  50684. Ucirc: "\xDB",
  50685. Uuml: "\xDC",
  50686. Yacute: "\xDD",
  50687. THORN: "\xDE",
  50688. szlig: "\xDF",
  50689. agrave: "\xE0",
  50690. aacute: "\xE1",
  50691. acirc: "\xE2",
  50692. atilde: "\xE3",
  50693. auml: "\xE4",
  50694. aring: "\xE5",
  50695. aelig: "\xE6",
  50696. ccedil: "\xE7",
  50697. egrave: "\xE8",
  50698. eacute: "\xE9",
  50699. ecirc: "\xEA",
  50700. euml: "\xEB",
  50701. igrave: "\xEC",
  50702. iacute: "\xED",
  50703. icirc: "\xEE",
  50704. iuml: "\xEF",
  50705. eth: "\xF0",
  50706. ntilde: "\xF1",
  50707. ograve: "\xF2",
  50708. oacute: "\xF3",
  50709. ocirc: "\xF4",
  50710. otilde: "\xF5",
  50711. ouml: "\xF6",
  50712. oslash: "\xF8",
  50713. ugrave: "\xF9",
  50714. uacute: "\xFA",
  50715. ucirc: "\xFB",
  50716. uuml: "\xFC",
  50717. yacute: "\xFD",
  50718. thorn: "\xFE",
  50719. yuml: "\xFF",
  50720. nbsp: "\xA0",
  50721. iexcl: "\xA1",
  50722. cent: "\xA2",
  50723. pound: "\xA3",
  50724. curren: "\xA4",
  50725. yen: "\xA5",
  50726. brvbar: "\xA6",
  50727. sect: "\xA7",
  50728. uml: "\xA8",
  50729. copy: "\xA9",
  50730. ordf: "\xAA",
  50731. laquo: "\xAB",
  50732. not: "\xAC",
  50733. shy: "\xAD\xAD",
  50734. reg: "\xAE",
  50735. macr: "\xAF",
  50736. deg: "\xB0",
  50737. plusmn: "\xB1",
  50738. sup2: "\xB2",
  50739. sup3: "\xB3",
  50740. acute: "\xB4",
  50741. micro: "\xB5",
  50742. para: "\xB6",
  50743. middot: "\xB7",
  50744. cedil: "\xB8",
  50745. sup1: "\xB9",
  50746. ordm: "\xBA",
  50747. raquo: "\xBB",
  50748. frac14: "\xBC",
  50749. frac12: "\xBD",
  50750. frac34: "\xBE",
  50751. iquest: "\xBF",
  50752. times: "\xD7",
  50753. divide: "\xF7",
  50754. forall: "\u2200",
  50755. part: "\u2202",
  50756. exist: "\u2203",
  50757. empty: "\u2205",
  50758. nabla: "\u2207",
  50759. isin: "\u2208",
  50760. notin: "\u2209",
  50761. ni: "\u220B",
  50762. prod: "\u220F",
  50763. sum: "\u2211",
  50764. minus: "\u2212",
  50765. lowast: "\u2217",
  50766. radic: "\u221A",
  50767. prop: "\u221D",
  50768. infin: "\u221E",
  50769. ang: "\u2220",
  50770. and: "\u2227",
  50771. or: "\u2228",
  50772. cap: "\u2229",
  50773. cup: "\u222A",
  50774. "int": "\u222B",
  50775. there4: "\u2234",
  50776. sim: "\u223C",
  50777. cong: "\u2245",
  50778. asymp: "\u2248",
  50779. ne: "\u2260",
  50780. equiv: "\u2261",
  50781. le: "\u2264",
  50782. ge: "\u2265",
  50783. sub: "\u2282",
  50784. sup: "\u2283",
  50785. nsub: "\u2284",
  50786. sube: "\u2286",
  50787. supe: "\u2287",
  50788. oplus: "\u2295",
  50789. otimes: "\u2297",
  50790. perp: "\u22A5",
  50791. sdot: "\u22C5",
  50792. Alpha: "\u0391",
  50793. Beta: "\u0392",
  50794. Gamma: "\u0393",
  50795. Delta: "\u0394",
  50796. Epsilon: "\u0395",
  50797. Zeta: "\u0396",
  50798. Eta: "\u0397",
  50799. Theta: "\u0398",
  50800. Iota: "\u0399",
  50801. Kappa: "\u039A",
  50802. Lambda: "\u039B",
  50803. Mu: "\u039C",
  50804. Nu: "\u039D",
  50805. Xi: "\u039E",
  50806. Omicron: "\u039F",
  50807. Pi: "\u03A0",
  50808. Rho: "\u03A1",
  50809. Sigma: "\u03A3",
  50810. Tau: "\u03A4",
  50811. Upsilon: "\u03A5",
  50812. Phi: "\u03A6",
  50813. Chi: "\u03A7",
  50814. Psi: "\u03A8",
  50815. Omega: "\u03A9",
  50816. alpha: "\u03B1",
  50817. beta: "\u03B2",
  50818. gamma: "\u03B3",
  50819. delta: "\u03B4",
  50820. epsilon: "\u03B5",
  50821. zeta: "\u03B6",
  50822. eta: "\u03B7",
  50823. theta: "\u03B8",
  50824. iota: "\u03B9",
  50825. kappa: "\u03BA",
  50826. lambda: "\u03BB",
  50827. mu: "\u03BC",
  50828. nu: "\u03BD",
  50829. xi: "\u03BE",
  50830. omicron: "\u03BF",
  50831. pi: "\u03C0",
  50832. rho: "\u03C1",
  50833. sigmaf: "\u03C2",
  50834. sigma: "\u03C3",
  50835. tau: "\u03C4",
  50836. upsilon: "\u03C5",
  50837. phi: "\u03C6",
  50838. chi: "\u03C7",
  50839. psi: "\u03C8",
  50840. omega: "\u03C9",
  50841. thetasym: "\u03D1",
  50842. upsih: "\u03D2",
  50843. piv: "\u03D6",
  50844. OElig: "\u0152",
  50845. oelig: "\u0153",
  50846. Scaron: "\u0160",
  50847. scaron: "\u0161",
  50848. Yuml: "\u0178",
  50849. fnof: "\u0192",
  50850. circ: "\u02C6",
  50851. tilde: "\u02DC",
  50852. ensp: "\u2002",
  50853. emsp: "\u2003",
  50854. thinsp: "\u2009",
  50855. zwnj: "\u200C",
  50856. zwj: "\u200D",
  50857. lrm: "\u200E",
  50858. rlm: "\u200F",
  50859. ndash: "\u2013",
  50860. mdash: "\u2014",
  50861. lsquo: "\u2018",
  50862. rsquo: "\u2019",
  50863. sbquo: "\u201A",
  50864. ldquo: "\u201C",
  50865. rdquo: "\u201D",
  50866. bdquo: "\u201E",
  50867. dagger: "\u2020",
  50868. Dagger: "\u2021",
  50869. bull: "\u2022",
  50870. hellip: "\u2026",
  50871. permil: "\u2030",
  50872. prime: "\u2032",
  50873. Prime: "\u2033",
  50874. lsaquo: "\u2039",
  50875. rsaquo: "\u203A",
  50876. oline: "\u203E",
  50877. euro: "\u20AC",
  50878. trade: "\u2122",
  50879. larr: "\u2190",
  50880. uarr: "\u2191",
  50881. rarr: "\u2192",
  50882. darr: "\u2193",
  50883. harr: "\u2194",
  50884. crarr: "\u21B5",
  50885. lceil: "\u2308",
  50886. rceil: "\u2309",
  50887. lfloor: "\u230A",
  50888. rfloor: "\u230B",
  50889. loz: "\u25CA",
  50890. spades: "\u2660",
  50891. clubs: "\u2663",
  50892. hearts: "\u2665",
  50893. diams: "\u2666"
  50894. });
  50895. exports2.entityMap = exports2.HTML_ENTITIES;
  50896. })(entities$1);
  50897. var sax$1 = {};
  50898. var NAMESPACE$1 = conventions$2.NAMESPACE;
  50899. var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
  50900. var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
  50901. var tagNamePattern = new RegExp("^" + nameStartChar.source + nameChar.source + "*(?::" + nameStartChar.source + nameChar.source + "*)?$");
  50902. var S_TAG = 0;
  50903. var S_ATTR = 1;
  50904. var S_ATTR_SPACE = 2;
  50905. var S_EQ = 3;
  50906. var S_ATTR_NOQUOT_VALUE = 4;
  50907. var S_ATTR_END = 5;
  50908. var S_TAG_SPACE = 6;
  50909. var S_TAG_CLOSE = 7;
  50910. function ParseError$1(message, locator) {
  50911. this.message = message;
  50912. this.locator = locator;
  50913. if (Error.captureStackTrace)
  50914. Error.captureStackTrace(this, ParseError$1);
  50915. }
  50916. ParseError$1.prototype = new Error();
  50917. ParseError$1.prototype.name = ParseError$1.name;
  50918. function XMLReader$1() {
  50919. }
  50920. XMLReader$1.prototype = {
  50921. parse: function(source, defaultNSMap, entityMap) {
  50922. var domBuilder = this.domBuilder;
  50923. domBuilder.startDocument();
  50924. _copy(defaultNSMap, defaultNSMap = {});
  50925. parse$2(
  50926. source,
  50927. defaultNSMap,
  50928. entityMap,
  50929. domBuilder,
  50930. this.errorHandler
  50931. );
  50932. domBuilder.endDocument();
  50933. }
  50934. };
  50935. function parse$2(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
  50936. function fixedFromCharCode(code) {
  50937. if (code > 65535) {
  50938. code -= 65536;
  50939. var surrogate1 = 55296 + (code >> 10), surrogate2 = 56320 + (code & 1023);
  50940. return String.fromCharCode(surrogate1, surrogate2);
  50941. } else {
  50942. return String.fromCharCode(code);
  50943. }
  50944. }
  50945. function entityReplacer(a2) {
  50946. var k = a2.slice(1, -1);
  50947. if (Object.hasOwnProperty.call(entityMap, k)) {
  50948. return entityMap[k];
  50949. } else if (k.charAt(0) === "#") {
  50950. return fixedFromCharCode(parseInt(k.substr(1).replace("x", "0x")));
  50951. } else {
  50952. errorHandler.error("entity not found:" + a2);
  50953. return a2;
  50954. }
  50955. }
  50956. function appendText(end2) {
  50957. if (end2 > start2) {
  50958. var xt2 = source.substring(start2, end2).replace(/&#?\w+;/g, entityReplacer);
  50959. locator && position2(start2);
  50960. domBuilder.characters(xt2, 0, end2 - start2);
  50961. start2 = end2;
  50962. }
  50963. }
  50964. function position2(p, m) {
  50965. while (p >= lineEnd && (m = linePattern.exec(source))) {
  50966. lineStart = m.index;
  50967. lineEnd = lineStart + m[0].length;
  50968. locator.lineNumber++;
  50969. }
  50970. locator.columnNumber = p - lineStart + 1;
  50971. }
  50972. var lineStart = 0;
  50973. var lineEnd = 0;
  50974. var linePattern = /.*(?:\r\n?|\n)|.*$/g;
  50975. var locator = domBuilder.locator;
  50976. var parseStack = [{ currentNSMap: defaultNSMapCopy }];
  50977. var closeMap = {};
  50978. var start2 = 0;
  50979. while (true) {
  50980. try {
  50981. var tagStart = source.indexOf("<", start2);
  50982. if (tagStart < 0) {
  50983. if (!source.substr(start2).match(/^\s*$/)) {
  50984. var doc = domBuilder.doc;
  50985. var text = doc.createTextNode(source.substr(start2));
  50986. doc.appendChild(text);
  50987. domBuilder.currentElement = text;
  50988. }
  50989. return;
  50990. }
  50991. if (tagStart > start2) {
  50992. appendText(tagStart);
  50993. }
  50994. switch (source.charAt(tagStart + 1)) {
  50995. case "/":
  50996. var end = source.indexOf(">", tagStart + 3);
  50997. var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, "");
  50998. var config = parseStack.pop();
  50999. if (end < 0) {
  51000. tagName = source.substring(tagStart + 2).replace(/[\s<].*/, "");
  51001. errorHandler.error("end tag name: " + tagName + " is not complete:" + config.tagName);
  51002. end = tagStart + 1 + tagName.length;
  51003. } else if (tagName.match(/\s</)) {
  51004. tagName = tagName.replace(/[\s<].*/, "");
  51005. errorHandler.error("end tag name: " + tagName + " maybe not complete");
  51006. end = tagStart + 1 + tagName.length;
  51007. }
  51008. var localNSMap = config.localNSMap;
  51009. var endMatch = config.tagName == tagName;
  51010. var endIgnoreCaseMach = endMatch || config.tagName && config.tagName.toLowerCase() == tagName.toLowerCase();
  51011. if (endIgnoreCaseMach) {
  51012. domBuilder.endElement(config.uri, config.localName, tagName);
  51013. if (localNSMap) {
  51014. for (var prefix in localNSMap) {
  51015. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  51016. domBuilder.endPrefixMapping(prefix);
  51017. }
  51018. }
  51019. }
  51020. if (!endMatch) {
  51021. errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config.tagName);
  51022. }
  51023. } else {
  51024. parseStack.push(config);
  51025. }
  51026. end++;
  51027. break;
  51028. case "?":
  51029. locator && position2(tagStart);
  51030. end = parseInstruction(source, tagStart, domBuilder);
  51031. break;
  51032. case "!":
  51033. locator && position2(tagStart);
  51034. end = parseDCC(source, tagStart, domBuilder, errorHandler);
  51035. break;
  51036. default:
  51037. locator && position2(tagStart);
  51038. var el = new ElementAttributes();
  51039. var currentNSMap = parseStack[parseStack.length - 1].currentNSMap;
  51040. var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler);
  51041. var len = el.length;
  51042. if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) {
  51043. el.closed = true;
  51044. if (!entityMap.nbsp) {
  51045. errorHandler.warning("unclosed xml attribute");
  51046. }
  51047. }
  51048. if (locator && len) {
  51049. var locator2 = copyLocator(locator, {});
  51050. for (var i2 = 0; i2 < len; i2++) {
  51051. var a = el[i2];
  51052. position2(a.offset);
  51053. a.locator = copyLocator(locator, {});
  51054. }
  51055. domBuilder.locator = locator2;
  51056. if (appendElement$1(el, domBuilder, currentNSMap)) {
  51057. parseStack.push(el);
  51058. }
  51059. domBuilder.locator = locator;
  51060. } else {
  51061. if (appendElement$1(el, domBuilder, currentNSMap)) {
  51062. parseStack.push(el);
  51063. }
  51064. }
  51065. if (NAMESPACE$1.isHTML(el.uri) && !el.closed) {
  51066. end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder);
  51067. } else {
  51068. end++;
  51069. }
  51070. }
  51071. } catch (e) {
  51072. if (e instanceof ParseError$1) {
  51073. throw e;
  51074. }
  51075. errorHandler.error("element parse error: " + e);
  51076. end = -1;
  51077. }
  51078. if (end > start2) {
  51079. start2 = end;
  51080. } else {
  51081. appendText(Math.max(tagStart, start2) + 1);
  51082. }
  51083. }
  51084. }
  51085. function copyLocator(f, t2) {
  51086. t2.lineNumber = f.lineNumber;
  51087. t2.columnNumber = f.columnNumber;
  51088. return t2;
  51089. }
  51090. function parseElementStartPart(source, start2, el, currentNSMap, entityReplacer, errorHandler) {
  51091. function addAttribute(qname, value2, startIndex) {
  51092. if (el.attributeNames.hasOwnProperty(qname)) {
  51093. errorHandler.fatalError("Attribute " + qname + " redefined");
  51094. }
  51095. el.addValue(
  51096. qname,
  51097. value2.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, entityReplacer),
  51098. startIndex
  51099. );
  51100. }
  51101. var attrName;
  51102. var value;
  51103. var p = ++start2;
  51104. var s = S_TAG;
  51105. while (true) {
  51106. var c = source.charAt(p);
  51107. switch (c) {
  51108. case "=":
  51109. if (s === S_ATTR) {
  51110. attrName = source.slice(start2, p);
  51111. s = S_EQ;
  51112. } else if (s === S_ATTR_SPACE) {
  51113. s = S_EQ;
  51114. } else {
  51115. throw new Error("attribute equal must after attrName");
  51116. }
  51117. break;
  51118. case "'":
  51119. case '"':
  51120. if (s === S_EQ || s === S_ATTR) {
  51121. if (s === S_ATTR) {
  51122. errorHandler.warning('attribute value must after "="');
  51123. attrName = source.slice(start2, p);
  51124. }
  51125. start2 = p + 1;
  51126. p = source.indexOf(c, start2);
  51127. if (p > 0) {
  51128. value = source.slice(start2, p);
  51129. addAttribute(attrName, value, start2 - 1);
  51130. s = S_ATTR_END;
  51131. } else {
  51132. throw new Error("attribute value no end '" + c + "' match");
  51133. }
  51134. } else if (s == S_ATTR_NOQUOT_VALUE) {
  51135. value = source.slice(start2, p);
  51136. addAttribute(attrName, value, start2);
  51137. errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ")!!");
  51138. start2 = p + 1;
  51139. s = S_ATTR_END;
  51140. } else {
  51141. throw new Error('attribute value must after "="');
  51142. }
  51143. break;
  51144. case "/":
  51145. switch (s) {
  51146. case S_TAG:
  51147. el.setTagName(source.slice(start2, p));
  51148. case S_ATTR_END:
  51149. case S_TAG_SPACE:
  51150. case S_TAG_CLOSE:
  51151. s = S_TAG_CLOSE;
  51152. el.closed = true;
  51153. case S_ATTR_NOQUOT_VALUE:
  51154. case S_ATTR:
  51155. break;
  51156. case S_ATTR_SPACE:
  51157. el.closed = true;
  51158. break;
  51159. default:
  51160. throw new Error("attribute invalid close char('/')");
  51161. }
  51162. break;
  51163. case "":
  51164. errorHandler.error("unexpected end of input");
  51165. if (s == S_TAG) {
  51166. el.setTagName(source.slice(start2, p));
  51167. }
  51168. return p;
  51169. case ">":
  51170. switch (s) {
  51171. case S_TAG:
  51172. el.setTagName(source.slice(start2, p));
  51173. case S_ATTR_END:
  51174. case S_TAG_SPACE:
  51175. case S_TAG_CLOSE:
  51176. break;
  51177. case S_ATTR_NOQUOT_VALUE:
  51178. case S_ATTR:
  51179. value = source.slice(start2, p);
  51180. if (value.slice(-1) === "/") {
  51181. el.closed = true;
  51182. value = value.slice(0, -1);
  51183. }
  51184. case S_ATTR_SPACE:
  51185. if (s === S_ATTR_SPACE) {
  51186. value = attrName;
  51187. }
  51188. if (s == S_ATTR_NOQUOT_VALUE) {
  51189. errorHandler.warning('attribute "' + value + '" missed quot(")!');
  51190. addAttribute(attrName, value, start2);
  51191. } else {
  51192. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !value.match(/^(?:disabled|checked|selected)$/i)) {
  51193. errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!');
  51194. }
  51195. addAttribute(value, value, start2);
  51196. }
  51197. break;
  51198. case S_EQ:
  51199. throw new Error("attribute value missed!!");
  51200. }
  51201. return p;
  51202. case "\x80":
  51203. c = " ";
  51204. default:
  51205. if (c <= " ") {
  51206. switch (s) {
  51207. case S_TAG:
  51208. el.setTagName(source.slice(start2, p));
  51209. s = S_TAG_SPACE;
  51210. break;
  51211. case S_ATTR:
  51212. attrName = source.slice(start2, p);
  51213. s = S_ATTR_SPACE;
  51214. break;
  51215. case S_ATTR_NOQUOT_VALUE:
  51216. var value = source.slice(start2, p);
  51217. errorHandler.warning('attribute "' + value + '" missed quot(")!!');
  51218. addAttribute(attrName, value, start2);
  51219. case S_ATTR_END:
  51220. s = S_TAG_SPACE;
  51221. break;
  51222. }
  51223. } else {
  51224. switch (s) {
  51225. case S_ATTR_SPACE:
  51226. el.tagName;
  51227. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
  51228. errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!');
  51229. }
  51230. addAttribute(attrName, attrName, start2);
  51231. start2 = p;
  51232. s = S_ATTR;
  51233. break;
  51234. case S_ATTR_END:
  51235. errorHandler.warning('attribute space is required"' + attrName + '"!!');
  51236. case S_TAG_SPACE:
  51237. s = S_ATTR;
  51238. start2 = p;
  51239. break;
  51240. case S_EQ:
  51241. s = S_ATTR_NOQUOT_VALUE;
  51242. start2 = p;
  51243. break;
  51244. case S_TAG_CLOSE:
  51245. throw new Error("elements closed character '/' and '>' must be connected to");
  51246. }
  51247. }
  51248. }
  51249. p++;
  51250. }
  51251. }
  51252. function appendElement$1(el, domBuilder, currentNSMap) {
  51253. var tagName = el.tagName;
  51254. var localNSMap = null;
  51255. var i2 = el.length;
  51256. while (i2--) {
  51257. var a = el[i2];
  51258. var qName = a.qName;
  51259. var value = a.value;
  51260. var nsp = qName.indexOf(":");
  51261. if (nsp > 0) {
  51262. var prefix = a.prefix = qName.slice(0, nsp);
  51263. var localName = qName.slice(nsp + 1);
  51264. var nsPrefix = prefix === "xmlns" && localName;
  51265. } else {
  51266. localName = qName;
  51267. prefix = null;
  51268. nsPrefix = qName === "xmlns" && "";
  51269. }
  51270. a.localName = localName;
  51271. if (nsPrefix !== false) {
  51272. if (localNSMap == null) {
  51273. localNSMap = {};
  51274. _copy(currentNSMap, currentNSMap = {});
  51275. }
  51276. currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
  51277. a.uri = NAMESPACE$1.XMLNS;
  51278. domBuilder.startPrefixMapping(nsPrefix, value);
  51279. }
  51280. }
  51281. var i2 = el.length;
  51282. while (i2--) {
  51283. a = el[i2];
  51284. var prefix = a.prefix;
  51285. if (prefix) {
  51286. if (prefix === "xml") {
  51287. a.uri = NAMESPACE$1.XML;
  51288. }
  51289. if (prefix !== "xmlns") {
  51290. a.uri = currentNSMap[prefix || ""];
  51291. }
  51292. }
  51293. }
  51294. var nsp = tagName.indexOf(":");
  51295. if (nsp > 0) {
  51296. prefix = el.prefix = tagName.slice(0, nsp);
  51297. localName = el.localName = tagName.slice(nsp + 1);
  51298. } else {
  51299. prefix = null;
  51300. localName = el.localName = tagName;
  51301. }
  51302. var ns = el.uri = currentNSMap[prefix || ""];
  51303. domBuilder.startElement(ns, localName, tagName, el);
  51304. if (el.closed) {
  51305. domBuilder.endElement(ns, localName, tagName);
  51306. if (localNSMap) {
  51307. for (prefix in localNSMap) {
  51308. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  51309. domBuilder.endPrefixMapping(prefix);
  51310. }
  51311. }
  51312. }
  51313. } else {
  51314. el.currentNSMap = currentNSMap;
  51315. el.localNSMap = localNSMap;
  51316. return true;
  51317. }
  51318. }
  51319. function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) {
  51320. if (/^(?:script|textarea)$/i.test(tagName)) {
  51321. var elEndStart = source.indexOf("</" + tagName + ">", elStartEnd);
  51322. var text = source.substring(elStartEnd + 1, elEndStart);
  51323. if (/[&<]/.test(text)) {
  51324. if (/^script$/i.test(tagName)) {
  51325. domBuilder.characters(text, 0, text.length);
  51326. return elEndStart;
  51327. }
  51328. text = text.replace(/&#?\w+;/g, entityReplacer);
  51329. domBuilder.characters(text, 0, text.length);
  51330. return elEndStart;
  51331. }
  51332. }
  51333. return elStartEnd + 1;
  51334. }
  51335. function fixSelfClosed(source, elStartEnd, tagName, closeMap) {
  51336. var pos = closeMap[tagName];
  51337. if (pos == null) {
  51338. pos = source.lastIndexOf("</" + tagName + ">");
  51339. if (pos < elStartEnd) {
  51340. pos = source.lastIndexOf("</" + tagName);
  51341. }
  51342. closeMap[tagName] = pos;
  51343. }
  51344. return pos < elStartEnd;
  51345. }
  51346. function _copy(source, target) {
  51347. for (var n in source) {
  51348. if (Object.prototype.hasOwnProperty.call(source, n)) {
  51349. target[n] = source[n];
  51350. }
  51351. }
  51352. }
  51353. function parseDCC(source, start2, domBuilder, errorHandler) {
  51354. var next = source.charAt(start2 + 2);
  51355. switch (next) {
  51356. case "-":
  51357. if (source.charAt(start2 + 3) === "-") {
  51358. var end = source.indexOf("-->", start2 + 4);
  51359. if (end > start2) {
  51360. domBuilder.comment(source, start2 + 4, end - start2 - 4);
  51361. return end + 3;
  51362. } else {
  51363. errorHandler.error("Unclosed comment");
  51364. return -1;
  51365. }
  51366. } else {
  51367. return -1;
  51368. }
  51369. default:
  51370. if (source.substr(start2 + 3, 6) == "CDATA[") {
  51371. var end = source.indexOf("]]>", start2 + 9);
  51372. domBuilder.startCDATA();
  51373. domBuilder.characters(source, start2 + 9, end - start2 - 9);
  51374. domBuilder.endCDATA();
  51375. return end + 3;
  51376. }
  51377. var matchs = split(source, start2);
  51378. var len = matchs.length;
  51379. if (len > 1 && /!doctype/i.test(matchs[0][0])) {
  51380. var name = matchs[1][0];
  51381. var pubid = false;
  51382. var sysid = false;
  51383. if (len > 3) {
  51384. if (/^public$/i.test(matchs[2][0])) {
  51385. pubid = matchs[3][0];
  51386. sysid = len > 4 && matchs[4][0];
  51387. } else if (/^system$/i.test(matchs[2][0])) {
  51388. sysid = matchs[3][0];
  51389. }
  51390. }
  51391. var lastMatch = matchs[len - 1];
  51392. domBuilder.startDTD(name, pubid, sysid);
  51393. domBuilder.endDTD();
  51394. return lastMatch.index + lastMatch[0].length;
  51395. }
  51396. }
  51397. return -1;
  51398. }
  51399. function parseInstruction(source, start2, domBuilder) {
  51400. var end = source.indexOf("?>", start2);
  51401. if (end) {
  51402. var match = source.substring(start2, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
  51403. if (match) {
  51404. match[0].length;
  51405. domBuilder.processingInstruction(match[1], match[2]);
  51406. return end + 2;
  51407. } else {
  51408. return -1;
  51409. }
  51410. }
  51411. return -1;
  51412. }
  51413. function ElementAttributes() {
  51414. this.attributeNames = {};
  51415. }
  51416. ElementAttributes.prototype = {
  51417. setTagName: function(tagName) {
  51418. if (!tagNamePattern.test(tagName)) {
  51419. throw new Error("invalid tagName:" + tagName);
  51420. }
  51421. this.tagName = tagName;
  51422. },
  51423. addValue: function(qName, value, offset) {
  51424. if (!tagNamePattern.test(qName)) {
  51425. throw new Error("invalid attribute:" + qName);
  51426. }
  51427. this.attributeNames[qName] = this.length;
  51428. this[this.length++] = { qName, value, offset };
  51429. },
  51430. length: 0,
  51431. getLocalName: function(i2) {
  51432. return this[i2].localName;
  51433. },
  51434. getLocator: function(i2) {
  51435. return this[i2].locator;
  51436. },
  51437. getQName: function(i2) {
  51438. return this[i2].qName;
  51439. },
  51440. getURI: function(i2) {
  51441. return this[i2].uri;
  51442. },
  51443. getValue: function(i2) {
  51444. return this[i2].value;
  51445. }
  51446. };
  51447. function split(source, start2) {
  51448. var match;
  51449. var buf = [];
  51450. var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
  51451. reg.lastIndex = start2;
  51452. reg.exec(source);
  51453. while (match = reg.exec(source)) {
  51454. buf.push(match);
  51455. if (match[1])
  51456. return buf;
  51457. }
  51458. }
  51459. sax$1.XMLReader = XMLReader$1;
  51460. sax$1.ParseError = ParseError$1;
  51461. var conventions = conventions$2;
  51462. var dom = dom$1;
  51463. var entities = entities$1;
  51464. var sax = sax$1;
  51465. var DOMImplementation = dom.DOMImplementation;
  51466. var NAMESPACE = conventions.NAMESPACE;
  51467. var ParseError = sax.ParseError;
  51468. var XMLReader = sax.XMLReader;
  51469. function normalizeLineEndings(input) {
  51470. return input.replace(/\r[\n\u0085]/g, "\n").replace(/[\r\u0085\u2028]/g, "\n");
  51471. }
  51472. function DOMParser$1(options2) {
  51473. this.options = options2 || { locator: {} };
  51474. }
  51475. DOMParser$1.prototype.parseFromString = function(source, mimeType) {
  51476. var options2 = this.options;
  51477. var sax2 = new XMLReader();
  51478. var domBuilder = options2.domBuilder || new DOMHandler();
  51479. var errorHandler = options2.errorHandler;
  51480. var locator = options2.locator;
  51481. var defaultNSMap = options2.xmlns || {};
  51482. var isHTML = /\/x?html?$/.test(mimeType);
  51483. var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
  51484. if (locator) {
  51485. domBuilder.setDocumentLocator(locator);
  51486. }
  51487. sax2.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator);
  51488. sax2.domBuilder = options2.domBuilder || domBuilder;
  51489. if (isHTML) {
  51490. defaultNSMap[""] = NAMESPACE.HTML;
  51491. }
  51492. defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
  51493. var normalize = options2.normalizeLineEndings || normalizeLineEndings;
  51494. if (source && typeof source === "string") {
  51495. sax2.parse(
  51496. normalize(source),
  51497. defaultNSMap,
  51498. entityMap
  51499. );
  51500. } else {
  51501. sax2.errorHandler.error("invalid doc source");
  51502. }
  51503. return domBuilder.doc;
  51504. };
  51505. function buildErrorHandler(errorImpl, domBuilder, locator) {
  51506. if (!errorImpl) {
  51507. if (domBuilder instanceof DOMHandler) {
  51508. return domBuilder;
  51509. }
  51510. errorImpl = domBuilder;
  51511. }
  51512. var errorHandler = {};
  51513. var isCallback = errorImpl instanceof Function;
  51514. locator = locator || {};
  51515. function build(key) {
  51516. var fn2 = errorImpl[key];
  51517. if (!fn2 && isCallback) {
  51518. fn2 = errorImpl.length == 2 ? function(msg) {
  51519. errorImpl(key, msg);
  51520. } : errorImpl;
  51521. }
  51522. errorHandler[key] = fn2 && function(msg) {
  51523. fn2("[xmldom " + key + "] " + msg + _locator(locator));
  51524. } || function() {
  51525. };
  51526. }
  51527. build("warning");
  51528. build("error");
  51529. build("fatalError");
  51530. return errorHandler;
  51531. }
  51532. function DOMHandler() {
  51533. this.cdata = false;
  51534. }
  51535. function position(locator, node) {
  51536. node.lineNumber = locator.lineNumber;
  51537. node.columnNumber = locator.columnNumber;
  51538. }
  51539. DOMHandler.prototype = {
  51540. startDocument: function() {
  51541. this.doc = new DOMImplementation().createDocument(null, null, null);
  51542. if (this.locator) {
  51543. this.doc.documentURI = this.locator.systemId;
  51544. }
  51545. },
  51546. startElement: function(namespaceURI, localName, qName, attrs) {
  51547. var doc = this.doc;
  51548. var el = doc.createElementNS(namespaceURI, qName || localName);
  51549. var len = attrs.length;
  51550. appendElement(this, el);
  51551. this.currentElement = el;
  51552. this.locator && position(this.locator, el);
  51553. for (var i2 = 0; i2 < len; i2++) {
  51554. var namespaceURI = attrs.getURI(i2);
  51555. var value = attrs.getValue(i2);
  51556. var qName = attrs.getQName(i2);
  51557. var attr = doc.createAttributeNS(namespaceURI, qName);
  51558. this.locator && position(attrs.getLocator(i2), attr);
  51559. attr.value = attr.nodeValue = value;
  51560. el.setAttributeNode(attr);
  51561. }
  51562. },
  51563. endElement: function(namespaceURI, localName, qName) {
  51564. var current = this.currentElement;
  51565. current.tagName;
  51566. this.currentElement = current.parentNode;
  51567. },
  51568. startPrefixMapping: function(prefix, uri) {
  51569. },
  51570. endPrefixMapping: function(prefix) {
  51571. },
  51572. processingInstruction: function(target, data) {
  51573. var ins = this.doc.createProcessingInstruction(target, data);
  51574. this.locator && position(this.locator, ins);
  51575. appendElement(this, ins);
  51576. },
  51577. ignorableWhitespace: function(ch, start2, length) {
  51578. },
  51579. characters: function(chars, start2, length) {
  51580. chars = _toString.apply(this, arguments);
  51581. if (chars) {
  51582. if (this.cdata) {
  51583. var charNode = this.doc.createCDATASection(chars);
  51584. } else {
  51585. var charNode = this.doc.createTextNode(chars);
  51586. }
  51587. if (this.currentElement) {
  51588. this.currentElement.appendChild(charNode);
  51589. } else if (/^\s*$/.test(chars)) {
  51590. this.doc.appendChild(charNode);
  51591. }
  51592. this.locator && position(this.locator, charNode);
  51593. }
  51594. },
  51595. skippedEntity: function(name) {
  51596. },
  51597. endDocument: function() {
  51598. this.doc.normalize();
  51599. },
  51600. setDocumentLocator: function(locator) {
  51601. if (this.locator = locator) {
  51602. locator.lineNumber = 0;
  51603. }
  51604. },
  51605. comment: function(chars, start2, length) {
  51606. chars = _toString.apply(this, arguments);
  51607. var comm = this.doc.createComment(chars);
  51608. this.locator && position(this.locator, comm);
  51609. appendElement(this, comm);
  51610. },
  51611. startCDATA: function() {
  51612. this.cdata = true;
  51613. },
  51614. endCDATA: function() {
  51615. this.cdata = false;
  51616. },
  51617. startDTD: function(name, publicId, systemId) {
  51618. var impl = this.doc.implementation;
  51619. if (impl && impl.createDocumentType) {
  51620. var dt2 = impl.createDocumentType(name, publicId, systemId);
  51621. this.locator && position(this.locator, dt2);
  51622. appendElement(this, dt2);
  51623. this.doc.doctype = dt2;
  51624. }
  51625. },
  51626. warning: function(error) {
  51627. console.warn("[xmldom warning] " + error, _locator(this.locator));
  51628. },
  51629. error: function(error) {
  51630. console.error("[xmldom error] " + error, _locator(this.locator));
  51631. },
  51632. fatalError: function(error) {
  51633. throw new ParseError(error, this.locator);
  51634. }
  51635. };
  51636. function _locator(l) {
  51637. if (l) {
  51638. return "\n@" + (l.systemId || "") + "#[line:" + l.lineNumber + ",col:" + l.columnNumber + "]";
  51639. }
  51640. }
  51641. function _toString(chars, start2, length) {
  51642. if (typeof chars == "string") {
  51643. return chars.substr(start2, length);
  51644. } else {
  51645. if (chars.length >= start2 + length || start2) {
  51646. return new java.lang.String(chars, start2, length) + "";
  51647. }
  51648. return chars;
  51649. }
  51650. }
  51651. "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(key) {
  51652. DOMHandler.prototype[key] = function() {
  51653. return null;
  51654. };
  51655. });
  51656. function appendElement(hander, node) {
  51657. if (!hander.currentElement) {
  51658. hander.doc.appendChild(node);
  51659. } else {
  51660. hander.currentElement.appendChild(node);
  51661. }
  51662. }
  51663. domParser.__DOMHandler = DOMHandler;
  51664. domParser.normalizeLineEndings = normalizeLineEndings;
  51665. domParser.DOMParser = DOMParser$1;
  51666. var DOMParser = domParser.DOMParser;
  51667. /*! @name mpd-parser @version 1.1.1 @license Apache-2.0 */
  51668. const isObject$3 = (obj) => {
  51669. return !!obj && typeof obj === "object";
  51670. };
  51671. const merge$3 = (...objects) => {
  51672. return objects.reduce((result, source) => {
  51673. if (typeof source !== "object") {
  51674. return result;
  51675. }
  51676. Object.keys(source).forEach((key) => {
  51677. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  51678. result[key] = result[key].concat(source[key]);
  51679. } else if (isObject$3(result[key]) && isObject$3(source[key])) {
  51680. result[key] = merge$3(result[key], source[key]);
  51681. } else {
  51682. result[key] = source[key];
  51683. }
  51684. });
  51685. return result;
  51686. }, {});
  51687. };
  51688. const values$1 = (o) => Object.keys(o).map((k) => o[k]);
  51689. const range$1 = (start2, end) => {
  51690. const result = [];
  51691. for (let i2 = start2; i2 < end; i2++) {
  51692. result.push(i2);
  51693. }
  51694. return result;
  51695. };
  51696. const flatten$1 = (lists) => lists.reduce((x, y) => x.concat(y), []);
  51697. const from$1 = (list) => {
  51698. if (!list.length) {
  51699. return [];
  51700. }
  51701. const result = [];
  51702. for (let i2 = 0; i2 < list.length; i2++) {
  51703. result.push(list[i2]);
  51704. }
  51705. return result;
  51706. };
  51707. const findIndexes$1 = (l, key) => l.reduce((a, e, i2) => {
  51708. if (e[key]) {
  51709. a.push(i2);
  51710. }
  51711. return a;
  51712. }, []);
  51713. const union$1 = (lists, keyFunction) => {
  51714. return values$1(lists.reduce((acc, list) => {
  51715. list.forEach((el) => {
  51716. acc[keyFunction(el)] = el;
  51717. });
  51718. return acc;
  51719. }, {}));
  51720. };
  51721. var errors$1 = {
  51722. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  51723. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  51724. DASH_INVALID_XML: "DASH_INVALID_XML",
  51725. NO_BASE_URL: "NO_BASE_URL",
  51726. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  51727. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  51728. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  51729. };
  51730. const urlTypeToSegment$1 = ({
  51731. baseUrl = "",
  51732. source = "",
  51733. range: range3 = "",
  51734. indexRange = ""
  51735. }) => {
  51736. const segment = {
  51737. uri: source,
  51738. resolvedUri: resolveUrl$3(baseUrl || "", source)
  51739. };
  51740. if (range3 || indexRange) {
  51741. const rangeStr = range3 ? range3 : indexRange;
  51742. const ranges = rangeStr.split("-");
  51743. let startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  51744. let endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  51745. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  51746. startRange = Number(startRange);
  51747. }
  51748. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  51749. endRange = Number(endRange);
  51750. }
  51751. let length;
  51752. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  51753. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  51754. } else {
  51755. length = endRange - startRange + 1;
  51756. }
  51757. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  51758. length = Number(length);
  51759. }
  51760. segment.byterange = {
  51761. length,
  51762. offset: startRange
  51763. };
  51764. }
  51765. return segment;
  51766. };
  51767. const byteRangeToString$1 = (byterange) => {
  51768. let endRange;
  51769. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  51770. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  51771. } else {
  51772. endRange = byterange.offset + byterange.length - 1;
  51773. }
  51774. return `${byterange.offset}-${endRange}`;
  51775. };
  51776. const parseEndNumber$1 = (endNumber) => {
  51777. if (endNumber && typeof endNumber !== "number") {
  51778. endNumber = parseInt(endNumber, 10);
  51779. }
  51780. if (isNaN(endNumber)) {
  51781. return null;
  51782. }
  51783. return endNumber;
  51784. };
  51785. const segmentRange$1 = {
  51786. static(attributes) {
  51787. const {
  51788. duration: duration5,
  51789. timescale: timescale2 = 1,
  51790. sourceDuration,
  51791. periodDuration
  51792. } = attributes;
  51793. const endNumber = parseEndNumber$1(attributes.endNumber);
  51794. const segmentDuration = duration5 / timescale2;
  51795. if (typeof endNumber === "number") {
  51796. return {
  51797. start: 0,
  51798. end: endNumber
  51799. };
  51800. }
  51801. if (typeof periodDuration === "number") {
  51802. return {
  51803. start: 0,
  51804. end: periodDuration / segmentDuration
  51805. };
  51806. }
  51807. return {
  51808. start: 0,
  51809. end: sourceDuration / segmentDuration
  51810. };
  51811. },
  51812. dynamic(attributes) {
  51813. const {
  51814. NOW,
  51815. clientOffset,
  51816. availabilityStartTime: availabilityStartTime2,
  51817. timescale: timescale2 = 1,
  51818. duration: duration5,
  51819. periodStart = 0,
  51820. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  51821. timeShiftBufferDepth: timeShiftBufferDepth2 = Infinity
  51822. } = attributes;
  51823. const endNumber = parseEndNumber$1(attributes.endNumber);
  51824. const now2 = (NOW + clientOffset) / 1e3;
  51825. const periodStartWC = availabilityStartTime2 + periodStart;
  51826. const periodEndWC = now2 + minimumUpdatePeriod2;
  51827. const periodDuration = periodEndWC - periodStartWC;
  51828. const segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  51829. const availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  51830. const availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  51831. return {
  51832. start: Math.max(0, availableStart),
  51833. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  51834. };
  51835. }
  51836. };
  51837. const toSegments$1 = (attributes) => (number) => {
  51838. const {
  51839. duration: duration5,
  51840. timescale: timescale2 = 1,
  51841. periodStart,
  51842. startNumber: startNumber2 = 1
  51843. } = attributes;
  51844. return {
  51845. number: startNumber2 + number,
  51846. duration: duration5 / timescale2,
  51847. timeline: periodStart,
  51848. time: number * duration5
  51849. };
  51850. };
  51851. const parseByDuration$1 = (attributes) => {
  51852. const {
  51853. type: type2,
  51854. duration: duration5,
  51855. timescale: timescale2 = 1,
  51856. periodDuration,
  51857. sourceDuration
  51858. } = attributes;
  51859. const {
  51860. start: start2,
  51861. end
  51862. } = segmentRange$1[type2](attributes);
  51863. const segments = range$1(start2, end).map(toSegments$1(attributes));
  51864. if (type2 === "static") {
  51865. const index2 = segments.length - 1;
  51866. const sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  51867. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  51868. }
  51869. return segments;
  51870. };
  51871. const segmentsFromBase$1 = (attributes) => {
  51872. const {
  51873. baseUrl,
  51874. initialization = {},
  51875. sourceDuration,
  51876. indexRange = "",
  51877. periodStart,
  51878. presentationTime,
  51879. number = 0,
  51880. duration: duration5
  51881. } = attributes;
  51882. if (!baseUrl) {
  51883. throw new Error(errors$1.NO_BASE_URL);
  51884. }
  51885. const initSegment = urlTypeToSegment$1({
  51886. baseUrl,
  51887. source: initialization.sourceURL,
  51888. range: initialization.range
  51889. });
  51890. const segment = urlTypeToSegment$1({
  51891. baseUrl,
  51892. source: baseUrl,
  51893. indexRange
  51894. });
  51895. segment.map = initSegment;
  51896. if (duration5) {
  51897. const segmentTimeInfo = parseByDuration$1(attributes);
  51898. if (segmentTimeInfo.length) {
  51899. segment.duration = segmentTimeInfo[0].duration;
  51900. segment.timeline = segmentTimeInfo[0].timeline;
  51901. }
  51902. } else if (sourceDuration) {
  51903. segment.duration = sourceDuration;
  51904. segment.timeline = periodStart;
  51905. }
  51906. segment.presentationTime = presentationTime || periodStart;
  51907. segment.number = number;
  51908. return [segment];
  51909. };
  51910. const addSidxSegmentsToPlaylist$1$1 = (playlist, sidx, baseUrl) => {
  51911. const initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  51912. const sourceDuration = playlist.sidx.duration;
  51913. const timeline = playlist.timeline || 0;
  51914. const sidxByteRange = playlist.sidx.byterange;
  51915. const sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  51916. const timescale2 = sidx.timescale;
  51917. const mediaReferences = sidx.references.filter((r2) => r2.referenceType !== 1);
  51918. const segments = [];
  51919. const type2 = playlist.endList ? "static" : "dynamic";
  51920. const periodStart = playlist.sidx.timeline;
  51921. let presentationTime = periodStart;
  51922. let number = playlist.mediaSequence || 0;
  51923. let startIndex;
  51924. if (typeof sidx.firstOffset === "bigint") {
  51925. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  51926. } else {
  51927. startIndex = sidxEnd + sidx.firstOffset;
  51928. }
  51929. for (let i2 = 0; i2 < mediaReferences.length; i2++) {
  51930. const reference = sidx.references[i2];
  51931. const size = reference.referencedSize;
  51932. const duration5 = reference.subsegmentDuration;
  51933. let endIndex;
  51934. if (typeof startIndex === "bigint") {
  51935. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  51936. } else {
  51937. endIndex = startIndex + size - 1;
  51938. }
  51939. const indexRange = `${startIndex}-${endIndex}`;
  51940. const attributes = {
  51941. baseUrl,
  51942. timescale: timescale2,
  51943. timeline,
  51944. periodStart,
  51945. presentationTime,
  51946. number,
  51947. duration: duration5,
  51948. sourceDuration,
  51949. indexRange,
  51950. type: type2
  51951. };
  51952. const segment = segmentsFromBase$1(attributes)[0];
  51953. if (initSegment) {
  51954. segment.map = initSegment;
  51955. }
  51956. segments.push(segment);
  51957. if (typeof startIndex === "bigint") {
  51958. startIndex += window_1.BigInt(size);
  51959. } else {
  51960. startIndex += size;
  51961. }
  51962. presentationTime += duration5 / timescale2;
  51963. number++;
  51964. }
  51965. playlist.segments = segments;
  51966. return playlist;
  51967. };
  51968. const SUPPORTED_MEDIA_TYPES$1 = ["AUDIO", "SUBTITLES"];
  51969. const TIME_FUDGE$1 = 1 / 60;
  51970. const getUniqueTimelineStarts$1 = (timelineStarts) => {
  51971. return union$1(timelineStarts, ({
  51972. timeline
  51973. }) => timeline).sort((a, b) => a.timeline > b.timeline ? 1 : -1);
  51974. };
  51975. const findPlaylistWithName$1 = (playlists, name) => {
  51976. for (let i2 = 0; i2 < playlists.length; i2++) {
  51977. if (playlists[i2].attributes.NAME === name) {
  51978. return playlists[i2];
  51979. }
  51980. }
  51981. return null;
  51982. };
  51983. const getMediaGroupPlaylists$1 = (manifest) => {
  51984. let mediaGroupPlaylists = [];
  51985. forEachMediaGroup$3(manifest, SUPPORTED_MEDIA_TYPES$1, (properties, type2, group, label2) => {
  51986. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  51987. });
  51988. return mediaGroupPlaylists;
  51989. };
  51990. const updateMediaSequenceForPlaylist$1 = ({
  51991. playlist,
  51992. mediaSequence
  51993. }) => {
  51994. playlist.mediaSequence = mediaSequence;
  51995. playlist.segments.forEach((segment, index2) => {
  51996. segment.number = playlist.mediaSequence + index2;
  51997. });
  51998. };
  51999. const updateSequenceNumbers$1 = ({
  52000. oldPlaylists,
  52001. newPlaylists,
  52002. timelineStarts
  52003. }) => {
  52004. newPlaylists.forEach((playlist) => {
  52005. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  52006. timeline
  52007. }) {
  52008. return timeline === playlist.timeline;
  52009. });
  52010. const oldPlaylist = findPlaylistWithName$1(oldPlaylists, playlist.attributes.NAME);
  52011. if (!oldPlaylist) {
  52012. return;
  52013. }
  52014. if (playlist.sidx) {
  52015. return;
  52016. }
  52017. const firstNewSegment = playlist.segments[0];
  52018. const oldMatchingSegmentIndex = oldPlaylist.segments.findIndex(function(oldSegment) {
  52019. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE$1;
  52020. });
  52021. if (oldMatchingSegmentIndex === -1) {
  52022. updateMediaSequenceForPlaylist$1({
  52023. playlist,
  52024. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  52025. });
  52026. playlist.segments[0].discontinuity = true;
  52027. playlist.discontinuityStarts.unshift(0);
  52028. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  52029. playlist.discontinuitySequence--;
  52030. }
  52031. return;
  52032. }
  52033. const oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  52034. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  52035. firstNewSegment.discontinuity = true;
  52036. playlist.discontinuityStarts.unshift(0);
  52037. playlist.discontinuitySequence--;
  52038. }
  52039. updateMediaSequenceForPlaylist$1({
  52040. playlist,
  52041. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  52042. });
  52043. });
  52044. };
  52045. const positionManifestOnTimeline$1 = ({
  52046. oldManifest,
  52047. newManifest
  52048. }) => {
  52049. const oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists$1(oldManifest));
  52050. const newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists$1(newManifest));
  52051. newManifest.timelineStarts = getUniqueTimelineStarts$1([oldManifest.timelineStarts, newManifest.timelineStarts]);
  52052. updateSequenceNumbers$1({
  52053. oldPlaylists,
  52054. newPlaylists,
  52055. timelineStarts: newManifest.timelineStarts
  52056. });
  52057. return newManifest;
  52058. };
  52059. const generateSidxKey$1 = (sidx) => sidx && sidx.uri + "-" + byteRangeToString$1(sidx.byterange);
  52060. const mergeDiscontiguousPlaylists$1 = (playlists) => {
  52061. const mergedPlaylists = values$1(playlists.reduce((acc, playlist) => {
  52062. const name = playlist.attributes.id + (playlist.attributes.lang || "");
  52063. if (!acc[name]) {
  52064. acc[name] = playlist;
  52065. acc[name].attributes.timelineStarts = [];
  52066. } else {
  52067. if (playlist.segments) {
  52068. if (playlist.segments[0]) {
  52069. playlist.segments[0].discontinuity = true;
  52070. }
  52071. acc[name].segments.push(...playlist.segments);
  52072. }
  52073. if (playlist.attributes.contentProtection) {
  52074. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  52075. }
  52076. }
  52077. acc[name].attributes.timelineStarts.push({
  52078. start: playlist.attributes.periodStart,
  52079. timeline: playlist.attributes.periodStart
  52080. });
  52081. return acc;
  52082. }, {}));
  52083. return mergedPlaylists.map((playlist) => {
  52084. playlist.discontinuityStarts = findIndexes$1(playlist.segments || [], "discontinuity");
  52085. return playlist;
  52086. });
  52087. };
  52088. const addSidxSegmentsToPlaylist$2 = (playlist, sidxMapping) => {
  52089. const sidxKey = generateSidxKey$1(playlist.sidx);
  52090. const sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  52091. if (sidxMatch) {
  52092. addSidxSegmentsToPlaylist$1$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  52093. }
  52094. return playlist;
  52095. };
  52096. const addSidxSegmentsToPlaylists$1 = (playlists, sidxMapping = {}) => {
  52097. if (!Object.keys(sidxMapping).length) {
  52098. return playlists;
  52099. }
  52100. for (const i2 in playlists) {
  52101. playlists[i2] = addSidxSegmentsToPlaylist$2(playlists[i2], sidxMapping);
  52102. }
  52103. return playlists;
  52104. };
  52105. const formatAudioPlaylist$1 = ({
  52106. attributes,
  52107. segments,
  52108. sidx,
  52109. mediaSequence,
  52110. discontinuitySequence,
  52111. discontinuityStarts
  52112. }, isAudioOnly3) => {
  52113. const playlist = {
  52114. attributes: {
  52115. NAME: attributes.id,
  52116. BANDWIDTH: attributes.bandwidth,
  52117. CODECS: attributes.codecs,
  52118. ["PROGRAM-ID"]: 1
  52119. },
  52120. uri: "",
  52121. endList: attributes.type === "static",
  52122. timeline: attributes.periodStart,
  52123. resolvedUri: "",
  52124. targetDuration: attributes.duration,
  52125. discontinuitySequence,
  52126. discontinuityStarts,
  52127. timelineStarts: attributes.timelineStarts,
  52128. mediaSequence,
  52129. segments
  52130. };
  52131. if (attributes.contentProtection) {
  52132. playlist.contentProtection = attributes.contentProtection;
  52133. }
  52134. if (sidx) {
  52135. playlist.sidx = sidx;
  52136. }
  52137. if (isAudioOnly3) {
  52138. playlist.attributes.AUDIO = "audio";
  52139. playlist.attributes.SUBTITLES = "subs";
  52140. }
  52141. return playlist;
  52142. };
  52143. const formatVttPlaylist$1 = ({
  52144. attributes,
  52145. segments,
  52146. mediaSequence,
  52147. discontinuityStarts,
  52148. discontinuitySequence
  52149. }) => {
  52150. if (typeof segments === "undefined") {
  52151. segments = [{
  52152. uri: attributes.baseUrl,
  52153. timeline: attributes.periodStart,
  52154. resolvedUri: attributes.baseUrl || "",
  52155. duration: attributes.sourceDuration,
  52156. number: 0
  52157. }];
  52158. attributes.duration = attributes.sourceDuration;
  52159. }
  52160. const m3u8Attributes = {
  52161. NAME: attributes.id,
  52162. BANDWIDTH: attributes.bandwidth,
  52163. ["PROGRAM-ID"]: 1
  52164. };
  52165. if (attributes.codecs) {
  52166. m3u8Attributes.CODECS = attributes.codecs;
  52167. }
  52168. return {
  52169. attributes: m3u8Attributes,
  52170. uri: "",
  52171. endList: attributes.type === "static",
  52172. timeline: attributes.periodStart,
  52173. resolvedUri: attributes.baseUrl || "",
  52174. targetDuration: attributes.duration,
  52175. timelineStarts: attributes.timelineStarts,
  52176. discontinuityStarts,
  52177. discontinuitySequence,
  52178. mediaSequence,
  52179. segments
  52180. };
  52181. };
  52182. const organizeAudioPlaylists$1 = (playlists, sidxMapping = {}, isAudioOnly3 = false) => {
  52183. let mainPlaylist;
  52184. const formattedPlaylists = playlists.reduce((a, playlist) => {
  52185. const role = playlist.attributes.role && playlist.attributes.role.value || "";
  52186. const language = playlist.attributes.lang || "";
  52187. let label2 = playlist.attributes.label || "main";
  52188. if (language && !playlist.attributes.label) {
  52189. const roleLabel = role ? ` (${role})` : "";
  52190. label2 = `${playlist.attributes.lang}${roleLabel}`;
  52191. }
  52192. if (!a[label2]) {
  52193. a[label2] = {
  52194. language,
  52195. autoselect: true,
  52196. default: role === "main",
  52197. playlists: [],
  52198. uri: ""
  52199. };
  52200. }
  52201. const formatted = addSidxSegmentsToPlaylist$2(formatAudioPlaylist$1(playlist, isAudioOnly3), sidxMapping);
  52202. a[label2].playlists.push(formatted);
  52203. if (typeof mainPlaylist === "undefined" && role === "main") {
  52204. mainPlaylist = playlist;
  52205. mainPlaylist.default = true;
  52206. }
  52207. return a;
  52208. }, {});
  52209. if (!mainPlaylist) {
  52210. const firstLabel = Object.keys(formattedPlaylists)[0];
  52211. formattedPlaylists[firstLabel].default = true;
  52212. }
  52213. return formattedPlaylists;
  52214. };
  52215. const organizeVttPlaylists$1 = (playlists, sidxMapping = {}) => {
  52216. return playlists.reduce((a, playlist) => {
  52217. const label2 = playlist.attributes.label || playlist.attributes.lang || "text";
  52218. if (!a[label2]) {
  52219. a[label2] = {
  52220. language: label2,
  52221. default: false,
  52222. autoselect: false,
  52223. playlists: [],
  52224. uri: ""
  52225. };
  52226. }
  52227. a[label2].playlists.push(addSidxSegmentsToPlaylist$2(formatVttPlaylist$1(playlist), sidxMapping));
  52228. return a;
  52229. }, {});
  52230. };
  52231. const organizeCaptionServices$1 = (captionServices) => captionServices.reduce((svcObj, svc) => {
  52232. if (!svc) {
  52233. return svcObj;
  52234. }
  52235. svc.forEach((service) => {
  52236. const {
  52237. channel,
  52238. language
  52239. } = service;
  52240. svcObj[language] = {
  52241. autoselect: false,
  52242. default: false,
  52243. instreamId: channel,
  52244. language
  52245. };
  52246. if (service.hasOwnProperty("aspectRatio")) {
  52247. svcObj[language].aspectRatio = service.aspectRatio;
  52248. }
  52249. if (service.hasOwnProperty("easyReader")) {
  52250. svcObj[language].easyReader = service.easyReader;
  52251. }
  52252. if (service.hasOwnProperty("3D")) {
  52253. svcObj[language]["3D"] = service["3D"];
  52254. }
  52255. });
  52256. return svcObj;
  52257. }, {});
  52258. const formatVideoPlaylist$1 = ({
  52259. attributes,
  52260. segments,
  52261. sidx,
  52262. discontinuityStarts
  52263. }) => {
  52264. const playlist = {
  52265. attributes: {
  52266. NAME: attributes.id,
  52267. AUDIO: "audio",
  52268. SUBTITLES: "subs",
  52269. RESOLUTION: {
  52270. width: attributes.width,
  52271. height: attributes.height
  52272. },
  52273. CODECS: attributes.codecs,
  52274. BANDWIDTH: attributes.bandwidth,
  52275. ["PROGRAM-ID"]: 1
  52276. },
  52277. uri: "",
  52278. endList: attributes.type === "static",
  52279. timeline: attributes.periodStart,
  52280. resolvedUri: "",
  52281. targetDuration: attributes.duration,
  52282. discontinuityStarts,
  52283. timelineStarts: attributes.timelineStarts,
  52284. segments
  52285. };
  52286. if (attributes.frameRate) {
  52287. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  52288. }
  52289. if (attributes.contentProtection) {
  52290. playlist.contentProtection = attributes.contentProtection;
  52291. }
  52292. if (sidx) {
  52293. playlist.sidx = sidx;
  52294. }
  52295. return playlist;
  52296. };
  52297. const videoOnly$1 = ({
  52298. attributes
  52299. }) => attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  52300. const audioOnly$1 = ({
  52301. attributes
  52302. }) => attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  52303. const vttOnly$1 = ({
  52304. attributes
  52305. }) => attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  52306. const addMediaSequenceValues$1 = (playlists, timelineStarts) => {
  52307. playlists.forEach((playlist) => {
  52308. playlist.mediaSequence = 0;
  52309. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  52310. timeline
  52311. }) {
  52312. return timeline === playlist.timeline;
  52313. });
  52314. if (!playlist.segments) {
  52315. return;
  52316. }
  52317. playlist.segments.forEach((segment, index2) => {
  52318. segment.number = index2;
  52319. });
  52320. });
  52321. };
  52322. const flattenMediaGroupPlaylists$1 = (mediaGroupObject) => {
  52323. if (!mediaGroupObject) {
  52324. return [];
  52325. }
  52326. return Object.keys(mediaGroupObject).reduce((acc, label2) => {
  52327. const labelContents = mediaGroupObject[label2];
  52328. return acc.concat(labelContents.playlists);
  52329. }, []);
  52330. };
  52331. const toM3u8$1 = ({
  52332. dashPlaylists,
  52333. locations,
  52334. sidxMapping = {},
  52335. previousManifest,
  52336. eventStream
  52337. }) => {
  52338. if (!dashPlaylists.length) {
  52339. return {};
  52340. }
  52341. const {
  52342. sourceDuration: duration5,
  52343. type: type2,
  52344. suggestedPresentationDelay: suggestedPresentationDelay2,
  52345. minimumUpdatePeriod: minimumUpdatePeriod2
  52346. } = dashPlaylists[0].attributes;
  52347. const videoPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(videoOnly$1)).map(formatVideoPlaylist$1);
  52348. const audioPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(audioOnly$1));
  52349. const vttPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(vttOnly$1));
  52350. const captions = dashPlaylists.map((playlist) => playlist.attributes.captionServices).filter(Boolean);
  52351. const manifest = {
  52352. allowCache: true,
  52353. discontinuityStarts: [],
  52354. segments: [],
  52355. endList: true,
  52356. mediaGroups: {
  52357. AUDIO: {},
  52358. VIDEO: {},
  52359. ["CLOSED-CAPTIONS"]: {},
  52360. SUBTITLES: {}
  52361. },
  52362. uri: "",
  52363. duration: duration5,
  52364. playlists: addSidxSegmentsToPlaylists$1(videoPlaylists, sidxMapping)
  52365. };
  52366. if (minimumUpdatePeriod2 >= 0) {
  52367. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  52368. }
  52369. if (locations) {
  52370. manifest.locations = locations;
  52371. }
  52372. if (type2 === "dynamic") {
  52373. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  52374. }
  52375. if (eventStream && eventStream.length > 0) {
  52376. manifest.eventStream = eventStream;
  52377. }
  52378. const isAudioOnly3 = manifest.playlists.length === 0;
  52379. const organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists$1(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  52380. const organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists$1(vttPlaylists, sidxMapping) : null;
  52381. const formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists$1(organizedAudioGroup), flattenMediaGroupPlaylists$1(organizedVttGroup));
  52382. const playlistTimelineStarts = formattedPlaylists.map(({
  52383. timelineStarts
  52384. }) => timelineStarts);
  52385. manifest.timelineStarts = getUniqueTimelineStarts$1(playlistTimelineStarts);
  52386. addMediaSequenceValues$1(formattedPlaylists, manifest.timelineStarts);
  52387. if (organizedAudioGroup) {
  52388. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  52389. }
  52390. if (organizedVttGroup) {
  52391. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  52392. }
  52393. if (captions.length) {
  52394. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices$1(captions);
  52395. }
  52396. if (previousManifest) {
  52397. return positionManifestOnTimeline$1({
  52398. oldManifest: previousManifest,
  52399. newManifest: manifest
  52400. });
  52401. }
  52402. return manifest;
  52403. };
  52404. const getLiveRValue$1 = (attributes, time, duration5) => {
  52405. const {
  52406. NOW,
  52407. clientOffset,
  52408. availabilityStartTime: availabilityStartTime2,
  52409. timescale: timescale2 = 1,
  52410. periodStart = 0,
  52411. minimumUpdatePeriod: minimumUpdatePeriod2 = 0
  52412. } = attributes;
  52413. const now2 = (NOW + clientOffset) / 1e3;
  52414. const periodStartWC = availabilityStartTime2 + periodStart;
  52415. const periodEndWC = now2 + minimumUpdatePeriod2;
  52416. const periodDuration = periodEndWC - periodStartWC;
  52417. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  52418. };
  52419. const parseByTimeline$1 = (attributes, segmentTimeline) => {
  52420. const {
  52421. type: type2,
  52422. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  52423. media = "",
  52424. sourceDuration,
  52425. timescale: timescale2 = 1,
  52426. startNumber: startNumber2 = 1,
  52427. periodStart: timeline
  52428. } = attributes;
  52429. const segments = [];
  52430. let time = -1;
  52431. for (let sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  52432. const S = segmentTimeline[sIndex];
  52433. const duration5 = S.d;
  52434. const repeat = S.r || 0;
  52435. const segmentTime = S.t || 0;
  52436. if (time < 0) {
  52437. time = segmentTime;
  52438. }
  52439. if (segmentTime && segmentTime > time) {
  52440. time = segmentTime;
  52441. }
  52442. let count;
  52443. if (repeat < 0) {
  52444. const nextS = sIndex + 1;
  52445. if (nextS === segmentTimeline.length) {
  52446. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  52447. count = getLiveRValue$1(attributes, time, duration5);
  52448. } else {
  52449. count = (sourceDuration * timescale2 - time) / duration5;
  52450. }
  52451. } else {
  52452. count = (segmentTimeline[nextS].t - time) / duration5;
  52453. }
  52454. } else {
  52455. count = repeat + 1;
  52456. }
  52457. const end = startNumber2 + segments.length + count;
  52458. let number = startNumber2 + segments.length;
  52459. while (number < end) {
  52460. segments.push({
  52461. number,
  52462. duration: duration5 / timescale2,
  52463. time,
  52464. timeline
  52465. });
  52466. time += duration5;
  52467. number++;
  52468. }
  52469. }
  52470. return segments;
  52471. };
  52472. const identifierPattern$1 = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  52473. const identifierReplacement$1 = (values3) => (match, identifier, format, width2) => {
  52474. if (match === "$$") {
  52475. return "$";
  52476. }
  52477. if (typeof values3[identifier] === "undefined") {
  52478. return match;
  52479. }
  52480. const value = "" + values3[identifier];
  52481. if (identifier === "RepresentationID") {
  52482. return value;
  52483. }
  52484. if (!format) {
  52485. width2 = 1;
  52486. } else {
  52487. width2 = parseInt(width2, 10);
  52488. }
  52489. if (value.length >= width2) {
  52490. return value;
  52491. }
  52492. return `${new Array(width2 - value.length + 1).join("0")}${value}`;
  52493. };
  52494. const constructTemplateUrl$1 = (url, values3) => url.replace(identifierPattern$1, identifierReplacement$1(values3));
  52495. const parseTemplateInfo$1 = (attributes, segmentTimeline) => {
  52496. if (!attributes.duration && !segmentTimeline) {
  52497. return [{
  52498. number: attributes.startNumber || 1,
  52499. duration: attributes.sourceDuration,
  52500. time: 0,
  52501. timeline: attributes.periodStart
  52502. }];
  52503. }
  52504. if (attributes.duration) {
  52505. return parseByDuration$1(attributes);
  52506. }
  52507. return parseByTimeline$1(attributes, segmentTimeline);
  52508. };
  52509. const segmentsFromTemplate$1 = (attributes, segmentTimeline) => {
  52510. const templateValues = {
  52511. RepresentationID: attributes.id,
  52512. Bandwidth: attributes.bandwidth || 0
  52513. };
  52514. const {
  52515. initialization = {
  52516. sourceURL: "",
  52517. range: ""
  52518. }
  52519. } = attributes;
  52520. const mapSegment = urlTypeToSegment$1({
  52521. baseUrl: attributes.baseUrl,
  52522. source: constructTemplateUrl$1(initialization.sourceURL, templateValues),
  52523. range: initialization.range
  52524. });
  52525. const segments = parseTemplateInfo$1(attributes, segmentTimeline);
  52526. return segments.map((segment) => {
  52527. templateValues.Number = segment.number;
  52528. templateValues.Time = segment.time;
  52529. const uri = constructTemplateUrl$1(attributes.media || "", templateValues);
  52530. const timescale2 = attributes.timescale || 1;
  52531. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52532. const presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  52533. const map = {
  52534. uri,
  52535. timeline: segment.timeline,
  52536. duration: segment.duration,
  52537. resolvedUri: resolveUrl$3(attributes.baseUrl || "", uri),
  52538. map: mapSegment,
  52539. number: segment.number,
  52540. presentationTime
  52541. };
  52542. return map;
  52543. });
  52544. };
  52545. const SegmentURLToSegmentObject$1 = (attributes, segmentUrl) => {
  52546. const {
  52547. baseUrl,
  52548. initialization = {}
  52549. } = attributes;
  52550. const initSegment = urlTypeToSegment$1({
  52551. baseUrl,
  52552. source: initialization.sourceURL,
  52553. range: initialization.range
  52554. });
  52555. const segment = urlTypeToSegment$1({
  52556. baseUrl,
  52557. source: segmentUrl.media,
  52558. range: segmentUrl.mediaRange
  52559. });
  52560. segment.map = initSegment;
  52561. return segment;
  52562. };
  52563. const segmentsFromList$1 = (attributes, segmentTimeline) => {
  52564. const {
  52565. duration: duration5,
  52566. segmentUrls = [],
  52567. periodStart
  52568. } = attributes;
  52569. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  52570. throw new Error(errors$1.SEGMENT_TIME_UNSPECIFIED);
  52571. }
  52572. const segmentUrlMap = segmentUrls.map((segmentUrlObject) => SegmentURLToSegmentObject$1(attributes, segmentUrlObject));
  52573. let segmentTimeInfo;
  52574. if (duration5) {
  52575. segmentTimeInfo = parseByDuration$1(attributes);
  52576. }
  52577. if (segmentTimeline) {
  52578. segmentTimeInfo = parseByTimeline$1(attributes, segmentTimeline);
  52579. }
  52580. const segments = segmentTimeInfo.map((segmentTime, index2) => {
  52581. if (segmentUrlMap[index2]) {
  52582. const segment = segmentUrlMap[index2];
  52583. const timescale2 = attributes.timescale || 1;
  52584. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52585. segment.timeline = segmentTime.timeline;
  52586. segment.duration = segmentTime.duration;
  52587. segment.number = segmentTime.number;
  52588. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  52589. return segment;
  52590. }
  52591. }).filter((segment) => segment);
  52592. return segments;
  52593. };
  52594. const generateSegments$1 = ({
  52595. attributes,
  52596. segmentInfo
  52597. }) => {
  52598. let segmentAttributes;
  52599. let segmentsFn;
  52600. if (segmentInfo.template) {
  52601. segmentsFn = segmentsFromTemplate$1;
  52602. segmentAttributes = merge$3(attributes, segmentInfo.template);
  52603. } else if (segmentInfo.base) {
  52604. segmentsFn = segmentsFromBase$1;
  52605. segmentAttributes = merge$3(attributes, segmentInfo.base);
  52606. } else if (segmentInfo.list) {
  52607. segmentsFn = segmentsFromList$1;
  52608. segmentAttributes = merge$3(attributes, segmentInfo.list);
  52609. }
  52610. const segmentsInfo = {
  52611. attributes
  52612. };
  52613. if (!segmentsFn) {
  52614. return segmentsInfo;
  52615. }
  52616. const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  52617. if (segmentAttributes.duration) {
  52618. const {
  52619. duration: duration5,
  52620. timescale: timescale2 = 1
  52621. } = segmentAttributes;
  52622. segmentAttributes.duration = duration5 / timescale2;
  52623. } else if (segments.length) {
  52624. segmentAttributes.duration = segments.reduce((max2, segment) => {
  52625. return Math.max(max2, Math.ceil(segment.duration));
  52626. }, 0);
  52627. } else {
  52628. segmentAttributes.duration = 0;
  52629. }
  52630. segmentsInfo.attributes = segmentAttributes;
  52631. segmentsInfo.segments = segments;
  52632. if (segmentInfo.base && segmentAttributes.indexRange) {
  52633. segmentsInfo.sidx = segments[0];
  52634. segmentsInfo.segments = [];
  52635. }
  52636. return segmentsInfo;
  52637. };
  52638. const toPlaylists$1 = (representations) => representations.map(generateSegments$1);
  52639. const findChildren$1 = (element, name) => from$1(element.childNodes).filter(({
  52640. tagName
  52641. }) => tagName === name);
  52642. const getContent$1 = (element) => element.textContent.trim();
  52643. const parseDivisionValue$1 = (value) => {
  52644. return parseFloat(value.split("/").reduce((prev, current) => prev / current));
  52645. };
  52646. const parseDuration$1 = (str) => {
  52647. const SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  52648. const SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  52649. const SECONDS_IN_DAY = 24 * 60 * 60;
  52650. const SECONDS_IN_HOUR = 60 * 60;
  52651. const SECONDS_IN_MIN = 60;
  52652. const durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  52653. const match = durationRegex.exec(str);
  52654. if (!match) {
  52655. return 0;
  52656. }
  52657. const [year, month, day, hour, minute, second] = match.slice(1);
  52658. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  52659. };
  52660. const parseDate$1 = (str) => {
  52661. const dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  52662. if (dateRegex.test(str)) {
  52663. str += "Z";
  52664. }
  52665. return Date.parse(str);
  52666. };
  52667. const parsers$1 = {
  52668. mediaPresentationDuration(value) {
  52669. return parseDuration$1(value);
  52670. },
  52671. availabilityStartTime(value) {
  52672. return parseDate$1(value) / 1e3;
  52673. },
  52674. minimumUpdatePeriod(value) {
  52675. return parseDuration$1(value);
  52676. },
  52677. suggestedPresentationDelay(value) {
  52678. return parseDuration$1(value);
  52679. },
  52680. type(value) {
  52681. return value;
  52682. },
  52683. timeShiftBufferDepth(value) {
  52684. return parseDuration$1(value);
  52685. },
  52686. start(value) {
  52687. return parseDuration$1(value);
  52688. },
  52689. width(value) {
  52690. return parseInt(value, 10);
  52691. },
  52692. height(value) {
  52693. return parseInt(value, 10);
  52694. },
  52695. bandwidth(value) {
  52696. return parseInt(value, 10);
  52697. },
  52698. frameRate(value) {
  52699. return parseDivisionValue$1(value);
  52700. },
  52701. startNumber(value) {
  52702. return parseInt(value, 10);
  52703. },
  52704. timescale(value) {
  52705. return parseInt(value, 10);
  52706. },
  52707. presentationTimeOffset(value) {
  52708. return parseInt(value, 10);
  52709. },
  52710. duration(value) {
  52711. const parsedValue = parseInt(value, 10);
  52712. if (isNaN(parsedValue)) {
  52713. return parseDuration$1(value);
  52714. }
  52715. return parsedValue;
  52716. },
  52717. d(value) {
  52718. return parseInt(value, 10);
  52719. },
  52720. t(value) {
  52721. return parseInt(value, 10);
  52722. },
  52723. r(value) {
  52724. return parseInt(value, 10);
  52725. },
  52726. presentationTime(value) {
  52727. return parseInt(value, 10);
  52728. },
  52729. DEFAULT(value) {
  52730. return value;
  52731. }
  52732. };
  52733. const parseAttributes$2 = (el) => {
  52734. if (!(el && el.attributes)) {
  52735. return {};
  52736. }
  52737. return from$1(el.attributes).reduce((a, e) => {
  52738. const parseFn = parsers$1[e.name] || parsers$1.DEFAULT;
  52739. a[e.name] = parseFn(e.value);
  52740. return a;
  52741. }, {});
  52742. };
  52743. const keySystemsMap$1 = {
  52744. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  52745. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  52746. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  52747. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  52748. };
  52749. const buildBaseUrls$1 = (referenceUrls, baseUrlElements) => {
  52750. if (!baseUrlElements.length) {
  52751. return referenceUrls;
  52752. }
  52753. return flatten$1(referenceUrls.map(function(reference) {
  52754. return baseUrlElements.map(function(baseUrlElement) {
  52755. return resolveUrl$3(reference, getContent$1(baseUrlElement));
  52756. });
  52757. }));
  52758. };
  52759. const getSegmentInformation$1 = (adaptationSet) => {
  52760. const segmentTemplate = findChildren$1(adaptationSet, "SegmentTemplate")[0];
  52761. const segmentList = findChildren$1(adaptationSet, "SegmentList")[0];
  52762. const segmentUrls = segmentList && findChildren$1(segmentList, "SegmentURL").map((s) => merge$3({
  52763. tag: "SegmentURL"
  52764. }, parseAttributes$2(s)));
  52765. const segmentBase = findChildren$1(adaptationSet, "SegmentBase")[0];
  52766. const segmentTimelineParentNode = segmentList || segmentTemplate;
  52767. const segmentTimeline = segmentTimelineParentNode && findChildren$1(segmentTimelineParentNode, "SegmentTimeline")[0];
  52768. const segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  52769. const segmentInitialization = segmentInitializationParentNode && findChildren$1(segmentInitializationParentNode, "Initialization")[0];
  52770. const template = segmentTemplate && parseAttributes$2(segmentTemplate);
  52771. if (template && segmentInitialization) {
  52772. template.initialization = segmentInitialization && parseAttributes$2(segmentInitialization);
  52773. } else if (template && template.initialization) {
  52774. template.initialization = {
  52775. sourceURL: template.initialization
  52776. };
  52777. }
  52778. const segmentInfo = {
  52779. template,
  52780. segmentTimeline: segmentTimeline && findChildren$1(segmentTimeline, "S").map((s) => parseAttributes$2(s)),
  52781. list: segmentList && merge$3(parseAttributes$2(segmentList), {
  52782. segmentUrls,
  52783. initialization: parseAttributes$2(segmentInitialization)
  52784. }),
  52785. base: segmentBase && merge$3(parseAttributes$2(segmentBase), {
  52786. initialization: parseAttributes$2(segmentInitialization)
  52787. })
  52788. };
  52789. Object.keys(segmentInfo).forEach((key) => {
  52790. if (!segmentInfo[key]) {
  52791. delete segmentInfo[key];
  52792. }
  52793. });
  52794. return segmentInfo;
  52795. };
  52796. const inheritBaseUrls$1 = (adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) => (representation) => {
  52797. const repBaseUrlElements = findChildren$1(representation, "BaseURL");
  52798. const repBaseUrls = buildBaseUrls$1(adaptationSetBaseUrls, repBaseUrlElements);
  52799. const attributes = merge$3(adaptationSetAttributes, parseAttributes$2(representation));
  52800. const representationSegmentInfo = getSegmentInformation$1(representation);
  52801. return repBaseUrls.map((baseUrl) => {
  52802. return {
  52803. segmentInfo: merge$3(adaptationSetSegmentInfo, representationSegmentInfo),
  52804. attributes: merge$3(attributes, {
  52805. baseUrl
  52806. })
  52807. };
  52808. });
  52809. };
  52810. const generateKeySystemInformation$1 = (contentProtectionNodes) => {
  52811. return contentProtectionNodes.reduce((acc, node) => {
  52812. const attributes = parseAttributes$2(node);
  52813. if (attributes.schemeIdUri) {
  52814. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  52815. }
  52816. const keySystem = keySystemsMap$1[attributes.schemeIdUri];
  52817. if (keySystem) {
  52818. acc[keySystem] = {
  52819. attributes
  52820. };
  52821. const psshNode = findChildren$1(node, "cenc:pssh")[0];
  52822. if (psshNode) {
  52823. const pssh = getContent$1(psshNode);
  52824. acc[keySystem].pssh = pssh && decodeB64ToUint8Array$1(pssh);
  52825. }
  52826. }
  52827. return acc;
  52828. }, {});
  52829. };
  52830. const parseCaptionServiceMetadata$1 = (service) => {
  52831. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  52832. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52833. return values3.map((value) => {
  52834. let channel;
  52835. let language;
  52836. language = value;
  52837. if (/^CC\d=/.test(value)) {
  52838. [channel, language] = value.split("=");
  52839. } else if (/^CC\d$/.test(value)) {
  52840. channel = value;
  52841. }
  52842. return {
  52843. channel,
  52844. language
  52845. };
  52846. });
  52847. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  52848. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52849. return values3.map((value) => {
  52850. const flags = {
  52851. "channel": void 0,
  52852. "language": void 0,
  52853. "aspectRatio": 1,
  52854. "easyReader": 0,
  52855. "3D": 0
  52856. };
  52857. if (/=/.test(value)) {
  52858. const [channel, opts = ""] = value.split("=");
  52859. flags.channel = channel;
  52860. flags.language = value;
  52861. opts.split(",").forEach((opt) => {
  52862. const [name, val] = opt.split(":");
  52863. if (name === "lang") {
  52864. flags.language = val;
  52865. } else if (name === "er") {
  52866. flags.easyReader = Number(val);
  52867. } else if (name === "war") {
  52868. flags.aspectRatio = Number(val);
  52869. } else if (name === "3D") {
  52870. flags["3D"] = Number(val);
  52871. }
  52872. });
  52873. } else {
  52874. flags.language = value;
  52875. }
  52876. if (flags.channel) {
  52877. flags.channel = "SERVICE" + flags.channel;
  52878. }
  52879. return flags;
  52880. });
  52881. }
  52882. };
  52883. const toEventStream = (period) => {
  52884. return flatten$1(findChildren$1(period.node, "EventStream").map((eventStream) => {
  52885. const eventStreamAttributes = parseAttributes$2(eventStream);
  52886. const schemeIdUri = eventStreamAttributes.schemeIdUri;
  52887. return findChildren$1(eventStream, "Event").map((event2) => {
  52888. const eventAttributes = parseAttributes$2(event2);
  52889. const presentationTime = eventAttributes.presentationTime || 0;
  52890. const timescale2 = eventStreamAttributes.timescale || 1;
  52891. const duration5 = eventAttributes.duration || 0;
  52892. const start2 = presentationTime / timescale2 + period.attributes.start;
  52893. return {
  52894. schemeIdUri,
  52895. value: eventStreamAttributes.value,
  52896. id: eventAttributes.id,
  52897. start: start2,
  52898. end: start2 + duration5 / timescale2,
  52899. messageData: getContent$1(event2) || eventAttributes.messageData,
  52900. contentEncoding: eventStreamAttributes.contentEncoding,
  52901. presentationTimeOffset: eventStreamAttributes.presentationTimeOffset || 0
  52902. };
  52903. });
  52904. }));
  52905. };
  52906. const toRepresentations$1 = (periodAttributes, periodBaseUrls, periodSegmentInfo) => (adaptationSet) => {
  52907. const adaptationSetAttributes = parseAttributes$2(adaptationSet);
  52908. const adaptationSetBaseUrls = buildBaseUrls$1(periodBaseUrls, findChildren$1(adaptationSet, "BaseURL"));
  52909. const role = findChildren$1(adaptationSet, "Role")[0];
  52910. const roleAttributes = {
  52911. role: parseAttributes$2(role)
  52912. };
  52913. let attrs = merge$3(periodAttributes, adaptationSetAttributes, roleAttributes);
  52914. const accessibility = findChildren$1(adaptationSet, "Accessibility")[0];
  52915. const captionServices = parseCaptionServiceMetadata$1(parseAttributes$2(accessibility));
  52916. if (captionServices) {
  52917. attrs = merge$3(attrs, {
  52918. captionServices
  52919. });
  52920. }
  52921. const label2 = findChildren$1(adaptationSet, "Label")[0];
  52922. if (label2 && label2.childNodes.length) {
  52923. const labelVal = label2.childNodes[0].nodeValue.trim();
  52924. attrs = merge$3(attrs, {
  52925. label: labelVal
  52926. });
  52927. }
  52928. const contentProtection = generateKeySystemInformation$1(findChildren$1(adaptationSet, "ContentProtection"));
  52929. if (Object.keys(contentProtection).length) {
  52930. attrs = merge$3(attrs, {
  52931. contentProtection
  52932. });
  52933. }
  52934. const segmentInfo = getSegmentInformation$1(adaptationSet);
  52935. const representations = findChildren$1(adaptationSet, "Representation");
  52936. const adaptationSetSegmentInfo = merge$3(periodSegmentInfo, segmentInfo);
  52937. return flatten$1(representations.map(inheritBaseUrls$1(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  52938. };
  52939. const toAdaptationSets$1 = (mpdAttributes, mpdBaseUrls) => (period, index2) => {
  52940. const periodBaseUrls = buildBaseUrls$1(mpdBaseUrls, findChildren$1(period.node, "BaseURL"));
  52941. const periodAttributes = merge$3(mpdAttributes, {
  52942. periodStart: period.attributes.start
  52943. });
  52944. if (typeof period.attributes.duration === "number") {
  52945. periodAttributes.periodDuration = period.attributes.duration;
  52946. }
  52947. const adaptationSets = findChildren$1(period.node, "AdaptationSet");
  52948. const periodSegmentInfo = getSegmentInformation$1(period.node);
  52949. return flatten$1(adaptationSets.map(toRepresentations$1(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  52950. };
  52951. const getPeriodStart$1 = ({
  52952. attributes,
  52953. priorPeriodAttributes,
  52954. mpdType
  52955. }) => {
  52956. if (typeof attributes.start === "number") {
  52957. return attributes.start;
  52958. }
  52959. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  52960. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  52961. }
  52962. if (!priorPeriodAttributes && mpdType === "static") {
  52963. return 0;
  52964. }
  52965. return null;
  52966. };
  52967. const inheritAttributes$1 = (mpd, options2 = {}) => {
  52968. const {
  52969. manifestUri = "",
  52970. NOW = Date.now(),
  52971. clientOffset = 0
  52972. } = options2;
  52973. const periodNodes = findChildren$1(mpd, "Period");
  52974. if (!periodNodes.length) {
  52975. throw new Error(errors$1.INVALID_NUMBER_OF_PERIOD);
  52976. }
  52977. const locations = findChildren$1(mpd, "Location");
  52978. const mpdAttributes = parseAttributes$2(mpd);
  52979. const mpdBaseUrls = buildBaseUrls$1([manifestUri], findChildren$1(mpd, "BaseURL"));
  52980. mpdAttributes.type = mpdAttributes.type || "static";
  52981. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  52982. mpdAttributes.NOW = NOW;
  52983. mpdAttributes.clientOffset = clientOffset;
  52984. if (locations.length) {
  52985. mpdAttributes.locations = locations.map(getContent$1);
  52986. }
  52987. const periods = [];
  52988. periodNodes.forEach((node, index2) => {
  52989. const attributes = parseAttributes$2(node);
  52990. const priorPeriod = periods[index2 - 1];
  52991. attributes.start = getPeriodStart$1({
  52992. attributes,
  52993. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  52994. mpdType: mpdAttributes.type
  52995. });
  52996. periods.push({
  52997. node,
  52998. attributes
  52999. });
  53000. });
  53001. return {
  53002. locations: mpdAttributes.locations,
  53003. representationInfo: flatten$1(periods.map(toAdaptationSets$1(mpdAttributes, mpdBaseUrls))),
  53004. eventStream: flatten$1(periods.map(toEventStream))
  53005. };
  53006. };
  53007. const stringToMpdXml$1 = (manifestString) => {
  53008. if (manifestString === "") {
  53009. throw new Error(errors$1.DASH_EMPTY_MANIFEST);
  53010. }
  53011. const parser2 = new DOMParser();
  53012. let xml;
  53013. let mpd;
  53014. try {
  53015. xml = parser2.parseFromString(manifestString, "application/xml");
  53016. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  53017. } catch (e) {
  53018. }
  53019. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  53020. throw new Error(errors$1.DASH_INVALID_XML);
  53021. }
  53022. return mpd;
  53023. };
  53024. const parseUTCTimingScheme$1 = (mpd) => {
  53025. const UTCTimingNode = findChildren$1(mpd, "UTCTiming")[0];
  53026. if (!UTCTimingNode) {
  53027. return null;
  53028. }
  53029. const attributes = parseAttributes$2(UTCTimingNode);
  53030. switch (attributes.schemeIdUri) {
  53031. case "urn:mpeg:dash:utc:http-head:2014":
  53032. case "urn:mpeg:dash:utc:http-head:2012":
  53033. attributes.method = "HEAD";
  53034. break;
  53035. case "urn:mpeg:dash:utc:http-xsdate:2014":
  53036. case "urn:mpeg:dash:utc:http-iso:2014":
  53037. case "urn:mpeg:dash:utc:http-xsdate:2012":
  53038. case "urn:mpeg:dash:utc:http-iso:2012":
  53039. attributes.method = "GET";
  53040. break;
  53041. case "urn:mpeg:dash:utc:direct:2014":
  53042. case "urn:mpeg:dash:utc:direct:2012":
  53043. attributes.method = "DIRECT";
  53044. attributes.value = Date.parse(attributes.value);
  53045. break;
  53046. case "urn:mpeg:dash:utc:http-ntp:2014":
  53047. case "urn:mpeg:dash:utc:ntp:2014":
  53048. case "urn:mpeg:dash:utc:sntp:2014":
  53049. default:
  53050. throw new Error(errors$1.UNSUPPORTED_UTC_TIMING_SCHEME);
  53051. }
  53052. return attributes;
  53053. };
  53054. const parse$1 = (manifestString, options2 = {}) => {
  53055. const parsedManifestInfo = inheritAttributes$1(stringToMpdXml$1(manifestString), options2);
  53056. const playlists = toPlaylists$1(parsedManifestInfo.representationInfo);
  53057. return toM3u8$1({
  53058. dashPlaylists: playlists,
  53059. locations: parsedManifestInfo.locations,
  53060. sidxMapping: options2.sidxMapping,
  53061. previousManifest: options2.previousManifest,
  53062. eventStream: parsedManifestInfo.eventStream
  53063. });
  53064. };
  53065. const parseUTCTiming$1 = (manifestString) => parseUTCTimingScheme$1(stringToMpdXml$1(manifestString));
  53066. var MAX_UINT32$1 = Math.pow(2, 32);
  53067. var getUint64$3 = function(uint8) {
  53068. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  53069. var value;
  53070. if (dv.getBigUint64) {
  53071. value = dv.getBigUint64(0);
  53072. if (value < Number.MAX_SAFE_INTEGER) {
  53073. return Number(value);
  53074. }
  53075. return value;
  53076. }
  53077. return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);
  53078. };
  53079. var numbers$1 = {
  53080. getUint64: getUint64$3,
  53081. MAX_UINT32: MAX_UINT32$1
  53082. };
  53083. var getUint64$2 = numbers$1.getUint64;
  53084. var parseSidx$1 = function(data) {
  53085. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  53086. version: data[0],
  53087. flags: new Uint8Array(data.subarray(1, 4)),
  53088. references: [],
  53089. referenceId: view.getUint32(4),
  53090. timescale: view.getUint32(8)
  53091. }, i2 = 12;
  53092. if (result.version === 0) {
  53093. result.earliestPresentationTime = view.getUint32(i2);
  53094. result.firstOffset = view.getUint32(i2 + 4);
  53095. i2 += 8;
  53096. } else {
  53097. result.earliestPresentationTime = getUint64$2(data.subarray(i2));
  53098. result.firstOffset = getUint64$2(data.subarray(i2 + 8));
  53099. i2 += 16;
  53100. }
  53101. i2 += 2;
  53102. var referenceCount = view.getUint16(i2);
  53103. i2 += 2;
  53104. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  53105. result.references.push({
  53106. referenceType: (data[i2] & 128) >>> 7,
  53107. referencedSize: view.getUint32(i2) & 2147483647,
  53108. subsegmentDuration: view.getUint32(i2 + 4),
  53109. startsWithSap: !!(data[i2 + 8] & 128),
  53110. sapType: (data[i2 + 8] & 112) >>> 4,
  53111. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  53112. });
  53113. }
  53114. return result;
  53115. };
  53116. var parseSidx_1$1 = parseSidx$1;
  53117. var ID3$1 = toUint8$1([73, 68, 51]);
  53118. var getId3Size$1 = function getId3Size(bytes, offset) {
  53119. if (offset === void 0) {
  53120. offset = 0;
  53121. }
  53122. bytes = toUint8$1(bytes);
  53123. var flags = bytes[offset + 5];
  53124. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  53125. var footerPresent = (flags & 16) >> 4;
  53126. if (footerPresent) {
  53127. return returnSize + 20;
  53128. }
  53129. return returnSize + 10;
  53130. };
  53131. var getId3Offset$1 = function getId3Offset(bytes, offset) {
  53132. if (offset === void 0) {
  53133. offset = 0;
  53134. }
  53135. bytes = toUint8$1(bytes);
  53136. if (bytes.length - offset < 10 || !bytesMatch$1(bytes, ID3$1, {
  53137. offset
  53138. })) {
  53139. return offset;
  53140. }
  53141. offset += getId3Size$1(bytes, offset);
  53142. return getId3Offset(bytes, offset);
  53143. };
  53144. var normalizePath$3 = function normalizePath(path) {
  53145. if (typeof path === "string") {
  53146. return stringToBytes$1(path);
  53147. }
  53148. if (typeof path === "number") {
  53149. return path;
  53150. }
  53151. return path;
  53152. };
  53153. var normalizePaths$3 = function normalizePaths(paths) {
  53154. if (!Array.isArray(paths)) {
  53155. return [normalizePath$3(paths)];
  53156. }
  53157. return paths.map(function(p) {
  53158. return normalizePath$3(p);
  53159. });
  53160. };
  53161. var findBox$1 = function findBox(bytes, paths, complete) {
  53162. if (complete === void 0) {
  53163. complete = false;
  53164. }
  53165. paths = normalizePaths$3(paths);
  53166. bytes = toUint8$1(bytes);
  53167. var results = [];
  53168. if (!paths.length) {
  53169. return results;
  53170. }
  53171. var i2 = 0;
  53172. while (i2 < bytes.length) {
  53173. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  53174. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  53175. if (size === 0) {
  53176. break;
  53177. }
  53178. var end = i2 + size;
  53179. if (end > bytes.length) {
  53180. if (complete) {
  53181. break;
  53182. }
  53183. end = bytes.length;
  53184. }
  53185. var data = bytes.subarray(i2 + 8, end);
  53186. if (bytesMatch$1(type2, paths[0])) {
  53187. if (paths.length === 1) {
  53188. results.push(data);
  53189. } else {
  53190. results.push.apply(results, findBox(data, paths.slice(1), complete));
  53191. }
  53192. }
  53193. i2 = end;
  53194. }
  53195. return results;
  53196. };
  53197. var EBML_TAGS$1 = {
  53198. EBML: toUint8$1([26, 69, 223, 163]),
  53199. DocType: toUint8$1([66, 130]),
  53200. Segment: toUint8$1([24, 83, 128, 103]),
  53201. SegmentInfo: toUint8$1([21, 73, 169, 102]),
  53202. Tracks: toUint8$1([22, 84, 174, 107]),
  53203. Track: toUint8$1([174]),
  53204. TrackNumber: toUint8$1([215]),
  53205. DefaultDuration: toUint8$1([35, 227, 131]),
  53206. TrackEntry: toUint8$1([174]),
  53207. TrackType: toUint8$1([131]),
  53208. FlagDefault: toUint8$1([136]),
  53209. CodecID: toUint8$1([134]),
  53210. CodecPrivate: toUint8$1([99, 162]),
  53211. VideoTrack: toUint8$1([224]),
  53212. AudioTrack: toUint8$1([225]),
  53213. Cluster: toUint8$1([31, 67, 182, 117]),
  53214. Timestamp: toUint8$1([231]),
  53215. TimestampScale: toUint8$1([42, 215, 177]),
  53216. BlockGroup: toUint8$1([160]),
  53217. BlockDuration: toUint8$1([155]),
  53218. Block: toUint8$1([161]),
  53219. SimpleBlock: toUint8$1([163])
  53220. };
  53221. var LENGTH_TABLE$1 = [128, 64, 32, 16, 8, 4, 2, 1];
  53222. var getLength$1 = function getLength(byte) {
  53223. var len = 1;
  53224. for (var i2 = 0; i2 < LENGTH_TABLE$1.length; i2++) {
  53225. if (byte & LENGTH_TABLE$1[i2]) {
  53226. break;
  53227. }
  53228. len++;
  53229. }
  53230. return len;
  53231. };
  53232. var getvint$1 = function getvint(bytes, offset, removeLength, signed) {
  53233. if (removeLength === void 0) {
  53234. removeLength = true;
  53235. }
  53236. if (signed === void 0) {
  53237. signed = false;
  53238. }
  53239. var length = getLength$1(bytes[offset]);
  53240. var valueBytes = bytes.subarray(offset, offset + length);
  53241. if (removeLength) {
  53242. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  53243. valueBytes[0] ^= LENGTH_TABLE$1[length - 1];
  53244. }
  53245. return {
  53246. length,
  53247. value: bytesToNumber$1(valueBytes, {
  53248. signed
  53249. }),
  53250. bytes: valueBytes
  53251. };
  53252. };
  53253. var normalizePath$2 = function normalizePath2(path) {
  53254. if (typeof path === "string") {
  53255. return path.match(/.{1,2}/g).map(function(p) {
  53256. return normalizePath2(p);
  53257. });
  53258. }
  53259. if (typeof path === "number") {
  53260. return numberToBytes$1(path);
  53261. }
  53262. return path;
  53263. };
  53264. var normalizePaths$2 = function normalizePaths2(paths) {
  53265. if (!Array.isArray(paths)) {
  53266. return [normalizePath$2(paths)];
  53267. }
  53268. return paths.map(function(p) {
  53269. return normalizePath$2(p);
  53270. });
  53271. };
  53272. var getInfinityDataSize$1 = function getInfinityDataSize(id, bytes, offset) {
  53273. if (offset >= bytes.length) {
  53274. return bytes.length;
  53275. }
  53276. var innerid = getvint$1(bytes, offset, false);
  53277. if (bytesMatch$1(id.bytes, innerid.bytes)) {
  53278. return offset;
  53279. }
  53280. var dataHeader = getvint$1(bytes, offset + innerid.length);
  53281. return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  53282. };
  53283. var findEbml$1 = function findEbml(bytes, paths) {
  53284. paths = normalizePaths$2(paths);
  53285. bytes = toUint8$1(bytes);
  53286. var results = [];
  53287. if (!paths.length) {
  53288. return results;
  53289. }
  53290. var i2 = 0;
  53291. while (i2 < bytes.length) {
  53292. var id = getvint$1(bytes, i2, false);
  53293. var dataHeader = getvint$1(bytes, i2 + id.length);
  53294. var dataStart = i2 + id.length + dataHeader.length;
  53295. if (dataHeader.value === 127) {
  53296. dataHeader.value = getInfinityDataSize$1(id, bytes, dataStart);
  53297. if (dataHeader.value !== bytes.length) {
  53298. dataHeader.value -= dataStart;
  53299. }
  53300. }
  53301. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  53302. var data = bytes.subarray(dataStart, dataEnd);
  53303. if (bytesMatch$1(paths[0], id.bytes)) {
  53304. if (paths.length === 1) {
  53305. results.push(data);
  53306. } else {
  53307. results = results.concat(findEbml(data, paths.slice(1)));
  53308. }
  53309. }
  53310. var totalLength = id.length + dataHeader.length + data.length;
  53311. i2 += totalLength;
  53312. }
  53313. return results;
  53314. };
  53315. var NAL_TYPE_ONE$1 = toUint8$1([0, 0, 0, 1]);
  53316. var NAL_TYPE_TWO$1 = toUint8$1([0, 0, 1]);
  53317. var EMULATION_PREVENTION$1 = toUint8$1([0, 0, 3]);
  53318. var discardEmulationPreventionBytes$1 = function discardEmulationPreventionBytes(bytes) {
  53319. var positions = [];
  53320. var i2 = 1;
  53321. while (i2 < bytes.length - 2) {
  53322. if (bytesMatch$1(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION$1)) {
  53323. positions.push(i2 + 2);
  53324. i2++;
  53325. }
  53326. i2++;
  53327. }
  53328. if (positions.length === 0) {
  53329. return bytes;
  53330. }
  53331. var newLength = bytes.length - positions.length;
  53332. var newData = new Uint8Array(newLength);
  53333. var sourceIndex = 0;
  53334. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  53335. if (sourceIndex === positions[0]) {
  53336. sourceIndex++;
  53337. positions.shift();
  53338. }
  53339. newData[i2] = bytes[sourceIndex];
  53340. }
  53341. return newData;
  53342. };
  53343. var findNal$1 = function findNal(bytes, dataType, types, nalLimit) {
  53344. if (nalLimit === void 0) {
  53345. nalLimit = Infinity;
  53346. }
  53347. bytes = toUint8$1(bytes);
  53348. types = [].concat(types);
  53349. var i2 = 0;
  53350. var nalStart;
  53351. var nalsFound = 0;
  53352. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  53353. var nalOffset = void 0;
  53354. if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_ONE$1)) {
  53355. nalOffset = 4;
  53356. } else if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_TWO$1)) {
  53357. nalOffset = 3;
  53358. }
  53359. if (!nalOffset) {
  53360. i2++;
  53361. continue;
  53362. }
  53363. nalsFound++;
  53364. if (nalStart) {
  53365. return discardEmulationPreventionBytes$1(bytes.subarray(nalStart, i2));
  53366. }
  53367. var nalType = void 0;
  53368. if (dataType === "h264") {
  53369. nalType = bytes[i2 + nalOffset] & 31;
  53370. } else if (dataType === "h265") {
  53371. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  53372. }
  53373. if (types.indexOf(nalType) !== -1) {
  53374. nalStart = i2 + nalOffset;
  53375. }
  53376. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  53377. }
  53378. return bytes.subarray(0, 0);
  53379. };
  53380. var findH264Nal$1 = function findH264Nal(bytes, type2, nalLimit) {
  53381. return findNal$1(bytes, "h264", type2, nalLimit);
  53382. };
  53383. var findH265Nal$1 = function findH265Nal(bytes, type2, nalLimit) {
  53384. return findNal$1(bytes, "h265", type2, nalLimit);
  53385. };
  53386. var CONSTANTS$1 = {
  53387. "webm": toUint8$1([119, 101, 98, 109]),
  53388. "matroska": toUint8$1([109, 97, 116, 114, 111, 115, 107, 97]),
  53389. "flac": toUint8$1([102, 76, 97, 67]),
  53390. "ogg": toUint8$1([79, 103, 103, 83]),
  53391. "ac3": toUint8$1([11, 119]),
  53392. "riff": toUint8$1([82, 73, 70, 70]),
  53393. "avi": toUint8$1([65, 86, 73]),
  53394. "wav": toUint8$1([87, 65, 86, 69]),
  53395. "3gp": toUint8$1([102, 116, 121, 112, 51, 103]),
  53396. "mp4": toUint8$1([102, 116, 121, 112]),
  53397. "fmp4": toUint8$1([115, 116, 121, 112]),
  53398. "mov": toUint8$1([102, 116, 121, 112, 113, 116]),
  53399. "moov": toUint8$1([109, 111, 111, 118]),
  53400. "moof": toUint8$1([109, 111, 111, 102])
  53401. };
  53402. var _isLikely$1 = {
  53403. aac: function aac(bytes) {
  53404. var offset = getId3Offset$1(bytes);
  53405. return bytesMatch$1(bytes, [255, 16], {
  53406. offset,
  53407. mask: [255, 22]
  53408. });
  53409. },
  53410. mp3: function mp3(bytes) {
  53411. var offset = getId3Offset$1(bytes);
  53412. return bytesMatch$1(bytes, [255, 2], {
  53413. offset,
  53414. mask: [255, 6]
  53415. });
  53416. },
  53417. webm: function webm(bytes) {
  53418. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53419. return bytesMatch$1(docType, CONSTANTS$1.webm);
  53420. },
  53421. mkv: function mkv(bytes) {
  53422. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53423. return bytesMatch$1(docType, CONSTANTS$1.matroska);
  53424. },
  53425. mp4: function mp4(bytes) {
  53426. if (_isLikely$1["3gp"](bytes) || _isLikely$1.mov(bytes)) {
  53427. return false;
  53428. }
  53429. if (bytesMatch$1(bytes, CONSTANTS$1.mp4, {
  53430. offset: 4
  53431. }) || bytesMatch$1(bytes, CONSTANTS$1.fmp4, {
  53432. offset: 4
  53433. })) {
  53434. return true;
  53435. }
  53436. if (bytesMatch$1(bytes, CONSTANTS$1.moof, {
  53437. offset: 4
  53438. }) || bytesMatch$1(bytes, CONSTANTS$1.moov, {
  53439. offset: 4
  53440. })) {
  53441. return true;
  53442. }
  53443. },
  53444. mov: function mov(bytes) {
  53445. return bytesMatch$1(bytes, CONSTANTS$1.mov, {
  53446. offset: 4
  53447. });
  53448. },
  53449. "3gp": function gp(bytes) {
  53450. return bytesMatch$1(bytes, CONSTANTS$1["3gp"], {
  53451. offset: 4
  53452. });
  53453. },
  53454. ac3: function ac3(bytes) {
  53455. var offset = getId3Offset$1(bytes);
  53456. return bytesMatch$1(bytes, CONSTANTS$1.ac3, {
  53457. offset
  53458. });
  53459. },
  53460. ts: function ts(bytes) {
  53461. if (bytes.length < 189 && bytes.length >= 1) {
  53462. return bytes[0] === 71;
  53463. }
  53464. var i2 = 0;
  53465. while (i2 + 188 < bytes.length && i2 < 188) {
  53466. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  53467. return true;
  53468. }
  53469. i2 += 1;
  53470. }
  53471. return false;
  53472. },
  53473. flac: function flac(bytes) {
  53474. var offset = getId3Offset$1(bytes);
  53475. return bytesMatch$1(bytes, CONSTANTS$1.flac, {
  53476. offset
  53477. });
  53478. },
  53479. ogg: function ogg(bytes) {
  53480. return bytesMatch$1(bytes, CONSTANTS$1.ogg);
  53481. },
  53482. avi: function avi(bytes) {
  53483. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.avi, {
  53484. offset: 8
  53485. });
  53486. },
  53487. wav: function wav(bytes) {
  53488. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.wav, {
  53489. offset: 8
  53490. });
  53491. },
  53492. "h264": function h264(bytes) {
  53493. return findH264Nal$1(bytes, 7, 3).length;
  53494. },
  53495. "h265": function h265(bytes) {
  53496. return findH265Nal$1(bytes, [32, 33], 3).length;
  53497. }
  53498. };
  53499. var isLikelyTypes$1 = Object.keys(_isLikely$1).filter(function(t2) {
  53500. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  53501. }).concat(["ts", "h264", "h265"]);
  53502. isLikelyTypes$1.forEach(function(type2) {
  53503. var isLikelyFn = _isLikely$1[type2];
  53504. _isLikely$1[type2] = function(bytes) {
  53505. return isLikelyFn(toUint8$1(bytes));
  53506. };
  53507. });
  53508. var isLikely$1 = _isLikely$1;
  53509. var detectContainerForBytes$1 = function detectContainerForBytes(bytes) {
  53510. bytes = toUint8$1(bytes);
  53511. for (var i2 = 0; i2 < isLikelyTypes$1.length; i2++) {
  53512. var type2 = isLikelyTypes$1[i2];
  53513. if (isLikely$1[type2](bytes)) {
  53514. return type2;
  53515. }
  53516. }
  53517. return "";
  53518. };
  53519. var isLikelyFmp4MediaSegment$1 = function isLikelyFmp4MediaSegment(bytes) {
  53520. return findBox$1(bytes, ["moof"]).length > 0;
  53521. };
  53522. var ONE_SECOND_IN_TS$1 = 9e4, secondsToVideoTs$1, secondsToAudioTs$1, videoTsToSeconds$1, audioTsToSeconds$1, audioTsToVideoTs$1, videoTsToAudioTs$1, metadataTsToSeconds$1;
  53523. secondsToVideoTs$1 = function(seconds) {
  53524. return seconds * ONE_SECOND_IN_TS$1;
  53525. };
  53526. secondsToAudioTs$1 = function(seconds, sampleRate) {
  53527. return seconds * sampleRate;
  53528. };
  53529. videoTsToSeconds$1 = function(timestamp) {
  53530. return timestamp / ONE_SECOND_IN_TS$1;
  53531. };
  53532. audioTsToSeconds$1 = function(timestamp, sampleRate) {
  53533. return timestamp / sampleRate;
  53534. };
  53535. audioTsToVideoTs$1 = function(timestamp, sampleRate) {
  53536. return secondsToVideoTs$1(audioTsToSeconds$1(timestamp, sampleRate));
  53537. };
  53538. videoTsToAudioTs$1 = function(timestamp, sampleRate) {
  53539. return secondsToAudioTs$1(videoTsToSeconds$1(timestamp), sampleRate);
  53540. };
  53541. metadataTsToSeconds$1 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  53542. return videoTsToSeconds$1(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  53543. };
  53544. var clock$1 = {
  53545. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$1,
  53546. secondsToVideoTs: secondsToVideoTs$1,
  53547. secondsToAudioTs: secondsToAudioTs$1,
  53548. videoTsToSeconds: videoTsToSeconds$1,
  53549. audioTsToSeconds: audioTsToSeconds$1,
  53550. audioTsToVideoTs: audioTsToVideoTs$1,
  53551. videoTsToAudioTs: videoTsToAudioTs$1,
  53552. metadataTsToSeconds: metadataTsToSeconds$1
  53553. };
  53554. /**
  53555. * @license
  53556. * Video.js 8.3.0 <http://videojs.com/>
  53557. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  53558. * Available under Apache License Version 2.0
  53559. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  53560. *
  53561. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  53562. * Available under Apache License Version 2.0
  53563. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  53564. */
  53565. var version$6$1 = "8.3.0";
  53566. const hooks_$1 = {};
  53567. const hooks$1 = function(type2, fn2) {
  53568. hooks_$1[type2] = hooks_$1[type2] || [];
  53569. if (fn2) {
  53570. hooks_$1[type2] = hooks_$1[type2].concat(fn2);
  53571. }
  53572. return hooks_$1[type2];
  53573. };
  53574. const hook$1 = function(type2, fn2) {
  53575. hooks$1(type2, fn2);
  53576. };
  53577. const removeHook$1 = function(type2, fn2) {
  53578. const index2 = hooks$1(type2).indexOf(fn2);
  53579. if (index2 <= -1) {
  53580. return false;
  53581. }
  53582. hooks_$1[type2] = hooks_$1[type2].slice();
  53583. hooks_$1[type2].splice(index2, 1);
  53584. return true;
  53585. };
  53586. const hookOnce$1 = function(type2, fn2) {
  53587. hooks$1(type2, [].concat(fn2).map((original) => {
  53588. const wrapper = (...args) => {
  53589. removeHook$1(type2, wrapper);
  53590. return original(...args);
  53591. };
  53592. return wrapper;
  53593. }));
  53594. };
  53595. const FullscreenApi$1 = {
  53596. prefixed: true
  53597. };
  53598. const apiMap$1 = [
  53599. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  53600. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  53601. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  53602. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  53603. ];
  53604. const specApi$1 = apiMap$1[0];
  53605. let browserApi$1;
  53606. for (let i2 = 0; i2 < apiMap$1.length; i2++) {
  53607. if (apiMap$1[i2][1] in document_1) {
  53608. browserApi$1 = apiMap$1[i2];
  53609. break;
  53610. }
  53611. }
  53612. if (browserApi$1) {
  53613. for (let i2 = 0; i2 < browserApi$1.length; i2++) {
  53614. FullscreenApi$1[specApi$1[i2]] = browserApi$1[i2];
  53615. }
  53616. FullscreenApi$1.prefixed = browserApi$1[0] !== specApi$1[0];
  53617. }
  53618. let history$1 = [];
  53619. const LogByTypeFactory$1 = (name, log2) => (type2, level, args) => {
  53620. const lvl = log2.levels[level];
  53621. const lvlRegExp = new RegExp(`^(${lvl})$`);
  53622. if (type2 !== "log") {
  53623. args.unshift(type2.toUpperCase() + ":");
  53624. }
  53625. args.unshift(name + ":");
  53626. if (history$1) {
  53627. history$1.push([].concat(args));
  53628. const splice2 = history$1.length - 1e3;
  53629. history$1.splice(0, splice2 > 0 ? splice2 : 0);
  53630. }
  53631. if (!window_1.console) {
  53632. return;
  53633. }
  53634. let fn2 = window_1.console[type2];
  53635. if (!fn2 && type2 === "debug") {
  53636. fn2 = window_1.console.info || window_1.console.log;
  53637. }
  53638. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  53639. return;
  53640. }
  53641. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  53642. };
  53643. function createLogger$1$1(name) {
  53644. let level = "info";
  53645. let logByType;
  53646. const log2 = function(...args) {
  53647. logByType("log", level, args);
  53648. };
  53649. logByType = LogByTypeFactory$1(name, log2);
  53650. log2.createLogger = (subname) => createLogger$1$1(name + ": " + subname);
  53651. log2.levels = {
  53652. all: "debug|log|warn|error",
  53653. off: "",
  53654. debug: "debug|log|warn|error",
  53655. info: "log|warn|error",
  53656. warn: "warn|error",
  53657. error: "error",
  53658. DEFAULT: level
  53659. };
  53660. log2.level = (lvl) => {
  53661. if (typeof lvl === "string") {
  53662. if (!log2.levels.hasOwnProperty(lvl)) {
  53663. throw new Error(`"${lvl}" in not a valid log level`);
  53664. }
  53665. level = lvl;
  53666. }
  53667. return level;
  53668. };
  53669. log2.history = () => history$1 ? [].concat(history$1) : [];
  53670. log2.history.filter = (fname) => {
  53671. return (history$1 || []).filter((historyItem) => {
  53672. return new RegExp(`.*${fname}.*`).test(historyItem[0]);
  53673. });
  53674. };
  53675. log2.history.clear = () => {
  53676. if (history$1) {
  53677. history$1.length = 0;
  53678. }
  53679. };
  53680. log2.history.disable = () => {
  53681. if (history$1 !== null) {
  53682. history$1.length = 0;
  53683. history$1 = null;
  53684. }
  53685. };
  53686. log2.history.enable = () => {
  53687. if (history$1 === null) {
  53688. history$1 = [];
  53689. }
  53690. };
  53691. log2.error = (...args) => logByType("error", level, args);
  53692. log2.warn = (...args) => logByType("warn", level, args);
  53693. log2.debug = (...args) => logByType("debug", level, args);
  53694. return log2;
  53695. }
  53696. const log$1$1 = createLogger$1$1("VIDEOJS");
  53697. const createLogger$2 = log$1$1.createLogger;
  53698. const toString$1 = Object.prototype.toString;
  53699. const keys$1 = function(object) {
  53700. return isObject$2(object) ? Object.keys(object) : [];
  53701. };
  53702. function each$1(object, fn2) {
  53703. keys$1(object).forEach((key) => fn2(object[key], key));
  53704. }
  53705. function reduce$1(object, fn2, initial = 0) {
  53706. return keys$1(object).reduce((accum, key) => fn2(accum, object[key], key), initial);
  53707. }
  53708. function isObject$2(value) {
  53709. return !!value && typeof value === "object";
  53710. }
  53711. function isPlain$1(value) {
  53712. return isObject$2(value) && toString$1.call(value) === "[object Object]" && value.constructor === Object;
  53713. }
  53714. function merge$1(...sources) {
  53715. const result = {};
  53716. sources.forEach((source) => {
  53717. if (!source) {
  53718. return;
  53719. }
  53720. each$1(source, (value, key) => {
  53721. if (!isPlain$1(value)) {
  53722. result[key] = value;
  53723. return;
  53724. }
  53725. if (!isPlain$1(result[key])) {
  53726. result[key] = {};
  53727. }
  53728. result[key] = merge$1(result[key], value);
  53729. });
  53730. });
  53731. return result;
  53732. }
  53733. function defineLazyProperty$1(obj, key, getValue2, setter = true) {
  53734. const set4 = (value) => Object.defineProperty(obj, key, {
  53735. value,
  53736. enumerable: true,
  53737. writable: true
  53738. });
  53739. const options2 = {
  53740. configurable: true,
  53741. enumerable: true,
  53742. get() {
  53743. const value = getValue2();
  53744. set4(value);
  53745. return value;
  53746. }
  53747. };
  53748. if (setter) {
  53749. options2.set = set4;
  53750. }
  53751. return Object.defineProperty(obj, key, options2);
  53752. }
  53753. var Obj = /* @__PURE__ */ Object.freeze({
  53754. __proto__: null,
  53755. each: each$1,
  53756. reduce: reduce$1,
  53757. isObject: isObject$2,
  53758. isPlain: isPlain$1,
  53759. merge: merge$1,
  53760. defineLazyProperty: defineLazyProperty$1
  53761. });
  53762. let IS_IPOD$1 = false;
  53763. let IOS_VERSION$1 = null;
  53764. let IS_ANDROID$1 = false;
  53765. let ANDROID_VERSION$1;
  53766. let IS_FIREFOX$1 = false;
  53767. let IS_EDGE$1 = false;
  53768. let IS_CHROMIUM = false;
  53769. let IS_CHROME$1 = false;
  53770. let CHROMIUM_VERSION = null;
  53771. let CHROME_VERSION$1 = null;
  53772. let IE_VERSION$1 = null;
  53773. let IS_SAFARI$1 = false;
  53774. let IS_WINDOWS$1 = false;
  53775. let IS_IPAD$1 = false;
  53776. let IS_IPHONE$1 = false;
  53777. const TOUCH_ENABLED$1 = Boolean(isReal$1() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  53778. const UAD = window_1.navigator && window_1.navigator.userAgentData;
  53779. if (UAD) {
  53780. IS_ANDROID$1 = UAD.platform === "Android";
  53781. IS_EDGE$1 = Boolean(UAD.brands.find((b) => b.brand === "Microsoft Edge"));
  53782. IS_CHROMIUM = Boolean(UAD.brands.find((b) => b.brand === "Chromium"));
  53783. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53784. CHROMIUM_VERSION = CHROME_VERSION$1 = (UAD.brands.find((b) => b.brand === "Chromium") || {}).version || null;
  53785. IS_WINDOWS$1 = UAD.platform === "Windows";
  53786. }
  53787. if (!IS_CHROMIUM) {
  53788. const USER_AGENT2 = window_1.navigator && window_1.navigator.userAgent || "";
  53789. IS_IPOD$1 = /iPod/i.test(USER_AGENT2);
  53790. IOS_VERSION$1 = function() {
  53791. const match = USER_AGENT2.match(/OS (\d+)_/i);
  53792. if (match && match[1]) {
  53793. return match[1];
  53794. }
  53795. return null;
  53796. }();
  53797. IS_ANDROID$1 = /Android/i.test(USER_AGENT2);
  53798. ANDROID_VERSION$1 = function() {
  53799. const match = USER_AGENT2.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  53800. if (!match) {
  53801. return null;
  53802. }
  53803. const major = match[1] && parseFloat(match[1]);
  53804. const minor = match[2] && parseFloat(match[2]);
  53805. if (major && minor) {
  53806. return parseFloat(match[1] + "." + match[2]);
  53807. } else if (major) {
  53808. return major;
  53809. }
  53810. return null;
  53811. }();
  53812. IS_FIREFOX$1 = /Firefox/i.test(USER_AGENT2);
  53813. IS_EDGE$1 = /Edg/i.test(USER_AGENT2);
  53814. IS_CHROMIUM = /Chrome/i.test(USER_AGENT2) || /CriOS/i.test(USER_AGENT2);
  53815. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53816. CHROMIUM_VERSION = CHROME_VERSION$1 = function() {
  53817. const match = USER_AGENT2.match(/(Chrome|CriOS)\/(\d+)/);
  53818. if (match && match[2]) {
  53819. return parseFloat(match[2]);
  53820. }
  53821. return null;
  53822. }();
  53823. IE_VERSION$1 = function() {
  53824. const result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT2);
  53825. let version2 = result && parseFloat(result[1]);
  53826. if (!version2 && /Trident\/7.0/i.test(USER_AGENT2) && /rv:11.0/.test(USER_AGENT2)) {
  53827. version2 = 11;
  53828. }
  53829. return version2;
  53830. }();
  53831. IS_SAFARI$1 = /Safari/i.test(USER_AGENT2) && !IS_CHROME$1 && !IS_ANDROID$1 && !IS_EDGE$1;
  53832. IS_WINDOWS$1 = /Windows/i.test(USER_AGENT2);
  53833. IS_IPAD$1 = /iPad/i.test(USER_AGENT2) || IS_SAFARI$1 && TOUCH_ENABLED$1 && !/iPhone/i.test(USER_AGENT2);
  53834. IS_IPHONE$1 = /iPhone/i.test(USER_AGENT2) && !IS_IPAD$1;
  53835. }
  53836. const IS_IOS$1 = IS_IPHONE$1 || IS_IPAD$1 || IS_IPOD$1;
  53837. const IS_ANY_SAFARI$1 = (IS_SAFARI$1 || IS_IOS$1) && !IS_CHROME$1;
  53838. var browser$1 = /* @__PURE__ */ Object.freeze({
  53839. __proto__: null,
  53840. get IS_IPOD() {
  53841. return IS_IPOD$1;
  53842. },
  53843. get IOS_VERSION() {
  53844. return IOS_VERSION$1;
  53845. },
  53846. get IS_ANDROID() {
  53847. return IS_ANDROID$1;
  53848. },
  53849. get ANDROID_VERSION() {
  53850. return ANDROID_VERSION$1;
  53851. },
  53852. get IS_FIREFOX() {
  53853. return IS_FIREFOX$1;
  53854. },
  53855. get IS_EDGE() {
  53856. return IS_EDGE$1;
  53857. },
  53858. get IS_CHROMIUM() {
  53859. return IS_CHROMIUM;
  53860. },
  53861. get IS_CHROME() {
  53862. return IS_CHROME$1;
  53863. },
  53864. get CHROMIUM_VERSION() {
  53865. return CHROMIUM_VERSION;
  53866. },
  53867. get CHROME_VERSION() {
  53868. return CHROME_VERSION$1;
  53869. },
  53870. get IE_VERSION() {
  53871. return IE_VERSION$1;
  53872. },
  53873. get IS_SAFARI() {
  53874. return IS_SAFARI$1;
  53875. },
  53876. get IS_WINDOWS() {
  53877. return IS_WINDOWS$1;
  53878. },
  53879. get IS_IPAD() {
  53880. return IS_IPAD$1;
  53881. },
  53882. get IS_IPHONE() {
  53883. return IS_IPHONE$1;
  53884. },
  53885. TOUCH_ENABLED: TOUCH_ENABLED$1,
  53886. IS_IOS: IS_IOS$1,
  53887. IS_ANY_SAFARI: IS_ANY_SAFARI$1
  53888. });
  53889. function isNonBlankString$1(str) {
  53890. return typeof str === "string" && Boolean(str.trim());
  53891. }
  53892. function throwIfWhitespace$1(str) {
  53893. if (str.indexOf(" ") >= 0) {
  53894. throw new Error("class has illegal whitespace characters");
  53895. }
  53896. }
  53897. function isReal$1() {
  53898. return document_1 === window_1.document;
  53899. }
  53900. function isEl$1(value) {
  53901. return isObject$2(value) && value.nodeType === 1;
  53902. }
  53903. function isInFrame$1() {
  53904. try {
  53905. return window_1.parent !== window_1.self;
  53906. } catch (x) {
  53907. return true;
  53908. }
  53909. }
  53910. function createQuerier$1(method) {
  53911. return function(selector, context) {
  53912. if (!isNonBlankString$1(selector)) {
  53913. return document_1[method](null);
  53914. }
  53915. if (isNonBlankString$1(context)) {
  53916. context = document_1.querySelector(context);
  53917. }
  53918. const ctx = isEl$1(context) ? context : document_1;
  53919. return ctx[method] && ctx[method](selector);
  53920. };
  53921. }
  53922. function createEl$1(tagName = "div", properties = {}, attributes = {}, content) {
  53923. const el = document_1.createElement(tagName);
  53924. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  53925. const val = properties[propName];
  53926. if (propName === "textContent") {
  53927. textContent$1(el, val);
  53928. } else if (el[propName] !== val || propName === "tabIndex") {
  53929. el[propName] = val;
  53930. }
  53931. });
  53932. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53933. el.setAttribute(attrName, attributes[attrName]);
  53934. });
  53935. if (content) {
  53936. appendContent$1(el, content);
  53937. }
  53938. return el;
  53939. }
  53940. function textContent$1(el, text) {
  53941. if (typeof el.textContent === "undefined") {
  53942. el.innerText = text;
  53943. } else {
  53944. el.textContent = text;
  53945. }
  53946. return el;
  53947. }
  53948. function prependTo$1(child, parent) {
  53949. if (parent.firstChild) {
  53950. parent.insertBefore(child, parent.firstChild);
  53951. } else {
  53952. parent.appendChild(child);
  53953. }
  53954. }
  53955. function hasClass$1(element, classToCheck) {
  53956. throwIfWhitespace$1(classToCheck);
  53957. return element.classList.contains(classToCheck);
  53958. }
  53959. function addClass$1(element, ...classesToAdd) {
  53960. element.classList.add(...classesToAdd.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53961. return element;
  53962. }
  53963. function removeClass$1(element, ...classesToRemove) {
  53964. if (!element) {
  53965. log$1$1.warn("removeClass was called with an element that doesn't exist");
  53966. return null;
  53967. }
  53968. element.classList.remove(...classesToRemove.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53969. return element;
  53970. }
  53971. function toggleClass$1(element, classToToggle, predicate) {
  53972. if (typeof predicate === "function") {
  53973. predicate = predicate(element, classToToggle);
  53974. }
  53975. if (typeof predicate !== "boolean") {
  53976. predicate = void 0;
  53977. }
  53978. classToToggle.split(/\s+/).forEach((className) => element.classList.toggle(className, predicate));
  53979. return element;
  53980. }
  53981. function setAttributes$1(el, attributes) {
  53982. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53983. const attrValue = attributes[attrName];
  53984. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  53985. el.removeAttribute(attrName);
  53986. } else {
  53987. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  53988. }
  53989. });
  53990. }
  53991. function getAttributes$1(tag) {
  53992. const obj = {};
  53993. const knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  53994. if (tag && tag.attributes && tag.attributes.length > 0) {
  53995. const attrs = tag.attributes;
  53996. for (let i2 = attrs.length - 1; i2 >= 0; i2--) {
  53997. const attrName = attrs[i2].name;
  53998. let attrVal = attrs[i2].value;
  53999. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  54000. attrVal = attrVal !== null ? true : false;
  54001. }
  54002. obj[attrName] = attrVal;
  54003. }
  54004. }
  54005. return obj;
  54006. }
  54007. function getAttribute$1(el, attribute) {
  54008. return el.getAttribute(attribute);
  54009. }
  54010. function setAttribute$1(el, attribute, value) {
  54011. el.setAttribute(attribute, value);
  54012. }
  54013. function removeAttribute$1(el, attribute) {
  54014. el.removeAttribute(attribute);
  54015. }
  54016. function blockTextSelection$1() {
  54017. document_1.body.focus();
  54018. document_1.onselectstart = function() {
  54019. return false;
  54020. };
  54021. }
  54022. function unblockTextSelection$1() {
  54023. document_1.onselectstart = function() {
  54024. return true;
  54025. };
  54026. }
  54027. function getBoundingClientRect$1(el) {
  54028. if (el && el.getBoundingClientRect && el.parentNode) {
  54029. const rect = el.getBoundingClientRect();
  54030. const result = {};
  54031. ["bottom", "height", "left", "right", "top", "width"].forEach((k) => {
  54032. if (rect[k] !== void 0) {
  54033. result[k] = rect[k];
  54034. }
  54035. });
  54036. if (!result.height) {
  54037. result.height = parseFloat(computedStyle$1(el, "height"));
  54038. }
  54039. if (!result.width) {
  54040. result.width = parseFloat(computedStyle$1(el, "width"));
  54041. }
  54042. return result;
  54043. }
  54044. }
  54045. function findPosition$1(el) {
  54046. if (!el || el && !el.offsetParent) {
  54047. return {
  54048. left: 0,
  54049. top: 0,
  54050. width: 0,
  54051. height: 0
  54052. };
  54053. }
  54054. const width2 = el.offsetWidth;
  54055. const height2 = el.offsetHeight;
  54056. let left = 0;
  54057. let top = 0;
  54058. while (el.offsetParent && el !== document_1[FullscreenApi$1.fullscreenElement]) {
  54059. left += el.offsetLeft;
  54060. top += el.offsetTop;
  54061. el = el.offsetParent;
  54062. }
  54063. return {
  54064. left,
  54065. top,
  54066. width: width2,
  54067. height: height2
  54068. };
  54069. }
  54070. function getPointerPosition$1(el, event2) {
  54071. const translated = {
  54072. x: 0,
  54073. y: 0
  54074. };
  54075. if (IS_IOS$1) {
  54076. let item = el;
  54077. while (item && item.nodeName.toLowerCase() !== "html") {
  54078. const transform3 = computedStyle$1(item, "transform");
  54079. if (/^matrix/.test(transform3)) {
  54080. const values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  54081. translated.x += values3[4];
  54082. translated.y += values3[5];
  54083. } else if (/^matrix3d/.test(transform3)) {
  54084. const values3 = transform3.slice(9, -1).split(/,\s/).map(Number);
  54085. translated.x += values3[12];
  54086. translated.y += values3[13];
  54087. }
  54088. item = item.parentNode;
  54089. }
  54090. }
  54091. const position2 = {};
  54092. const boxTarget = findPosition$1(event2.target);
  54093. const box = findPosition$1(el);
  54094. const boxW = box.width;
  54095. const boxH = box.height;
  54096. let offsetY = event2.offsetY - (box.top - boxTarget.top);
  54097. let offsetX = event2.offsetX - (box.left - boxTarget.left);
  54098. if (event2.changedTouches) {
  54099. offsetX = event2.changedTouches[0].pageX - box.left;
  54100. offsetY = event2.changedTouches[0].pageY + box.top;
  54101. if (IS_IOS$1) {
  54102. offsetX -= translated.x;
  54103. offsetY -= translated.y;
  54104. }
  54105. }
  54106. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  54107. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  54108. return position2;
  54109. }
  54110. function isTextNode$1(value) {
  54111. return isObject$2(value) && value.nodeType === 3;
  54112. }
  54113. function emptyEl$1(el) {
  54114. while (el.firstChild) {
  54115. el.removeChild(el.firstChild);
  54116. }
  54117. return el;
  54118. }
  54119. function normalizeContent$1(content) {
  54120. if (typeof content === "function") {
  54121. content = content();
  54122. }
  54123. return (Array.isArray(content) ? content : [content]).map((value) => {
  54124. if (typeof value === "function") {
  54125. value = value();
  54126. }
  54127. if (isEl$1(value) || isTextNode$1(value)) {
  54128. return value;
  54129. }
  54130. if (typeof value === "string" && /\S/.test(value)) {
  54131. return document_1.createTextNode(value);
  54132. }
  54133. }).filter((value) => value);
  54134. }
  54135. function appendContent$1(el, content) {
  54136. normalizeContent$1(content).forEach((node) => el.appendChild(node));
  54137. return el;
  54138. }
  54139. function insertContent$1(el, content) {
  54140. return appendContent$1(emptyEl$1(el), content);
  54141. }
  54142. function isSingleLeftClick$1(event2) {
  54143. if (event2.button === void 0 && event2.buttons === void 0) {
  54144. return true;
  54145. }
  54146. if (event2.button === 0 && event2.buttons === void 0) {
  54147. return true;
  54148. }
  54149. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  54150. return true;
  54151. }
  54152. if (event2.button !== 0 || event2.buttons !== 1) {
  54153. return false;
  54154. }
  54155. return true;
  54156. }
  54157. const $$1 = createQuerier$1("querySelector");
  54158. const $$$1 = createQuerier$1("querySelectorAll");
  54159. function computedStyle$1(el, prop) {
  54160. if (!el || !prop) {
  54161. return "";
  54162. }
  54163. if (typeof window_1.getComputedStyle === "function") {
  54164. let computedStyleValue;
  54165. try {
  54166. computedStyleValue = window_1.getComputedStyle(el);
  54167. } catch (e) {
  54168. return "";
  54169. }
  54170. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  54171. }
  54172. return "";
  54173. }
  54174. var Dom$2 = /* @__PURE__ */ Object.freeze({
  54175. __proto__: null,
  54176. isReal: isReal$1,
  54177. isEl: isEl$1,
  54178. isInFrame: isInFrame$1,
  54179. createEl: createEl$1,
  54180. textContent: textContent$1,
  54181. prependTo: prependTo$1,
  54182. hasClass: hasClass$1,
  54183. addClass: addClass$1,
  54184. removeClass: removeClass$1,
  54185. toggleClass: toggleClass$1,
  54186. setAttributes: setAttributes$1,
  54187. getAttributes: getAttributes$1,
  54188. getAttribute: getAttribute$1,
  54189. setAttribute: setAttribute$1,
  54190. removeAttribute: removeAttribute$1,
  54191. blockTextSelection: blockTextSelection$1,
  54192. unblockTextSelection: unblockTextSelection$1,
  54193. getBoundingClientRect: getBoundingClientRect$1,
  54194. findPosition: findPosition$1,
  54195. getPointerPosition: getPointerPosition$1,
  54196. isTextNode: isTextNode$1,
  54197. emptyEl: emptyEl$1,
  54198. normalizeContent: normalizeContent$1,
  54199. appendContent: appendContent$1,
  54200. insertContent: insertContent$1,
  54201. isSingleLeftClick: isSingleLeftClick$1,
  54202. $: $$1,
  54203. $$: $$$1,
  54204. computedStyle: computedStyle$1
  54205. });
  54206. let _windowLoaded$1 = false;
  54207. let videojs$1$1;
  54208. const autoSetup$1 = function() {
  54209. if (videojs$1$1.options.autoSetup === false) {
  54210. return;
  54211. }
  54212. const vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  54213. const audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  54214. const divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  54215. const mediaEls = vids.concat(audios, divs);
  54216. if (mediaEls && mediaEls.length > 0) {
  54217. for (let i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  54218. const mediaEl = mediaEls[i2];
  54219. if (mediaEl && mediaEl.getAttribute) {
  54220. if (mediaEl.player === void 0) {
  54221. const options2 = mediaEl.getAttribute("data-setup");
  54222. if (options2 !== null) {
  54223. videojs$1$1(mediaEl);
  54224. }
  54225. }
  54226. } else {
  54227. autoSetupTimeout$1(1);
  54228. break;
  54229. }
  54230. }
  54231. } else if (!_windowLoaded$1) {
  54232. autoSetupTimeout$1(1);
  54233. }
  54234. };
  54235. function autoSetupTimeout$1(wait, vjs) {
  54236. if (!isReal$1()) {
  54237. return;
  54238. }
  54239. if (vjs) {
  54240. videojs$1$1 = vjs;
  54241. }
  54242. window_1.setTimeout(autoSetup$1, wait);
  54243. }
  54244. function setWindowLoaded$1() {
  54245. _windowLoaded$1 = true;
  54246. window_1.removeEventListener("load", setWindowLoaded$1);
  54247. }
  54248. if (isReal$1()) {
  54249. if (document_1.readyState === "complete") {
  54250. setWindowLoaded$1();
  54251. } else {
  54252. window_1.addEventListener("load", setWindowLoaded$1);
  54253. }
  54254. }
  54255. const createStyleElement$1 = function(className) {
  54256. const style = document_1.createElement("style");
  54257. style.className = className;
  54258. return style;
  54259. };
  54260. const setTextContent$1 = function(el, content) {
  54261. if (el.styleSheet) {
  54262. el.styleSheet.cssText = content;
  54263. } else {
  54264. el.textContent = content;
  54265. }
  54266. };
  54267. var DomData$1 = /* @__PURE__ */ new WeakMap();
  54268. const _initialGuid$1 = 3;
  54269. let _guid$1 = _initialGuid$1;
  54270. function newGUID$1() {
  54271. return _guid$1++;
  54272. }
  54273. function _cleanUpEvents$1(elem, type2) {
  54274. if (!DomData$1.has(elem)) {
  54275. return;
  54276. }
  54277. const data = DomData$1.get(elem);
  54278. if (data.handlers[type2].length === 0) {
  54279. delete data.handlers[type2];
  54280. if (elem.removeEventListener) {
  54281. elem.removeEventListener(type2, data.dispatcher, false);
  54282. } else if (elem.detachEvent) {
  54283. elem.detachEvent("on" + type2, data.dispatcher);
  54284. }
  54285. }
  54286. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  54287. delete data.handlers;
  54288. delete data.dispatcher;
  54289. delete data.disabled;
  54290. }
  54291. if (Object.getOwnPropertyNames(data).length === 0) {
  54292. DomData$1.delete(elem);
  54293. }
  54294. }
  54295. function _handleMultipleEvents$1(fn2, elem, types, callback2) {
  54296. types.forEach(function(type2) {
  54297. fn2(elem, type2, callback2);
  54298. });
  54299. }
  54300. function fixEvent$1(event2) {
  54301. if (event2.fixed_) {
  54302. return event2;
  54303. }
  54304. function returnTrue() {
  54305. return true;
  54306. }
  54307. function returnFalse() {
  54308. return false;
  54309. }
  54310. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  54311. const old = event2 || window_1.event;
  54312. event2 = {};
  54313. for (const key in old) {
  54314. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  54315. if (!(key === "returnValue" && old.preventDefault)) {
  54316. event2[key] = old[key];
  54317. }
  54318. }
  54319. }
  54320. if (!event2.target) {
  54321. event2.target = event2.srcElement || document_1;
  54322. }
  54323. if (!event2.relatedTarget) {
  54324. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  54325. }
  54326. event2.preventDefault = function() {
  54327. if (old.preventDefault) {
  54328. old.preventDefault();
  54329. }
  54330. event2.returnValue = false;
  54331. old.returnValue = false;
  54332. event2.defaultPrevented = true;
  54333. };
  54334. event2.defaultPrevented = false;
  54335. event2.stopPropagation = function() {
  54336. if (old.stopPropagation) {
  54337. old.stopPropagation();
  54338. }
  54339. event2.cancelBubble = true;
  54340. old.cancelBubble = true;
  54341. event2.isPropagationStopped = returnTrue;
  54342. };
  54343. event2.isPropagationStopped = returnFalse;
  54344. event2.stopImmediatePropagation = function() {
  54345. if (old.stopImmediatePropagation) {
  54346. old.stopImmediatePropagation();
  54347. }
  54348. event2.isImmediatePropagationStopped = returnTrue;
  54349. event2.stopPropagation();
  54350. };
  54351. event2.isImmediatePropagationStopped = returnFalse;
  54352. if (event2.clientX !== null && event2.clientX !== void 0) {
  54353. const doc = document_1.documentElement;
  54354. const body = document_1.body;
  54355. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  54356. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  54357. }
  54358. event2.which = event2.charCode || event2.keyCode;
  54359. if (event2.button !== null && event2.button !== void 0) {
  54360. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  54361. }
  54362. }
  54363. event2.fixed_ = true;
  54364. return event2;
  54365. }
  54366. let _supportsPassive$1;
  54367. const supportsPassive$1 = function() {
  54368. if (typeof _supportsPassive$1 !== "boolean") {
  54369. _supportsPassive$1 = false;
  54370. try {
  54371. const opts = Object.defineProperty({}, "passive", {
  54372. get() {
  54373. _supportsPassive$1 = true;
  54374. }
  54375. });
  54376. window_1.addEventListener("test", null, opts);
  54377. window_1.removeEventListener("test", null, opts);
  54378. } catch (e) {
  54379. }
  54380. }
  54381. return _supportsPassive$1;
  54382. };
  54383. const passiveEvents$1 = ["touchstart", "touchmove"];
  54384. function on$1(elem, type2, fn2) {
  54385. if (Array.isArray(type2)) {
  54386. return _handleMultipleEvents$1(on$1, elem, type2, fn2);
  54387. }
  54388. if (!DomData$1.has(elem)) {
  54389. DomData$1.set(elem, {});
  54390. }
  54391. const data = DomData$1.get(elem);
  54392. if (!data.handlers) {
  54393. data.handlers = {};
  54394. }
  54395. if (!data.handlers[type2]) {
  54396. data.handlers[type2] = [];
  54397. }
  54398. if (!fn2.guid) {
  54399. fn2.guid = newGUID$1();
  54400. }
  54401. data.handlers[type2].push(fn2);
  54402. if (!data.dispatcher) {
  54403. data.disabled = false;
  54404. data.dispatcher = function(event2, hash) {
  54405. if (data.disabled) {
  54406. return;
  54407. }
  54408. event2 = fixEvent$1(event2);
  54409. const handlers = data.handlers[event2.type];
  54410. if (handlers) {
  54411. const handlersCopy = handlers.slice(0);
  54412. for (let m = 0, n = handlersCopy.length; m < n; m++) {
  54413. if (event2.isImmediatePropagationStopped()) {
  54414. break;
  54415. } else {
  54416. try {
  54417. handlersCopy[m].call(elem, event2, hash);
  54418. } catch (e) {
  54419. log$1$1.error(e);
  54420. }
  54421. }
  54422. }
  54423. }
  54424. };
  54425. }
  54426. if (data.handlers[type2].length === 1) {
  54427. if (elem.addEventListener) {
  54428. let options2 = false;
  54429. if (supportsPassive$1() && passiveEvents$1.indexOf(type2) > -1) {
  54430. options2 = {
  54431. passive: true
  54432. };
  54433. }
  54434. elem.addEventListener(type2, data.dispatcher, options2);
  54435. } else if (elem.attachEvent) {
  54436. elem.attachEvent("on" + type2, data.dispatcher);
  54437. }
  54438. }
  54439. }
  54440. function off$1(elem, type2, fn2) {
  54441. if (!DomData$1.has(elem)) {
  54442. return;
  54443. }
  54444. const data = DomData$1.get(elem);
  54445. if (!data.handlers) {
  54446. return;
  54447. }
  54448. if (Array.isArray(type2)) {
  54449. return _handleMultipleEvents$1(off$1, elem, type2, fn2);
  54450. }
  54451. const removeType = function(el, t2) {
  54452. data.handlers[t2] = [];
  54453. _cleanUpEvents$1(el, t2);
  54454. };
  54455. if (type2 === void 0) {
  54456. for (const t2 in data.handlers) {
  54457. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  54458. removeType(elem, t2);
  54459. }
  54460. }
  54461. return;
  54462. }
  54463. const handlers = data.handlers[type2];
  54464. if (!handlers) {
  54465. return;
  54466. }
  54467. if (!fn2) {
  54468. removeType(elem, type2);
  54469. return;
  54470. }
  54471. if (fn2.guid) {
  54472. for (let n = 0; n < handlers.length; n++) {
  54473. if (handlers[n].guid === fn2.guid) {
  54474. handlers.splice(n--, 1);
  54475. }
  54476. }
  54477. }
  54478. _cleanUpEvents$1(elem, type2);
  54479. }
  54480. function trigger$1(elem, event2, hash) {
  54481. const elemData = DomData$1.has(elem) ? DomData$1.get(elem) : {};
  54482. const parent = elem.parentNode || elem.ownerDocument;
  54483. if (typeof event2 === "string") {
  54484. event2 = {
  54485. type: event2,
  54486. target: elem
  54487. };
  54488. } else if (!event2.target) {
  54489. event2.target = elem;
  54490. }
  54491. event2 = fixEvent$1(event2);
  54492. if (elemData.dispatcher) {
  54493. elemData.dispatcher.call(elem, event2, hash);
  54494. }
  54495. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  54496. trigger$1.call(null, parent, event2, hash);
  54497. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  54498. if (!DomData$1.has(event2.target)) {
  54499. DomData$1.set(event2.target, {});
  54500. }
  54501. const targetData = DomData$1.get(event2.target);
  54502. if (event2.target[event2.type]) {
  54503. targetData.disabled = true;
  54504. if (typeof event2.target[event2.type] === "function") {
  54505. event2.target[event2.type]();
  54506. }
  54507. targetData.disabled = false;
  54508. }
  54509. }
  54510. return !event2.defaultPrevented;
  54511. }
  54512. function one$1(elem, type2, fn2) {
  54513. if (Array.isArray(type2)) {
  54514. return _handleMultipleEvents$1(one$1, elem, type2, fn2);
  54515. }
  54516. const func = function() {
  54517. off$1(elem, type2, func);
  54518. fn2.apply(this, arguments);
  54519. };
  54520. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54521. on$1(elem, type2, func);
  54522. }
  54523. function any$1(elem, type2, fn2) {
  54524. const func = function() {
  54525. off$1(elem, type2, func);
  54526. fn2.apply(this, arguments);
  54527. };
  54528. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54529. on$1(elem, type2, func);
  54530. }
  54531. var Events$1 = /* @__PURE__ */ Object.freeze({
  54532. __proto__: null,
  54533. fixEvent: fixEvent$1,
  54534. on: on$1,
  54535. off: off$1,
  54536. trigger: trigger$1,
  54537. one: one$1,
  54538. any: any$1
  54539. });
  54540. const UPDATE_REFRESH_INTERVAL$1 = 30;
  54541. const bind_ = function(context, fn2, uid) {
  54542. if (!fn2.guid) {
  54543. fn2.guid = newGUID$1();
  54544. }
  54545. const bound = fn2.bind(context);
  54546. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  54547. return bound;
  54548. };
  54549. const throttle$1 = function(fn2, wait) {
  54550. let last = window_1.performance.now();
  54551. const throttled = function(...args) {
  54552. const now2 = window_1.performance.now();
  54553. if (now2 - last >= wait) {
  54554. fn2(...args);
  54555. last = now2;
  54556. }
  54557. };
  54558. return throttled;
  54559. };
  54560. const debounce$1 = function(func, wait, immediate, context = window_1) {
  54561. let timeout;
  54562. const cancel = () => {
  54563. context.clearTimeout(timeout);
  54564. timeout = null;
  54565. };
  54566. const debounced = function() {
  54567. const self2 = this;
  54568. const args = arguments;
  54569. let later = function() {
  54570. timeout = null;
  54571. later = null;
  54572. if (!immediate) {
  54573. func.apply(self2, args);
  54574. }
  54575. };
  54576. if (!timeout && immediate) {
  54577. func.apply(self2, args);
  54578. }
  54579. context.clearTimeout(timeout);
  54580. timeout = context.setTimeout(later, wait);
  54581. };
  54582. debounced.cancel = cancel;
  54583. return debounced;
  54584. };
  54585. var Fn = /* @__PURE__ */ Object.freeze({
  54586. __proto__: null,
  54587. UPDATE_REFRESH_INTERVAL: UPDATE_REFRESH_INTERVAL$1,
  54588. bind_,
  54589. throttle: throttle$1,
  54590. debounce: debounce$1
  54591. });
  54592. let EVENT_MAP$1;
  54593. class EventTarget$2$1 {
  54594. on(type2, fn2) {
  54595. const ael = this.addEventListener;
  54596. this.addEventListener = () => {
  54597. };
  54598. on$1(this, type2, fn2);
  54599. this.addEventListener = ael;
  54600. }
  54601. off(type2, fn2) {
  54602. off$1(this, type2, fn2);
  54603. }
  54604. one(type2, fn2) {
  54605. const ael = this.addEventListener;
  54606. this.addEventListener = () => {
  54607. };
  54608. one$1(this, type2, fn2);
  54609. this.addEventListener = ael;
  54610. }
  54611. any(type2, fn2) {
  54612. const ael = this.addEventListener;
  54613. this.addEventListener = () => {
  54614. };
  54615. any$1(this, type2, fn2);
  54616. this.addEventListener = ael;
  54617. }
  54618. trigger(event2) {
  54619. const type2 = event2.type || event2;
  54620. if (typeof event2 === "string") {
  54621. event2 = {
  54622. type: type2
  54623. };
  54624. }
  54625. event2 = fixEvent$1(event2);
  54626. if (this.allowedEvents_[type2] && this["on" + type2]) {
  54627. this["on" + type2](event2);
  54628. }
  54629. trigger$1(this, event2);
  54630. }
  54631. queueTrigger(event2) {
  54632. if (!EVENT_MAP$1) {
  54633. EVENT_MAP$1 = /* @__PURE__ */ new Map();
  54634. }
  54635. const type2 = event2.type || event2;
  54636. let map = EVENT_MAP$1.get(this);
  54637. if (!map) {
  54638. map = /* @__PURE__ */ new Map();
  54639. EVENT_MAP$1.set(this, map);
  54640. }
  54641. const oldTimeout = map.get(type2);
  54642. map.delete(type2);
  54643. window_1.clearTimeout(oldTimeout);
  54644. const timeout = window_1.setTimeout(() => {
  54645. map.delete(type2);
  54646. if (map.size === 0) {
  54647. map = null;
  54648. EVENT_MAP$1.delete(this);
  54649. }
  54650. this.trigger(event2);
  54651. }, 0);
  54652. map.set(type2, timeout);
  54653. }
  54654. }
  54655. EventTarget$2$1.prototype.allowedEvents_ = {};
  54656. EventTarget$2$1.prototype.addEventListener = EventTarget$2$1.prototype.on;
  54657. EventTarget$2$1.prototype.removeEventListener = EventTarget$2$1.prototype.off;
  54658. EventTarget$2$1.prototype.dispatchEvent = EventTarget$2$1.prototype.trigger;
  54659. const objName$1 = (obj) => {
  54660. if (typeof obj.name === "function") {
  54661. return obj.name();
  54662. }
  54663. if (typeof obj.name === "string") {
  54664. return obj.name;
  54665. }
  54666. if (obj.name_) {
  54667. return obj.name_;
  54668. }
  54669. if (obj.constructor && obj.constructor.name) {
  54670. return obj.constructor.name;
  54671. }
  54672. return typeof obj;
  54673. };
  54674. const isEvented$1 = (object) => object instanceof EventTarget$2$1 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every((k) => typeof object[k] === "function");
  54675. const addEventedCallback$1 = (target, callback2) => {
  54676. if (isEvented$1(target)) {
  54677. callback2();
  54678. } else {
  54679. if (!target.eventedCallbacks) {
  54680. target.eventedCallbacks = [];
  54681. }
  54682. target.eventedCallbacks.push(callback2);
  54683. }
  54684. };
  54685. const isValidEventType$1 = (type2) => typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  54686. const validateTarget$1 = (target, obj, fnName) => {
  54687. if (!target || !target.nodeName && !isEvented$1(target)) {
  54688. throw new Error(`Invalid target for ${objName$1(obj)}#${fnName}; must be a DOM node or evented object.`);
  54689. }
  54690. };
  54691. const validateEventType$1 = (type2, obj, fnName) => {
  54692. if (!isValidEventType$1(type2)) {
  54693. throw new Error(`Invalid event type for ${objName$1(obj)}#${fnName}; must be a non-empty string or array.`);
  54694. }
  54695. };
  54696. const validateListener$1 = (listener, obj, fnName) => {
  54697. if (typeof listener !== "function") {
  54698. throw new Error(`Invalid listener for ${objName$1(obj)}#${fnName}; must be a function.`);
  54699. }
  54700. };
  54701. const normalizeListenArgs$1 = (self2, args, fnName) => {
  54702. const isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  54703. let target;
  54704. let type2;
  54705. let listener;
  54706. if (isTargetingSelf) {
  54707. target = self2.eventBusEl_;
  54708. if (args.length >= 3) {
  54709. args.shift();
  54710. }
  54711. [type2, listener] = args;
  54712. } else {
  54713. [target, type2, listener] = args;
  54714. }
  54715. validateTarget$1(target, self2, fnName);
  54716. validateEventType$1(type2, self2, fnName);
  54717. validateListener$1(listener, self2, fnName);
  54718. listener = bind_(self2, listener);
  54719. return {
  54720. isTargetingSelf,
  54721. target,
  54722. type: type2,
  54723. listener
  54724. };
  54725. };
  54726. const listen$1 = (target, method, type2, listener) => {
  54727. validateTarget$1(target, target, method);
  54728. if (target.nodeName) {
  54729. Events$1[method](target, type2, listener);
  54730. } else {
  54731. target[method](type2, listener);
  54732. }
  54733. };
  54734. const EventedMixin$1 = {
  54735. on(...args) {
  54736. const {
  54737. isTargetingSelf,
  54738. target,
  54739. type: type2,
  54740. listener
  54741. } = normalizeListenArgs$1(this, args, "on");
  54742. listen$1(target, "on", type2, listener);
  54743. if (!isTargetingSelf) {
  54744. const removeListenerOnDispose = () => this.off(target, type2, listener);
  54745. removeListenerOnDispose.guid = listener.guid;
  54746. const removeRemoverOnTargetDispose = () => this.off("dispose", removeListenerOnDispose);
  54747. removeRemoverOnTargetDispose.guid = listener.guid;
  54748. listen$1(this, "on", "dispose", removeListenerOnDispose);
  54749. listen$1(target, "on", "dispose", removeRemoverOnTargetDispose);
  54750. }
  54751. },
  54752. one(...args) {
  54753. const {
  54754. isTargetingSelf,
  54755. target,
  54756. type: type2,
  54757. listener
  54758. } = normalizeListenArgs$1(this, args, "one");
  54759. if (isTargetingSelf) {
  54760. listen$1(target, "one", type2, listener);
  54761. } else {
  54762. const wrapper = (...largs) => {
  54763. this.off(target, type2, wrapper);
  54764. listener.apply(null, largs);
  54765. };
  54766. wrapper.guid = listener.guid;
  54767. listen$1(target, "one", type2, wrapper);
  54768. }
  54769. },
  54770. any(...args) {
  54771. const {
  54772. isTargetingSelf,
  54773. target,
  54774. type: type2,
  54775. listener
  54776. } = normalizeListenArgs$1(this, args, "any");
  54777. if (isTargetingSelf) {
  54778. listen$1(target, "any", type2, listener);
  54779. } else {
  54780. const wrapper = (...largs) => {
  54781. this.off(target, type2, wrapper);
  54782. listener.apply(null, largs);
  54783. };
  54784. wrapper.guid = listener.guid;
  54785. listen$1(target, "any", type2, wrapper);
  54786. }
  54787. },
  54788. off(targetOrType, typeOrListener, listener) {
  54789. if (!targetOrType || isValidEventType$1(targetOrType)) {
  54790. off$1(this.eventBusEl_, targetOrType, typeOrListener);
  54791. } else {
  54792. const target = targetOrType;
  54793. const type2 = typeOrListener;
  54794. validateTarget$1(target, this, "off");
  54795. validateEventType$1(type2, this, "off");
  54796. validateListener$1(listener, this, "off");
  54797. listener = bind_(this, listener);
  54798. this.off("dispose", listener);
  54799. if (target.nodeName) {
  54800. off$1(target, type2, listener);
  54801. off$1(target, "dispose", listener);
  54802. } else if (isEvented$1(target)) {
  54803. target.off(type2, listener);
  54804. target.off("dispose", listener);
  54805. }
  54806. }
  54807. },
  54808. trigger(event2, hash) {
  54809. validateTarget$1(this.eventBusEl_, this, "trigger");
  54810. const type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  54811. if (!isValidEventType$1(type2)) {
  54812. throw new Error(`Invalid event type for ${objName$1(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);
  54813. }
  54814. return trigger$1(this.eventBusEl_, event2, hash);
  54815. }
  54816. };
  54817. function evented$1(target, options2 = {}) {
  54818. const {
  54819. eventBusKey
  54820. } = options2;
  54821. if (eventBusKey) {
  54822. if (!target[eventBusKey].nodeName) {
  54823. throw new Error(`The eventBusKey "${eventBusKey}" does not refer to an element.`);
  54824. }
  54825. target.eventBusEl_ = target[eventBusKey];
  54826. } else {
  54827. target.eventBusEl_ = createEl$1("span", {
  54828. className: "vjs-event-bus"
  54829. });
  54830. }
  54831. Object.assign(target, EventedMixin$1);
  54832. if (target.eventedCallbacks) {
  54833. target.eventedCallbacks.forEach((callback2) => {
  54834. callback2();
  54835. });
  54836. }
  54837. target.on("dispose", () => {
  54838. target.off();
  54839. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  54840. if (val && DomData$1.has(val)) {
  54841. DomData$1.delete(val);
  54842. }
  54843. });
  54844. window_1.setTimeout(() => {
  54845. target.eventBusEl_ = null;
  54846. }, 0);
  54847. });
  54848. return target;
  54849. }
  54850. const StatefulMixin$1 = {
  54851. state: {},
  54852. setState(stateUpdates) {
  54853. if (typeof stateUpdates === "function") {
  54854. stateUpdates = stateUpdates();
  54855. }
  54856. let changes;
  54857. each$1(stateUpdates, (value, key) => {
  54858. if (this.state[key] !== value) {
  54859. changes = changes || {};
  54860. changes[key] = {
  54861. from: this.state[key],
  54862. to: value
  54863. };
  54864. }
  54865. this.state[key] = value;
  54866. });
  54867. if (changes && isEvented$1(this)) {
  54868. this.trigger({
  54869. changes,
  54870. type: "statechanged"
  54871. });
  54872. }
  54873. return changes;
  54874. }
  54875. };
  54876. function stateful$1(target, defaultState) {
  54877. Object.assign(target, StatefulMixin$1);
  54878. target.state = Object.assign({}, target.state, defaultState);
  54879. if (typeof target.handleStateChanged === "function" && isEvented$1(target)) {
  54880. target.on("statechanged", target.handleStateChanged);
  54881. }
  54882. return target;
  54883. }
  54884. const toLowerCase$1 = function(string) {
  54885. if (typeof string !== "string") {
  54886. return string;
  54887. }
  54888. return string.replace(/./, (w) => w.toLowerCase());
  54889. };
  54890. const toTitleCase$1$1 = function(string) {
  54891. if (typeof string !== "string") {
  54892. return string;
  54893. }
  54894. return string.replace(/./, (w) => w.toUpperCase());
  54895. };
  54896. const titleCaseEquals$1 = function(str1, str2) {
  54897. return toTitleCase$1$1(str1) === toTitleCase$1$1(str2);
  54898. };
  54899. var Str = /* @__PURE__ */ Object.freeze({
  54900. __proto__: null,
  54901. toLowerCase: toLowerCase$1,
  54902. toTitleCase: toTitleCase$1$1,
  54903. titleCaseEquals: titleCaseEquals$1
  54904. });
  54905. class Component$1$1 {
  54906. constructor(player, options2, ready) {
  54907. if (!player && this.play) {
  54908. this.player_ = player = this;
  54909. } else {
  54910. this.player_ = player;
  54911. }
  54912. this.isDisposed_ = false;
  54913. this.parentComponent_ = null;
  54914. this.options_ = merge$1({}, this.options_);
  54915. options2 = this.options_ = merge$1(this.options_, options2);
  54916. this.id_ = options2.id || options2.el && options2.el.id;
  54917. if (!this.id_) {
  54918. const id = player && player.id && player.id() || "no_player";
  54919. this.id_ = `${id}_component_${newGUID$1()}`;
  54920. }
  54921. this.name_ = options2.name || null;
  54922. if (options2.el) {
  54923. this.el_ = options2.el;
  54924. } else if (options2.createEl !== false) {
  54925. this.el_ = this.createEl();
  54926. }
  54927. if (options2.className && this.el_) {
  54928. options2.className.split(" ").forEach((c) => this.addClass(c));
  54929. }
  54930. ["on", "off", "one", "any", "trigger"].forEach((fn2) => {
  54931. this[fn2] = void 0;
  54932. });
  54933. if (options2.evented !== false) {
  54934. evented$1(this, {
  54935. eventBusKey: this.el_ ? "el_" : null
  54936. });
  54937. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  54938. this.on(this.player_, "languagechange", this.handleLanguagechange);
  54939. }
  54940. stateful$1(this, this.constructor.defaultState);
  54941. this.children_ = [];
  54942. this.childIndex_ = {};
  54943. this.childNameIndex_ = {};
  54944. this.setTimeoutIds_ = /* @__PURE__ */ new Set();
  54945. this.setIntervalIds_ = /* @__PURE__ */ new Set();
  54946. this.rafIds_ = /* @__PURE__ */ new Set();
  54947. this.namedRafs_ = /* @__PURE__ */ new Map();
  54948. this.clearingTimersOnDispose_ = false;
  54949. if (options2.initChildren !== false) {
  54950. this.initChildren();
  54951. }
  54952. this.ready(ready);
  54953. if (options2.reportTouchActivity !== false) {
  54954. this.enableTouchActivity();
  54955. }
  54956. }
  54957. on(type2, fn2) {
  54958. }
  54959. off(type2, fn2) {
  54960. }
  54961. one(type2, fn2) {
  54962. }
  54963. any(type2, fn2) {
  54964. }
  54965. trigger(event2) {
  54966. }
  54967. dispose(options2 = {}) {
  54968. if (this.isDisposed_) {
  54969. return;
  54970. }
  54971. if (this.readyQueue_) {
  54972. this.readyQueue_.length = 0;
  54973. }
  54974. this.trigger({
  54975. type: "dispose",
  54976. bubbles: false
  54977. });
  54978. this.isDisposed_ = true;
  54979. if (this.children_) {
  54980. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  54981. if (this.children_[i2].dispose) {
  54982. this.children_[i2].dispose();
  54983. }
  54984. }
  54985. }
  54986. this.children_ = null;
  54987. this.childIndex_ = null;
  54988. this.childNameIndex_ = null;
  54989. this.parentComponent_ = null;
  54990. if (this.el_) {
  54991. if (this.el_.parentNode) {
  54992. if (options2.restoreEl) {
  54993. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  54994. } else {
  54995. this.el_.parentNode.removeChild(this.el_);
  54996. }
  54997. }
  54998. this.el_ = null;
  54999. }
  55000. this.player_ = null;
  55001. }
  55002. isDisposed() {
  55003. return Boolean(this.isDisposed_);
  55004. }
  55005. player() {
  55006. return this.player_;
  55007. }
  55008. options(obj) {
  55009. if (!obj) {
  55010. return this.options_;
  55011. }
  55012. this.options_ = merge$1(this.options_, obj);
  55013. return this.options_;
  55014. }
  55015. el() {
  55016. return this.el_;
  55017. }
  55018. createEl(tagName, properties, attributes) {
  55019. return createEl$1(tagName, properties, attributes);
  55020. }
  55021. localize(string, tokens, defaultValue2 = string) {
  55022. const code = this.player_.language && this.player_.language();
  55023. const languages = this.player_.languages && this.player_.languages();
  55024. const language = languages && languages[code];
  55025. const primaryCode = code && code.split("-")[0];
  55026. const primaryLang = languages && languages[primaryCode];
  55027. let localizedString = defaultValue2;
  55028. if (language && language[string]) {
  55029. localizedString = language[string];
  55030. } else if (primaryLang && primaryLang[string]) {
  55031. localizedString = primaryLang[string];
  55032. }
  55033. if (tokens) {
  55034. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  55035. const value = tokens[index2 - 1];
  55036. let ret = value;
  55037. if (typeof value === "undefined") {
  55038. ret = match;
  55039. }
  55040. return ret;
  55041. });
  55042. }
  55043. return localizedString;
  55044. }
  55045. handleLanguagechange() {
  55046. }
  55047. contentEl() {
  55048. return this.contentEl_ || this.el_;
  55049. }
  55050. id() {
  55051. return this.id_;
  55052. }
  55053. name() {
  55054. return this.name_;
  55055. }
  55056. children() {
  55057. return this.children_;
  55058. }
  55059. getChildById(id) {
  55060. return this.childIndex_[id];
  55061. }
  55062. getChild(name) {
  55063. if (!name) {
  55064. return;
  55065. }
  55066. return this.childNameIndex_[name];
  55067. }
  55068. getDescendant(...names2) {
  55069. names2 = names2.reduce((acc, n) => acc.concat(n), []);
  55070. let currentChild = this;
  55071. for (let i2 = 0; i2 < names2.length; i2++) {
  55072. currentChild = currentChild.getChild(names2[i2]);
  55073. if (!currentChild || !currentChild.getChild) {
  55074. return;
  55075. }
  55076. }
  55077. return currentChild;
  55078. }
  55079. addChild(child, options2 = {}, index2 = this.children_.length) {
  55080. let component;
  55081. let componentName;
  55082. if (typeof child === "string") {
  55083. componentName = toTitleCase$1$1(child);
  55084. const componentClassName = options2.componentClass || componentName;
  55085. options2.name = componentName;
  55086. const ComponentClass = Component$1$1.getComponent(componentClassName);
  55087. if (!ComponentClass) {
  55088. throw new Error(`Component ${componentClassName} does not exist`);
  55089. }
  55090. if (typeof ComponentClass !== "function") {
  55091. return null;
  55092. }
  55093. component = new ComponentClass(this.player_ || this, options2);
  55094. } else {
  55095. component = child;
  55096. }
  55097. if (component.parentComponent_) {
  55098. component.parentComponent_.removeChild(component);
  55099. }
  55100. this.children_.splice(index2, 0, component);
  55101. component.parentComponent_ = this;
  55102. if (typeof component.id === "function") {
  55103. this.childIndex_[component.id()] = component;
  55104. }
  55105. componentName = componentName || component.name && toTitleCase$1$1(component.name());
  55106. if (componentName) {
  55107. this.childNameIndex_[componentName] = component;
  55108. this.childNameIndex_[toLowerCase$1(componentName)] = component;
  55109. }
  55110. if (typeof component.el === "function" && component.el()) {
  55111. let refNode = null;
  55112. if (this.children_[index2 + 1]) {
  55113. if (this.children_[index2 + 1].el_) {
  55114. refNode = this.children_[index2 + 1].el_;
  55115. } else if (isEl$1(this.children_[index2 + 1])) {
  55116. refNode = this.children_[index2 + 1];
  55117. }
  55118. }
  55119. this.contentEl().insertBefore(component.el(), refNode);
  55120. }
  55121. return component;
  55122. }
  55123. removeChild(component) {
  55124. if (typeof component === "string") {
  55125. component = this.getChild(component);
  55126. }
  55127. if (!component || !this.children_) {
  55128. return;
  55129. }
  55130. let childFound = false;
  55131. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  55132. if (this.children_[i2] === component) {
  55133. childFound = true;
  55134. this.children_.splice(i2, 1);
  55135. break;
  55136. }
  55137. }
  55138. if (!childFound) {
  55139. return;
  55140. }
  55141. component.parentComponent_ = null;
  55142. this.childIndex_[component.id()] = null;
  55143. this.childNameIndex_[toTitleCase$1$1(component.name())] = null;
  55144. this.childNameIndex_[toLowerCase$1(component.name())] = null;
  55145. const compEl = component.el();
  55146. if (compEl && compEl.parentNode === this.contentEl()) {
  55147. this.contentEl().removeChild(component.el());
  55148. }
  55149. }
  55150. initChildren() {
  55151. const children = this.options_.children;
  55152. if (children) {
  55153. const parentOptions = this.options_;
  55154. const handleAdd = (child) => {
  55155. const name = child.name;
  55156. let opts = child.opts;
  55157. if (parentOptions[name] !== void 0) {
  55158. opts = parentOptions[name];
  55159. }
  55160. if (opts === false) {
  55161. return;
  55162. }
  55163. if (opts === true) {
  55164. opts = {};
  55165. }
  55166. opts.playerOptions = this.options_.playerOptions;
  55167. const newChild = this.addChild(name, opts);
  55168. if (newChild) {
  55169. this[name] = newChild;
  55170. }
  55171. };
  55172. let workingChildren;
  55173. const Tech2 = Component$1$1.getComponent("Tech");
  55174. if (Array.isArray(children)) {
  55175. workingChildren = children;
  55176. } else {
  55177. workingChildren = Object.keys(children);
  55178. }
  55179. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  55180. return !workingChildren.some(function(wchild) {
  55181. if (typeof wchild === "string") {
  55182. return child === wchild;
  55183. }
  55184. return child === wchild.name;
  55185. });
  55186. })).map((child) => {
  55187. let name;
  55188. let opts;
  55189. if (typeof child === "string") {
  55190. name = child;
  55191. opts = children[name] || this.options_[name] || {};
  55192. } else {
  55193. name = child.name;
  55194. opts = child;
  55195. }
  55196. return {
  55197. name,
  55198. opts
  55199. };
  55200. }).filter((child) => {
  55201. const c = Component$1$1.getComponent(child.opts.componentClass || toTitleCase$1$1(child.name));
  55202. return c && !Tech2.isTech(c);
  55203. }).forEach(handleAdd);
  55204. }
  55205. }
  55206. buildCSSClass() {
  55207. return "";
  55208. }
  55209. ready(fn2, sync = false) {
  55210. if (!fn2) {
  55211. return;
  55212. }
  55213. if (!this.isReady_) {
  55214. this.readyQueue_ = this.readyQueue_ || [];
  55215. this.readyQueue_.push(fn2);
  55216. return;
  55217. }
  55218. if (sync) {
  55219. fn2.call(this);
  55220. } else {
  55221. this.setTimeout(fn2, 1);
  55222. }
  55223. }
  55224. triggerReady() {
  55225. this.isReady_ = true;
  55226. this.setTimeout(function() {
  55227. const readyQueue = this.readyQueue_;
  55228. this.readyQueue_ = [];
  55229. if (readyQueue && readyQueue.length > 0) {
  55230. readyQueue.forEach(function(fn2) {
  55231. fn2.call(this);
  55232. }, this);
  55233. }
  55234. this.trigger("ready");
  55235. }, 1);
  55236. }
  55237. $(selector, context) {
  55238. return $$1(selector, context || this.contentEl());
  55239. }
  55240. $$(selector, context) {
  55241. return $$$1(selector, context || this.contentEl());
  55242. }
  55243. hasClass(classToCheck) {
  55244. return hasClass$1(this.el_, classToCheck);
  55245. }
  55246. addClass(...classesToAdd) {
  55247. addClass$1(this.el_, ...classesToAdd);
  55248. }
  55249. removeClass(...classesToRemove) {
  55250. removeClass$1(this.el_, ...classesToRemove);
  55251. }
  55252. toggleClass(classToToggle, predicate) {
  55253. toggleClass$1(this.el_, classToToggle, predicate);
  55254. }
  55255. show() {
  55256. this.removeClass("vjs-hidden");
  55257. }
  55258. hide() {
  55259. this.addClass("vjs-hidden");
  55260. }
  55261. lockShowing() {
  55262. this.addClass("vjs-lock-showing");
  55263. }
  55264. unlockShowing() {
  55265. this.removeClass("vjs-lock-showing");
  55266. }
  55267. getAttribute(attribute) {
  55268. return getAttribute$1(this.el_, attribute);
  55269. }
  55270. setAttribute(attribute, value) {
  55271. setAttribute$1(this.el_, attribute, value);
  55272. }
  55273. removeAttribute(attribute) {
  55274. removeAttribute$1(this.el_, attribute);
  55275. }
  55276. width(num, skipListeners) {
  55277. return this.dimension("width", num, skipListeners);
  55278. }
  55279. height(num, skipListeners) {
  55280. return this.dimension("height", num, skipListeners);
  55281. }
  55282. dimensions(width2, height2) {
  55283. this.width(width2, true);
  55284. this.height(height2);
  55285. }
  55286. dimension(widthOrHeight, num, skipListeners) {
  55287. if (num !== void 0) {
  55288. if (num === null || num !== num) {
  55289. num = 0;
  55290. }
  55291. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  55292. this.el_.style[widthOrHeight] = num;
  55293. } else if (num === "auto") {
  55294. this.el_.style[widthOrHeight] = "";
  55295. } else {
  55296. this.el_.style[widthOrHeight] = num + "px";
  55297. }
  55298. if (!skipListeners) {
  55299. this.trigger("componentresize");
  55300. }
  55301. return;
  55302. }
  55303. if (!this.el_) {
  55304. return 0;
  55305. }
  55306. const val = this.el_.style[widthOrHeight];
  55307. const pxIndex = val.indexOf("px");
  55308. if (pxIndex !== -1) {
  55309. return parseInt(val.slice(0, pxIndex), 10);
  55310. }
  55311. return parseInt(this.el_["offset" + toTitleCase$1$1(widthOrHeight)], 10);
  55312. }
  55313. currentDimension(widthOrHeight) {
  55314. let computedWidthOrHeight = 0;
  55315. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  55316. throw new Error("currentDimension only accepts width or height value");
  55317. }
  55318. computedWidthOrHeight = computedStyle$1(this.el_, widthOrHeight);
  55319. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  55320. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  55321. const rule = `offset${toTitleCase$1$1(widthOrHeight)}`;
  55322. computedWidthOrHeight = this.el_[rule];
  55323. }
  55324. return computedWidthOrHeight;
  55325. }
  55326. currentDimensions() {
  55327. return {
  55328. width: this.currentDimension("width"),
  55329. height: this.currentDimension("height")
  55330. };
  55331. }
  55332. currentWidth() {
  55333. return this.currentDimension("width");
  55334. }
  55335. currentHeight() {
  55336. return this.currentDimension("height");
  55337. }
  55338. focus() {
  55339. this.el_.focus();
  55340. }
  55341. blur() {
  55342. this.el_.blur();
  55343. }
  55344. handleKeyDown(event2) {
  55345. if (this.player_) {
  55346. if (!keycode.isEventKey(event2, "Tab")) {
  55347. event2.stopPropagation();
  55348. }
  55349. this.player_.handleKeyDown(event2);
  55350. }
  55351. }
  55352. handleKeyPress(event2) {
  55353. this.handleKeyDown(event2);
  55354. }
  55355. emitTapEvents() {
  55356. let touchStart = 0;
  55357. let firstTouch = null;
  55358. const tapMovementThreshold = 10;
  55359. const touchTimeThreshold = 200;
  55360. let couldBeTap;
  55361. this.on("touchstart", function(event2) {
  55362. if (event2.touches.length === 1) {
  55363. firstTouch = {
  55364. pageX: event2.touches[0].pageX,
  55365. pageY: event2.touches[0].pageY
  55366. };
  55367. touchStart = window_1.performance.now();
  55368. couldBeTap = true;
  55369. }
  55370. });
  55371. this.on("touchmove", function(event2) {
  55372. if (event2.touches.length > 1) {
  55373. couldBeTap = false;
  55374. } else if (firstTouch) {
  55375. const xdiff = event2.touches[0].pageX - firstTouch.pageX;
  55376. const ydiff = event2.touches[0].pageY - firstTouch.pageY;
  55377. const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  55378. if (touchDistance > tapMovementThreshold) {
  55379. couldBeTap = false;
  55380. }
  55381. }
  55382. });
  55383. const noTap = function() {
  55384. couldBeTap = false;
  55385. };
  55386. this.on("touchleave", noTap);
  55387. this.on("touchcancel", noTap);
  55388. this.on("touchend", function(event2) {
  55389. firstTouch = null;
  55390. if (couldBeTap === true) {
  55391. const touchTime = window_1.performance.now() - touchStart;
  55392. if (touchTime < touchTimeThreshold) {
  55393. event2.preventDefault();
  55394. this.trigger("tap");
  55395. }
  55396. }
  55397. });
  55398. }
  55399. enableTouchActivity() {
  55400. if (!this.player() || !this.player().reportUserActivity) {
  55401. return;
  55402. }
  55403. const report = bind_(this.player(), this.player().reportUserActivity);
  55404. let touchHolding;
  55405. this.on("touchstart", function() {
  55406. report();
  55407. this.clearInterval(touchHolding);
  55408. touchHolding = this.setInterval(report, 250);
  55409. });
  55410. const touchEnd = function(event2) {
  55411. report();
  55412. this.clearInterval(touchHolding);
  55413. };
  55414. this.on("touchmove", report);
  55415. this.on("touchend", touchEnd);
  55416. this.on("touchcancel", touchEnd);
  55417. }
  55418. setTimeout(fn2, timeout) {
  55419. var timeoutId;
  55420. fn2 = bind_(this, fn2);
  55421. this.clearTimersOnDispose_();
  55422. timeoutId = window_1.setTimeout(() => {
  55423. if (this.setTimeoutIds_.has(timeoutId)) {
  55424. this.setTimeoutIds_.delete(timeoutId);
  55425. }
  55426. fn2();
  55427. }, timeout);
  55428. this.setTimeoutIds_.add(timeoutId);
  55429. return timeoutId;
  55430. }
  55431. clearTimeout(timeoutId) {
  55432. if (this.setTimeoutIds_.has(timeoutId)) {
  55433. this.setTimeoutIds_.delete(timeoutId);
  55434. window_1.clearTimeout(timeoutId);
  55435. }
  55436. return timeoutId;
  55437. }
  55438. setInterval(fn2, interval) {
  55439. fn2 = bind_(this, fn2);
  55440. this.clearTimersOnDispose_();
  55441. const intervalId = window_1.setInterval(fn2, interval);
  55442. this.setIntervalIds_.add(intervalId);
  55443. return intervalId;
  55444. }
  55445. clearInterval(intervalId) {
  55446. if (this.setIntervalIds_.has(intervalId)) {
  55447. this.setIntervalIds_.delete(intervalId);
  55448. window_1.clearInterval(intervalId);
  55449. }
  55450. return intervalId;
  55451. }
  55452. requestAnimationFrame(fn2) {
  55453. this.clearTimersOnDispose_();
  55454. var id;
  55455. fn2 = bind_(this, fn2);
  55456. id = window_1.requestAnimationFrame(() => {
  55457. if (this.rafIds_.has(id)) {
  55458. this.rafIds_.delete(id);
  55459. }
  55460. fn2();
  55461. });
  55462. this.rafIds_.add(id);
  55463. return id;
  55464. }
  55465. requestNamedAnimationFrame(name, fn2) {
  55466. if (this.namedRafs_.has(name)) {
  55467. return;
  55468. }
  55469. this.clearTimersOnDispose_();
  55470. fn2 = bind_(this, fn2);
  55471. const id = this.requestAnimationFrame(() => {
  55472. fn2();
  55473. if (this.namedRafs_.has(name)) {
  55474. this.namedRafs_.delete(name);
  55475. }
  55476. });
  55477. this.namedRafs_.set(name, id);
  55478. return name;
  55479. }
  55480. cancelNamedAnimationFrame(name) {
  55481. if (!this.namedRafs_.has(name)) {
  55482. return;
  55483. }
  55484. this.cancelAnimationFrame(this.namedRafs_.get(name));
  55485. this.namedRafs_.delete(name);
  55486. }
  55487. cancelAnimationFrame(id) {
  55488. if (this.rafIds_.has(id)) {
  55489. this.rafIds_.delete(id);
  55490. window_1.cancelAnimationFrame(id);
  55491. }
  55492. return id;
  55493. }
  55494. clearTimersOnDispose_() {
  55495. if (this.clearingTimersOnDispose_) {
  55496. return;
  55497. }
  55498. this.clearingTimersOnDispose_ = true;
  55499. this.one("dispose", () => {
  55500. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(([idName, cancelName]) => {
  55501. this[idName].forEach((val, key) => this[cancelName](key));
  55502. });
  55503. this.clearingTimersOnDispose_ = false;
  55504. });
  55505. }
  55506. static registerComponent(name, ComponentToRegister) {
  55507. if (typeof name !== "string" || !name) {
  55508. throw new Error(`Illegal component name, "${name}"; must be a non-empty string.`);
  55509. }
  55510. const Tech2 = Component$1$1.getComponent("Tech");
  55511. const isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  55512. const isComp = Component$1$1 === ComponentToRegister || Component$1$1.prototype.isPrototypeOf(ComponentToRegister.prototype);
  55513. if (isTech || !isComp) {
  55514. let reason;
  55515. if (isTech) {
  55516. reason = "techs must be registered using Tech.registerTech()";
  55517. } else {
  55518. reason = "must be a Component subclass";
  55519. }
  55520. throw new Error(`Illegal component, "${name}"; ${reason}.`);
  55521. }
  55522. name = toTitleCase$1$1(name);
  55523. if (!Component$1$1.components_) {
  55524. Component$1$1.components_ = {};
  55525. }
  55526. const Player2 = Component$1$1.getComponent("Player");
  55527. if (name === "Player" && Player2 && Player2.players) {
  55528. const players = Player2.players;
  55529. const playerNames = Object.keys(players);
  55530. if (players && playerNames.length > 0 && playerNames.map((pname) => players[pname]).every(Boolean)) {
  55531. throw new Error("Can not register Player component after player has been created.");
  55532. }
  55533. }
  55534. Component$1$1.components_[name] = ComponentToRegister;
  55535. Component$1$1.components_[toLowerCase$1(name)] = ComponentToRegister;
  55536. return ComponentToRegister;
  55537. }
  55538. static getComponent(name) {
  55539. if (!name || !Component$1$1.components_) {
  55540. return;
  55541. }
  55542. return Component$1$1.components_[name];
  55543. }
  55544. }
  55545. Component$1$1.registerComponent("Component", Component$1$1);
  55546. function rangeCheck$1(fnName, index2, maxIndex) {
  55547. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  55548. throw new Error(`Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index2}) is non-numeric or out of bounds (0-${maxIndex}).`);
  55549. }
  55550. }
  55551. function getRange$1(fnName, valueIndex, ranges, rangeIndex) {
  55552. rangeCheck$1(fnName, rangeIndex, ranges.length - 1);
  55553. return ranges[rangeIndex][valueIndex];
  55554. }
  55555. function createTimeRangesObj$1(ranges) {
  55556. let timeRangesObj;
  55557. if (ranges === void 0 || ranges.length === 0) {
  55558. timeRangesObj = {
  55559. length: 0,
  55560. start() {
  55561. throw new Error("This TimeRanges object is empty");
  55562. },
  55563. end() {
  55564. throw new Error("This TimeRanges object is empty");
  55565. }
  55566. };
  55567. } else {
  55568. timeRangesObj = {
  55569. length: ranges.length,
  55570. start: getRange$1.bind(null, "start", 0, ranges),
  55571. end: getRange$1.bind(null, "end", 1, ranges)
  55572. };
  55573. }
  55574. if (window_1.Symbol && window_1.Symbol.iterator) {
  55575. timeRangesObj[window_1.Symbol.iterator] = () => (ranges || []).values();
  55576. }
  55577. return timeRangesObj;
  55578. }
  55579. function createTimeRanges$1(start2, end) {
  55580. if (Array.isArray(start2)) {
  55581. return createTimeRangesObj$1(start2);
  55582. } else if (start2 === void 0 || end === void 0) {
  55583. return createTimeRangesObj$1();
  55584. }
  55585. return createTimeRangesObj$1([[start2, end]]);
  55586. }
  55587. const defaultImplementation$1 = function(seconds, guide) {
  55588. seconds = seconds < 0 ? 0 : seconds;
  55589. let s = Math.floor(seconds % 60);
  55590. let m = Math.floor(seconds / 60 % 60);
  55591. let h2 = Math.floor(seconds / 3600);
  55592. const gm = Math.floor(guide / 60 % 60);
  55593. const gh = Math.floor(guide / 3600);
  55594. if (isNaN(seconds) || seconds === Infinity) {
  55595. h2 = m = s = "-";
  55596. }
  55597. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  55598. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  55599. s = s < 10 ? "0" + s : s;
  55600. return h2 + m + s;
  55601. };
  55602. let implementation$1 = defaultImplementation$1;
  55603. function setFormatTime$1(customImplementation) {
  55604. implementation$1 = customImplementation;
  55605. }
  55606. function resetFormatTime$1() {
  55607. implementation$1 = defaultImplementation$1;
  55608. }
  55609. function formatTime$1(seconds, guide = seconds) {
  55610. return implementation$1(seconds, guide);
  55611. }
  55612. var Time = /* @__PURE__ */ Object.freeze({
  55613. __proto__: null,
  55614. createTimeRanges: createTimeRanges$1,
  55615. createTimeRange: createTimeRanges$1,
  55616. setFormatTime: setFormatTime$1,
  55617. resetFormatTime: resetFormatTime$1,
  55618. formatTime: formatTime$1
  55619. });
  55620. function bufferedPercent$1(buffered, duration5) {
  55621. let bufferedDuration = 0;
  55622. let start2;
  55623. let end;
  55624. if (!duration5) {
  55625. return 0;
  55626. }
  55627. if (!buffered || !buffered.length) {
  55628. buffered = createTimeRanges$1(0, 0);
  55629. }
  55630. for (let i2 = 0; i2 < buffered.length; i2++) {
  55631. start2 = buffered.start(i2);
  55632. end = buffered.end(i2);
  55633. if (end > duration5) {
  55634. end = duration5;
  55635. }
  55636. bufferedDuration += end - start2;
  55637. }
  55638. return bufferedDuration / duration5;
  55639. }
  55640. function MediaError$1(value) {
  55641. if (value instanceof MediaError$1) {
  55642. return value;
  55643. }
  55644. if (typeof value === "number") {
  55645. this.code = value;
  55646. } else if (typeof value === "string") {
  55647. this.message = value;
  55648. } else if (isObject$2(value)) {
  55649. if (typeof value.code === "number") {
  55650. this.code = value.code;
  55651. }
  55652. Object.assign(this, value);
  55653. }
  55654. if (!this.message) {
  55655. this.message = MediaError$1.defaultMessages[this.code] || "";
  55656. }
  55657. }
  55658. MediaError$1.prototype.code = 0;
  55659. MediaError$1.prototype.message = "";
  55660. MediaError$1.prototype.status = null;
  55661. MediaError$1.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  55662. MediaError$1.defaultMessages = {
  55663. 1: "You aborted the media playback",
  55664. 2: "A network error caused the media download to fail part-way.",
  55665. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  55666. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  55667. 5: "The media is encrypted and we do not have the keys to decrypt it."
  55668. };
  55669. for (let errNum = 0; errNum < MediaError$1.errorTypes.length; errNum++) {
  55670. MediaError$1[MediaError$1.errorTypes[errNum]] = errNum;
  55671. MediaError$1.prototype[MediaError$1.errorTypes[errNum]] = errNum;
  55672. }
  55673. function isPromise$1(value) {
  55674. return value !== void 0 && value !== null && typeof value.then === "function";
  55675. }
  55676. function silencePromise$1(value) {
  55677. if (isPromise$1(value)) {
  55678. value.then(null, (e) => {
  55679. });
  55680. }
  55681. }
  55682. const trackToJson_$1 = function(track) {
  55683. const ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce((acc, prop, i2) => {
  55684. if (track[prop]) {
  55685. acc[prop] = track[prop];
  55686. }
  55687. return acc;
  55688. }, {
  55689. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  55690. return {
  55691. startTime: cue.startTime,
  55692. endTime: cue.endTime,
  55693. text: cue.text,
  55694. id: cue.id
  55695. };
  55696. })
  55697. });
  55698. return ret;
  55699. };
  55700. const textTracksToJson$1 = function(tech) {
  55701. const trackEls = tech.$$("track");
  55702. const trackObjs = Array.prototype.map.call(trackEls, (t2) => t2.track);
  55703. const tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  55704. const json = trackToJson_$1(trackEl.track);
  55705. if (trackEl.src) {
  55706. json.src = trackEl.src;
  55707. }
  55708. return json;
  55709. });
  55710. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  55711. return trackObjs.indexOf(track) === -1;
  55712. }).map(trackToJson_$1));
  55713. };
  55714. const jsonToTextTracks$1 = function(json, tech) {
  55715. json.forEach(function(track) {
  55716. const addedTrack = tech.addRemoteTextTrack(track).track;
  55717. if (!track.src && track.cues) {
  55718. track.cues.forEach((cue) => addedTrack.addCue(cue));
  55719. }
  55720. });
  55721. return tech.textTracks();
  55722. };
  55723. var textTrackConverter$1 = {
  55724. textTracksToJson: textTracksToJson$1,
  55725. jsonToTextTracks: jsonToTextTracks$1,
  55726. trackToJson_: trackToJson_$1
  55727. };
  55728. const MODAL_CLASS_NAME$1 = "vjs-modal-dialog";
  55729. class ModalDialog$1 extends Component$1$1 {
  55730. constructor(player, options2) {
  55731. super(player, options2);
  55732. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  55733. this.close_ = (e) => this.close(e);
  55734. this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = false;
  55735. this.closeable(!this.options_.uncloseable);
  55736. this.content(this.options_.content);
  55737. this.contentEl_ = createEl$1("div", {
  55738. className: `${MODAL_CLASS_NAME$1}-content`
  55739. }, {
  55740. role: "document"
  55741. });
  55742. this.descEl_ = createEl$1("p", {
  55743. className: `${MODAL_CLASS_NAME$1}-description vjs-control-text`,
  55744. id: this.el().getAttribute("aria-describedby")
  55745. });
  55746. textContent$1(this.descEl_, this.description());
  55747. this.el_.appendChild(this.descEl_);
  55748. this.el_.appendChild(this.contentEl_);
  55749. }
  55750. createEl() {
  55751. return super.createEl("div", {
  55752. className: this.buildCSSClass(),
  55753. tabIndex: -1
  55754. }, {
  55755. "aria-describedby": `${this.id()}_description`,
  55756. "aria-hidden": "true",
  55757. "aria-label": this.label(),
  55758. "role": "dialog"
  55759. });
  55760. }
  55761. dispose() {
  55762. this.contentEl_ = null;
  55763. this.descEl_ = null;
  55764. this.previouslyActiveEl_ = null;
  55765. super.dispose();
  55766. }
  55767. buildCSSClass() {
  55768. return `${MODAL_CLASS_NAME$1} vjs-hidden ${super.buildCSSClass()}`;
  55769. }
  55770. label() {
  55771. return this.localize(this.options_.label || "Modal Window");
  55772. }
  55773. description() {
  55774. let desc = this.options_.description || this.localize("This is a modal window.");
  55775. if (this.closeable()) {
  55776. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  55777. }
  55778. return desc;
  55779. }
  55780. open() {
  55781. if (!this.opened_) {
  55782. const player = this.player();
  55783. this.trigger("beforemodalopen");
  55784. this.opened_ = true;
  55785. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  55786. this.fill();
  55787. }
  55788. this.wasPlaying_ = !player.paused();
  55789. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  55790. player.pause();
  55791. }
  55792. this.on("keydown", this.handleKeyDown_);
  55793. this.hadControls_ = player.controls();
  55794. player.controls(false);
  55795. this.show();
  55796. this.conditionalFocus_();
  55797. this.el().setAttribute("aria-hidden", "false");
  55798. this.trigger("modalopen");
  55799. this.hasBeenOpened_ = true;
  55800. }
  55801. }
  55802. opened(value) {
  55803. if (typeof value === "boolean") {
  55804. this[value ? "open" : "close"]();
  55805. }
  55806. return this.opened_;
  55807. }
  55808. close() {
  55809. if (!this.opened_) {
  55810. return;
  55811. }
  55812. const player = this.player();
  55813. this.trigger("beforemodalclose");
  55814. this.opened_ = false;
  55815. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  55816. player.play();
  55817. }
  55818. this.off("keydown", this.handleKeyDown_);
  55819. if (this.hadControls_) {
  55820. player.controls(true);
  55821. }
  55822. this.hide();
  55823. this.el().setAttribute("aria-hidden", "true");
  55824. this.trigger("modalclose");
  55825. this.conditionalBlur_();
  55826. if (this.options_.temporary) {
  55827. this.dispose();
  55828. }
  55829. }
  55830. closeable(value) {
  55831. if (typeof value === "boolean") {
  55832. const closeable = this.closeable_ = !!value;
  55833. let close = this.getChild("closeButton");
  55834. if (closeable && !close) {
  55835. const temp = this.contentEl_;
  55836. this.contentEl_ = this.el_;
  55837. close = this.addChild("closeButton", {
  55838. controlText: "Close Modal Dialog"
  55839. });
  55840. this.contentEl_ = temp;
  55841. this.on(close, "close", this.close_);
  55842. }
  55843. if (!closeable && close) {
  55844. this.off(close, "close", this.close_);
  55845. this.removeChild(close);
  55846. close.dispose();
  55847. }
  55848. }
  55849. return this.closeable_;
  55850. }
  55851. fill() {
  55852. this.fillWith(this.content());
  55853. }
  55854. fillWith(content) {
  55855. const contentEl = this.contentEl();
  55856. const parentEl = contentEl.parentNode;
  55857. const nextSiblingEl = contentEl.nextSibling;
  55858. this.trigger("beforemodalfill");
  55859. this.hasBeenFilled_ = true;
  55860. parentEl.removeChild(contentEl);
  55861. this.empty();
  55862. insertContent$1(contentEl, content);
  55863. this.trigger("modalfill");
  55864. if (nextSiblingEl) {
  55865. parentEl.insertBefore(contentEl, nextSiblingEl);
  55866. } else {
  55867. parentEl.appendChild(contentEl);
  55868. }
  55869. const closeButton = this.getChild("closeButton");
  55870. if (closeButton) {
  55871. parentEl.appendChild(closeButton.el_);
  55872. }
  55873. }
  55874. empty() {
  55875. this.trigger("beforemodalempty");
  55876. emptyEl$1(this.contentEl());
  55877. this.trigger("modalempty");
  55878. }
  55879. content(value) {
  55880. if (typeof value !== "undefined") {
  55881. this.content_ = value;
  55882. }
  55883. return this.content_;
  55884. }
  55885. conditionalFocus_() {
  55886. const activeEl = document_1.activeElement;
  55887. const playerEl = this.player_.el_;
  55888. this.previouslyActiveEl_ = null;
  55889. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  55890. this.previouslyActiveEl_ = activeEl;
  55891. this.focus();
  55892. }
  55893. }
  55894. conditionalBlur_() {
  55895. if (this.previouslyActiveEl_) {
  55896. this.previouslyActiveEl_.focus();
  55897. this.previouslyActiveEl_ = null;
  55898. }
  55899. }
  55900. handleKeyDown(event2) {
  55901. event2.stopPropagation();
  55902. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  55903. event2.preventDefault();
  55904. this.close();
  55905. return;
  55906. }
  55907. if (!keycode.isEventKey(event2, "Tab")) {
  55908. return;
  55909. }
  55910. const focusableEls = this.focusableEls_();
  55911. const activeEl = this.el_.querySelector(":focus");
  55912. let focusIndex;
  55913. for (let i2 = 0; i2 < focusableEls.length; i2++) {
  55914. if (activeEl === focusableEls[i2]) {
  55915. focusIndex = i2;
  55916. break;
  55917. }
  55918. }
  55919. if (document_1.activeElement === this.el_) {
  55920. focusIndex = 0;
  55921. }
  55922. if (event2.shiftKey && focusIndex === 0) {
  55923. focusableEls[focusableEls.length - 1].focus();
  55924. event2.preventDefault();
  55925. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  55926. focusableEls[0].focus();
  55927. event2.preventDefault();
  55928. }
  55929. }
  55930. focusableEls_() {
  55931. const allChildren = this.el_.querySelectorAll("*");
  55932. return Array.prototype.filter.call(allChildren, (child) => {
  55933. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  55934. });
  55935. }
  55936. }
  55937. ModalDialog$1.prototype.options_ = {
  55938. pauseOnOpen: true,
  55939. temporary: true
  55940. };
  55941. Component$1$1.registerComponent("ModalDialog", ModalDialog$1);
  55942. class TrackList$1 extends EventTarget$2$1 {
  55943. constructor(tracks = []) {
  55944. super();
  55945. this.tracks_ = [];
  55946. Object.defineProperty(this, "length", {
  55947. get() {
  55948. return this.tracks_.length;
  55949. }
  55950. });
  55951. for (let i2 = 0; i2 < tracks.length; i2++) {
  55952. this.addTrack(tracks[i2]);
  55953. }
  55954. }
  55955. addTrack(track) {
  55956. const index2 = this.tracks_.length;
  55957. if (!("" + index2 in this)) {
  55958. Object.defineProperty(this, index2, {
  55959. get() {
  55960. return this.tracks_[index2];
  55961. }
  55962. });
  55963. }
  55964. if (this.tracks_.indexOf(track) === -1) {
  55965. this.tracks_.push(track);
  55966. this.trigger({
  55967. track,
  55968. type: "addtrack",
  55969. target: this
  55970. });
  55971. }
  55972. track.labelchange_ = () => {
  55973. this.trigger({
  55974. track,
  55975. type: "labelchange",
  55976. target: this
  55977. });
  55978. };
  55979. if (isEvented$1(track)) {
  55980. track.addEventListener("labelchange", track.labelchange_);
  55981. }
  55982. }
  55983. removeTrack(rtrack) {
  55984. let track;
  55985. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  55986. if (this[i2] === rtrack) {
  55987. track = this[i2];
  55988. if (track.off) {
  55989. track.off();
  55990. }
  55991. this.tracks_.splice(i2, 1);
  55992. break;
  55993. }
  55994. }
  55995. if (!track) {
  55996. return;
  55997. }
  55998. this.trigger({
  55999. track,
  56000. type: "removetrack",
  56001. target: this
  56002. });
  56003. }
  56004. getTrackById(id) {
  56005. let result = null;
  56006. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  56007. const track = this[i2];
  56008. if (track.id === id) {
  56009. result = track;
  56010. break;
  56011. }
  56012. }
  56013. return result;
  56014. }
  56015. }
  56016. TrackList$1.prototype.allowedEvents_ = {
  56017. change: "change",
  56018. addtrack: "addtrack",
  56019. removetrack: "removetrack",
  56020. labelchange: "labelchange"
  56021. };
  56022. for (const event2 in TrackList$1.prototype.allowedEvents_) {
  56023. TrackList$1.prototype["on" + event2] = null;
  56024. }
  56025. const disableOthers$1$1 = function(list, track) {
  56026. for (let i2 = 0; i2 < list.length; i2++) {
  56027. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  56028. continue;
  56029. }
  56030. list[i2].enabled = false;
  56031. }
  56032. };
  56033. class AudioTrackList$1 extends TrackList$1 {
  56034. constructor(tracks = []) {
  56035. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  56036. if (tracks[i2].enabled) {
  56037. disableOthers$1$1(tracks, tracks[i2]);
  56038. break;
  56039. }
  56040. }
  56041. super(tracks);
  56042. this.changing_ = false;
  56043. }
  56044. addTrack(track) {
  56045. if (track.enabled) {
  56046. disableOthers$1$1(this, track);
  56047. }
  56048. super.addTrack(track);
  56049. if (!track.addEventListener) {
  56050. return;
  56051. }
  56052. track.enabledChange_ = () => {
  56053. if (this.changing_) {
  56054. return;
  56055. }
  56056. this.changing_ = true;
  56057. disableOthers$1$1(this, track);
  56058. this.changing_ = false;
  56059. this.trigger("change");
  56060. };
  56061. track.addEventListener("enabledchange", track.enabledChange_);
  56062. }
  56063. removeTrack(rtrack) {
  56064. super.removeTrack(rtrack);
  56065. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  56066. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  56067. rtrack.enabledChange_ = null;
  56068. }
  56069. }
  56070. }
  56071. const disableOthers$2 = function(list, track) {
  56072. for (let i2 = 0; i2 < list.length; i2++) {
  56073. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  56074. continue;
  56075. }
  56076. list[i2].selected = false;
  56077. }
  56078. };
  56079. class VideoTrackList$1 extends TrackList$1 {
  56080. constructor(tracks = []) {
  56081. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  56082. if (tracks[i2].selected) {
  56083. disableOthers$2(tracks, tracks[i2]);
  56084. break;
  56085. }
  56086. }
  56087. super(tracks);
  56088. this.changing_ = false;
  56089. Object.defineProperty(this, "selectedIndex", {
  56090. get() {
  56091. for (let i2 = 0; i2 < this.length; i2++) {
  56092. if (this[i2].selected) {
  56093. return i2;
  56094. }
  56095. }
  56096. return -1;
  56097. },
  56098. set() {
  56099. }
  56100. });
  56101. }
  56102. addTrack(track) {
  56103. if (track.selected) {
  56104. disableOthers$2(this, track);
  56105. }
  56106. super.addTrack(track);
  56107. if (!track.addEventListener) {
  56108. return;
  56109. }
  56110. track.selectedChange_ = () => {
  56111. if (this.changing_) {
  56112. return;
  56113. }
  56114. this.changing_ = true;
  56115. disableOthers$2(this, track);
  56116. this.changing_ = false;
  56117. this.trigger("change");
  56118. };
  56119. track.addEventListener("selectedchange", track.selectedChange_);
  56120. }
  56121. removeTrack(rtrack) {
  56122. super.removeTrack(rtrack);
  56123. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  56124. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  56125. rtrack.selectedChange_ = null;
  56126. }
  56127. }
  56128. }
  56129. class TextTrackList$1 extends TrackList$1 {
  56130. addTrack(track) {
  56131. super.addTrack(track);
  56132. if (!this.queueChange_) {
  56133. this.queueChange_ = () => this.queueTrigger("change");
  56134. }
  56135. if (!this.triggerSelectedlanguagechange) {
  56136. this.triggerSelectedlanguagechange_ = () => this.trigger("selectedlanguagechange");
  56137. }
  56138. track.addEventListener("modechange", this.queueChange_);
  56139. const nonLanguageTextTrackKind = ["metadata", "chapters"];
  56140. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  56141. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  56142. }
  56143. }
  56144. removeTrack(rtrack) {
  56145. super.removeTrack(rtrack);
  56146. if (rtrack.removeEventListener) {
  56147. if (this.queueChange_) {
  56148. rtrack.removeEventListener("modechange", this.queueChange_);
  56149. }
  56150. if (this.selectedlanguagechange_) {
  56151. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  56152. }
  56153. }
  56154. }
  56155. }
  56156. class HtmlTrackElementList$1 {
  56157. constructor(trackElements = []) {
  56158. this.trackElements_ = [];
  56159. Object.defineProperty(this, "length", {
  56160. get() {
  56161. return this.trackElements_.length;
  56162. }
  56163. });
  56164. for (let i2 = 0, length = trackElements.length; i2 < length; i2++) {
  56165. this.addTrackElement_(trackElements[i2]);
  56166. }
  56167. }
  56168. addTrackElement_(trackElement) {
  56169. const index2 = this.trackElements_.length;
  56170. if (!("" + index2 in this)) {
  56171. Object.defineProperty(this, index2, {
  56172. get() {
  56173. return this.trackElements_[index2];
  56174. }
  56175. });
  56176. }
  56177. if (this.trackElements_.indexOf(trackElement) === -1) {
  56178. this.trackElements_.push(trackElement);
  56179. }
  56180. }
  56181. getTrackElementByTrack_(track) {
  56182. let trackElement_;
  56183. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56184. if (track === this.trackElements_[i2].track) {
  56185. trackElement_ = this.trackElements_[i2];
  56186. break;
  56187. }
  56188. }
  56189. return trackElement_;
  56190. }
  56191. removeTrackElement_(trackElement) {
  56192. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56193. if (trackElement === this.trackElements_[i2]) {
  56194. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  56195. this.trackElements_[i2].track.off();
  56196. }
  56197. if (typeof this.trackElements_[i2].off === "function") {
  56198. this.trackElements_[i2].off();
  56199. }
  56200. this.trackElements_.splice(i2, 1);
  56201. break;
  56202. }
  56203. }
  56204. }
  56205. }
  56206. class TextTrackCueList$1 {
  56207. constructor(cues) {
  56208. TextTrackCueList$1.prototype.setCues_.call(this, cues);
  56209. Object.defineProperty(this, "length", {
  56210. get() {
  56211. return this.length_;
  56212. }
  56213. });
  56214. }
  56215. setCues_(cues) {
  56216. const oldLength = this.length || 0;
  56217. let i2 = 0;
  56218. const l = cues.length;
  56219. this.cues_ = cues;
  56220. this.length_ = cues.length;
  56221. const defineProp = function(index2) {
  56222. if (!("" + index2 in this)) {
  56223. Object.defineProperty(this, "" + index2, {
  56224. get() {
  56225. return this.cues_[index2];
  56226. }
  56227. });
  56228. }
  56229. };
  56230. if (oldLength < l) {
  56231. i2 = oldLength;
  56232. for (; i2 < l; i2++) {
  56233. defineProp.call(this, i2);
  56234. }
  56235. }
  56236. }
  56237. getCueById(id) {
  56238. let result = null;
  56239. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  56240. const cue = this[i2];
  56241. if (cue.id === id) {
  56242. result = cue;
  56243. break;
  56244. }
  56245. }
  56246. return result;
  56247. }
  56248. }
  56249. const VideoTrackKind$1 = {
  56250. alternative: "alternative",
  56251. captions: "captions",
  56252. main: "main",
  56253. sign: "sign",
  56254. subtitles: "subtitles",
  56255. commentary: "commentary"
  56256. };
  56257. const AudioTrackKind$1 = {
  56258. "alternative": "alternative",
  56259. "descriptions": "descriptions",
  56260. "main": "main",
  56261. "main-desc": "main-desc",
  56262. "translation": "translation",
  56263. "commentary": "commentary"
  56264. };
  56265. const TextTrackKind$1 = {
  56266. subtitles: "subtitles",
  56267. captions: "captions",
  56268. descriptions: "descriptions",
  56269. chapters: "chapters",
  56270. metadata: "metadata"
  56271. };
  56272. const TextTrackMode$1 = {
  56273. disabled: "disabled",
  56274. hidden: "hidden",
  56275. showing: "showing"
  56276. };
  56277. class Track$1 extends EventTarget$2$1 {
  56278. constructor(options2 = {}) {
  56279. super();
  56280. const trackProps = {
  56281. id: options2.id || "vjs_track_" + newGUID$1(),
  56282. kind: options2.kind || "",
  56283. language: options2.language || ""
  56284. };
  56285. let label2 = options2.label || "";
  56286. for (const key in trackProps) {
  56287. Object.defineProperty(this, key, {
  56288. get() {
  56289. return trackProps[key];
  56290. },
  56291. set() {
  56292. }
  56293. });
  56294. }
  56295. Object.defineProperty(this, "label", {
  56296. get() {
  56297. return label2;
  56298. },
  56299. set(newLabel) {
  56300. if (newLabel !== label2) {
  56301. label2 = newLabel;
  56302. this.trigger("labelchange");
  56303. }
  56304. }
  56305. });
  56306. }
  56307. }
  56308. const parseUrl$1 = function(url) {
  56309. const props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  56310. const a = document_1.createElement("a");
  56311. a.href = url;
  56312. const details = {};
  56313. for (let i2 = 0; i2 < props.length; i2++) {
  56314. details[props[i2]] = a[props[i2]];
  56315. }
  56316. if (details.protocol === "http:") {
  56317. details.host = details.host.replace(/:80$/, "");
  56318. }
  56319. if (details.protocol === "https:") {
  56320. details.host = details.host.replace(/:443$/, "");
  56321. }
  56322. if (!details.protocol) {
  56323. details.protocol = window_1.location.protocol;
  56324. }
  56325. if (!details.host) {
  56326. details.host = window_1.location.host;
  56327. }
  56328. return details;
  56329. };
  56330. const getAbsoluteURL$1 = function(url) {
  56331. if (!url.match(/^https?:\/\//)) {
  56332. const a = document_1.createElement("a");
  56333. a.href = url;
  56334. url = a.href;
  56335. }
  56336. return url;
  56337. };
  56338. const getFileExtension$1 = function(path) {
  56339. if (typeof path === "string") {
  56340. const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  56341. const pathParts = splitPathRe.exec(path);
  56342. if (pathParts) {
  56343. return pathParts.pop().toLowerCase();
  56344. }
  56345. }
  56346. return "";
  56347. };
  56348. const isCrossOrigin$1 = function(url, winLoc = window_1.location) {
  56349. const urlInfo = parseUrl$1(url);
  56350. const srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  56351. const crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  56352. return crossOrigin;
  56353. };
  56354. var Url$2 = /* @__PURE__ */ Object.freeze({
  56355. __proto__: null,
  56356. parseUrl: parseUrl$1,
  56357. getAbsoluteURL: getAbsoluteURL$1,
  56358. getFileExtension: getFileExtension$1,
  56359. isCrossOrigin: isCrossOrigin$1
  56360. });
  56361. const parseCues$1 = function(srcContent, track) {
  56362. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  56363. const errors2 = [];
  56364. parser2.oncue = function(cue) {
  56365. track.addCue(cue);
  56366. };
  56367. parser2.onparsingerror = function(error) {
  56368. errors2.push(error);
  56369. };
  56370. parser2.onflush = function() {
  56371. track.trigger({
  56372. type: "loadeddata",
  56373. target: track
  56374. });
  56375. };
  56376. parser2.parse(srcContent);
  56377. if (errors2.length > 0) {
  56378. if (window_1.console && window_1.console.groupCollapsed) {
  56379. window_1.console.groupCollapsed(`Text Track parsing errors for ${track.src}`);
  56380. }
  56381. errors2.forEach((error) => log$1$1.error(error));
  56382. if (window_1.console && window_1.console.groupEnd) {
  56383. window_1.console.groupEnd();
  56384. }
  56385. }
  56386. parser2.flush();
  56387. };
  56388. const loadTrack$1 = function(src, track) {
  56389. const opts = {
  56390. uri: src
  56391. };
  56392. const crossOrigin = isCrossOrigin$1(src);
  56393. if (crossOrigin) {
  56394. opts.cors = crossOrigin;
  56395. }
  56396. const withCredentials = track.tech_.crossOrigin() === "use-credentials";
  56397. if (withCredentials) {
  56398. opts.withCredentials = withCredentials;
  56399. }
  56400. XHR(opts, bind_(this, function(err, response, responseBody) {
  56401. if (err) {
  56402. return log$1$1.error(err, response);
  56403. }
  56404. track.loaded_ = true;
  56405. if (typeof window_1.WebVTT !== "function") {
  56406. if (track.tech_) {
  56407. track.tech_.any(["vttjsloaded", "vttjserror"], (event2) => {
  56408. if (event2.type === "vttjserror") {
  56409. log$1$1.error(`vttjs failed to load, stopping trying to process ${track.src}`);
  56410. return;
  56411. }
  56412. return parseCues$1(responseBody, track);
  56413. });
  56414. }
  56415. } else {
  56416. parseCues$1(responseBody, track);
  56417. }
  56418. }));
  56419. };
  56420. class TextTrack$1 extends Track$1 {
  56421. constructor(options2 = {}) {
  56422. if (!options2.tech) {
  56423. throw new Error("A tech was not provided.");
  56424. }
  56425. const settings = merge$1(options2, {
  56426. kind: TextTrackKind$1[options2.kind] || "subtitles",
  56427. language: options2.language || options2.srclang || ""
  56428. });
  56429. let mode = TextTrackMode$1[settings.mode] || "disabled";
  56430. const default_ = settings.default;
  56431. if (settings.kind === "metadata" || settings.kind === "chapters") {
  56432. mode = "hidden";
  56433. }
  56434. super(settings);
  56435. this.tech_ = settings.tech;
  56436. this.cues_ = [];
  56437. this.activeCues_ = [];
  56438. this.preload_ = this.tech_.preloadTextTracks !== false;
  56439. const cues = new TextTrackCueList$1(this.cues_);
  56440. const activeCues = new TextTrackCueList$1(this.activeCues_);
  56441. let changed = false;
  56442. this.timeupdateHandler = bind_(this, function(event2 = {}) {
  56443. if (this.tech_.isDisposed()) {
  56444. return;
  56445. }
  56446. if (!this.tech_.isReady_) {
  56447. if (event2.type !== "timeupdate") {
  56448. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56449. }
  56450. return;
  56451. }
  56452. this.activeCues = this.activeCues;
  56453. if (changed) {
  56454. this.trigger("cuechange");
  56455. changed = false;
  56456. }
  56457. if (event2.type !== "timeupdate") {
  56458. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56459. }
  56460. });
  56461. const disposeHandler = () => {
  56462. this.stopTracking();
  56463. };
  56464. this.tech_.one("dispose", disposeHandler);
  56465. if (mode !== "disabled") {
  56466. this.startTracking();
  56467. }
  56468. Object.defineProperties(this, {
  56469. default: {
  56470. get() {
  56471. return default_;
  56472. },
  56473. set() {
  56474. }
  56475. },
  56476. mode: {
  56477. get() {
  56478. return mode;
  56479. },
  56480. set(newMode) {
  56481. if (!TextTrackMode$1[newMode]) {
  56482. return;
  56483. }
  56484. if (mode === newMode) {
  56485. return;
  56486. }
  56487. mode = newMode;
  56488. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  56489. loadTrack$1(this.src, this);
  56490. }
  56491. this.stopTracking();
  56492. if (mode !== "disabled") {
  56493. this.startTracking();
  56494. }
  56495. this.trigger("modechange");
  56496. }
  56497. },
  56498. cues: {
  56499. get() {
  56500. if (!this.loaded_) {
  56501. return null;
  56502. }
  56503. return cues;
  56504. },
  56505. set() {
  56506. }
  56507. },
  56508. activeCues: {
  56509. get() {
  56510. if (!this.loaded_) {
  56511. return null;
  56512. }
  56513. if (this.cues.length === 0) {
  56514. return activeCues;
  56515. }
  56516. const ct2 = this.tech_.currentTime();
  56517. const active = [];
  56518. for (let i2 = 0, l = this.cues.length; i2 < l; i2++) {
  56519. const cue = this.cues[i2];
  56520. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  56521. active.push(cue);
  56522. }
  56523. }
  56524. changed = false;
  56525. if (active.length !== this.activeCues_.length) {
  56526. changed = true;
  56527. } else {
  56528. for (let i2 = 0; i2 < active.length; i2++) {
  56529. if (this.activeCues_.indexOf(active[i2]) === -1) {
  56530. changed = true;
  56531. }
  56532. }
  56533. }
  56534. this.activeCues_ = active;
  56535. activeCues.setCues_(this.activeCues_);
  56536. return activeCues;
  56537. },
  56538. set() {
  56539. }
  56540. }
  56541. });
  56542. if (settings.src) {
  56543. this.src = settings.src;
  56544. if (!this.preload_) {
  56545. this.loaded_ = true;
  56546. }
  56547. if (this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  56548. loadTrack$1(this.src, this);
  56549. }
  56550. } else {
  56551. this.loaded_ = true;
  56552. }
  56553. }
  56554. startTracking() {
  56555. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56556. this.tech_.on("timeupdate", this.timeupdateHandler);
  56557. }
  56558. stopTracking() {
  56559. if (this.rvf_) {
  56560. this.tech_.cancelVideoFrameCallback(this.rvf_);
  56561. this.rvf_ = void 0;
  56562. }
  56563. this.tech_.off("timeupdate", this.timeupdateHandler);
  56564. }
  56565. addCue(originalCue) {
  56566. let cue = originalCue;
  56567. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  56568. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  56569. for (const prop in originalCue) {
  56570. if (!(prop in cue)) {
  56571. cue[prop] = originalCue[prop];
  56572. }
  56573. }
  56574. cue.id = originalCue.id;
  56575. cue.originalCue_ = originalCue;
  56576. }
  56577. const tracks = this.tech_.textTracks();
  56578. for (let i2 = 0; i2 < tracks.length; i2++) {
  56579. if (tracks[i2] !== this) {
  56580. tracks[i2].removeCue(cue);
  56581. }
  56582. }
  56583. this.cues_.push(cue);
  56584. this.cues.setCues_(this.cues_);
  56585. }
  56586. removeCue(removeCue) {
  56587. let i2 = this.cues_.length;
  56588. while (i2--) {
  56589. const cue = this.cues_[i2];
  56590. if (cue === removeCue || cue.originalCue_ && cue.originalCue_ === removeCue) {
  56591. this.cues_.splice(i2, 1);
  56592. this.cues.setCues_(this.cues_);
  56593. break;
  56594. }
  56595. }
  56596. }
  56597. }
  56598. TextTrack$1.prototype.allowedEvents_ = {
  56599. cuechange: "cuechange"
  56600. };
  56601. class AudioTrack$1 extends Track$1 {
  56602. constructor(options2 = {}) {
  56603. const settings = merge$1(options2, {
  56604. kind: AudioTrackKind$1[options2.kind] || ""
  56605. });
  56606. super(settings);
  56607. let enabled = false;
  56608. Object.defineProperty(this, "enabled", {
  56609. get() {
  56610. return enabled;
  56611. },
  56612. set(newEnabled) {
  56613. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  56614. return;
  56615. }
  56616. enabled = newEnabled;
  56617. this.trigger("enabledchange");
  56618. }
  56619. });
  56620. if (settings.enabled) {
  56621. this.enabled = settings.enabled;
  56622. }
  56623. this.loaded_ = true;
  56624. }
  56625. }
  56626. class VideoTrack$1 extends Track$1 {
  56627. constructor(options2 = {}) {
  56628. const settings = merge$1(options2, {
  56629. kind: VideoTrackKind$1[options2.kind] || ""
  56630. });
  56631. super(settings);
  56632. let selected = false;
  56633. Object.defineProperty(this, "selected", {
  56634. get() {
  56635. return selected;
  56636. },
  56637. set(newSelected) {
  56638. if (typeof newSelected !== "boolean" || newSelected === selected) {
  56639. return;
  56640. }
  56641. selected = newSelected;
  56642. this.trigger("selectedchange");
  56643. }
  56644. });
  56645. if (settings.selected) {
  56646. this.selected = settings.selected;
  56647. }
  56648. }
  56649. }
  56650. class HTMLTrackElement$1 extends EventTarget$2$1 {
  56651. constructor(options2 = {}) {
  56652. super();
  56653. let readyState;
  56654. const track = new TextTrack$1(options2);
  56655. this.kind = track.kind;
  56656. this.src = track.src;
  56657. this.srclang = track.language;
  56658. this.label = track.label;
  56659. this.default = track.default;
  56660. Object.defineProperties(this, {
  56661. readyState: {
  56662. get() {
  56663. return readyState;
  56664. }
  56665. },
  56666. track: {
  56667. get() {
  56668. return track;
  56669. }
  56670. }
  56671. });
  56672. readyState = HTMLTrackElement$1.NONE;
  56673. track.addEventListener("loadeddata", () => {
  56674. readyState = HTMLTrackElement$1.LOADED;
  56675. this.trigger({
  56676. type: "load",
  56677. target: this
  56678. });
  56679. });
  56680. }
  56681. }
  56682. HTMLTrackElement$1.prototype.allowedEvents_ = {
  56683. load: "load"
  56684. };
  56685. HTMLTrackElement$1.NONE = 0;
  56686. HTMLTrackElement$1.LOADING = 1;
  56687. HTMLTrackElement$1.LOADED = 2;
  56688. HTMLTrackElement$1.ERROR = 3;
  56689. const NORMAL$1 = {
  56690. audio: {
  56691. ListClass: AudioTrackList$1,
  56692. TrackClass: AudioTrack$1,
  56693. capitalName: "Audio"
  56694. },
  56695. video: {
  56696. ListClass: VideoTrackList$1,
  56697. TrackClass: VideoTrack$1,
  56698. capitalName: "Video"
  56699. },
  56700. text: {
  56701. ListClass: TextTrackList$1,
  56702. TrackClass: TextTrack$1,
  56703. capitalName: "Text"
  56704. }
  56705. };
  56706. Object.keys(NORMAL$1).forEach(function(type2) {
  56707. NORMAL$1[type2].getterName = `${type2}Tracks`;
  56708. NORMAL$1[type2].privateName = `${type2}Tracks_`;
  56709. });
  56710. const REMOTE$1 = {
  56711. remoteText: {
  56712. ListClass: TextTrackList$1,
  56713. TrackClass: TextTrack$1,
  56714. capitalName: "RemoteText",
  56715. getterName: "remoteTextTracks",
  56716. privateName: "remoteTextTracks_"
  56717. },
  56718. remoteTextEl: {
  56719. ListClass: HtmlTrackElementList$1,
  56720. TrackClass: HTMLTrackElement$1,
  56721. capitalName: "RemoteTextTrackEls",
  56722. getterName: "remoteTextTrackEls",
  56723. privateName: "remoteTextTrackEls_"
  56724. }
  56725. };
  56726. const ALL$1 = Object.assign({}, NORMAL$1, REMOTE$1);
  56727. REMOTE$1.names = Object.keys(REMOTE$1);
  56728. NORMAL$1.names = Object.keys(NORMAL$1);
  56729. ALL$1.names = [].concat(REMOTE$1.names).concat(NORMAL$1.names);
  56730. function createTrackHelper$1(self2, kind, label2, language, options2 = {}) {
  56731. const tracks = self2.textTracks();
  56732. options2.kind = kind;
  56733. if (label2) {
  56734. options2.label = label2;
  56735. }
  56736. if (language) {
  56737. options2.language = language;
  56738. }
  56739. options2.tech = self2;
  56740. const track = new ALL$1.text.TrackClass(options2);
  56741. tracks.addTrack(track);
  56742. return track;
  56743. }
  56744. class Tech$2 extends Component$1$1 {
  56745. constructor(options2 = {}, ready = function() {
  56746. }) {
  56747. options2.reportTouchActivity = false;
  56748. super(null, options2, ready);
  56749. this.onDurationChange_ = (e) => this.onDurationChange(e);
  56750. this.trackProgress_ = (e) => this.trackProgress(e);
  56751. this.trackCurrentTime_ = (e) => this.trackCurrentTime(e);
  56752. this.stopTrackingCurrentTime_ = (e) => this.stopTrackingCurrentTime(e);
  56753. this.disposeSourceHandler_ = (e) => this.disposeSourceHandler(e);
  56754. this.queuedHanders_ = /* @__PURE__ */ new Set();
  56755. this.hasStarted_ = false;
  56756. this.on("playing", function() {
  56757. this.hasStarted_ = true;
  56758. });
  56759. this.on("loadstart", function() {
  56760. this.hasStarted_ = false;
  56761. });
  56762. ALL$1.names.forEach((name) => {
  56763. const props = ALL$1[name];
  56764. if (options2 && options2[props.getterName]) {
  56765. this[props.privateName] = options2[props.getterName];
  56766. }
  56767. });
  56768. if (!this.featuresProgressEvents) {
  56769. this.manualProgressOn();
  56770. }
  56771. if (!this.featuresTimeupdateEvents) {
  56772. this.manualTimeUpdatesOn();
  56773. }
  56774. ["Text", "Audio", "Video"].forEach((track) => {
  56775. if (options2[`native${track}Tracks`] === false) {
  56776. this[`featuresNative${track}Tracks`] = false;
  56777. }
  56778. });
  56779. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  56780. this.featuresNativeTextTracks = false;
  56781. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  56782. this.featuresNativeTextTracks = true;
  56783. }
  56784. if (!this.featuresNativeTextTracks) {
  56785. this.emulateTextTracks();
  56786. }
  56787. this.preloadTextTracks = options2.preloadTextTracks !== false;
  56788. this.autoRemoteTextTracks_ = new ALL$1.text.ListClass();
  56789. this.initTrackListeners();
  56790. if (!options2.nativeControlsForTouch) {
  56791. this.emitTapEvents();
  56792. }
  56793. if (this.constructor) {
  56794. this.name_ = this.constructor.name || "Unknown Tech";
  56795. }
  56796. }
  56797. triggerSourceset(src) {
  56798. if (!this.isReady_) {
  56799. this.one("ready", () => this.setTimeout(() => this.triggerSourceset(src), 1));
  56800. }
  56801. this.trigger({
  56802. src,
  56803. type: "sourceset"
  56804. });
  56805. }
  56806. manualProgressOn() {
  56807. this.on("durationchange", this.onDurationChange_);
  56808. this.manualProgress = true;
  56809. this.one("ready", this.trackProgress_);
  56810. }
  56811. manualProgressOff() {
  56812. this.manualProgress = false;
  56813. this.stopTrackingProgress();
  56814. this.off("durationchange", this.onDurationChange_);
  56815. }
  56816. trackProgress(event2) {
  56817. this.stopTrackingProgress();
  56818. this.progressInterval = this.setInterval(bind_(this, function() {
  56819. const numBufferedPercent = this.bufferedPercent();
  56820. if (this.bufferedPercent_ !== numBufferedPercent) {
  56821. this.trigger("progress");
  56822. }
  56823. this.bufferedPercent_ = numBufferedPercent;
  56824. if (numBufferedPercent === 1) {
  56825. this.stopTrackingProgress();
  56826. }
  56827. }), 500);
  56828. }
  56829. onDurationChange(event2) {
  56830. this.duration_ = this.duration();
  56831. }
  56832. buffered() {
  56833. return createTimeRanges$1(0, 0);
  56834. }
  56835. bufferedPercent() {
  56836. return bufferedPercent$1(this.buffered(), this.duration_);
  56837. }
  56838. stopTrackingProgress() {
  56839. this.clearInterval(this.progressInterval);
  56840. }
  56841. manualTimeUpdatesOn() {
  56842. this.manualTimeUpdates = true;
  56843. this.on("play", this.trackCurrentTime_);
  56844. this.on("pause", this.stopTrackingCurrentTime_);
  56845. }
  56846. manualTimeUpdatesOff() {
  56847. this.manualTimeUpdates = false;
  56848. this.stopTrackingCurrentTime();
  56849. this.off("play", this.trackCurrentTime_);
  56850. this.off("pause", this.stopTrackingCurrentTime_);
  56851. }
  56852. trackCurrentTime() {
  56853. if (this.currentTimeInterval) {
  56854. this.stopTrackingCurrentTime();
  56855. }
  56856. this.currentTimeInterval = this.setInterval(function() {
  56857. this.trigger({
  56858. type: "timeupdate",
  56859. target: this,
  56860. manuallyTriggered: true
  56861. });
  56862. }, 250);
  56863. }
  56864. stopTrackingCurrentTime() {
  56865. this.clearInterval(this.currentTimeInterval);
  56866. this.trigger({
  56867. type: "timeupdate",
  56868. target: this,
  56869. manuallyTriggered: true
  56870. });
  56871. }
  56872. dispose() {
  56873. this.clearTracks(NORMAL$1.names);
  56874. if (this.manualProgress) {
  56875. this.manualProgressOff();
  56876. }
  56877. if (this.manualTimeUpdates) {
  56878. this.manualTimeUpdatesOff();
  56879. }
  56880. super.dispose();
  56881. }
  56882. clearTracks(types) {
  56883. types = [].concat(types);
  56884. types.forEach((type2) => {
  56885. const list = this[`${type2}Tracks`]() || [];
  56886. let i2 = list.length;
  56887. while (i2--) {
  56888. const track = list[i2];
  56889. if (type2 === "text") {
  56890. this.removeRemoteTextTrack(track);
  56891. }
  56892. list.removeTrack(track);
  56893. }
  56894. });
  56895. }
  56896. cleanupAutoTextTracks() {
  56897. const list = this.autoRemoteTextTracks_ || [];
  56898. let i2 = list.length;
  56899. while (i2--) {
  56900. const track = list[i2];
  56901. this.removeRemoteTextTrack(track);
  56902. }
  56903. }
  56904. reset() {
  56905. }
  56906. crossOrigin() {
  56907. }
  56908. setCrossOrigin() {
  56909. }
  56910. error(err) {
  56911. if (err !== void 0) {
  56912. this.error_ = new MediaError$1(err);
  56913. this.trigger("error");
  56914. }
  56915. return this.error_;
  56916. }
  56917. played() {
  56918. if (this.hasStarted_) {
  56919. return createTimeRanges$1(0, 0);
  56920. }
  56921. return createTimeRanges$1();
  56922. }
  56923. play() {
  56924. }
  56925. setScrubbing(_isScrubbing) {
  56926. }
  56927. scrubbing() {
  56928. }
  56929. setCurrentTime(_seconds) {
  56930. if (this.manualTimeUpdates) {
  56931. this.trigger({
  56932. type: "timeupdate",
  56933. target: this,
  56934. manuallyTriggered: true
  56935. });
  56936. }
  56937. }
  56938. initTrackListeners() {
  56939. NORMAL$1.names.forEach((name) => {
  56940. const props = NORMAL$1[name];
  56941. const trackListChanges = () => {
  56942. this.trigger(`${name}trackchange`);
  56943. };
  56944. const tracks = this[props.getterName]();
  56945. tracks.addEventListener("removetrack", trackListChanges);
  56946. tracks.addEventListener("addtrack", trackListChanges);
  56947. this.on("dispose", () => {
  56948. tracks.removeEventListener("removetrack", trackListChanges);
  56949. tracks.removeEventListener("addtrack", trackListChanges);
  56950. });
  56951. });
  56952. }
  56953. addWebVttScript_() {
  56954. if (window_1.WebVTT) {
  56955. return;
  56956. }
  56957. if (document_1.body.contains(this.el())) {
  56958. if (!this.options_["vtt.js"] && isPlain$1(vtt) && Object.keys(vtt).length > 0) {
  56959. this.trigger("vttjsloaded");
  56960. return;
  56961. }
  56962. const script = document_1.createElement("script");
  56963. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  56964. script.onload = () => {
  56965. this.trigger("vttjsloaded");
  56966. };
  56967. script.onerror = () => {
  56968. this.trigger("vttjserror");
  56969. };
  56970. this.on("dispose", () => {
  56971. script.onload = null;
  56972. script.onerror = null;
  56973. });
  56974. window_1.WebVTT = true;
  56975. this.el().parentNode.appendChild(script);
  56976. } else {
  56977. this.ready(this.addWebVttScript_);
  56978. }
  56979. }
  56980. emulateTextTracks() {
  56981. const tracks = this.textTracks();
  56982. const remoteTracks = this.remoteTextTracks();
  56983. const handleAddTrack = (e) => tracks.addTrack(e.track);
  56984. const handleRemoveTrack = (e) => tracks.removeTrack(e.track);
  56985. remoteTracks.on("addtrack", handleAddTrack);
  56986. remoteTracks.on("removetrack", handleRemoveTrack);
  56987. this.addWebVttScript_();
  56988. const updateDisplay = () => this.trigger("texttrackchange");
  56989. const textTracksChanges = () => {
  56990. updateDisplay();
  56991. for (let i2 = 0; i2 < tracks.length; i2++) {
  56992. const track = tracks[i2];
  56993. track.removeEventListener("cuechange", updateDisplay);
  56994. if (track.mode === "showing") {
  56995. track.addEventListener("cuechange", updateDisplay);
  56996. }
  56997. }
  56998. };
  56999. textTracksChanges();
  57000. tracks.addEventListener("change", textTracksChanges);
  57001. tracks.addEventListener("addtrack", textTracksChanges);
  57002. tracks.addEventListener("removetrack", textTracksChanges);
  57003. this.on("dispose", function() {
  57004. remoteTracks.off("addtrack", handleAddTrack);
  57005. remoteTracks.off("removetrack", handleRemoveTrack);
  57006. tracks.removeEventListener("change", textTracksChanges);
  57007. tracks.removeEventListener("addtrack", textTracksChanges);
  57008. tracks.removeEventListener("removetrack", textTracksChanges);
  57009. for (let i2 = 0; i2 < tracks.length; i2++) {
  57010. const track = tracks[i2];
  57011. track.removeEventListener("cuechange", updateDisplay);
  57012. }
  57013. });
  57014. }
  57015. addTextTrack(kind, label2, language) {
  57016. if (!kind) {
  57017. throw new Error("TextTrack kind is required but was not provided");
  57018. }
  57019. return createTrackHelper$1(this, kind, label2, language);
  57020. }
  57021. createRemoteTextTrack(options2) {
  57022. const track = merge$1(options2, {
  57023. tech: this
  57024. });
  57025. return new REMOTE$1.remoteTextEl.TrackClass(track);
  57026. }
  57027. addRemoteTextTrack(options2 = {}, manualCleanup) {
  57028. const htmlTrackElement = this.createRemoteTextTrack(options2);
  57029. if (typeof manualCleanup !== "boolean") {
  57030. manualCleanup = false;
  57031. }
  57032. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  57033. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  57034. if (manualCleanup === false) {
  57035. this.ready(() => this.autoRemoteTextTracks_.addTrack(htmlTrackElement.track));
  57036. }
  57037. return htmlTrackElement;
  57038. }
  57039. removeRemoteTextTrack(track) {
  57040. const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  57041. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  57042. this.remoteTextTracks().removeTrack(track);
  57043. this.autoRemoteTextTracks_.removeTrack(track);
  57044. }
  57045. getVideoPlaybackQuality() {
  57046. return {};
  57047. }
  57048. requestPictureInPicture() {
  57049. return Promise.reject();
  57050. }
  57051. disablePictureInPicture() {
  57052. return true;
  57053. }
  57054. setDisablePictureInPicture() {
  57055. }
  57056. requestVideoFrameCallback(cb) {
  57057. const id = newGUID$1();
  57058. if (!this.isReady_ || this.paused()) {
  57059. this.queuedHanders_.add(id);
  57060. this.one("playing", () => {
  57061. if (this.queuedHanders_.has(id)) {
  57062. this.queuedHanders_.delete(id);
  57063. cb();
  57064. }
  57065. });
  57066. } else {
  57067. this.requestNamedAnimationFrame(id, cb);
  57068. }
  57069. return id;
  57070. }
  57071. cancelVideoFrameCallback(id) {
  57072. if (this.queuedHanders_.has(id)) {
  57073. this.queuedHanders_.delete(id);
  57074. } else {
  57075. this.cancelNamedAnimationFrame(id);
  57076. }
  57077. }
  57078. setPoster() {
  57079. }
  57080. playsinline() {
  57081. }
  57082. setPlaysinline() {
  57083. }
  57084. overrideNativeAudioTracks(override) {
  57085. }
  57086. overrideNativeVideoTracks(override) {
  57087. }
  57088. canPlayType(_type) {
  57089. return "";
  57090. }
  57091. static canPlayType(_type) {
  57092. return "";
  57093. }
  57094. static canPlaySource(srcObj, options2) {
  57095. return Tech$2.canPlayType(srcObj.type);
  57096. }
  57097. static isTech(component) {
  57098. return component.prototype instanceof Tech$2 || component instanceof Tech$2 || component === Tech$2;
  57099. }
  57100. static registerTech(name, tech) {
  57101. if (!Tech$2.techs_) {
  57102. Tech$2.techs_ = {};
  57103. }
  57104. if (!Tech$2.isTech(tech)) {
  57105. throw new Error(`Tech ${name} must be a Tech`);
  57106. }
  57107. if (!Tech$2.canPlayType) {
  57108. throw new Error("Techs must have a static canPlayType method on them");
  57109. }
  57110. if (!Tech$2.canPlaySource) {
  57111. throw new Error("Techs must have a static canPlaySource method on them");
  57112. }
  57113. name = toTitleCase$1$1(name);
  57114. Tech$2.techs_[name] = tech;
  57115. Tech$2.techs_[toLowerCase$1(name)] = tech;
  57116. if (name !== "Tech") {
  57117. Tech$2.defaultTechOrder_.push(name);
  57118. }
  57119. return tech;
  57120. }
  57121. static getTech(name) {
  57122. if (!name) {
  57123. return;
  57124. }
  57125. if (Tech$2.techs_ && Tech$2.techs_[name]) {
  57126. return Tech$2.techs_[name];
  57127. }
  57128. name = toTitleCase$1$1(name);
  57129. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  57130. log$1$1.warn(`The ${name} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);
  57131. return window_1.videojs[name];
  57132. }
  57133. }
  57134. }
  57135. ALL$1.names.forEach(function(name) {
  57136. const props = ALL$1[name];
  57137. Tech$2.prototype[props.getterName] = function() {
  57138. this[props.privateName] = this[props.privateName] || new props.ListClass();
  57139. return this[props.privateName];
  57140. };
  57141. });
  57142. Tech$2.prototype.featuresVolumeControl = true;
  57143. Tech$2.prototype.featuresMuteControl = true;
  57144. Tech$2.prototype.featuresFullscreenResize = false;
  57145. Tech$2.prototype.featuresPlaybackRate = false;
  57146. Tech$2.prototype.featuresProgressEvents = false;
  57147. Tech$2.prototype.featuresSourceset = false;
  57148. Tech$2.prototype.featuresTimeupdateEvents = false;
  57149. Tech$2.prototype.featuresNativeTextTracks = false;
  57150. Tech$2.prototype.featuresVideoFrameCallback = false;
  57151. Tech$2.withSourceHandlers = function(_Tech) {
  57152. _Tech.registerSourceHandler = function(handler, index2) {
  57153. let handlers = _Tech.sourceHandlers;
  57154. if (!handlers) {
  57155. handlers = _Tech.sourceHandlers = [];
  57156. }
  57157. if (index2 === void 0) {
  57158. index2 = handlers.length;
  57159. }
  57160. handlers.splice(index2, 0, handler);
  57161. };
  57162. _Tech.canPlayType = function(type2) {
  57163. const handlers = _Tech.sourceHandlers || [];
  57164. let can;
  57165. for (let i2 = 0; i2 < handlers.length; i2++) {
  57166. can = handlers[i2].canPlayType(type2);
  57167. if (can) {
  57168. return can;
  57169. }
  57170. }
  57171. return "";
  57172. };
  57173. _Tech.selectSourceHandler = function(source, options2) {
  57174. const handlers = _Tech.sourceHandlers || [];
  57175. let can;
  57176. for (let i2 = 0; i2 < handlers.length; i2++) {
  57177. can = handlers[i2].canHandleSource(source, options2);
  57178. if (can) {
  57179. return handlers[i2];
  57180. }
  57181. }
  57182. return null;
  57183. };
  57184. _Tech.canPlaySource = function(srcObj, options2) {
  57185. const sh = _Tech.selectSourceHandler(srcObj, options2);
  57186. if (sh) {
  57187. return sh.canHandleSource(srcObj, options2);
  57188. }
  57189. return "";
  57190. };
  57191. const deferrable = ["seekable", "seeking", "duration"];
  57192. deferrable.forEach(function(fnName) {
  57193. const originalFn = this[fnName];
  57194. if (typeof originalFn !== "function") {
  57195. return;
  57196. }
  57197. this[fnName] = function() {
  57198. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  57199. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  57200. }
  57201. return originalFn.apply(this, arguments);
  57202. };
  57203. }, _Tech.prototype);
  57204. _Tech.prototype.setSource = function(source) {
  57205. let sh = _Tech.selectSourceHandler(source, this.options_);
  57206. if (!sh) {
  57207. if (_Tech.nativeSourceHandler) {
  57208. sh = _Tech.nativeSourceHandler;
  57209. } else {
  57210. log$1$1.error("No source handler found for the current source.");
  57211. }
  57212. }
  57213. this.disposeSourceHandler();
  57214. this.off("dispose", this.disposeSourceHandler_);
  57215. if (sh !== _Tech.nativeSourceHandler) {
  57216. this.currentSource_ = source;
  57217. }
  57218. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  57219. this.one("dispose", this.disposeSourceHandler_);
  57220. };
  57221. _Tech.prototype.disposeSourceHandler = function() {
  57222. if (this.currentSource_) {
  57223. this.clearTracks(["audio", "video"]);
  57224. this.currentSource_ = null;
  57225. }
  57226. this.cleanupAutoTextTracks();
  57227. if (this.sourceHandler_) {
  57228. if (this.sourceHandler_.dispose) {
  57229. this.sourceHandler_.dispose();
  57230. }
  57231. this.sourceHandler_ = null;
  57232. }
  57233. };
  57234. };
  57235. Component$1$1.registerComponent("Tech", Tech$2);
  57236. Tech$2.registerTech("Tech", Tech$2);
  57237. Tech$2.defaultTechOrder_ = [];
  57238. const middlewares$1 = {};
  57239. const middlewareInstances$1 = {};
  57240. const TERMINATOR$1 = {};
  57241. function use$1(type2, middleware) {
  57242. middlewares$1[type2] = middlewares$1[type2] || [];
  57243. middlewares$1[type2].push(middleware);
  57244. }
  57245. function setSource$1(player, src, next) {
  57246. player.setTimeout(() => setSourceHelper$1(src, middlewares$1[src.type], next, player), 1);
  57247. }
  57248. function setTech$1(middleware, tech) {
  57249. middleware.forEach((mw) => mw.setTech && mw.setTech(tech));
  57250. }
  57251. function get$1(middleware, tech, method) {
  57252. return middleware.reduceRight(middlewareIterator$1(method), tech[method]());
  57253. }
  57254. function set$1(middleware, tech, method, arg) {
  57255. return tech[method](middleware.reduce(middlewareIterator$1(method), arg));
  57256. }
  57257. function mediate$1(middleware, tech, method, arg = null) {
  57258. const callMethod = "call" + toTitleCase$1$1(method);
  57259. const middlewareValue = middleware.reduce(middlewareIterator$1(callMethod), arg);
  57260. const terminated = middlewareValue === TERMINATOR$1;
  57261. const returnValue = terminated ? null : tech[method](middlewareValue);
  57262. executeRight$1(middleware, method, returnValue, terminated);
  57263. return returnValue;
  57264. }
  57265. const allowedGetters$1 = {
  57266. buffered: 1,
  57267. currentTime: 1,
  57268. duration: 1,
  57269. muted: 1,
  57270. played: 1,
  57271. paused: 1,
  57272. seekable: 1,
  57273. volume: 1,
  57274. ended: 1
  57275. };
  57276. const allowedSetters$1 = {
  57277. setCurrentTime: 1,
  57278. setMuted: 1,
  57279. setVolume: 1
  57280. };
  57281. const allowedMediators$1 = {
  57282. play: 1,
  57283. pause: 1
  57284. };
  57285. function middlewareIterator$1(method) {
  57286. return (value, mw) => {
  57287. if (value === TERMINATOR$1) {
  57288. return TERMINATOR$1;
  57289. }
  57290. if (mw[method]) {
  57291. return mw[method](value);
  57292. }
  57293. return value;
  57294. };
  57295. }
  57296. function executeRight$1(mws, method, value, terminated) {
  57297. for (let i2 = mws.length - 1; i2 >= 0; i2--) {
  57298. const mw = mws[i2];
  57299. if (mw[method]) {
  57300. mw[method](terminated, value);
  57301. }
  57302. }
  57303. }
  57304. function clearCacheForPlayer$1(player) {
  57305. middlewareInstances$1[player.id()] = null;
  57306. }
  57307. function getOrCreateFactory$1(player, mwFactory) {
  57308. const mws = middlewareInstances$1[player.id()];
  57309. let mw = null;
  57310. if (mws === void 0 || mws === null) {
  57311. mw = mwFactory(player);
  57312. middlewareInstances$1[player.id()] = [[mwFactory, mw]];
  57313. return mw;
  57314. }
  57315. for (let i2 = 0; i2 < mws.length; i2++) {
  57316. const [mwf, mwi] = mws[i2];
  57317. if (mwf !== mwFactory) {
  57318. continue;
  57319. }
  57320. mw = mwi;
  57321. }
  57322. if (mw === null) {
  57323. mw = mwFactory(player);
  57324. mws.push([mwFactory, mw]);
  57325. }
  57326. return mw;
  57327. }
  57328. function setSourceHelper$1(src = {}, middleware = [], next, player, acc = [], lastRun = false) {
  57329. const [mwFactory, ...mwrest] = middleware;
  57330. if (typeof mwFactory === "string") {
  57331. setSourceHelper$1(src, middlewares$1[mwFactory], next, player, acc, lastRun);
  57332. } else if (mwFactory) {
  57333. const mw = getOrCreateFactory$1(player, mwFactory);
  57334. if (!mw.setSource) {
  57335. acc.push(mw);
  57336. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57337. }
  57338. mw.setSource(Object.assign({}, src), function(err, _src) {
  57339. if (err) {
  57340. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57341. }
  57342. acc.push(mw);
  57343. setSourceHelper$1(_src, src.type === _src.type ? mwrest : middlewares$1[_src.type], next, player, acc, lastRun);
  57344. });
  57345. } else if (mwrest.length) {
  57346. setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57347. } else if (lastRun) {
  57348. next(src, acc);
  57349. } else {
  57350. setSourceHelper$1(src, middlewares$1["*"], next, player, acc, true);
  57351. }
  57352. }
  57353. const MimetypesKind$1 = {
  57354. opus: "video/ogg",
  57355. ogv: "video/ogg",
  57356. mp4: "video/mp4",
  57357. mov: "video/mp4",
  57358. m4v: "video/mp4",
  57359. mkv: "video/x-matroska",
  57360. m4a: "audio/mp4",
  57361. mp3: "audio/mpeg",
  57362. aac: "audio/aac",
  57363. caf: "audio/x-caf",
  57364. flac: "audio/flac",
  57365. oga: "audio/ogg",
  57366. wav: "audio/wav",
  57367. m3u8: "application/x-mpegURL",
  57368. mpd: "application/dash+xml",
  57369. jpg: "image/jpeg",
  57370. jpeg: "image/jpeg",
  57371. gif: "image/gif",
  57372. png: "image/png",
  57373. svg: "image/svg+xml",
  57374. webp: "image/webp"
  57375. };
  57376. const getMimetype$1 = function(src = "") {
  57377. const ext = getFileExtension$1(src);
  57378. const mimetype = MimetypesKind$1[ext.toLowerCase()];
  57379. return mimetype || "";
  57380. };
  57381. const findMimetype$1 = (player, src) => {
  57382. if (!src) {
  57383. return "";
  57384. }
  57385. if (player.cache_.source.src === src && player.cache_.source.type) {
  57386. return player.cache_.source.type;
  57387. }
  57388. const matchingSources = player.cache_.sources.filter((s) => s.src === src);
  57389. if (matchingSources.length) {
  57390. return matchingSources[0].type;
  57391. }
  57392. const sources = player.$$("source");
  57393. for (let i2 = 0; i2 < sources.length; i2++) {
  57394. const s = sources[i2];
  57395. if (s.type && s.src && s.src === src) {
  57396. return s.type;
  57397. }
  57398. }
  57399. return getMimetype$1(src);
  57400. };
  57401. const filterSource$1 = function(src) {
  57402. if (Array.isArray(src)) {
  57403. let newsrc = [];
  57404. src.forEach(function(srcobj) {
  57405. srcobj = filterSource$1(srcobj);
  57406. if (Array.isArray(srcobj)) {
  57407. newsrc = newsrc.concat(srcobj);
  57408. } else if (isObject$2(srcobj)) {
  57409. newsrc.push(srcobj);
  57410. }
  57411. });
  57412. src = newsrc;
  57413. } else if (typeof src === "string" && src.trim()) {
  57414. src = [fixSource$1({
  57415. src
  57416. })];
  57417. } else if (isObject$2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  57418. src = [fixSource$1(src)];
  57419. } else {
  57420. src = [];
  57421. }
  57422. return src;
  57423. };
  57424. function fixSource$1(src) {
  57425. if (!src.type) {
  57426. const mimetype = getMimetype$1(src.src);
  57427. if (mimetype) {
  57428. src.type = mimetype;
  57429. }
  57430. }
  57431. return src;
  57432. }
  57433. class MediaLoader$1 extends Component$1$1 {
  57434. constructor(player, options2, ready) {
  57435. const options_ = merge$1({
  57436. createEl: false
  57437. }, options2);
  57438. super(player, options_, ready);
  57439. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  57440. for (let i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  57441. const techName = toTitleCase$1$1(j[i2]);
  57442. let tech = Tech$2.getTech(techName);
  57443. if (!techName) {
  57444. tech = Component$1$1.getComponent(techName);
  57445. }
  57446. if (tech && tech.isSupported()) {
  57447. player.loadTech_(techName);
  57448. break;
  57449. }
  57450. }
  57451. } else {
  57452. player.src(options2.playerOptions.sources);
  57453. }
  57454. }
  57455. }
  57456. Component$1$1.registerComponent("MediaLoader", MediaLoader$1);
  57457. class ClickableComponent$1 extends Component$1$1 {
  57458. constructor(player, options2) {
  57459. super(player, options2);
  57460. if (this.options_.controlText) {
  57461. this.controlText(this.options_.controlText);
  57462. }
  57463. this.handleMouseOver_ = (e) => this.handleMouseOver(e);
  57464. this.handleMouseOut_ = (e) => this.handleMouseOut(e);
  57465. this.handleClick_ = (e) => this.handleClick(e);
  57466. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  57467. this.emitTapEvents();
  57468. this.enable();
  57469. }
  57470. createEl(tag = "div", props = {}, attributes = {}) {
  57471. props = Object.assign({
  57472. className: this.buildCSSClass(),
  57473. tabIndex: 0
  57474. }, props);
  57475. if (tag === "button") {
  57476. log$1$1.error(`Creating a ClickableComponent with an HTML element of ${tag} is not supported; use a Button instead.`);
  57477. }
  57478. attributes = Object.assign({
  57479. role: "button"
  57480. }, attributes);
  57481. this.tabIndex_ = props.tabIndex;
  57482. const el = createEl$1(tag, props, attributes);
  57483. el.appendChild(createEl$1("span", {
  57484. className: "vjs-icon-placeholder"
  57485. }, {
  57486. "aria-hidden": true
  57487. }));
  57488. this.createControlTextEl(el);
  57489. return el;
  57490. }
  57491. dispose() {
  57492. this.controlTextEl_ = null;
  57493. super.dispose();
  57494. }
  57495. createControlTextEl(el) {
  57496. this.controlTextEl_ = createEl$1("span", {
  57497. className: "vjs-control-text"
  57498. }, {
  57499. "aria-live": "polite"
  57500. });
  57501. if (el) {
  57502. el.appendChild(this.controlTextEl_);
  57503. }
  57504. this.controlText(this.controlText_, el);
  57505. return this.controlTextEl_;
  57506. }
  57507. controlText(text, el = this.el()) {
  57508. if (text === void 0) {
  57509. return this.controlText_ || "Need Text";
  57510. }
  57511. const localizedText = this.localize(text);
  57512. this.controlText_ = text;
  57513. textContent$1(this.controlTextEl_, localizedText);
  57514. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  57515. el.setAttribute("title", localizedText);
  57516. }
  57517. }
  57518. buildCSSClass() {
  57519. return `vjs-control vjs-button ${super.buildCSSClass()}`;
  57520. }
  57521. enable() {
  57522. if (!this.enabled_) {
  57523. this.enabled_ = true;
  57524. this.removeClass("vjs-disabled");
  57525. this.el_.setAttribute("aria-disabled", "false");
  57526. if (typeof this.tabIndex_ !== "undefined") {
  57527. this.el_.setAttribute("tabIndex", this.tabIndex_);
  57528. }
  57529. this.on(["tap", "click"], this.handleClick_);
  57530. this.on("keydown", this.handleKeyDown_);
  57531. }
  57532. }
  57533. disable() {
  57534. this.enabled_ = false;
  57535. this.addClass("vjs-disabled");
  57536. this.el_.setAttribute("aria-disabled", "true");
  57537. if (typeof this.tabIndex_ !== "undefined") {
  57538. this.el_.removeAttribute("tabIndex");
  57539. }
  57540. this.off("mouseover", this.handleMouseOver_);
  57541. this.off("mouseout", this.handleMouseOut_);
  57542. this.off(["tap", "click"], this.handleClick_);
  57543. this.off("keydown", this.handleKeyDown_);
  57544. }
  57545. handleLanguagechange() {
  57546. this.controlText(this.controlText_);
  57547. }
  57548. handleClick(event2) {
  57549. if (this.options_.clickHandler) {
  57550. this.options_.clickHandler.call(this, arguments);
  57551. }
  57552. }
  57553. handleKeyDown(event2) {
  57554. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57555. event2.preventDefault();
  57556. event2.stopPropagation();
  57557. this.trigger("click");
  57558. } else {
  57559. super.handleKeyDown(event2);
  57560. }
  57561. }
  57562. }
  57563. Component$1$1.registerComponent("ClickableComponent", ClickableComponent$1);
  57564. class PosterImage$1 extends ClickableComponent$1 {
  57565. constructor(player, options2) {
  57566. super(player, options2);
  57567. this.update();
  57568. this.update_ = (e) => this.update(e);
  57569. player.on("posterchange", this.update_);
  57570. }
  57571. dispose() {
  57572. this.player().off("posterchange", this.update_);
  57573. super.dispose();
  57574. }
  57575. createEl() {
  57576. return createEl$1("div", {
  57577. className: "vjs-poster"
  57578. });
  57579. }
  57580. crossOrigin(value) {
  57581. if (typeof value === "undefined") {
  57582. if (this.$("img")) {
  57583. return this.$("img").crossOrigin;
  57584. } else if (this.player_.tech_ && this.player_.tech_.isReady_) {
  57585. return this.player_.crossOrigin();
  57586. }
  57587. return this.player_.options_.crossOrigin || this.player_.options_.crossorigin || null;
  57588. }
  57589. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  57590. this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  57591. return;
  57592. }
  57593. if (this.$("img")) {
  57594. this.$("img").crossOrigin = value;
  57595. }
  57596. return;
  57597. }
  57598. update(event2) {
  57599. const url = this.player().poster();
  57600. this.setSrc(url);
  57601. if (url) {
  57602. this.show();
  57603. } else {
  57604. this.hide();
  57605. }
  57606. }
  57607. setSrc(url) {
  57608. if (!url) {
  57609. this.el_.textContent = "";
  57610. return;
  57611. }
  57612. if (!this.$("img")) {
  57613. this.el_.appendChild(createEl$1("picture", {
  57614. className: "vjs-poster",
  57615. tabIndex: -1
  57616. }, {}, createEl$1("img", {
  57617. loading: "lazy",
  57618. crossOrigin: this.crossOrigin()
  57619. }, {
  57620. alt: ""
  57621. })));
  57622. }
  57623. this.$("img").src = url;
  57624. }
  57625. handleClick(event2) {
  57626. if (!this.player_.controls()) {
  57627. return;
  57628. }
  57629. if (this.player_.tech(true)) {
  57630. this.player_.tech(true).focus();
  57631. }
  57632. if (this.player_.paused()) {
  57633. silencePromise$1(this.player_.play());
  57634. } else {
  57635. this.player_.pause();
  57636. }
  57637. }
  57638. }
  57639. PosterImage$1.prototype.crossorigin = PosterImage$1.prototype.crossOrigin;
  57640. Component$1$1.registerComponent("PosterImage", PosterImage$1);
  57641. const darkGray$1 = "#222";
  57642. const lightGray$1 = "#ccc";
  57643. const fontMap$1 = {
  57644. monospace: "monospace",
  57645. sansSerif: "sans-serif",
  57646. serif: "serif",
  57647. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  57648. monospaceSerif: '"Courier New", monospace',
  57649. proportionalSansSerif: "sans-serif",
  57650. proportionalSerif: "serif",
  57651. casual: '"Comic Sans MS", Impact, fantasy',
  57652. script: '"Monotype Corsiva", cursive',
  57653. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  57654. };
  57655. function constructColor$1(color2, opacity) {
  57656. let hex;
  57657. if (color2.length === 4) {
  57658. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  57659. } else if (color2.length === 7) {
  57660. hex = color2.slice(1);
  57661. } else {
  57662. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  57663. }
  57664. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  57665. }
  57666. function tryUpdateStyle$1(el, style, rule) {
  57667. try {
  57668. el.style[style] = rule;
  57669. } catch (e) {
  57670. return;
  57671. }
  57672. }
  57673. class TextTrackDisplay$1 extends Component$1$1 {
  57674. constructor(player, options2, ready) {
  57675. super(player, options2, ready);
  57676. const updateDisplayHandler = (e) => this.updateDisplay(e);
  57677. player.on("loadstart", (e) => this.toggleDisplay(e));
  57678. player.on("texttrackchange", updateDisplayHandler);
  57679. player.on("loadedmetadata", (e) => this.preselectTrack(e));
  57680. player.ready(bind_(this, function() {
  57681. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  57682. this.hide();
  57683. return;
  57684. }
  57685. player.on("fullscreenchange", updateDisplayHandler);
  57686. player.on("playerresize", updateDisplayHandler);
  57687. const screenOrientation = window_1.screen.orientation || window_1;
  57688. const changeOrientationEvent = window_1.screen.orientation ? "change" : "orientationchange";
  57689. screenOrientation.addEventListener(changeOrientationEvent, updateDisplayHandler);
  57690. player.on("dispose", () => screenOrientation.removeEventListener(changeOrientationEvent, updateDisplayHandler));
  57691. const tracks = this.options_.playerOptions.tracks || [];
  57692. for (let i2 = 0; i2 < tracks.length; i2++) {
  57693. this.player_.addRemoteTextTrack(tracks[i2], true);
  57694. }
  57695. this.preselectTrack();
  57696. }));
  57697. }
  57698. preselectTrack() {
  57699. const modes = {
  57700. captions: 1,
  57701. subtitles: 1
  57702. };
  57703. const trackList = this.player_.textTracks();
  57704. const userPref = this.player_.cache_.selectedLanguage;
  57705. let firstDesc;
  57706. let firstCaptions;
  57707. let preferredTrack;
  57708. for (let i2 = 0; i2 < trackList.length; i2++) {
  57709. const track = trackList[i2];
  57710. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  57711. if (track.kind === userPref.kind) {
  57712. preferredTrack = track;
  57713. } else if (!preferredTrack) {
  57714. preferredTrack = track;
  57715. }
  57716. } else if (userPref && !userPref.enabled) {
  57717. preferredTrack = null;
  57718. firstDesc = null;
  57719. firstCaptions = null;
  57720. } else if (track.default) {
  57721. if (track.kind === "descriptions" && !firstDesc) {
  57722. firstDesc = track;
  57723. } else if (track.kind in modes && !firstCaptions) {
  57724. firstCaptions = track;
  57725. }
  57726. }
  57727. }
  57728. if (preferredTrack) {
  57729. preferredTrack.mode = "showing";
  57730. } else if (firstCaptions) {
  57731. firstCaptions.mode = "showing";
  57732. } else if (firstDesc) {
  57733. firstDesc.mode = "showing";
  57734. }
  57735. }
  57736. toggleDisplay() {
  57737. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  57738. this.hide();
  57739. } else {
  57740. this.show();
  57741. }
  57742. }
  57743. createEl() {
  57744. return super.createEl("div", {
  57745. className: "vjs-text-track-display"
  57746. }, {
  57747. "translate": "yes",
  57748. "aria-live": "off",
  57749. "aria-atomic": "true"
  57750. });
  57751. }
  57752. clearDisplay() {
  57753. if (typeof window_1.WebVTT === "function") {
  57754. window_1.WebVTT.processCues(window_1, [], this.el_);
  57755. }
  57756. }
  57757. updateDisplay() {
  57758. const tracks = this.player_.textTracks();
  57759. const allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  57760. this.clearDisplay();
  57761. if (allowMultipleShowingTracks) {
  57762. const showingTracks = [];
  57763. for (let i3 = 0; i3 < tracks.length; ++i3) {
  57764. const track = tracks[i3];
  57765. if (track.mode !== "showing") {
  57766. continue;
  57767. }
  57768. showingTracks.push(track);
  57769. }
  57770. this.updateForTrack(showingTracks);
  57771. return;
  57772. }
  57773. let descriptionsTrack = null;
  57774. let captionsSubtitlesTrack = null;
  57775. let i2 = tracks.length;
  57776. while (i2--) {
  57777. const track = tracks[i2];
  57778. if (track.mode === "showing") {
  57779. if (track.kind === "descriptions") {
  57780. descriptionsTrack = track;
  57781. } else {
  57782. captionsSubtitlesTrack = track;
  57783. }
  57784. }
  57785. }
  57786. if (captionsSubtitlesTrack) {
  57787. if (this.getAttribute("aria-live") !== "off") {
  57788. this.setAttribute("aria-live", "off");
  57789. }
  57790. this.updateForTrack(captionsSubtitlesTrack);
  57791. } else if (descriptionsTrack) {
  57792. if (this.getAttribute("aria-live") !== "assertive") {
  57793. this.setAttribute("aria-live", "assertive");
  57794. }
  57795. this.updateForTrack(descriptionsTrack);
  57796. }
  57797. }
  57798. updateDisplayState(track) {
  57799. const overrides = this.player_.textTrackSettings.getValues();
  57800. const cues = track.activeCues;
  57801. let i2 = cues.length;
  57802. while (i2--) {
  57803. const cue = cues[i2];
  57804. if (!cue) {
  57805. continue;
  57806. }
  57807. const cueDiv = cue.displayState;
  57808. if (overrides.color) {
  57809. cueDiv.firstChild.style.color = overrides.color;
  57810. }
  57811. if (overrides.textOpacity) {
  57812. tryUpdateStyle$1(cueDiv.firstChild, "color", constructColor$1(overrides.color || "#fff", overrides.textOpacity));
  57813. }
  57814. if (overrides.backgroundColor) {
  57815. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  57816. }
  57817. if (overrides.backgroundOpacity) {
  57818. tryUpdateStyle$1(cueDiv.firstChild, "backgroundColor", constructColor$1(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  57819. }
  57820. if (overrides.windowColor) {
  57821. if (overrides.windowOpacity) {
  57822. tryUpdateStyle$1(cueDiv, "backgroundColor", constructColor$1(overrides.windowColor, overrides.windowOpacity));
  57823. } else {
  57824. cueDiv.style.backgroundColor = overrides.windowColor;
  57825. }
  57826. }
  57827. if (overrides.edgeStyle) {
  57828. if (overrides.edgeStyle === "dropshadow") {
  57829. cueDiv.firstChild.style.textShadow = `2px 2px 3px ${darkGray$1}, 2px 2px 4px ${darkGray$1}, 2px 2px 5px ${darkGray$1}`;
  57830. } else if (overrides.edgeStyle === "raised") {
  57831. cueDiv.firstChild.style.textShadow = `1px 1px ${darkGray$1}, 2px 2px ${darkGray$1}, 3px 3px ${darkGray$1}`;
  57832. } else if (overrides.edgeStyle === "depressed") {
  57833. cueDiv.firstChild.style.textShadow = `1px 1px ${lightGray$1}, 0 1px ${lightGray$1}, -1px -1px ${darkGray$1}, 0 -1px ${darkGray$1}`;
  57834. } else if (overrides.edgeStyle === "uniform") {
  57835. cueDiv.firstChild.style.textShadow = `0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}`;
  57836. }
  57837. }
  57838. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  57839. const fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  57840. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  57841. cueDiv.style.height = "auto";
  57842. cueDiv.style.top = "auto";
  57843. }
  57844. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  57845. if (overrides.fontFamily === "small-caps") {
  57846. cueDiv.firstChild.style.fontVariant = "small-caps";
  57847. } else {
  57848. cueDiv.firstChild.style.fontFamily = fontMap$1[overrides.fontFamily];
  57849. }
  57850. }
  57851. }
  57852. }
  57853. updateForTrack(tracks) {
  57854. if (!Array.isArray(tracks)) {
  57855. tracks = [tracks];
  57856. }
  57857. if (typeof window_1.WebVTT !== "function" || tracks.every((track) => {
  57858. return !track.activeCues;
  57859. })) {
  57860. return;
  57861. }
  57862. const cues = [];
  57863. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57864. const track = tracks[i2];
  57865. for (let j = 0; j < track.activeCues.length; ++j) {
  57866. cues.push(track.activeCues[j]);
  57867. }
  57868. }
  57869. window_1.WebVTT.processCues(window_1, cues, this.el_);
  57870. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57871. const track = tracks[i2];
  57872. for (let j = 0; j < track.activeCues.length; ++j) {
  57873. const cueEl = track.activeCues[j].displayState;
  57874. addClass$1(cueEl, "vjs-text-track-cue", "vjs-text-track-cue-" + (track.language ? track.language : i2));
  57875. if (track.language) {
  57876. setAttribute$1(cueEl, "lang", track.language);
  57877. }
  57878. }
  57879. if (this.player_.textTrackSettings) {
  57880. this.updateDisplayState(track);
  57881. }
  57882. }
  57883. }
  57884. }
  57885. Component$1$1.registerComponent("TextTrackDisplay", TextTrackDisplay$1);
  57886. class LoadingSpinner$1 extends Component$1$1 {
  57887. createEl() {
  57888. const isAudio = this.player_.isAudio();
  57889. const playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  57890. const controlText = createEl$1("span", {
  57891. className: "vjs-control-text",
  57892. textContent: this.localize("{1} is loading.", [playerType])
  57893. });
  57894. const el = super.createEl("div", {
  57895. className: "vjs-loading-spinner",
  57896. dir: "ltr"
  57897. });
  57898. el.appendChild(controlText);
  57899. return el;
  57900. }
  57901. handleLanguagechange() {
  57902. this.$(".vjs-control-text").textContent = this.localize("{1} is loading.", [this.player_.isAudio() ? "Audio Player" : "Video Player"]);
  57903. }
  57904. }
  57905. Component$1$1.registerComponent("LoadingSpinner", LoadingSpinner$1);
  57906. class Button$1 extends ClickableComponent$1 {
  57907. createEl(tag, props = {}, attributes = {}) {
  57908. tag = "button";
  57909. props = Object.assign({
  57910. className: this.buildCSSClass()
  57911. }, props);
  57912. attributes = Object.assign({
  57913. type: "button"
  57914. }, attributes);
  57915. const el = createEl$1(tag, props, attributes);
  57916. el.appendChild(createEl$1("span", {
  57917. className: "vjs-icon-placeholder"
  57918. }, {
  57919. "aria-hidden": true
  57920. }));
  57921. this.createControlTextEl(el);
  57922. return el;
  57923. }
  57924. addChild(child, options2 = {}) {
  57925. const className = this.constructor.name;
  57926. log$1$1.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);
  57927. return Component$1$1.prototype.addChild.call(this, child, options2);
  57928. }
  57929. enable() {
  57930. super.enable();
  57931. this.el_.removeAttribute("disabled");
  57932. }
  57933. disable() {
  57934. super.disable();
  57935. this.el_.setAttribute("disabled", "disabled");
  57936. }
  57937. handleKeyDown(event2) {
  57938. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57939. event2.stopPropagation();
  57940. return;
  57941. }
  57942. super.handleKeyDown(event2);
  57943. }
  57944. }
  57945. Component$1$1.registerComponent("Button", Button$1);
  57946. class BigPlayButton$1 extends Button$1 {
  57947. constructor(player, options2) {
  57948. super(player, options2);
  57949. this.mouseused_ = false;
  57950. this.on("mousedown", (e) => this.handleMouseDown(e));
  57951. }
  57952. buildCSSClass() {
  57953. return "vjs-big-play-button";
  57954. }
  57955. handleClick(event2) {
  57956. const playPromise = this.player_.play();
  57957. if (this.mouseused_ && event2.clientX && event2.clientY) {
  57958. silencePromise$1(playPromise);
  57959. if (this.player_.tech(true)) {
  57960. this.player_.tech(true).focus();
  57961. }
  57962. return;
  57963. }
  57964. const cb = this.player_.getChild("controlBar");
  57965. const playToggle = cb && cb.getChild("playToggle");
  57966. if (!playToggle) {
  57967. this.player_.tech(true).focus();
  57968. return;
  57969. }
  57970. const playFocus = () => playToggle.focus();
  57971. if (isPromise$1(playPromise)) {
  57972. playPromise.then(playFocus, () => {
  57973. });
  57974. } else {
  57975. this.setTimeout(playFocus, 1);
  57976. }
  57977. }
  57978. handleKeyDown(event2) {
  57979. this.mouseused_ = false;
  57980. super.handleKeyDown(event2);
  57981. }
  57982. handleMouseDown(event2) {
  57983. this.mouseused_ = true;
  57984. }
  57985. }
  57986. BigPlayButton$1.prototype.controlText_ = "Play Video";
  57987. Component$1$1.registerComponent("BigPlayButton", BigPlayButton$1);
  57988. class CloseButton$1 extends Button$1 {
  57989. constructor(player, options2) {
  57990. super(player, options2);
  57991. this.controlText(options2 && options2.controlText || this.localize("Close"));
  57992. }
  57993. buildCSSClass() {
  57994. return `vjs-close-button ${super.buildCSSClass()}`;
  57995. }
  57996. handleClick(event2) {
  57997. this.trigger({
  57998. type: "close",
  57999. bubbles: false
  58000. });
  58001. }
  58002. handleKeyDown(event2) {
  58003. if (keycode.isEventKey(event2, "Esc")) {
  58004. event2.preventDefault();
  58005. event2.stopPropagation();
  58006. this.trigger("click");
  58007. } else {
  58008. super.handleKeyDown(event2);
  58009. }
  58010. }
  58011. }
  58012. Component$1$1.registerComponent("CloseButton", CloseButton$1);
  58013. class PlayToggle$1 extends Button$1 {
  58014. constructor(player, options2 = {}) {
  58015. super(player, options2);
  58016. options2.replay = options2.replay === void 0 || options2.replay;
  58017. this.on(player, "play", (e) => this.handlePlay(e));
  58018. this.on(player, "pause", (e) => this.handlePause(e));
  58019. if (options2.replay) {
  58020. this.on(player, "ended", (e) => this.handleEnded(e));
  58021. }
  58022. }
  58023. buildCSSClass() {
  58024. return `vjs-play-control ${super.buildCSSClass()}`;
  58025. }
  58026. handleClick(event2) {
  58027. if (this.player_.paused()) {
  58028. silencePromise$1(this.player_.play());
  58029. } else {
  58030. this.player_.pause();
  58031. }
  58032. }
  58033. handleSeeked(event2) {
  58034. this.removeClass("vjs-ended");
  58035. if (this.player_.paused()) {
  58036. this.handlePause(event2);
  58037. } else {
  58038. this.handlePlay(event2);
  58039. }
  58040. }
  58041. handlePlay(event2) {
  58042. this.removeClass("vjs-ended", "vjs-paused");
  58043. this.addClass("vjs-playing");
  58044. this.controlText("Pause");
  58045. }
  58046. handlePause(event2) {
  58047. this.removeClass("vjs-playing");
  58048. this.addClass("vjs-paused");
  58049. this.controlText("Play");
  58050. }
  58051. handleEnded(event2) {
  58052. this.removeClass("vjs-playing");
  58053. this.addClass("vjs-ended");
  58054. this.controlText("Replay");
  58055. this.one(this.player_, "seeked", (e) => this.handleSeeked(e));
  58056. }
  58057. }
  58058. PlayToggle$1.prototype.controlText_ = "Play";
  58059. Component$1$1.registerComponent("PlayToggle", PlayToggle$1);
  58060. class TimeDisplay$1 extends Component$1$1 {
  58061. constructor(player, options2) {
  58062. super(player, options2);
  58063. this.on(player, ["timeupdate", "ended"], (e) => this.updateContent(e));
  58064. this.updateTextNode_();
  58065. }
  58066. createEl() {
  58067. const className = this.buildCSSClass();
  58068. const el = super.createEl("div", {
  58069. className: `${className} vjs-time-control vjs-control`
  58070. });
  58071. const span = createEl$1("span", {
  58072. className: "vjs-control-text",
  58073. textContent: `${this.localize(this.labelText_)}\xA0`
  58074. }, {
  58075. role: "presentation"
  58076. });
  58077. el.appendChild(span);
  58078. this.contentEl_ = createEl$1("span", {
  58079. className: `${className}-display`
  58080. }, {
  58081. role: "presentation"
  58082. });
  58083. el.appendChild(this.contentEl_);
  58084. return el;
  58085. }
  58086. dispose() {
  58087. this.contentEl_ = null;
  58088. this.textNode_ = null;
  58089. super.dispose();
  58090. }
  58091. updateTextNode_(time = 0) {
  58092. time = formatTime$1(time);
  58093. if (this.formattedTime_ === time) {
  58094. return;
  58095. }
  58096. this.formattedTime_ = time;
  58097. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", () => {
  58098. if (!this.contentEl_) {
  58099. return;
  58100. }
  58101. let oldNode = this.textNode_;
  58102. if (oldNode && this.contentEl_.firstChild !== oldNode) {
  58103. oldNode = null;
  58104. log$1$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  58105. }
  58106. this.textNode_ = document_1.createTextNode(this.formattedTime_);
  58107. if (!this.textNode_) {
  58108. return;
  58109. }
  58110. if (oldNode) {
  58111. this.contentEl_.replaceChild(this.textNode_, oldNode);
  58112. } else {
  58113. this.contentEl_.appendChild(this.textNode_);
  58114. }
  58115. });
  58116. }
  58117. updateContent(event2) {
  58118. }
  58119. }
  58120. TimeDisplay$1.prototype.labelText_ = "Time";
  58121. TimeDisplay$1.prototype.controlText_ = "Time";
  58122. Component$1$1.registerComponent("TimeDisplay", TimeDisplay$1);
  58123. class CurrentTimeDisplay$1 extends TimeDisplay$1 {
  58124. buildCSSClass() {
  58125. return "vjs-current-time";
  58126. }
  58127. updateContent(event2) {
  58128. let time;
  58129. if (this.player_.ended()) {
  58130. time = this.player_.duration();
  58131. } else {
  58132. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58133. }
  58134. this.updateTextNode_(time);
  58135. }
  58136. }
  58137. CurrentTimeDisplay$1.prototype.labelText_ = "Current Time";
  58138. CurrentTimeDisplay$1.prototype.controlText_ = "Current Time";
  58139. Component$1$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay$1);
  58140. class DurationDisplay$1 extends TimeDisplay$1 {
  58141. constructor(player, options2) {
  58142. super(player, options2);
  58143. const updateContent = (e) => this.updateContent(e);
  58144. this.on(player, "durationchange", updateContent);
  58145. this.on(player, "loadstart", updateContent);
  58146. this.on(player, "loadedmetadata", updateContent);
  58147. }
  58148. buildCSSClass() {
  58149. return "vjs-duration";
  58150. }
  58151. updateContent(event2) {
  58152. const duration5 = this.player_.duration();
  58153. this.updateTextNode_(duration5);
  58154. }
  58155. }
  58156. DurationDisplay$1.prototype.labelText_ = "Duration";
  58157. DurationDisplay$1.prototype.controlText_ = "Duration";
  58158. Component$1$1.registerComponent("DurationDisplay", DurationDisplay$1);
  58159. class TimeDivider$1 extends Component$1$1 {
  58160. createEl() {
  58161. const el = super.createEl("div", {
  58162. className: "vjs-time-control vjs-time-divider"
  58163. }, {
  58164. "aria-hidden": true
  58165. });
  58166. const div = super.createEl("div");
  58167. const span = super.createEl("span", {
  58168. textContent: "/"
  58169. });
  58170. div.appendChild(span);
  58171. el.appendChild(div);
  58172. return el;
  58173. }
  58174. }
  58175. Component$1$1.registerComponent("TimeDivider", TimeDivider$1);
  58176. class RemainingTimeDisplay$1 extends TimeDisplay$1 {
  58177. constructor(player, options2) {
  58178. super(player, options2);
  58179. this.on(player, "durationchange", (e) => this.updateContent(e));
  58180. }
  58181. buildCSSClass() {
  58182. return "vjs-remaining-time";
  58183. }
  58184. createEl() {
  58185. const el = super.createEl();
  58186. if (this.options_.displayNegative !== false) {
  58187. el.insertBefore(createEl$1("span", {}, {
  58188. "aria-hidden": true
  58189. }, "-"), this.contentEl_);
  58190. }
  58191. return el;
  58192. }
  58193. updateContent(event2) {
  58194. if (typeof this.player_.duration() !== "number") {
  58195. return;
  58196. }
  58197. let time;
  58198. if (this.player_.ended()) {
  58199. time = 0;
  58200. } else if (this.player_.remainingTimeDisplay) {
  58201. time = this.player_.remainingTimeDisplay();
  58202. } else {
  58203. time = this.player_.remainingTime();
  58204. }
  58205. this.updateTextNode_(time);
  58206. }
  58207. }
  58208. RemainingTimeDisplay$1.prototype.labelText_ = "Remaining Time";
  58209. RemainingTimeDisplay$1.prototype.controlText_ = "Remaining Time";
  58210. Component$1$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay$1);
  58211. class LiveDisplay$1 extends Component$1$1 {
  58212. constructor(player, options2) {
  58213. super(player, options2);
  58214. this.updateShowing();
  58215. this.on(this.player(), "durationchange", (e) => this.updateShowing(e));
  58216. }
  58217. createEl() {
  58218. const el = super.createEl("div", {
  58219. className: "vjs-live-control vjs-control"
  58220. });
  58221. this.contentEl_ = createEl$1("div", {
  58222. className: "vjs-live-display"
  58223. }, {
  58224. "aria-live": "off"
  58225. });
  58226. this.contentEl_.appendChild(createEl$1("span", {
  58227. className: "vjs-control-text",
  58228. textContent: `${this.localize("Stream Type")}\xA0`
  58229. }));
  58230. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  58231. el.appendChild(this.contentEl_);
  58232. return el;
  58233. }
  58234. dispose() {
  58235. this.contentEl_ = null;
  58236. super.dispose();
  58237. }
  58238. updateShowing(event2) {
  58239. if (this.player().duration() === Infinity) {
  58240. this.show();
  58241. } else {
  58242. this.hide();
  58243. }
  58244. }
  58245. }
  58246. Component$1$1.registerComponent("LiveDisplay", LiveDisplay$1);
  58247. class SeekToLive$1 extends Button$1 {
  58248. constructor(player, options2) {
  58249. super(player, options2);
  58250. this.updateLiveEdgeStatus();
  58251. if (this.player_.liveTracker) {
  58252. this.updateLiveEdgeStatusHandler_ = (e) => this.updateLiveEdgeStatus(e);
  58253. this.on(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58254. }
  58255. }
  58256. createEl() {
  58257. const el = super.createEl("button", {
  58258. className: "vjs-seek-to-live-control vjs-control"
  58259. });
  58260. this.textEl_ = createEl$1("span", {
  58261. className: "vjs-seek-to-live-text",
  58262. textContent: this.localize("LIVE")
  58263. }, {
  58264. "aria-hidden": "true"
  58265. });
  58266. el.appendChild(this.textEl_);
  58267. return el;
  58268. }
  58269. updateLiveEdgeStatus() {
  58270. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  58271. this.setAttribute("aria-disabled", true);
  58272. this.addClass("vjs-at-live-edge");
  58273. this.controlText("Seek to live, currently playing live");
  58274. } else {
  58275. this.setAttribute("aria-disabled", false);
  58276. this.removeClass("vjs-at-live-edge");
  58277. this.controlText("Seek to live, currently behind live");
  58278. }
  58279. }
  58280. handleClick() {
  58281. this.player_.liveTracker.seekToLiveEdge();
  58282. }
  58283. dispose() {
  58284. if (this.player_.liveTracker) {
  58285. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58286. }
  58287. this.textEl_ = null;
  58288. super.dispose();
  58289. }
  58290. }
  58291. SeekToLive$1.prototype.controlText_ = "Seek to live, currently playing live";
  58292. Component$1$1.registerComponent("SeekToLive", SeekToLive$1);
  58293. function clamp$1(number, min2, max2) {
  58294. number = Number(number);
  58295. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  58296. }
  58297. var Num = /* @__PURE__ */ Object.freeze({
  58298. __proto__: null,
  58299. clamp: clamp$1
  58300. });
  58301. class Slider$1 extends Component$1$1 {
  58302. constructor(player, options2) {
  58303. super(player, options2);
  58304. this.handleMouseDown_ = (e) => this.handleMouseDown(e);
  58305. this.handleMouseUp_ = (e) => this.handleMouseUp(e);
  58306. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  58307. this.handleClick_ = (e) => this.handleClick(e);
  58308. this.handleMouseMove_ = (e) => this.handleMouseMove(e);
  58309. this.update_ = (e) => this.update(e);
  58310. this.bar = this.getChild(this.options_.barName);
  58311. this.vertical(!!this.options_.vertical);
  58312. this.enable();
  58313. }
  58314. enabled() {
  58315. return this.enabled_;
  58316. }
  58317. enable() {
  58318. if (this.enabled()) {
  58319. return;
  58320. }
  58321. this.on("mousedown", this.handleMouseDown_);
  58322. this.on("touchstart", this.handleMouseDown_);
  58323. this.on("keydown", this.handleKeyDown_);
  58324. this.on("click", this.handleClick_);
  58325. this.on(this.player_, "controlsvisible", this.update);
  58326. if (this.playerEvent) {
  58327. this.on(this.player_, this.playerEvent, this.update);
  58328. }
  58329. this.removeClass("disabled");
  58330. this.setAttribute("tabindex", 0);
  58331. this.enabled_ = true;
  58332. }
  58333. disable() {
  58334. if (!this.enabled()) {
  58335. return;
  58336. }
  58337. const doc = this.bar.el_.ownerDocument;
  58338. this.off("mousedown", this.handleMouseDown_);
  58339. this.off("touchstart", this.handleMouseDown_);
  58340. this.off("keydown", this.handleKeyDown_);
  58341. this.off("click", this.handleClick_);
  58342. this.off(this.player_, "controlsvisible", this.update_);
  58343. this.off(doc, "mousemove", this.handleMouseMove_);
  58344. this.off(doc, "mouseup", this.handleMouseUp_);
  58345. this.off(doc, "touchmove", this.handleMouseMove_);
  58346. this.off(doc, "touchend", this.handleMouseUp_);
  58347. this.removeAttribute("tabindex");
  58348. this.addClass("disabled");
  58349. if (this.playerEvent) {
  58350. this.off(this.player_, this.playerEvent, this.update);
  58351. }
  58352. this.enabled_ = false;
  58353. }
  58354. createEl(type2, props = {}, attributes = {}) {
  58355. props.className = props.className + " vjs-slider";
  58356. props = Object.assign({
  58357. tabIndex: 0
  58358. }, props);
  58359. attributes = Object.assign({
  58360. "role": "slider",
  58361. "aria-valuenow": 0,
  58362. "aria-valuemin": 0,
  58363. "aria-valuemax": 100
  58364. }, attributes);
  58365. return super.createEl(type2, props, attributes);
  58366. }
  58367. handleMouseDown(event2) {
  58368. const doc = this.bar.el_.ownerDocument;
  58369. if (event2.type === "mousedown") {
  58370. event2.preventDefault();
  58371. }
  58372. if (event2.type === "touchstart" && !IS_CHROME$1) {
  58373. event2.preventDefault();
  58374. }
  58375. blockTextSelection$1();
  58376. this.addClass("vjs-sliding");
  58377. this.trigger("slideractive");
  58378. this.on(doc, "mousemove", this.handleMouseMove_);
  58379. this.on(doc, "mouseup", this.handleMouseUp_);
  58380. this.on(doc, "touchmove", this.handleMouseMove_);
  58381. this.on(doc, "touchend", this.handleMouseUp_);
  58382. this.handleMouseMove(event2, true);
  58383. }
  58384. handleMouseMove(event2) {
  58385. }
  58386. handleMouseUp(event2) {
  58387. const doc = this.bar.el_.ownerDocument;
  58388. unblockTextSelection$1();
  58389. this.removeClass("vjs-sliding");
  58390. this.trigger("sliderinactive");
  58391. this.off(doc, "mousemove", this.handleMouseMove_);
  58392. this.off(doc, "mouseup", this.handleMouseUp_);
  58393. this.off(doc, "touchmove", this.handleMouseMove_);
  58394. this.off(doc, "touchend", this.handleMouseUp_);
  58395. this.update();
  58396. }
  58397. update() {
  58398. if (!this.el_ || !this.bar) {
  58399. return;
  58400. }
  58401. const progress = this.getProgress();
  58402. if (progress === this.progress_) {
  58403. return progress;
  58404. }
  58405. this.progress_ = progress;
  58406. this.requestNamedAnimationFrame("Slider#update", () => {
  58407. const sizeKey = this.vertical() ? "height" : "width";
  58408. this.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  58409. });
  58410. return progress;
  58411. }
  58412. getProgress() {
  58413. return Number(clamp$1(this.getPercent(), 0, 1).toFixed(4));
  58414. }
  58415. calculateDistance(event2) {
  58416. const position2 = getPointerPosition$1(this.el_, event2);
  58417. if (this.vertical()) {
  58418. return position2.y;
  58419. }
  58420. return position2.x;
  58421. }
  58422. handleKeyDown(event2) {
  58423. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  58424. event2.preventDefault();
  58425. event2.stopPropagation();
  58426. this.stepBack();
  58427. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  58428. event2.preventDefault();
  58429. event2.stopPropagation();
  58430. this.stepForward();
  58431. } else {
  58432. super.handleKeyDown(event2);
  58433. }
  58434. }
  58435. handleClick(event2) {
  58436. event2.stopPropagation();
  58437. event2.preventDefault();
  58438. }
  58439. vertical(bool) {
  58440. if (bool === void 0) {
  58441. return this.vertical_ || false;
  58442. }
  58443. this.vertical_ = !!bool;
  58444. if (this.vertical_) {
  58445. this.addClass("vjs-slider-vertical");
  58446. } else {
  58447. this.addClass("vjs-slider-horizontal");
  58448. }
  58449. }
  58450. }
  58451. Component$1$1.registerComponent("Slider", Slider$1);
  58452. const percentify$1 = (time, end) => clamp$1(time / end * 100, 0, 100).toFixed(2) + "%";
  58453. class LoadProgressBar$1 extends Component$1$1 {
  58454. constructor(player, options2) {
  58455. super(player, options2);
  58456. this.partEls_ = [];
  58457. this.on(player, "progress", (e) => this.update(e));
  58458. }
  58459. createEl() {
  58460. const el = super.createEl("div", {
  58461. className: "vjs-load-progress"
  58462. });
  58463. const wrapper = createEl$1("span", {
  58464. className: "vjs-control-text"
  58465. });
  58466. const loadedText = createEl$1("span", {
  58467. textContent: this.localize("Loaded")
  58468. });
  58469. const separator = document_1.createTextNode(": ");
  58470. this.percentageEl_ = createEl$1("span", {
  58471. className: "vjs-control-text-loaded-percentage",
  58472. textContent: "0%"
  58473. });
  58474. el.appendChild(wrapper);
  58475. wrapper.appendChild(loadedText);
  58476. wrapper.appendChild(separator);
  58477. wrapper.appendChild(this.percentageEl_);
  58478. return el;
  58479. }
  58480. dispose() {
  58481. this.partEls_ = null;
  58482. this.percentageEl_ = null;
  58483. super.dispose();
  58484. }
  58485. update(event2) {
  58486. this.requestNamedAnimationFrame("LoadProgressBar#update", () => {
  58487. const liveTracker = this.player_.liveTracker;
  58488. const buffered = this.player_.buffered();
  58489. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  58490. const bufferedEnd = this.player_.bufferedEnd();
  58491. const children = this.partEls_;
  58492. const percent = percentify$1(bufferedEnd, duration5);
  58493. if (this.percent_ !== percent) {
  58494. this.el_.style.width = percent;
  58495. textContent$1(this.percentageEl_, percent);
  58496. this.percent_ = percent;
  58497. }
  58498. for (let i2 = 0; i2 < buffered.length; i2++) {
  58499. const start2 = buffered.start(i2);
  58500. const end = buffered.end(i2);
  58501. let part = children[i2];
  58502. if (!part) {
  58503. part = this.el_.appendChild(createEl$1());
  58504. children[i2] = part;
  58505. }
  58506. if (part.dataset.start === start2 && part.dataset.end === end) {
  58507. continue;
  58508. }
  58509. part.dataset.start = start2;
  58510. part.dataset.end = end;
  58511. part.style.left = percentify$1(start2, bufferedEnd);
  58512. part.style.width = percentify$1(end - start2, bufferedEnd);
  58513. }
  58514. for (let i2 = children.length; i2 > buffered.length; i2--) {
  58515. this.el_.removeChild(children[i2 - 1]);
  58516. }
  58517. children.length = buffered.length;
  58518. });
  58519. }
  58520. }
  58521. Component$1$1.registerComponent("LoadProgressBar", LoadProgressBar$1);
  58522. class TimeTooltip$1 extends Component$1$1 {
  58523. constructor(player, options2) {
  58524. super(player, options2);
  58525. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58526. }
  58527. createEl() {
  58528. return super.createEl("div", {
  58529. className: "vjs-time-tooltip"
  58530. }, {
  58531. "aria-hidden": "true"
  58532. });
  58533. }
  58534. update(seekBarRect, seekBarPoint, content) {
  58535. const tooltipRect = findPosition$1(this.el_);
  58536. const playerRect = getBoundingClientRect$1(this.player_.el());
  58537. const seekBarPointPx = seekBarRect.width * seekBarPoint;
  58538. if (!playerRect || !tooltipRect) {
  58539. return;
  58540. }
  58541. const spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  58542. const spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  58543. let pullTooltipBy = tooltipRect.width / 2;
  58544. if (spaceLeftOfPoint < pullTooltipBy) {
  58545. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  58546. } else if (spaceRightOfPoint < pullTooltipBy) {
  58547. pullTooltipBy = spaceRightOfPoint;
  58548. }
  58549. if (pullTooltipBy < 0) {
  58550. pullTooltipBy = 0;
  58551. } else if (pullTooltipBy > tooltipRect.width) {
  58552. pullTooltipBy = tooltipRect.width;
  58553. }
  58554. pullTooltipBy = Math.round(pullTooltipBy);
  58555. this.el_.style.right = `-${pullTooltipBy}px`;
  58556. this.write(content);
  58557. }
  58558. write(content) {
  58559. textContent$1(this.el_, content);
  58560. }
  58561. updateTime(seekBarRect, seekBarPoint, time, cb) {
  58562. this.requestNamedAnimationFrame("TimeTooltip#updateTime", () => {
  58563. let content;
  58564. const duration5 = this.player_.duration();
  58565. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58566. const liveWindow = this.player_.liveTracker.liveWindow();
  58567. const secondsBehind = liveWindow - seekBarPoint * liveWindow;
  58568. content = (secondsBehind < 1 ? "" : "-") + formatTime$1(secondsBehind, liveWindow);
  58569. } else {
  58570. content = formatTime$1(time, duration5);
  58571. }
  58572. this.update(seekBarRect, seekBarPoint, content);
  58573. if (cb) {
  58574. cb();
  58575. }
  58576. });
  58577. }
  58578. }
  58579. Component$1$1.registerComponent("TimeTooltip", TimeTooltip$1);
  58580. class PlayProgressBar$1 extends Component$1$1 {
  58581. constructor(player, options2) {
  58582. super(player, options2);
  58583. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58584. }
  58585. createEl() {
  58586. return super.createEl("div", {
  58587. className: "vjs-play-progress vjs-slider-bar"
  58588. }, {
  58589. "aria-hidden": "true"
  58590. });
  58591. }
  58592. update(seekBarRect, seekBarPoint) {
  58593. const timeTooltip = this.getChild("timeTooltip");
  58594. if (!timeTooltip) {
  58595. return;
  58596. }
  58597. const time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58598. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  58599. }
  58600. }
  58601. PlayProgressBar$1.prototype.options_ = {
  58602. children: []
  58603. };
  58604. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58605. PlayProgressBar$1.prototype.options_.children.push("timeTooltip");
  58606. }
  58607. Component$1$1.registerComponent("PlayProgressBar", PlayProgressBar$1);
  58608. class MouseTimeDisplay$1 extends Component$1$1 {
  58609. constructor(player, options2) {
  58610. super(player, options2);
  58611. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58612. }
  58613. createEl() {
  58614. return super.createEl("div", {
  58615. className: "vjs-mouse-display"
  58616. });
  58617. }
  58618. update(seekBarRect, seekBarPoint) {
  58619. const time = seekBarPoint * this.player_.duration();
  58620. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, () => {
  58621. this.el_.style.left = `${seekBarRect.width * seekBarPoint}px`;
  58622. });
  58623. }
  58624. }
  58625. MouseTimeDisplay$1.prototype.options_ = {
  58626. children: ["timeTooltip"]
  58627. };
  58628. Component$1$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay$1);
  58629. const STEP_SECONDS$1 = 5;
  58630. const PAGE_KEY_MULTIPLIER$1 = 12;
  58631. class SeekBar$1 extends Slider$1 {
  58632. constructor(player, options2) {
  58633. super(player, options2);
  58634. this.setEventHandlers_();
  58635. }
  58636. setEventHandlers_() {
  58637. this.update_ = bind_(this, this.update);
  58638. this.update = throttle$1(this.update_, UPDATE_REFRESH_INTERVAL$1);
  58639. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58640. if (this.player_.liveTracker) {
  58641. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  58642. }
  58643. this.updateInterval = null;
  58644. this.enableIntervalHandler_ = (e) => this.enableInterval_(e);
  58645. this.disableIntervalHandler_ = (e) => this.disableInterval_(e);
  58646. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  58647. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58648. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58649. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  58650. }
  58651. }
  58652. toggleVisibility_(e) {
  58653. if (document_1.visibilityState === "hidden") {
  58654. this.cancelNamedAnimationFrame("SeekBar#update");
  58655. this.cancelNamedAnimationFrame("Slider#update");
  58656. this.disableInterval_(e);
  58657. } else {
  58658. if (!this.player_.ended() && !this.player_.paused()) {
  58659. this.enableInterval_();
  58660. }
  58661. this.update();
  58662. }
  58663. }
  58664. enableInterval_() {
  58665. if (this.updateInterval) {
  58666. return;
  58667. }
  58668. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL$1);
  58669. }
  58670. disableInterval_(e) {
  58671. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  58672. return;
  58673. }
  58674. if (!this.updateInterval) {
  58675. return;
  58676. }
  58677. this.clearInterval(this.updateInterval);
  58678. this.updateInterval = null;
  58679. }
  58680. createEl() {
  58681. return super.createEl("div", {
  58682. className: "vjs-progress-holder"
  58683. }, {
  58684. "aria-label": this.localize("Progress Bar")
  58685. });
  58686. }
  58687. update(event2) {
  58688. if (document_1.visibilityState === "hidden") {
  58689. return;
  58690. }
  58691. const percent = super.update();
  58692. this.requestNamedAnimationFrame("SeekBar#update", () => {
  58693. const currentTime = this.player_.ended() ? this.player_.duration() : this.getCurrentTime_();
  58694. const liveTracker = this.player_.liveTracker;
  58695. let duration5 = this.player_.duration();
  58696. if (liveTracker && liveTracker.isLive()) {
  58697. duration5 = this.player_.liveTracker.liveCurrentTime();
  58698. }
  58699. if (this.percent_ !== percent) {
  58700. this.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  58701. this.percent_ = percent;
  58702. }
  58703. if (this.currentTime_ !== currentTime || this.duration_ !== duration5) {
  58704. this.el_.setAttribute("aria-valuetext", this.localize("progress bar timing: currentTime={1} duration={2}", [formatTime$1(currentTime, duration5), formatTime$1(duration5, duration5)], "{1} of {2}"));
  58705. this.currentTime_ = currentTime;
  58706. this.duration_ = duration5;
  58707. }
  58708. if (this.bar) {
  58709. this.bar.update(getBoundingClientRect$1(this.el()), this.getProgress());
  58710. }
  58711. });
  58712. return percent;
  58713. }
  58714. userSeek_(ct2) {
  58715. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58716. this.player_.liveTracker.nextSeekedFromUser();
  58717. }
  58718. this.player_.currentTime(ct2);
  58719. }
  58720. getCurrentTime_() {
  58721. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58722. }
  58723. getPercent() {
  58724. const currentTime = this.getCurrentTime_();
  58725. let percent;
  58726. const liveTracker = this.player_.liveTracker;
  58727. if (liveTracker && liveTracker.isLive()) {
  58728. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  58729. if (liveTracker.atLiveEdge()) {
  58730. percent = 1;
  58731. }
  58732. } else {
  58733. percent = currentTime / this.player_.duration();
  58734. }
  58735. return percent;
  58736. }
  58737. handleMouseDown(event2) {
  58738. if (!isSingleLeftClick$1(event2)) {
  58739. return;
  58740. }
  58741. event2.stopPropagation();
  58742. this.videoWasPlaying = !this.player_.paused();
  58743. this.player_.pause();
  58744. super.handleMouseDown(event2);
  58745. }
  58746. handleMouseMove(event2, mouseDown = false) {
  58747. if (!isSingleLeftClick$1(event2)) {
  58748. return;
  58749. }
  58750. if (!mouseDown && !this.player_.scrubbing()) {
  58751. this.player_.scrubbing(true);
  58752. }
  58753. let newTime;
  58754. const distance2 = this.calculateDistance(event2);
  58755. const liveTracker = this.player_.liveTracker;
  58756. if (!liveTracker || !liveTracker.isLive()) {
  58757. newTime = distance2 * this.player_.duration();
  58758. if (newTime === this.player_.duration()) {
  58759. newTime = newTime - 0.1;
  58760. }
  58761. } else {
  58762. if (distance2 >= 0.99) {
  58763. liveTracker.seekToLiveEdge();
  58764. return;
  58765. }
  58766. const seekableStart = liveTracker.seekableStart();
  58767. const seekableEnd = liveTracker.liveCurrentTime();
  58768. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  58769. if (newTime >= seekableEnd) {
  58770. newTime = seekableEnd;
  58771. }
  58772. if (newTime <= seekableStart) {
  58773. newTime = seekableStart + 0.1;
  58774. }
  58775. if (newTime === Infinity) {
  58776. return;
  58777. }
  58778. }
  58779. this.userSeek_(newTime);
  58780. }
  58781. enable() {
  58782. super.enable();
  58783. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58784. if (!mouseTimeDisplay) {
  58785. return;
  58786. }
  58787. mouseTimeDisplay.show();
  58788. }
  58789. disable() {
  58790. super.disable();
  58791. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58792. if (!mouseTimeDisplay) {
  58793. return;
  58794. }
  58795. mouseTimeDisplay.hide();
  58796. }
  58797. handleMouseUp(event2) {
  58798. super.handleMouseUp(event2);
  58799. if (event2) {
  58800. event2.stopPropagation();
  58801. }
  58802. this.player_.scrubbing(false);
  58803. this.player_.trigger({
  58804. type: "timeupdate",
  58805. target: this,
  58806. manuallyTriggered: true
  58807. });
  58808. if (this.videoWasPlaying) {
  58809. silencePromise$1(this.player_.play());
  58810. } else {
  58811. this.update_();
  58812. }
  58813. }
  58814. stepForward() {
  58815. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1);
  58816. }
  58817. stepBack() {
  58818. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1);
  58819. }
  58820. handleAction(event2) {
  58821. if (this.player_.paused()) {
  58822. this.player_.play();
  58823. } else {
  58824. this.player_.pause();
  58825. }
  58826. }
  58827. handleKeyDown(event2) {
  58828. const liveTracker = this.player_.liveTracker;
  58829. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  58830. event2.preventDefault();
  58831. event2.stopPropagation();
  58832. this.handleAction(event2);
  58833. } else if (keycode.isEventKey(event2, "Home")) {
  58834. event2.preventDefault();
  58835. event2.stopPropagation();
  58836. this.userSeek_(0);
  58837. } else if (keycode.isEventKey(event2, "End")) {
  58838. event2.preventDefault();
  58839. event2.stopPropagation();
  58840. if (liveTracker && liveTracker.isLive()) {
  58841. this.userSeek_(liveTracker.liveCurrentTime());
  58842. } else {
  58843. this.userSeek_(this.player_.duration());
  58844. }
  58845. } else if (/^[0-9]$/.test(keycode(event2))) {
  58846. event2.preventDefault();
  58847. event2.stopPropagation();
  58848. const gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  58849. if (liveTracker && liveTracker.isLive()) {
  58850. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  58851. } else {
  58852. this.userSeek_(this.player_.duration() * gotoFraction);
  58853. }
  58854. } else if (keycode.isEventKey(event2, "PgDn")) {
  58855. event2.preventDefault();
  58856. event2.stopPropagation();
  58857. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58858. } else if (keycode.isEventKey(event2, "PgUp")) {
  58859. event2.preventDefault();
  58860. event2.stopPropagation();
  58861. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58862. } else {
  58863. super.handleKeyDown(event2);
  58864. }
  58865. }
  58866. dispose() {
  58867. this.disableInterval_();
  58868. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58869. if (this.player_.liveTracker) {
  58870. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  58871. }
  58872. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  58873. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58874. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58875. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  58876. }
  58877. super.dispose();
  58878. }
  58879. }
  58880. SeekBar$1.prototype.options_ = {
  58881. children: ["loadProgressBar", "playProgressBar"],
  58882. barName: "playProgressBar"
  58883. };
  58884. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58885. SeekBar$1.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  58886. }
  58887. Component$1$1.registerComponent("SeekBar", SeekBar$1);
  58888. class ProgressControl$1 extends Component$1$1 {
  58889. constructor(player, options2) {
  58890. super(player, options2);
  58891. this.handleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  58892. this.throttledHandleMouseSeek = throttle$1(bind_(this, this.handleMouseSeek), UPDATE_REFRESH_INTERVAL$1);
  58893. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  58894. this.handleMouseDownHandler_ = (e) => this.handleMouseDown(e);
  58895. this.enable();
  58896. }
  58897. createEl() {
  58898. return super.createEl("div", {
  58899. className: "vjs-progress-control vjs-control"
  58900. });
  58901. }
  58902. handleMouseMove(event2) {
  58903. const seekBar = this.getChild("seekBar");
  58904. if (!seekBar) {
  58905. return;
  58906. }
  58907. const playProgressBar = seekBar.getChild("playProgressBar");
  58908. const mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  58909. if (!playProgressBar && !mouseTimeDisplay) {
  58910. return;
  58911. }
  58912. const seekBarEl = seekBar.el();
  58913. const seekBarRect = findPosition$1(seekBarEl);
  58914. let seekBarPoint = getPointerPosition$1(seekBarEl, event2).x;
  58915. seekBarPoint = clamp$1(seekBarPoint, 0, 1);
  58916. if (mouseTimeDisplay) {
  58917. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  58918. }
  58919. if (playProgressBar) {
  58920. playProgressBar.update(seekBarRect, seekBar.getProgress());
  58921. }
  58922. }
  58923. handleMouseSeek(event2) {
  58924. const seekBar = this.getChild("seekBar");
  58925. if (seekBar) {
  58926. seekBar.handleMouseMove(event2);
  58927. }
  58928. }
  58929. enabled() {
  58930. return this.enabled_;
  58931. }
  58932. disable() {
  58933. this.children().forEach((child) => child.disable && child.disable());
  58934. if (!this.enabled()) {
  58935. return;
  58936. }
  58937. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58938. this.off(this.el_, "mousemove", this.handleMouseMove);
  58939. this.removeListenersAddedOnMousedownAndTouchstart();
  58940. this.addClass("disabled");
  58941. this.enabled_ = false;
  58942. if (this.player_.scrubbing()) {
  58943. const seekBar = this.getChild("seekBar");
  58944. this.player_.scrubbing(false);
  58945. if (seekBar.videoWasPlaying) {
  58946. silencePromise$1(this.player_.play());
  58947. }
  58948. }
  58949. }
  58950. enable() {
  58951. this.children().forEach((child) => child.enable && child.enable());
  58952. if (this.enabled()) {
  58953. return;
  58954. }
  58955. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58956. this.on(this.el_, "mousemove", this.handleMouseMove);
  58957. this.removeClass("disabled");
  58958. this.enabled_ = true;
  58959. }
  58960. removeListenersAddedOnMousedownAndTouchstart() {
  58961. const doc = this.el_.ownerDocument;
  58962. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  58963. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  58964. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  58965. this.off(doc, "touchend", this.handleMouseUpHandler_);
  58966. }
  58967. handleMouseDown(event2) {
  58968. const doc = this.el_.ownerDocument;
  58969. const seekBar = this.getChild("seekBar");
  58970. if (seekBar) {
  58971. seekBar.handleMouseDown(event2);
  58972. }
  58973. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  58974. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  58975. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  58976. this.on(doc, "touchend", this.handleMouseUpHandler_);
  58977. }
  58978. handleMouseUp(event2) {
  58979. const seekBar = this.getChild("seekBar");
  58980. if (seekBar) {
  58981. seekBar.handleMouseUp(event2);
  58982. }
  58983. this.removeListenersAddedOnMousedownAndTouchstart();
  58984. }
  58985. }
  58986. ProgressControl$1.prototype.options_ = {
  58987. children: ["seekBar"]
  58988. };
  58989. Component$1$1.registerComponent("ProgressControl", ProgressControl$1);
  58990. class PictureInPictureToggle$1 extends Button$1 {
  58991. constructor(player, options2) {
  58992. super(player, options2);
  58993. this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], (e) => this.handlePictureInPictureChange(e));
  58994. this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], (e) => this.handlePictureInPictureEnabledChange(e));
  58995. this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], () => {
  58996. const isSourceAudio = player.currentType().substring(0, 5) === "audio";
  58997. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  58998. if (player.isInPictureInPicture()) {
  58999. player.exitPictureInPicture();
  59000. }
  59001. this.hide();
  59002. } else {
  59003. this.show();
  59004. }
  59005. });
  59006. this.disable();
  59007. }
  59008. buildCSSClass() {
  59009. return `vjs-picture-in-picture-control ${super.buildCSSClass()}`;
  59010. }
  59011. handlePictureInPictureEnabledChange() {
  59012. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false || this.player_.options_.enableDocumentPictureInPicture && "documentPictureInPicture" in window_1) {
  59013. this.enable();
  59014. } else {
  59015. this.disable();
  59016. }
  59017. }
  59018. handlePictureInPictureChange(event2) {
  59019. if (this.player_.isInPictureInPicture()) {
  59020. this.controlText("Exit Picture-in-Picture");
  59021. } else {
  59022. this.controlText("Picture-in-Picture");
  59023. }
  59024. this.handlePictureInPictureEnabledChange();
  59025. }
  59026. handleClick(event2) {
  59027. if (!this.player_.isInPictureInPicture()) {
  59028. this.player_.requestPictureInPicture();
  59029. } else {
  59030. this.player_.exitPictureInPicture();
  59031. }
  59032. }
  59033. }
  59034. PictureInPictureToggle$1.prototype.controlText_ = "Picture-in-Picture";
  59035. Component$1$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle$1);
  59036. class FullscreenToggle$1 extends Button$1 {
  59037. constructor(player, options2) {
  59038. super(player, options2);
  59039. this.on(player, "fullscreenchange", (e) => this.handleFullscreenChange(e));
  59040. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  59041. this.disable();
  59042. }
  59043. }
  59044. buildCSSClass() {
  59045. return `vjs-fullscreen-control ${super.buildCSSClass()}`;
  59046. }
  59047. handleFullscreenChange(event2) {
  59048. if (this.player_.isFullscreen()) {
  59049. this.controlText("Exit Fullscreen");
  59050. } else {
  59051. this.controlText("Fullscreen");
  59052. }
  59053. }
  59054. handleClick(event2) {
  59055. if (!this.player_.isFullscreen()) {
  59056. this.player_.requestFullscreen();
  59057. } else {
  59058. this.player_.exitFullscreen();
  59059. }
  59060. }
  59061. }
  59062. FullscreenToggle$1.prototype.controlText_ = "Fullscreen";
  59063. Component$1$1.registerComponent("FullscreenToggle", FullscreenToggle$1);
  59064. const checkVolumeSupport$1 = function(self2, player) {
  59065. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  59066. self2.addClass("vjs-hidden");
  59067. }
  59068. self2.on(player, "loadstart", function() {
  59069. if (!player.tech_.featuresVolumeControl) {
  59070. self2.addClass("vjs-hidden");
  59071. } else {
  59072. self2.removeClass("vjs-hidden");
  59073. }
  59074. });
  59075. };
  59076. class VolumeLevel$1 extends Component$1$1 {
  59077. createEl() {
  59078. const el = super.createEl("div", {
  59079. className: "vjs-volume-level"
  59080. });
  59081. el.appendChild(super.createEl("span", {
  59082. className: "vjs-control-text"
  59083. }));
  59084. return el;
  59085. }
  59086. }
  59087. Component$1$1.registerComponent("VolumeLevel", VolumeLevel$1);
  59088. class VolumeLevelTooltip$1 extends Component$1$1 {
  59089. constructor(player, options2) {
  59090. super(player, options2);
  59091. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59092. }
  59093. createEl() {
  59094. return super.createEl("div", {
  59095. className: "vjs-volume-tooltip"
  59096. }, {
  59097. "aria-hidden": "true"
  59098. });
  59099. }
  59100. update(rangeBarRect, rangeBarPoint, vertical, content) {
  59101. if (!vertical) {
  59102. const tooltipRect = getBoundingClientRect$1(this.el_);
  59103. const playerRect = getBoundingClientRect$1(this.player_.el());
  59104. const volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  59105. if (!playerRect || !tooltipRect) {
  59106. return;
  59107. }
  59108. const spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  59109. const spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  59110. let pullTooltipBy = tooltipRect.width / 2;
  59111. if (spaceLeftOfPoint < pullTooltipBy) {
  59112. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  59113. } else if (spaceRightOfPoint < pullTooltipBy) {
  59114. pullTooltipBy = spaceRightOfPoint;
  59115. }
  59116. if (pullTooltipBy < 0) {
  59117. pullTooltipBy = 0;
  59118. } else if (pullTooltipBy > tooltipRect.width) {
  59119. pullTooltipBy = tooltipRect.width;
  59120. }
  59121. this.el_.style.right = `-${pullTooltipBy}px`;
  59122. }
  59123. this.write(`${content}%`);
  59124. }
  59125. write(content) {
  59126. textContent$1(this.el_, content);
  59127. }
  59128. updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  59129. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", () => {
  59130. this.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  59131. if (cb) {
  59132. cb();
  59133. }
  59134. });
  59135. }
  59136. }
  59137. Component$1$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip$1);
  59138. class MouseVolumeLevelDisplay$1 extends Component$1$1 {
  59139. constructor(player, options2) {
  59140. super(player, options2);
  59141. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59142. }
  59143. createEl() {
  59144. return super.createEl("div", {
  59145. className: "vjs-mouse-display"
  59146. });
  59147. }
  59148. update(rangeBarRect, rangeBarPoint, vertical) {
  59149. const volume = 100 * rangeBarPoint;
  59150. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, () => {
  59151. if (vertical) {
  59152. this.el_.style.bottom = `${rangeBarRect.height * rangeBarPoint}px`;
  59153. } else {
  59154. this.el_.style.left = `${rangeBarRect.width * rangeBarPoint}px`;
  59155. }
  59156. });
  59157. }
  59158. }
  59159. MouseVolumeLevelDisplay$1.prototype.options_ = {
  59160. children: ["volumeLevelTooltip"]
  59161. };
  59162. Component$1$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay$1);
  59163. class VolumeBar$1 extends Slider$1 {
  59164. constructor(player, options2) {
  59165. super(player, options2);
  59166. this.on("slideractive", (e) => this.updateLastVolume_(e));
  59167. this.on(player, "volumechange", (e) => this.updateARIAAttributes(e));
  59168. player.ready(() => this.updateARIAAttributes());
  59169. }
  59170. createEl() {
  59171. return super.createEl("div", {
  59172. className: "vjs-volume-bar vjs-slider-bar"
  59173. }, {
  59174. "aria-label": this.localize("Volume Level"),
  59175. "aria-live": "polite"
  59176. });
  59177. }
  59178. handleMouseDown(event2) {
  59179. if (!isSingleLeftClick$1(event2)) {
  59180. return;
  59181. }
  59182. super.handleMouseDown(event2);
  59183. }
  59184. handleMouseMove(event2) {
  59185. const mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  59186. if (mouseVolumeLevelDisplay) {
  59187. const volumeBarEl = this.el();
  59188. const volumeBarRect = getBoundingClientRect$1(volumeBarEl);
  59189. const vertical = this.vertical();
  59190. let volumeBarPoint = getPointerPosition$1(volumeBarEl, event2);
  59191. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  59192. volumeBarPoint = clamp$1(volumeBarPoint, 0, 1);
  59193. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  59194. }
  59195. if (!isSingleLeftClick$1(event2)) {
  59196. return;
  59197. }
  59198. this.checkMuted();
  59199. this.player_.volume(this.calculateDistance(event2));
  59200. }
  59201. checkMuted() {
  59202. if (this.player_.muted()) {
  59203. this.player_.muted(false);
  59204. }
  59205. }
  59206. getPercent() {
  59207. if (this.player_.muted()) {
  59208. return 0;
  59209. }
  59210. return this.player_.volume();
  59211. }
  59212. stepForward() {
  59213. this.checkMuted();
  59214. this.player_.volume(this.player_.volume() + 0.1);
  59215. }
  59216. stepBack() {
  59217. this.checkMuted();
  59218. this.player_.volume(this.player_.volume() - 0.1);
  59219. }
  59220. updateARIAAttributes(event2) {
  59221. const ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  59222. this.el_.setAttribute("aria-valuenow", ariaValue);
  59223. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  59224. }
  59225. volumeAsPercentage_() {
  59226. return Math.round(this.player_.volume() * 100);
  59227. }
  59228. updateLastVolume_() {
  59229. const volumeBeforeDrag = this.player_.volume();
  59230. this.one("sliderinactive", () => {
  59231. if (this.player_.volume() === 0) {
  59232. this.player_.lastVolume_(volumeBeforeDrag);
  59233. }
  59234. });
  59235. }
  59236. }
  59237. VolumeBar$1.prototype.options_ = {
  59238. children: ["volumeLevel"],
  59239. barName: "volumeLevel"
  59240. };
  59241. if (!IS_IOS$1 && !IS_ANDROID$1) {
  59242. VolumeBar$1.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  59243. }
  59244. VolumeBar$1.prototype.playerEvent = "volumechange";
  59245. Component$1$1.registerComponent("VolumeBar", VolumeBar$1);
  59246. class VolumeControl$1 extends Component$1$1 {
  59247. constructor(player, options2 = {}) {
  59248. options2.vertical = options2.vertical || false;
  59249. if (typeof options2.volumeBar === "undefined" || isPlain$1(options2.volumeBar)) {
  59250. options2.volumeBar = options2.volumeBar || {};
  59251. options2.volumeBar.vertical = options2.vertical;
  59252. }
  59253. super(player, options2);
  59254. checkVolumeSupport$1(this, player);
  59255. this.throttledHandleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  59256. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  59257. this.on("mousedown", (e) => this.handleMouseDown(e));
  59258. this.on("touchstart", (e) => this.handleMouseDown(e));
  59259. this.on("mousemove", (e) => this.handleMouseMove(e));
  59260. this.on(this.volumeBar, ["focus", "slideractive"], () => {
  59261. this.volumeBar.addClass("vjs-slider-active");
  59262. this.addClass("vjs-slider-active");
  59263. this.trigger("slideractive");
  59264. });
  59265. this.on(this.volumeBar, ["blur", "sliderinactive"], () => {
  59266. this.volumeBar.removeClass("vjs-slider-active");
  59267. this.removeClass("vjs-slider-active");
  59268. this.trigger("sliderinactive");
  59269. });
  59270. }
  59271. createEl() {
  59272. let orientationClass = "vjs-volume-horizontal";
  59273. if (this.options_.vertical) {
  59274. orientationClass = "vjs-volume-vertical";
  59275. }
  59276. return super.createEl("div", {
  59277. className: `vjs-volume-control vjs-control ${orientationClass}`
  59278. });
  59279. }
  59280. handleMouseDown(event2) {
  59281. const doc = this.el_.ownerDocument;
  59282. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  59283. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  59284. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  59285. this.on(doc, "touchend", this.handleMouseUpHandler_);
  59286. }
  59287. handleMouseUp(event2) {
  59288. const doc = this.el_.ownerDocument;
  59289. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  59290. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  59291. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  59292. this.off(doc, "touchend", this.handleMouseUpHandler_);
  59293. }
  59294. handleMouseMove(event2) {
  59295. this.volumeBar.handleMouseMove(event2);
  59296. }
  59297. }
  59298. VolumeControl$1.prototype.options_ = {
  59299. children: ["volumeBar"]
  59300. };
  59301. Component$1$1.registerComponent("VolumeControl", VolumeControl$1);
  59302. const checkMuteSupport$1 = function(self2, player) {
  59303. if (player.tech_ && !player.tech_.featuresMuteControl) {
  59304. self2.addClass("vjs-hidden");
  59305. }
  59306. self2.on(player, "loadstart", function() {
  59307. if (!player.tech_.featuresMuteControl) {
  59308. self2.addClass("vjs-hidden");
  59309. } else {
  59310. self2.removeClass("vjs-hidden");
  59311. }
  59312. });
  59313. };
  59314. class MuteToggle$1 extends Button$1 {
  59315. constructor(player, options2) {
  59316. super(player, options2);
  59317. checkMuteSupport$1(this, player);
  59318. this.on(player, ["loadstart", "volumechange"], (e) => this.update(e));
  59319. }
  59320. buildCSSClass() {
  59321. return `vjs-mute-control ${super.buildCSSClass()}`;
  59322. }
  59323. handleClick(event2) {
  59324. const vol = this.player_.volume();
  59325. const lastVolume = this.player_.lastVolume_();
  59326. if (vol === 0) {
  59327. const volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  59328. this.player_.volume(volumeToSet);
  59329. this.player_.muted(false);
  59330. } else {
  59331. this.player_.muted(this.player_.muted() ? false : true);
  59332. }
  59333. }
  59334. update(event2) {
  59335. this.updateIcon_();
  59336. this.updateControlText_();
  59337. }
  59338. updateIcon_() {
  59339. const vol = this.player_.volume();
  59340. let level = 3;
  59341. if (IS_IOS$1 && this.player_.tech_ && this.player_.tech_.el_) {
  59342. this.player_.muted(this.player_.tech_.el_.muted);
  59343. }
  59344. if (vol === 0 || this.player_.muted()) {
  59345. level = 0;
  59346. } else if (vol < 0.33) {
  59347. level = 1;
  59348. } else if (vol < 0.67) {
  59349. level = 2;
  59350. }
  59351. removeClass$1(this.el_, [0, 1, 2, 3].reduce((str, i2) => str + `${i2 ? " " : ""}vjs-vol-${i2}`, ""));
  59352. addClass$1(this.el_, `vjs-vol-${level}`);
  59353. }
  59354. updateControlText_() {
  59355. const soundOff = this.player_.muted() || this.player_.volume() === 0;
  59356. const text = soundOff ? "Unmute" : "Mute";
  59357. if (this.controlText() !== text) {
  59358. this.controlText(text);
  59359. }
  59360. }
  59361. }
  59362. MuteToggle$1.prototype.controlText_ = "Mute";
  59363. Component$1$1.registerComponent("MuteToggle", MuteToggle$1);
  59364. class VolumePanel$1 extends Component$1$1 {
  59365. constructor(player, options2 = {}) {
  59366. if (typeof options2.inline !== "undefined") {
  59367. options2.inline = options2.inline;
  59368. } else {
  59369. options2.inline = true;
  59370. }
  59371. if (typeof options2.volumeControl === "undefined" || isPlain$1(options2.volumeControl)) {
  59372. options2.volumeControl = options2.volumeControl || {};
  59373. options2.volumeControl.vertical = !options2.inline;
  59374. }
  59375. super(player, options2);
  59376. this.handleKeyPressHandler_ = (e) => this.handleKeyPress(e);
  59377. this.on(player, ["loadstart"], (e) => this.volumePanelState_(e));
  59378. this.on(this.muteToggle, "keyup", (e) => this.handleKeyPress(e));
  59379. this.on(this.volumeControl, "keyup", (e) => this.handleVolumeControlKeyUp(e));
  59380. this.on("keydown", (e) => this.handleKeyPress(e));
  59381. this.on("mouseover", (e) => this.handleMouseOver(e));
  59382. this.on("mouseout", (e) => this.handleMouseOut(e));
  59383. this.on(this.volumeControl, ["slideractive"], this.sliderActive_);
  59384. this.on(this.volumeControl, ["sliderinactive"], this.sliderInactive_);
  59385. }
  59386. sliderActive_() {
  59387. this.addClass("vjs-slider-active");
  59388. }
  59389. sliderInactive_() {
  59390. this.removeClass("vjs-slider-active");
  59391. }
  59392. volumePanelState_() {
  59393. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  59394. this.addClass("vjs-hidden");
  59395. }
  59396. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  59397. this.addClass("vjs-mute-toggle-only");
  59398. }
  59399. }
  59400. createEl() {
  59401. let orientationClass = "vjs-volume-panel-horizontal";
  59402. if (!this.options_.inline) {
  59403. orientationClass = "vjs-volume-panel-vertical";
  59404. }
  59405. return super.createEl("div", {
  59406. className: `vjs-volume-panel vjs-control ${orientationClass}`
  59407. });
  59408. }
  59409. dispose() {
  59410. this.handleMouseOut();
  59411. super.dispose();
  59412. }
  59413. handleVolumeControlKeyUp(event2) {
  59414. if (keycode.isEventKey(event2, "Esc")) {
  59415. this.muteToggle.focus();
  59416. }
  59417. }
  59418. handleMouseOver(event2) {
  59419. this.addClass("vjs-hover");
  59420. on$1(document_1, "keyup", this.handleKeyPressHandler_);
  59421. }
  59422. handleMouseOut(event2) {
  59423. this.removeClass("vjs-hover");
  59424. off$1(document_1, "keyup", this.handleKeyPressHandler_);
  59425. }
  59426. handleKeyPress(event2) {
  59427. if (keycode.isEventKey(event2, "Esc")) {
  59428. this.handleMouseOut();
  59429. }
  59430. }
  59431. }
  59432. VolumePanel$1.prototype.options_ = {
  59433. children: ["muteToggle", "volumeControl"]
  59434. };
  59435. Component$1$1.registerComponent("VolumePanel", VolumePanel$1);
  59436. class SkipForward extends Button$1 {
  59437. constructor(player, options2) {
  59438. super(player, options2);
  59439. this.validOptions = [5, 10, 30];
  59440. this.skipTime = this.getSkipForwardTime();
  59441. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59442. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59443. this.show();
  59444. } else {
  59445. this.hide();
  59446. }
  59447. }
  59448. getSkipForwardTime() {
  59449. const playerOptions = this.options_.playerOptions;
  59450. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.forward;
  59451. }
  59452. buildCSSClass() {
  59453. return `vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`;
  59454. }
  59455. handleClick(event2) {
  59456. const currentVideoTime = this.player_.currentTime();
  59457. const liveTracker = this.player_.liveTracker;
  59458. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  59459. let newTime;
  59460. if (currentVideoTime + this.skipTime <= duration5) {
  59461. newTime = currentVideoTime + this.skipTime;
  59462. } else {
  59463. newTime = duration5;
  59464. }
  59465. this.player_.currentTime(newTime);
  59466. }
  59467. handleLanguagechange() {
  59468. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59469. }
  59470. }
  59471. Component$1$1.registerComponent("SkipForward", SkipForward);
  59472. class SkipBackward extends Button$1 {
  59473. constructor(player, options2) {
  59474. super(player, options2);
  59475. this.validOptions = [5, 10, 30];
  59476. this.skipTime = this.getSkipBackwardTime();
  59477. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59478. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59479. this.show();
  59480. } else {
  59481. this.hide();
  59482. }
  59483. }
  59484. getSkipBackwardTime() {
  59485. const playerOptions = this.options_.playerOptions;
  59486. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.backward;
  59487. }
  59488. buildCSSClass() {
  59489. return `vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`;
  59490. }
  59491. handleClick(event2) {
  59492. const currentVideoTime = this.player_.currentTime();
  59493. const liveTracker = this.player_.liveTracker;
  59494. const seekableStart = liveTracker && liveTracker.isLive() && liveTracker.seekableStart();
  59495. let newTime;
  59496. if (seekableStart && currentVideoTime - this.skipTime <= seekableStart) {
  59497. newTime = seekableStart;
  59498. } else if (currentVideoTime >= this.skipTime) {
  59499. newTime = currentVideoTime - this.skipTime;
  59500. } else {
  59501. newTime = 0;
  59502. }
  59503. this.player_.currentTime(newTime);
  59504. }
  59505. handleLanguagechange() {
  59506. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59507. }
  59508. }
  59509. SkipBackward.prototype.controlText_ = "Skip Backward";
  59510. Component$1$1.registerComponent("SkipBackward", SkipBackward);
  59511. class Menu$1 extends Component$1$1 {
  59512. constructor(player, options2) {
  59513. super(player, options2);
  59514. if (options2) {
  59515. this.menuButton_ = options2.menuButton;
  59516. }
  59517. this.focusedChild_ = -1;
  59518. this.on("keydown", (e) => this.handleKeyDown(e));
  59519. this.boundHandleBlur_ = (e) => this.handleBlur(e);
  59520. this.boundHandleTapClick_ = (e) => this.handleTapClick(e);
  59521. }
  59522. addEventListenerForItem(component) {
  59523. if (!(component instanceof Component$1$1)) {
  59524. return;
  59525. }
  59526. this.on(component, "blur", this.boundHandleBlur_);
  59527. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  59528. }
  59529. removeEventListenerForItem(component) {
  59530. if (!(component instanceof Component$1$1)) {
  59531. return;
  59532. }
  59533. this.off(component, "blur", this.boundHandleBlur_);
  59534. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  59535. }
  59536. removeChild(component) {
  59537. if (typeof component === "string") {
  59538. component = this.getChild(component);
  59539. }
  59540. this.removeEventListenerForItem(component);
  59541. super.removeChild(component);
  59542. }
  59543. addItem(component) {
  59544. const childComponent = this.addChild(component);
  59545. if (childComponent) {
  59546. this.addEventListenerForItem(childComponent);
  59547. }
  59548. }
  59549. createEl() {
  59550. const contentElType = this.options_.contentElType || "ul";
  59551. this.contentEl_ = createEl$1(contentElType, {
  59552. className: "vjs-menu-content"
  59553. });
  59554. this.contentEl_.setAttribute("role", "menu");
  59555. const el = super.createEl("div", {
  59556. append: this.contentEl_,
  59557. className: "vjs-menu"
  59558. });
  59559. el.appendChild(this.contentEl_);
  59560. on$1(el, "click", function(event2) {
  59561. event2.preventDefault();
  59562. event2.stopImmediatePropagation();
  59563. });
  59564. return el;
  59565. }
  59566. dispose() {
  59567. this.contentEl_ = null;
  59568. this.boundHandleBlur_ = null;
  59569. this.boundHandleTapClick_ = null;
  59570. super.dispose();
  59571. }
  59572. handleBlur(event2) {
  59573. const relatedTarget = event2.relatedTarget || document_1.activeElement;
  59574. if (!this.children().some((element) => {
  59575. return element.el() === relatedTarget;
  59576. })) {
  59577. const btn = this.menuButton_;
  59578. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  59579. btn.unpressButton();
  59580. }
  59581. }
  59582. }
  59583. handleTapClick(event2) {
  59584. if (this.menuButton_) {
  59585. this.menuButton_.unpressButton();
  59586. const childComponents = this.children();
  59587. if (!Array.isArray(childComponents)) {
  59588. return;
  59589. }
  59590. const foundComponent = childComponents.filter((component) => component.el() === event2.target)[0];
  59591. if (!foundComponent) {
  59592. return;
  59593. }
  59594. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  59595. this.menuButton_.focus();
  59596. }
  59597. }
  59598. }
  59599. handleKeyDown(event2) {
  59600. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  59601. event2.preventDefault();
  59602. event2.stopPropagation();
  59603. this.stepForward();
  59604. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  59605. event2.preventDefault();
  59606. event2.stopPropagation();
  59607. this.stepBack();
  59608. }
  59609. }
  59610. stepForward() {
  59611. let stepChild = 0;
  59612. if (this.focusedChild_ !== void 0) {
  59613. stepChild = this.focusedChild_ + 1;
  59614. }
  59615. this.focus(stepChild);
  59616. }
  59617. stepBack() {
  59618. let stepChild = 0;
  59619. if (this.focusedChild_ !== void 0) {
  59620. stepChild = this.focusedChild_ - 1;
  59621. }
  59622. this.focus(stepChild);
  59623. }
  59624. focus(item = 0) {
  59625. const children = this.children().slice();
  59626. const haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  59627. if (haveTitle) {
  59628. children.shift();
  59629. }
  59630. if (children.length > 0) {
  59631. if (item < 0) {
  59632. item = 0;
  59633. } else if (item >= children.length) {
  59634. item = children.length - 1;
  59635. }
  59636. this.focusedChild_ = item;
  59637. children[item].el_.focus();
  59638. }
  59639. }
  59640. }
  59641. Component$1$1.registerComponent("Menu", Menu$1);
  59642. class MenuButton$1 extends Component$1$1 {
  59643. constructor(player, options2 = {}) {
  59644. super(player, options2);
  59645. this.menuButton_ = new Button$1(player, options2);
  59646. this.menuButton_.controlText(this.controlText_);
  59647. this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  59648. const buttonClass = Button$1.prototype.buildCSSClass();
  59649. this.menuButton_.el_.className = this.buildCSSClass() + " " + buttonClass;
  59650. this.menuButton_.removeClass("vjs-control");
  59651. this.addChild(this.menuButton_);
  59652. this.update();
  59653. this.enabled_ = true;
  59654. const handleClick = (e) => this.handleClick(e);
  59655. this.handleMenuKeyUp_ = (e) => this.handleMenuKeyUp(e);
  59656. this.on(this.menuButton_, "tap", handleClick);
  59657. this.on(this.menuButton_, "click", handleClick);
  59658. this.on(this.menuButton_, "keydown", (e) => this.handleKeyDown(e));
  59659. this.on(this.menuButton_, "mouseenter", () => {
  59660. this.addClass("vjs-hover");
  59661. this.menu.show();
  59662. on$1(document_1, "keyup", this.handleMenuKeyUp_);
  59663. });
  59664. this.on("mouseleave", (e) => this.handleMouseLeave(e));
  59665. this.on("keydown", (e) => this.handleSubmenuKeyDown(e));
  59666. }
  59667. update() {
  59668. const menu = this.createMenu();
  59669. if (this.menu) {
  59670. this.menu.dispose();
  59671. this.removeChild(this.menu);
  59672. }
  59673. this.menu = menu;
  59674. this.addChild(menu);
  59675. this.buttonPressed_ = false;
  59676. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59677. if (this.items && this.items.length <= this.hideThreshold_) {
  59678. this.hide();
  59679. this.menu.contentEl_.removeAttribute("role");
  59680. } else {
  59681. this.show();
  59682. this.menu.contentEl_.setAttribute("role", "menu");
  59683. }
  59684. }
  59685. createMenu() {
  59686. const menu = new Menu$1(this.player_, {
  59687. menuButton: this
  59688. });
  59689. this.hideThreshold_ = 0;
  59690. if (this.options_.title) {
  59691. const titleEl = createEl$1("li", {
  59692. className: "vjs-menu-title",
  59693. textContent: toTitleCase$1$1(this.options_.title),
  59694. tabIndex: -1
  59695. });
  59696. const titleComponent = new Component$1$1(this.player_, {
  59697. el: titleEl
  59698. });
  59699. menu.addItem(titleComponent);
  59700. }
  59701. this.items = this.createItems();
  59702. if (this.items) {
  59703. for (let i2 = 0; i2 < this.items.length; i2++) {
  59704. menu.addItem(this.items[i2]);
  59705. }
  59706. }
  59707. return menu;
  59708. }
  59709. createItems() {
  59710. }
  59711. createEl() {
  59712. return super.createEl("div", {
  59713. className: this.buildWrapperCSSClass()
  59714. }, {});
  59715. }
  59716. buildWrapperCSSClass() {
  59717. let menuButtonClass = "vjs-menu-button";
  59718. if (this.options_.inline === true) {
  59719. menuButtonClass += "-inline";
  59720. } else {
  59721. menuButtonClass += "-popup";
  59722. }
  59723. const buttonClass = Button$1.prototype.buildCSSClass();
  59724. return `vjs-menu-button ${menuButtonClass} ${buttonClass} ${super.buildCSSClass()}`;
  59725. }
  59726. buildCSSClass() {
  59727. let menuButtonClass = "vjs-menu-button";
  59728. if (this.options_.inline === true) {
  59729. menuButtonClass += "-inline";
  59730. } else {
  59731. menuButtonClass += "-popup";
  59732. }
  59733. return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;
  59734. }
  59735. controlText(text, el = this.menuButton_.el()) {
  59736. return this.menuButton_.controlText(text, el);
  59737. }
  59738. dispose() {
  59739. this.handleMouseLeave();
  59740. super.dispose();
  59741. }
  59742. handleClick(event2) {
  59743. if (this.buttonPressed_) {
  59744. this.unpressButton();
  59745. } else {
  59746. this.pressButton();
  59747. }
  59748. }
  59749. handleMouseLeave(event2) {
  59750. this.removeClass("vjs-hover");
  59751. off$1(document_1, "keyup", this.handleMenuKeyUp_);
  59752. }
  59753. focus() {
  59754. this.menuButton_.focus();
  59755. }
  59756. blur() {
  59757. this.menuButton_.blur();
  59758. }
  59759. handleKeyDown(event2) {
  59760. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59761. if (this.buttonPressed_) {
  59762. this.unpressButton();
  59763. }
  59764. if (!keycode.isEventKey(event2, "Tab")) {
  59765. event2.preventDefault();
  59766. this.menuButton_.focus();
  59767. }
  59768. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  59769. if (!this.buttonPressed_) {
  59770. event2.preventDefault();
  59771. this.pressButton();
  59772. }
  59773. }
  59774. }
  59775. handleMenuKeyUp(event2) {
  59776. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59777. this.removeClass("vjs-hover");
  59778. }
  59779. }
  59780. handleSubmenuKeyPress(event2) {
  59781. this.handleSubmenuKeyDown(event2);
  59782. }
  59783. handleSubmenuKeyDown(event2) {
  59784. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59785. if (this.buttonPressed_) {
  59786. this.unpressButton();
  59787. }
  59788. if (!keycode.isEventKey(event2, "Tab")) {
  59789. event2.preventDefault();
  59790. this.menuButton_.focus();
  59791. }
  59792. }
  59793. }
  59794. pressButton() {
  59795. if (this.enabled_) {
  59796. this.buttonPressed_ = true;
  59797. this.menu.show();
  59798. this.menu.lockShowing();
  59799. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  59800. if (IS_IOS$1 && isInFrame$1()) {
  59801. return;
  59802. }
  59803. this.menu.focus();
  59804. }
  59805. }
  59806. unpressButton() {
  59807. if (this.enabled_) {
  59808. this.buttonPressed_ = false;
  59809. this.menu.unlockShowing();
  59810. this.menu.hide();
  59811. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59812. }
  59813. }
  59814. disable() {
  59815. this.unpressButton();
  59816. this.enabled_ = false;
  59817. this.addClass("vjs-disabled");
  59818. this.menuButton_.disable();
  59819. }
  59820. enable() {
  59821. this.enabled_ = true;
  59822. this.removeClass("vjs-disabled");
  59823. this.menuButton_.enable();
  59824. }
  59825. }
  59826. Component$1$1.registerComponent("MenuButton", MenuButton$1);
  59827. class TrackButton$1 extends MenuButton$1 {
  59828. constructor(player, options2) {
  59829. const tracks = options2.tracks;
  59830. super(player, options2);
  59831. if (this.items.length <= 1) {
  59832. this.hide();
  59833. }
  59834. if (!tracks) {
  59835. return;
  59836. }
  59837. const updateHandler = bind_(this, this.update);
  59838. tracks.addEventListener("removetrack", updateHandler);
  59839. tracks.addEventListener("addtrack", updateHandler);
  59840. tracks.addEventListener("labelchange", updateHandler);
  59841. this.player_.on("ready", updateHandler);
  59842. this.player_.on("dispose", function() {
  59843. tracks.removeEventListener("removetrack", updateHandler);
  59844. tracks.removeEventListener("addtrack", updateHandler);
  59845. tracks.removeEventListener("labelchange", updateHandler);
  59846. });
  59847. }
  59848. }
  59849. Component$1$1.registerComponent("TrackButton", TrackButton$1);
  59850. const MenuKeys$1 = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  59851. class MenuItem$1 extends ClickableComponent$1 {
  59852. constructor(player, options2) {
  59853. super(player, options2);
  59854. this.selectable = options2.selectable;
  59855. this.isSelected_ = options2.selected || false;
  59856. this.multiSelectable = options2.multiSelectable;
  59857. this.selected(this.isSelected_);
  59858. if (this.selectable) {
  59859. if (this.multiSelectable) {
  59860. this.el_.setAttribute("role", "menuitemcheckbox");
  59861. } else {
  59862. this.el_.setAttribute("role", "menuitemradio");
  59863. }
  59864. } else {
  59865. this.el_.setAttribute("role", "menuitem");
  59866. }
  59867. }
  59868. createEl(type2, props, attrs) {
  59869. this.nonIconControl = true;
  59870. const el = super.createEl("li", Object.assign({
  59871. className: "vjs-menu-item",
  59872. tabIndex: -1
  59873. }, props), attrs);
  59874. el.replaceChild(createEl$1("span", {
  59875. className: "vjs-menu-item-text",
  59876. textContent: this.localize(this.options_.label)
  59877. }), el.querySelector(".vjs-icon-placeholder"));
  59878. return el;
  59879. }
  59880. handleKeyDown(event2) {
  59881. if (!MenuKeys$1.some((key) => keycode.isEventKey(event2, key))) {
  59882. super.handleKeyDown(event2);
  59883. }
  59884. }
  59885. handleClick(event2) {
  59886. this.selected(true);
  59887. }
  59888. selected(selected) {
  59889. if (this.selectable) {
  59890. if (selected) {
  59891. this.addClass("vjs-selected");
  59892. this.el_.setAttribute("aria-checked", "true");
  59893. this.controlText(", selected");
  59894. this.isSelected_ = true;
  59895. } else {
  59896. this.removeClass("vjs-selected");
  59897. this.el_.setAttribute("aria-checked", "false");
  59898. this.controlText("");
  59899. this.isSelected_ = false;
  59900. }
  59901. }
  59902. }
  59903. }
  59904. Component$1$1.registerComponent("MenuItem", MenuItem$1);
  59905. class TextTrackMenuItem$1 extends MenuItem$1 {
  59906. constructor(player, options2) {
  59907. const track = options2.track;
  59908. const tracks = player.textTracks();
  59909. options2.label = track.label || track.language || "Unknown";
  59910. options2.selected = track.mode === "showing";
  59911. super(player, options2);
  59912. this.track = track;
  59913. this.kinds = (options2.kinds || [options2.kind || this.track.kind]).filter(Boolean);
  59914. const changeHandler = (...args) => {
  59915. this.handleTracksChange.apply(this, args);
  59916. };
  59917. const selectedLanguageChangeHandler = (...args) => {
  59918. this.handleSelectedLanguageChange.apply(this, args);
  59919. };
  59920. player.on(["loadstart", "texttrackchange"], changeHandler);
  59921. tracks.addEventListener("change", changeHandler);
  59922. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59923. this.on("dispose", function() {
  59924. player.off(["loadstart", "texttrackchange"], changeHandler);
  59925. tracks.removeEventListener("change", changeHandler);
  59926. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59927. });
  59928. if (tracks.onchange === void 0) {
  59929. let event2;
  59930. this.on(["tap", "click"], function() {
  59931. if (typeof window_1.Event !== "object") {
  59932. try {
  59933. event2 = new window_1.Event("change");
  59934. } catch (err) {
  59935. }
  59936. }
  59937. if (!event2) {
  59938. event2 = document_1.createEvent("Event");
  59939. event2.initEvent("change", true, true);
  59940. }
  59941. tracks.dispatchEvent(event2);
  59942. });
  59943. }
  59944. this.handleTracksChange();
  59945. }
  59946. handleClick(event2) {
  59947. const referenceTrack = this.track;
  59948. const tracks = this.player_.textTracks();
  59949. super.handleClick(event2);
  59950. if (!tracks) {
  59951. return;
  59952. }
  59953. for (let i2 = 0; i2 < tracks.length; i2++) {
  59954. const track = tracks[i2];
  59955. if (this.kinds.indexOf(track.kind) === -1) {
  59956. continue;
  59957. }
  59958. if (track === referenceTrack) {
  59959. if (track.mode !== "showing") {
  59960. track.mode = "showing";
  59961. }
  59962. } else if (track.mode !== "disabled") {
  59963. track.mode = "disabled";
  59964. }
  59965. }
  59966. }
  59967. handleTracksChange(event2) {
  59968. const shouldBeSelected = this.track.mode === "showing";
  59969. if (shouldBeSelected !== this.isSelected_) {
  59970. this.selected(shouldBeSelected);
  59971. }
  59972. }
  59973. handleSelectedLanguageChange(event2) {
  59974. if (this.track.mode === "showing") {
  59975. const selectedLanguage = this.player_.cache_.selectedLanguage;
  59976. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  59977. return;
  59978. }
  59979. this.player_.cache_.selectedLanguage = {
  59980. enabled: true,
  59981. language: this.track.language,
  59982. kind: this.track.kind
  59983. };
  59984. }
  59985. }
  59986. dispose() {
  59987. this.track = null;
  59988. super.dispose();
  59989. }
  59990. }
  59991. Component$1$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem$1);
  59992. class OffTextTrackMenuItem$1 extends TextTrackMenuItem$1 {
  59993. constructor(player, options2) {
  59994. options2.track = {
  59995. player,
  59996. kind: options2.kind,
  59997. kinds: options2.kinds,
  59998. default: false,
  59999. mode: "disabled"
  60000. };
  60001. if (!options2.kinds) {
  60002. options2.kinds = [options2.kind];
  60003. }
  60004. if (options2.label) {
  60005. options2.track.label = options2.label;
  60006. } else {
  60007. options2.track.label = options2.kinds.join(" and ") + " off";
  60008. }
  60009. options2.selectable = true;
  60010. options2.multiSelectable = false;
  60011. super(player, options2);
  60012. }
  60013. handleTracksChange(event2) {
  60014. const tracks = this.player().textTracks();
  60015. let shouldBeSelected = true;
  60016. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  60017. const track = tracks[i2];
  60018. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  60019. shouldBeSelected = false;
  60020. break;
  60021. }
  60022. }
  60023. if (shouldBeSelected !== this.isSelected_) {
  60024. this.selected(shouldBeSelected);
  60025. }
  60026. }
  60027. handleSelectedLanguageChange(event2) {
  60028. const tracks = this.player().textTracks();
  60029. let allHidden = true;
  60030. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  60031. const track = tracks[i2];
  60032. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  60033. allHidden = false;
  60034. break;
  60035. }
  60036. }
  60037. if (allHidden) {
  60038. this.player_.cache_.selectedLanguage = {
  60039. enabled: false
  60040. };
  60041. }
  60042. }
  60043. handleLanguagechange() {
  60044. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.label);
  60045. super.handleLanguagechange();
  60046. }
  60047. }
  60048. Component$1$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem$1);
  60049. class TextTrackButton$1 extends TrackButton$1 {
  60050. constructor(player, options2 = {}) {
  60051. options2.tracks = player.textTracks();
  60052. super(player, options2);
  60053. }
  60054. createItems(items = [], TrackMenuItem = TextTrackMenuItem$1) {
  60055. let label2;
  60056. if (this.label_) {
  60057. label2 = `${this.label_} off`;
  60058. }
  60059. items.push(new OffTextTrackMenuItem$1(this.player_, {
  60060. kinds: this.kinds_,
  60061. kind: this.kind_,
  60062. label: label2
  60063. }));
  60064. this.hideThreshold_ += 1;
  60065. const tracks = this.player_.textTracks();
  60066. if (!Array.isArray(this.kinds_)) {
  60067. this.kinds_ = [this.kind_];
  60068. }
  60069. for (let i2 = 0; i2 < tracks.length; i2++) {
  60070. const track = tracks[i2];
  60071. if (this.kinds_.indexOf(track.kind) > -1) {
  60072. const item = new TrackMenuItem(this.player_, {
  60073. track,
  60074. kinds: this.kinds_,
  60075. kind: this.kind_,
  60076. selectable: true,
  60077. multiSelectable: false
  60078. });
  60079. item.addClass(`vjs-${track.kind}-menu-item`);
  60080. items.push(item);
  60081. }
  60082. }
  60083. return items;
  60084. }
  60085. }
  60086. Component$1$1.registerComponent("TextTrackButton", TextTrackButton$1);
  60087. class ChaptersTrackMenuItem$1 extends MenuItem$1 {
  60088. constructor(player, options2) {
  60089. const track = options2.track;
  60090. const cue = options2.cue;
  60091. const currentTime = player.currentTime();
  60092. options2.selectable = true;
  60093. options2.multiSelectable = false;
  60094. options2.label = cue.text;
  60095. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  60096. super(player, options2);
  60097. this.track = track;
  60098. this.cue = cue;
  60099. }
  60100. handleClick(event2) {
  60101. super.handleClick();
  60102. this.player_.currentTime(this.cue.startTime);
  60103. }
  60104. }
  60105. Component$1$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem$1);
  60106. class ChaptersButton$1 extends TextTrackButton$1 {
  60107. constructor(player, options2, ready) {
  60108. super(player, options2, ready);
  60109. this.selectCurrentItem_ = () => {
  60110. this.items.forEach((item) => {
  60111. item.selected(this.track_.activeCues[0] === item.cue);
  60112. });
  60113. };
  60114. }
  60115. buildCSSClass() {
  60116. return `vjs-chapters-button ${super.buildCSSClass()}`;
  60117. }
  60118. buildWrapperCSSClass() {
  60119. return `vjs-chapters-button ${super.buildWrapperCSSClass()}`;
  60120. }
  60121. update(event2) {
  60122. if (event2 && event2.track && event2.track.kind !== "chapters") {
  60123. return;
  60124. }
  60125. const track = this.findChaptersTrack();
  60126. if (track !== this.track_) {
  60127. this.setTrack(track);
  60128. super.update();
  60129. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  60130. super.update();
  60131. }
  60132. }
  60133. setTrack(track) {
  60134. if (this.track_ === track) {
  60135. return;
  60136. }
  60137. if (!this.updateHandler_) {
  60138. this.updateHandler_ = this.update.bind(this);
  60139. }
  60140. if (this.track_) {
  60141. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60142. if (remoteTextTrackEl) {
  60143. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  60144. }
  60145. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  60146. this.track_ = null;
  60147. }
  60148. this.track_ = track;
  60149. if (this.track_) {
  60150. this.track_.mode = "hidden";
  60151. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60152. if (remoteTextTrackEl) {
  60153. remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  60154. }
  60155. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  60156. }
  60157. }
  60158. findChaptersTrack() {
  60159. const tracks = this.player_.textTracks() || [];
  60160. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  60161. const track = tracks[i2];
  60162. if (track.kind === this.kind_) {
  60163. return track;
  60164. }
  60165. }
  60166. }
  60167. getMenuCaption() {
  60168. if (this.track_ && this.track_.label) {
  60169. return this.track_.label;
  60170. }
  60171. return this.localize(toTitleCase$1$1(this.kind_));
  60172. }
  60173. createMenu() {
  60174. this.options_.title = this.getMenuCaption();
  60175. return super.createMenu();
  60176. }
  60177. createItems() {
  60178. const items = [];
  60179. if (!this.track_) {
  60180. return items;
  60181. }
  60182. const cues = this.track_.cues;
  60183. if (!cues) {
  60184. return items;
  60185. }
  60186. for (let i2 = 0, l = cues.length; i2 < l; i2++) {
  60187. const cue = cues[i2];
  60188. const mi = new ChaptersTrackMenuItem$1(this.player_, {
  60189. track: this.track_,
  60190. cue
  60191. });
  60192. items.push(mi);
  60193. }
  60194. return items;
  60195. }
  60196. }
  60197. ChaptersButton$1.prototype.kind_ = "chapters";
  60198. ChaptersButton$1.prototype.controlText_ = "Chapters";
  60199. Component$1$1.registerComponent("ChaptersButton", ChaptersButton$1);
  60200. class DescriptionsButton$1 extends TextTrackButton$1 {
  60201. constructor(player, options2, ready) {
  60202. super(player, options2, ready);
  60203. const tracks = player.textTracks();
  60204. const changeHandler = bind_(this, this.handleTracksChange);
  60205. tracks.addEventListener("change", changeHandler);
  60206. this.on("dispose", function() {
  60207. tracks.removeEventListener("change", changeHandler);
  60208. });
  60209. }
  60210. handleTracksChange(event2) {
  60211. const tracks = this.player().textTracks();
  60212. let disabled = false;
  60213. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  60214. const track = tracks[i2];
  60215. if (track.kind !== this.kind_ && track.mode === "showing") {
  60216. disabled = true;
  60217. break;
  60218. }
  60219. }
  60220. if (disabled) {
  60221. this.disable();
  60222. } else {
  60223. this.enable();
  60224. }
  60225. }
  60226. buildCSSClass() {
  60227. return `vjs-descriptions-button ${super.buildCSSClass()}`;
  60228. }
  60229. buildWrapperCSSClass() {
  60230. return `vjs-descriptions-button ${super.buildWrapperCSSClass()}`;
  60231. }
  60232. }
  60233. DescriptionsButton$1.prototype.kind_ = "descriptions";
  60234. DescriptionsButton$1.prototype.controlText_ = "Descriptions";
  60235. Component$1$1.registerComponent("DescriptionsButton", DescriptionsButton$1);
  60236. class SubtitlesButton$1 extends TextTrackButton$1 {
  60237. constructor(player, options2, ready) {
  60238. super(player, options2, ready);
  60239. }
  60240. buildCSSClass() {
  60241. return `vjs-subtitles-button ${super.buildCSSClass()}`;
  60242. }
  60243. buildWrapperCSSClass() {
  60244. return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`;
  60245. }
  60246. }
  60247. SubtitlesButton$1.prototype.kind_ = "subtitles";
  60248. SubtitlesButton$1.prototype.controlText_ = "Subtitles";
  60249. Component$1$1.registerComponent("SubtitlesButton", SubtitlesButton$1);
  60250. class CaptionSettingsMenuItem$1 extends TextTrackMenuItem$1 {
  60251. constructor(player, options2) {
  60252. options2.track = {
  60253. player,
  60254. kind: options2.kind,
  60255. label: options2.kind + " settings",
  60256. selectable: false,
  60257. default: false,
  60258. mode: "disabled"
  60259. };
  60260. options2.selectable = false;
  60261. options2.name = "CaptionSettingsMenuItem";
  60262. super(player, options2);
  60263. this.addClass("vjs-texttrack-settings");
  60264. this.controlText(", opens " + options2.kind + " settings dialog");
  60265. }
  60266. handleClick(event2) {
  60267. this.player().getChild("textTrackSettings").open();
  60268. }
  60269. handleLanguagechange() {
  60270. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.kind + " settings");
  60271. super.handleLanguagechange();
  60272. }
  60273. }
  60274. Component$1$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem$1);
  60275. class CaptionsButton$1 extends TextTrackButton$1 {
  60276. constructor(player, options2, ready) {
  60277. super(player, options2, ready);
  60278. }
  60279. buildCSSClass() {
  60280. return `vjs-captions-button ${super.buildCSSClass()}`;
  60281. }
  60282. buildWrapperCSSClass() {
  60283. return `vjs-captions-button ${super.buildWrapperCSSClass()}`;
  60284. }
  60285. createItems() {
  60286. const items = [];
  60287. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60288. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60289. kind: this.kind_
  60290. }));
  60291. this.hideThreshold_ += 1;
  60292. }
  60293. return super.createItems(items);
  60294. }
  60295. }
  60296. CaptionsButton$1.prototype.kind_ = "captions";
  60297. CaptionsButton$1.prototype.controlText_ = "Captions";
  60298. Component$1$1.registerComponent("CaptionsButton", CaptionsButton$1);
  60299. class SubsCapsMenuItem$1 extends TextTrackMenuItem$1 {
  60300. createEl(type2, props, attrs) {
  60301. const el = super.createEl(type2, props, attrs);
  60302. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60303. if (this.options_.track.kind === "captions") {
  60304. parentSpan.appendChild(createEl$1("span", {
  60305. className: "vjs-icon-placeholder"
  60306. }, {
  60307. "aria-hidden": true
  60308. }));
  60309. parentSpan.appendChild(createEl$1("span", {
  60310. className: "vjs-control-text",
  60311. textContent: ` ${this.localize("Captions")}`
  60312. }));
  60313. }
  60314. return el;
  60315. }
  60316. }
  60317. Component$1$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem$1);
  60318. class SubsCapsButton$1 extends TextTrackButton$1 {
  60319. constructor(player, options2 = {}) {
  60320. super(player, options2);
  60321. this.label_ = "subtitles";
  60322. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(this.player_.language_) > -1) {
  60323. this.label_ = "captions";
  60324. }
  60325. this.menuButton_.controlText(toTitleCase$1$1(this.label_));
  60326. }
  60327. buildCSSClass() {
  60328. return `vjs-subs-caps-button ${super.buildCSSClass()}`;
  60329. }
  60330. buildWrapperCSSClass() {
  60331. return `vjs-subs-caps-button ${super.buildWrapperCSSClass()}`;
  60332. }
  60333. createItems() {
  60334. let items = [];
  60335. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60336. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60337. kind: this.label_
  60338. }));
  60339. this.hideThreshold_ += 1;
  60340. }
  60341. items = super.createItems(items, SubsCapsMenuItem$1);
  60342. return items;
  60343. }
  60344. }
  60345. SubsCapsButton$1.prototype.kinds_ = ["captions", "subtitles"];
  60346. SubsCapsButton$1.prototype.controlText_ = "Subtitles";
  60347. Component$1$1.registerComponent("SubsCapsButton", SubsCapsButton$1);
  60348. class AudioTrackMenuItem$1 extends MenuItem$1 {
  60349. constructor(player, options2) {
  60350. const track = options2.track;
  60351. const tracks = player.audioTracks();
  60352. options2.label = track.label || track.language || "Unknown";
  60353. options2.selected = track.enabled;
  60354. super(player, options2);
  60355. this.track = track;
  60356. this.addClass(`vjs-${track.kind}-menu-item`);
  60357. const changeHandler = (...args) => {
  60358. this.handleTracksChange.apply(this, args);
  60359. };
  60360. tracks.addEventListener("change", changeHandler);
  60361. this.on("dispose", () => {
  60362. tracks.removeEventListener("change", changeHandler);
  60363. });
  60364. }
  60365. createEl(type2, props, attrs) {
  60366. const el = super.createEl(type2, props, attrs);
  60367. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60368. if (this.options_.track.kind === "main-desc") {
  60369. parentSpan.appendChild(createEl$1("span", {
  60370. className: "vjs-icon-placeholder"
  60371. }, {
  60372. "aria-hidden": true
  60373. }));
  60374. parentSpan.appendChild(createEl$1("span", {
  60375. className: "vjs-control-text",
  60376. textContent: " " + this.localize("Descriptions")
  60377. }));
  60378. }
  60379. return el;
  60380. }
  60381. handleClick(event2) {
  60382. super.handleClick(event2);
  60383. this.track.enabled = true;
  60384. if (this.player_.tech_.featuresNativeAudioTracks) {
  60385. const tracks = this.player_.audioTracks();
  60386. for (let i2 = 0; i2 < tracks.length; i2++) {
  60387. const track = tracks[i2];
  60388. if (track === this.track) {
  60389. continue;
  60390. }
  60391. track.enabled = track === this.track;
  60392. }
  60393. }
  60394. }
  60395. handleTracksChange(event2) {
  60396. this.selected(this.track.enabled);
  60397. }
  60398. }
  60399. Component$1$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem$1);
  60400. class AudioTrackButton$1 extends TrackButton$1 {
  60401. constructor(player, options2 = {}) {
  60402. options2.tracks = player.audioTracks();
  60403. super(player, options2);
  60404. }
  60405. buildCSSClass() {
  60406. return `vjs-audio-button ${super.buildCSSClass()}`;
  60407. }
  60408. buildWrapperCSSClass() {
  60409. return `vjs-audio-button ${super.buildWrapperCSSClass()}`;
  60410. }
  60411. createItems(items = []) {
  60412. this.hideThreshold_ = 1;
  60413. const tracks = this.player_.audioTracks();
  60414. for (let i2 = 0; i2 < tracks.length; i2++) {
  60415. const track = tracks[i2];
  60416. items.push(new AudioTrackMenuItem$1(this.player_, {
  60417. track,
  60418. selectable: true,
  60419. multiSelectable: false
  60420. }));
  60421. }
  60422. return items;
  60423. }
  60424. }
  60425. AudioTrackButton$1.prototype.controlText_ = "Audio Track";
  60426. Component$1$1.registerComponent("AudioTrackButton", AudioTrackButton$1);
  60427. class PlaybackRateMenuItem$1 extends MenuItem$1 {
  60428. constructor(player, options2) {
  60429. const label2 = options2.rate;
  60430. const rate = parseFloat(label2, 10);
  60431. options2.label = label2;
  60432. options2.selected = rate === player.playbackRate();
  60433. options2.selectable = true;
  60434. options2.multiSelectable = false;
  60435. super(player, options2);
  60436. this.label = label2;
  60437. this.rate = rate;
  60438. this.on(player, "ratechange", (e) => this.update(e));
  60439. }
  60440. handleClick(event2) {
  60441. super.handleClick();
  60442. this.player().playbackRate(this.rate);
  60443. }
  60444. update(event2) {
  60445. this.selected(this.player().playbackRate() === this.rate);
  60446. }
  60447. }
  60448. PlaybackRateMenuItem$1.prototype.contentElType = "button";
  60449. Component$1$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem$1);
  60450. class PlaybackRateMenuButton$1 extends MenuButton$1 {
  60451. constructor(player, options2) {
  60452. super(player, options2);
  60453. this.menuButton_.el_.setAttribute("aria-describedby", this.labelElId_);
  60454. this.updateVisibility();
  60455. this.updateLabel();
  60456. this.on(player, "loadstart", (e) => this.updateVisibility(e));
  60457. this.on(player, "ratechange", (e) => this.updateLabel(e));
  60458. this.on(player, "playbackrateschange", (e) => this.handlePlaybackRateschange(e));
  60459. }
  60460. createEl() {
  60461. const el = super.createEl();
  60462. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  60463. this.labelEl_ = createEl$1("div", {
  60464. className: "vjs-playback-rate-value",
  60465. id: this.labelElId_,
  60466. textContent: "1x"
  60467. });
  60468. el.appendChild(this.labelEl_);
  60469. return el;
  60470. }
  60471. dispose() {
  60472. this.labelEl_ = null;
  60473. super.dispose();
  60474. }
  60475. buildCSSClass() {
  60476. return `vjs-playback-rate ${super.buildCSSClass()}`;
  60477. }
  60478. buildWrapperCSSClass() {
  60479. return `vjs-playback-rate ${super.buildWrapperCSSClass()}`;
  60480. }
  60481. createItems() {
  60482. const rates = this.playbackRates();
  60483. const items = [];
  60484. for (let i2 = rates.length - 1; i2 >= 0; i2--) {
  60485. items.push(new PlaybackRateMenuItem$1(this.player(), {
  60486. rate: rates[i2] + "x"
  60487. }));
  60488. }
  60489. return items;
  60490. }
  60491. handlePlaybackRateschange(event2) {
  60492. this.update();
  60493. }
  60494. playbackRates() {
  60495. const player = this.player();
  60496. return player.playbackRates && player.playbackRates() || [];
  60497. }
  60498. playbackRateSupported() {
  60499. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  60500. }
  60501. updateVisibility(event2) {
  60502. if (this.playbackRateSupported()) {
  60503. this.removeClass("vjs-hidden");
  60504. } else {
  60505. this.addClass("vjs-hidden");
  60506. }
  60507. }
  60508. updateLabel(event2) {
  60509. if (this.playbackRateSupported()) {
  60510. this.labelEl_.textContent = this.player().playbackRate() + "x";
  60511. }
  60512. }
  60513. }
  60514. PlaybackRateMenuButton$1.prototype.controlText_ = "Playback Rate";
  60515. Component$1$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton$1);
  60516. class Spacer$1 extends Component$1$1 {
  60517. buildCSSClass() {
  60518. return `vjs-spacer ${super.buildCSSClass()}`;
  60519. }
  60520. createEl(tag = "div", props = {}, attributes = {}) {
  60521. if (!props.className) {
  60522. props.className = this.buildCSSClass();
  60523. }
  60524. return super.createEl(tag, props, attributes);
  60525. }
  60526. }
  60527. Component$1$1.registerComponent("Spacer", Spacer$1);
  60528. class CustomControlSpacer$1 extends Spacer$1 {
  60529. buildCSSClass() {
  60530. return `vjs-custom-control-spacer ${super.buildCSSClass()}`;
  60531. }
  60532. createEl() {
  60533. return super.createEl("div", {
  60534. className: this.buildCSSClass(),
  60535. textContent: "\xA0"
  60536. });
  60537. }
  60538. }
  60539. Component$1$1.registerComponent("CustomControlSpacer", CustomControlSpacer$1);
  60540. class ControlBar$1 extends Component$1$1 {
  60541. createEl() {
  60542. return super.createEl("div", {
  60543. className: "vjs-control-bar",
  60544. dir: "ltr"
  60545. });
  60546. }
  60547. }
  60548. ControlBar$1.prototype.options_ = {
  60549. children: ["playToggle", "skipBackward", "skipForward", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  60550. };
  60551. if ("exitPictureInPicture" in document_1) {
  60552. ControlBar$1.prototype.options_.children.splice(ControlBar$1.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  60553. }
  60554. Component$1$1.registerComponent("ControlBar", ControlBar$1);
  60555. class ErrorDisplay$1 extends ModalDialog$1 {
  60556. constructor(player, options2) {
  60557. super(player, options2);
  60558. this.on(player, "error", (e) => this.open(e));
  60559. }
  60560. buildCSSClass() {
  60561. return `vjs-error-display ${super.buildCSSClass()}`;
  60562. }
  60563. content() {
  60564. const error = this.player().error();
  60565. return error ? this.localize(error.message) : "";
  60566. }
  60567. }
  60568. ErrorDisplay$1.prototype.options_ = Object.assign({}, ModalDialog$1.prototype.options_, {
  60569. pauseOnOpen: false,
  60570. fillAlways: true,
  60571. temporary: false,
  60572. uncloseable: true
  60573. });
  60574. Component$1$1.registerComponent("ErrorDisplay", ErrorDisplay$1);
  60575. const LOCAL_STORAGE_KEY$1$1 = "vjs-text-track-settings";
  60576. const COLOR_BLACK$1 = ["#000", "Black"];
  60577. const COLOR_BLUE$1 = ["#00F", "Blue"];
  60578. const COLOR_CYAN$1 = ["#0FF", "Cyan"];
  60579. const COLOR_GREEN$1 = ["#0F0", "Green"];
  60580. const COLOR_MAGENTA$1 = ["#F0F", "Magenta"];
  60581. const COLOR_RED$1 = ["#F00", "Red"];
  60582. const COLOR_WHITE$1 = ["#FFF", "White"];
  60583. const COLOR_YELLOW$1 = ["#FF0", "Yellow"];
  60584. const OPACITY_OPAQUE$1 = ["1", "Opaque"];
  60585. const OPACITY_SEMI$1 = ["0.5", "Semi-Transparent"];
  60586. const OPACITY_TRANS$1 = ["0", "Transparent"];
  60587. const selectConfigs$1 = {
  60588. backgroundColor: {
  60589. selector: ".vjs-bg-color > select",
  60590. id: "captions-background-color-%s",
  60591. label: "Color",
  60592. options: [COLOR_BLACK$1, COLOR_WHITE$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60593. },
  60594. backgroundOpacity: {
  60595. selector: ".vjs-bg-opacity > select",
  60596. id: "captions-background-opacity-%s",
  60597. label: "Opacity",
  60598. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1, OPACITY_TRANS$1]
  60599. },
  60600. color: {
  60601. selector: ".vjs-text-color > select",
  60602. id: "captions-foreground-color-%s",
  60603. label: "Color",
  60604. options: [COLOR_WHITE$1, COLOR_BLACK$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60605. },
  60606. edgeStyle: {
  60607. selector: ".vjs-edge-style > select",
  60608. id: "%s",
  60609. label: "Text Edge Style",
  60610. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  60611. },
  60612. fontFamily: {
  60613. selector: ".vjs-font-family > select",
  60614. id: "captions-font-family-%s",
  60615. label: "Font Family",
  60616. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  60617. },
  60618. fontPercent: {
  60619. selector: ".vjs-font-percent > select",
  60620. id: "captions-font-size-%s",
  60621. label: "Font Size",
  60622. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  60623. default: 2,
  60624. parser: (v) => v === "1.00" ? null : Number(v)
  60625. },
  60626. textOpacity: {
  60627. selector: ".vjs-text-opacity > select",
  60628. id: "captions-foreground-opacity-%s",
  60629. label: "Opacity",
  60630. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1]
  60631. },
  60632. windowColor: {
  60633. selector: ".vjs-window-color > select",
  60634. id: "captions-window-color-%s",
  60635. label: "Color"
  60636. },
  60637. windowOpacity: {
  60638. selector: ".vjs-window-opacity > select",
  60639. id: "captions-window-opacity-%s",
  60640. label: "Opacity",
  60641. options: [OPACITY_TRANS$1, OPACITY_SEMI$1, OPACITY_OPAQUE$1]
  60642. }
  60643. };
  60644. selectConfigs$1.windowColor.options = selectConfigs$1.backgroundColor.options;
  60645. function parseOptionValue$1(value, parser2) {
  60646. if (parser2) {
  60647. value = parser2(value);
  60648. }
  60649. if (value && value !== "none") {
  60650. return value;
  60651. }
  60652. }
  60653. function getSelectedOptionValue$1(el, parser2) {
  60654. const value = el.options[el.options.selectedIndex].value;
  60655. return parseOptionValue$1(value, parser2);
  60656. }
  60657. function setSelectedOption$1(el, value, parser2) {
  60658. if (!value) {
  60659. return;
  60660. }
  60661. for (let i2 = 0; i2 < el.options.length; i2++) {
  60662. if (parseOptionValue$1(el.options[i2].value, parser2) === value) {
  60663. el.selectedIndex = i2;
  60664. break;
  60665. }
  60666. }
  60667. }
  60668. class TextTrackSettings$1 extends ModalDialog$1 {
  60669. constructor(player, options2) {
  60670. options2.temporary = false;
  60671. super(player, options2);
  60672. this.updateDisplay = this.updateDisplay.bind(this);
  60673. this.fill();
  60674. this.hasBeenOpened_ = this.hasBeenFilled_ = true;
  60675. this.endDialog = createEl$1("p", {
  60676. className: "vjs-control-text",
  60677. textContent: this.localize("End of dialog window.")
  60678. });
  60679. this.el().appendChild(this.endDialog);
  60680. this.setDefaults();
  60681. if (options2.persistTextTrackSettings === void 0) {
  60682. this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings;
  60683. }
  60684. this.on(this.$(".vjs-done-button"), "click", () => {
  60685. this.saveSettings();
  60686. this.close();
  60687. });
  60688. this.on(this.$(".vjs-default-button"), "click", () => {
  60689. this.setDefaults();
  60690. this.updateDisplay();
  60691. });
  60692. each$1(selectConfigs$1, (config) => {
  60693. this.on(this.$(config.selector), "change", this.updateDisplay);
  60694. });
  60695. if (this.options_.persistTextTrackSettings) {
  60696. this.restoreSettings();
  60697. }
  60698. }
  60699. dispose() {
  60700. this.endDialog = null;
  60701. super.dispose();
  60702. }
  60703. createElSelect_(key, legendId = "", type2 = "label") {
  60704. const config = selectConfigs$1[key];
  60705. const id = config.id.replace("%s", this.id_);
  60706. const selectLabelledbyIds = [legendId, id].join(" ").trim();
  60707. return [`<${type2} id="${id}" class="${type2 === "label" ? "vjs-label" : ""}">`, this.localize(config.label), `</${type2}>`, `<select aria-labelledby="${selectLabelledbyIds}">`].concat(config.options.map((o) => {
  60708. const optionId = id + "-" + o[1].replace(/\W+/g, "");
  60709. return [`<option id="${optionId}" value="${o[0]}" `, `aria-labelledby="${selectLabelledbyIds} ${optionId}">`, this.localize(o[1]), "</option>"].join("");
  60710. })).concat("</select>").join("");
  60711. }
  60712. createElFgColor_() {
  60713. const legendId = `captions-text-legend-${this.id_}`;
  60714. return ['<fieldset class="vjs-fg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text"), "</legend>", '<span class="vjs-text-color">', this.createElSelect_("color", legendId), "</span>", '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  60715. }
  60716. createElBgColor_() {
  60717. const legendId = `captions-background-${this.id_}`;
  60718. return ['<fieldset class="vjs-bg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text Background"), "</legend>", '<span class="vjs-bg-color">', this.createElSelect_("backgroundColor", legendId), "</span>", '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  60719. }
  60720. createElWinColor_() {
  60721. const legendId = `captions-window-${this.id_}`;
  60722. return ['<fieldset class="vjs-window vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Caption Area Background"), "</legend>", '<span class="vjs-window-color">', this.createElSelect_("windowColor", legendId), "</span>", '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  60723. }
  60724. createElColors_() {
  60725. return createEl$1("div", {
  60726. className: "vjs-track-settings-colors",
  60727. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  60728. });
  60729. }
  60730. createElFont_() {
  60731. return createEl$1("div", {
  60732. className: "vjs-track-settings-font",
  60733. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  60734. });
  60735. }
  60736. createElControls_() {
  60737. const defaultsDescription = this.localize("restore all settings to the default values");
  60738. return createEl$1("div", {
  60739. className: "vjs-track-settings-controls",
  60740. innerHTML: [`<button type="button" class="vjs-default-button" title="${defaultsDescription}">`, this.localize("Reset"), `<span class="vjs-control-text"> ${defaultsDescription}</span>`, "</button>", `<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")
  60741. });
  60742. }
  60743. content() {
  60744. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  60745. }
  60746. label() {
  60747. return this.localize("Caption Settings Dialog");
  60748. }
  60749. description() {
  60750. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  60751. }
  60752. buildCSSClass() {
  60753. return super.buildCSSClass() + " vjs-text-track-settings";
  60754. }
  60755. getValues() {
  60756. return reduce$1(selectConfigs$1, (accum, config, key) => {
  60757. const value = getSelectedOptionValue$1(this.$(config.selector), config.parser);
  60758. if (value !== void 0) {
  60759. accum[key] = value;
  60760. }
  60761. return accum;
  60762. }, {});
  60763. }
  60764. setValues(values3) {
  60765. each$1(selectConfigs$1, (config, key) => {
  60766. setSelectedOption$1(this.$(config.selector), values3[key], config.parser);
  60767. });
  60768. }
  60769. setDefaults() {
  60770. each$1(selectConfigs$1, (config) => {
  60771. const index2 = config.hasOwnProperty("default") ? config.default : 0;
  60772. this.$(config.selector).selectedIndex = index2;
  60773. });
  60774. }
  60775. restoreSettings() {
  60776. let values3;
  60777. try {
  60778. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1$1));
  60779. } catch (err) {
  60780. log$1$1.warn(err);
  60781. }
  60782. if (values3) {
  60783. this.setValues(values3);
  60784. }
  60785. }
  60786. saveSettings() {
  60787. if (!this.options_.persistTextTrackSettings) {
  60788. return;
  60789. }
  60790. const values3 = this.getValues();
  60791. try {
  60792. if (Object.keys(values3).length) {
  60793. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1$1, JSON.stringify(values3));
  60794. } else {
  60795. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1$1);
  60796. }
  60797. } catch (err) {
  60798. log$1$1.warn(err);
  60799. }
  60800. }
  60801. updateDisplay() {
  60802. const ttDisplay = this.player_.getChild("textTrackDisplay");
  60803. if (ttDisplay) {
  60804. ttDisplay.updateDisplay();
  60805. }
  60806. }
  60807. conditionalBlur_() {
  60808. this.previouslyActiveEl_ = null;
  60809. const cb = this.player_.controlBar;
  60810. const subsCapsBtn = cb && cb.subsCapsButton;
  60811. const ccBtn = cb && cb.captionsButton;
  60812. if (subsCapsBtn) {
  60813. subsCapsBtn.focus();
  60814. } else if (ccBtn) {
  60815. ccBtn.focus();
  60816. }
  60817. }
  60818. handleLanguagechange() {
  60819. this.fill();
  60820. }
  60821. }
  60822. Component$1$1.registerComponent("TextTrackSettings", TextTrackSettings$1);
  60823. class ResizeManager$1 extends Component$1$1 {
  60824. constructor(player, options2) {
  60825. let RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  60826. if (options2.ResizeObserver === null) {
  60827. RESIZE_OBSERVER_AVAILABLE = false;
  60828. }
  60829. const options_ = merge$1({
  60830. createEl: !RESIZE_OBSERVER_AVAILABLE,
  60831. reportTouchActivity: false
  60832. }, options2);
  60833. super(player, options_);
  60834. this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  60835. this.loadListener_ = null;
  60836. this.resizeObserver_ = null;
  60837. this.debouncedHandler_ = debounce$1(() => {
  60838. this.resizeHandler();
  60839. }, 100, false, this);
  60840. if (RESIZE_OBSERVER_AVAILABLE) {
  60841. this.resizeObserver_ = new this.ResizeObserver(this.debouncedHandler_);
  60842. this.resizeObserver_.observe(player.el());
  60843. } else {
  60844. this.loadListener_ = () => {
  60845. if (!this.el_ || !this.el_.contentWindow) {
  60846. return;
  60847. }
  60848. const debouncedHandler_ = this.debouncedHandler_;
  60849. let unloadListener_ = this.unloadListener_ = function() {
  60850. off$1(this, "resize", debouncedHandler_);
  60851. off$1(this, "unload", unloadListener_);
  60852. unloadListener_ = null;
  60853. };
  60854. on$1(this.el_.contentWindow, "unload", unloadListener_);
  60855. on$1(this.el_.contentWindow, "resize", debouncedHandler_);
  60856. };
  60857. this.one("load", this.loadListener_);
  60858. }
  60859. }
  60860. createEl() {
  60861. return super.createEl("iframe", {
  60862. className: "vjs-resize-manager",
  60863. tabIndex: -1,
  60864. title: this.localize("No content")
  60865. }, {
  60866. "aria-hidden": "true"
  60867. });
  60868. }
  60869. resizeHandler() {
  60870. if (!this.player_ || !this.player_.trigger) {
  60871. return;
  60872. }
  60873. this.player_.trigger("playerresize");
  60874. }
  60875. dispose() {
  60876. if (this.debouncedHandler_) {
  60877. this.debouncedHandler_.cancel();
  60878. }
  60879. if (this.resizeObserver_) {
  60880. if (this.player_.el()) {
  60881. this.resizeObserver_.unobserve(this.player_.el());
  60882. }
  60883. this.resizeObserver_.disconnect();
  60884. }
  60885. if (this.loadListener_) {
  60886. this.off("load", this.loadListener_);
  60887. }
  60888. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  60889. this.unloadListener_.call(this.el_.contentWindow);
  60890. }
  60891. this.ResizeObserver = null;
  60892. this.resizeObserver = null;
  60893. this.debouncedHandler_ = null;
  60894. this.loadListener_ = null;
  60895. super.dispose();
  60896. }
  60897. }
  60898. Component$1$1.registerComponent("ResizeManager", ResizeManager$1);
  60899. const defaults$2 = {
  60900. trackingThreshold: 20,
  60901. liveTolerance: 15
  60902. };
  60903. class LiveTracker$1 extends Component$1$1 {
  60904. constructor(player, options2) {
  60905. const options_ = merge$1(defaults$2, options2, {
  60906. createEl: false
  60907. });
  60908. super(player, options_);
  60909. this.trackLiveHandler_ = () => this.trackLive_();
  60910. this.handlePlay_ = (e) => this.handlePlay(e);
  60911. this.handleFirstTimeupdate_ = (e) => this.handleFirstTimeupdate(e);
  60912. this.handleSeeked_ = (e) => this.handleSeeked(e);
  60913. this.seekToLiveEdge_ = (e) => this.seekToLiveEdge(e);
  60914. this.reset_();
  60915. this.on(this.player_, "durationchange", (e) => this.handleDurationchange(e));
  60916. this.on(this.player_, "canplay", () => this.toggleTracking());
  60917. }
  60918. trackLive_() {
  60919. const seekable3 = this.player_.seekable();
  60920. if (!seekable3 || !seekable3.length) {
  60921. return;
  60922. }
  60923. const newTime = Number(window_1.performance.now().toFixed(4));
  60924. const deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  60925. this.lastTime_ = newTime;
  60926. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  60927. const liveCurrentTime = this.liveCurrentTime();
  60928. const currentTime = this.player_.currentTime();
  60929. let isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  60930. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  60931. isBehind = false;
  60932. }
  60933. if (isBehind !== this.behindLiveEdge_) {
  60934. this.behindLiveEdge_ = isBehind;
  60935. this.trigger("liveedgechange");
  60936. }
  60937. }
  60938. handleDurationchange() {
  60939. this.toggleTracking();
  60940. }
  60941. toggleTracking() {
  60942. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  60943. if (this.player_.options_.liveui) {
  60944. this.player_.addClass("vjs-liveui");
  60945. }
  60946. this.startTracking();
  60947. } else {
  60948. this.player_.removeClass("vjs-liveui");
  60949. this.stopTracking();
  60950. }
  60951. }
  60952. startTracking() {
  60953. if (this.isTracking()) {
  60954. return;
  60955. }
  60956. if (!this.timeupdateSeen_) {
  60957. this.timeupdateSeen_ = this.player_.hasStarted();
  60958. }
  60959. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL$1);
  60960. this.trackLive_();
  60961. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60962. if (!this.timeupdateSeen_) {
  60963. this.one(this.player_, "play", this.handlePlay_);
  60964. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60965. } else {
  60966. this.on(this.player_, "seeked", this.handleSeeked_);
  60967. }
  60968. }
  60969. handleFirstTimeupdate() {
  60970. this.timeupdateSeen_ = true;
  60971. this.on(this.player_, "seeked", this.handleSeeked_);
  60972. }
  60973. handleSeeked() {
  60974. const timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  60975. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  60976. this.nextSeekedFromUser_ = false;
  60977. this.trackLive_();
  60978. }
  60979. handlePlay() {
  60980. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  60981. }
  60982. reset_() {
  60983. this.lastTime_ = -1;
  60984. this.pastSeekEnd_ = 0;
  60985. this.lastSeekEnd_ = -1;
  60986. this.behindLiveEdge_ = true;
  60987. this.timeupdateSeen_ = false;
  60988. this.seekedBehindLive_ = false;
  60989. this.nextSeekedFromUser_ = false;
  60990. this.clearInterval(this.trackingInterval_);
  60991. this.trackingInterval_ = null;
  60992. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60993. this.off(this.player_, "seeked", this.handleSeeked_);
  60994. this.off(this.player_, "play", this.handlePlay_);
  60995. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60996. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  60997. }
  60998. nextSeekedFromUser() {
  60999. this.nextSeekedFromUser_ = true;
  61000. }
  61001. stopTracking() {
  61002. if (!this.isTracking()) {
  61003. return;
  61004. }
  61005. this.reset_();
  61006. this.trigger("liveedgechange");
  61007. }
  61008. seekableEnd() {
  61009. const seekable3 = this.player_.seekable();
  61010. const seekableEnds = [];
  61011. let i2 = seekable3 ? seekable3.length : 0;
  61012. while (i2--) {
  61013. seekableEnds.push(seekable3.end(i2));
  61014. }
  61015. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  61016. }
  61017. seekableStart() {
  61018. const seekable3 = this.player_.seekable();
  61019. const seekableStarts = [];
  61020. let i2 = seekable3 ? seekable3.length : 0;
  61021. while (i2--) {
  61022. seekableStarts.push(seekable3.start(i2));
  61023. }
  61024. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  61025. }
  61026. liveWindow() {
  61027. const liveCurrentTime = this.liveCurrentTime();
  61028. if (liveCurrentTime === Infinity) {
  61029. return 0;
  61030. }
  61031. return liveCurrentTime - this.seekableStart();
  61032. }
  61033. isLive() {
  61034. return this.isTracking();
  61035. }
  61036. atLiveEdge() {
  61037. return !this.behindLiveEdge();
  61038. }
  61039. liveCurrentTime() {
  61040. return this.pastSeekEnd() + this.seekableEnd();
  61041. }
  61042. pastSeekEnd() {
  61043. const seekableEnd = this.seekableEnd();
  61044. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  61045. this.pastSeekEnd_ = 0;
  61046. }
  61047. this.lastSeekEnd_ = seekableEnd;
  61048. return this.pastSeekEnd_;
  61049. }
  61050. behindLiveEdge() {
  61051. return this.behindLiveEdge_;
  61052. }
  61053. isTracking() {
  61054. return typeof this.trackingInterval_ === "number";
  61055. }
  61056. seekToLiveEdge() {
  61057. this.seekedBehindLive_ = false;
  61058. if (this.atLiveEdge()) {
  61059. return;
  61060. }
  61061. this.nextSeekedFromUser_ = false;
  61062. this.player_.currentTime(this.liveCurrentTime());
  61063. }
  61064. dispose() {
  61065. this.stopTracking();
  61066. super.dispose();
  61067. }
  61068. }
  61069. Component$1$1.registerComponent("LiveTracker", LiveTracker$1);
  61070. class TitleBar extends Component$1$1 {
  61071. constructor(player, options2) {
  61072. super(player, options2);
  61073. this.on("statechanged", (e) => this.updateDom_());
  61074. this.updateDom_();
  61075. }
  61076. createEl() {
  61077. this.els = {
  61078. title: createEl$1("div", {
  61079. className: "vjs-title-bar-title",
  61080. id: `vjs-title-bar-title-${newGUID$1()}`
  61081. }),
  61082. description: createEl$1("div", {
  61083. className: "vjs-title-bar-description",
  61084. id: `vjs-title-bar-description-${newGUID$1()}`
  61085. })
  61086. };
  61087. return createEl$1("div", {
  61088. className: "vjs-title-bar"
  61089. }, {}, Object.values(this.els));
  61090. }
  61091. updateDom_() {
  61092. const tech = this.player_.tech_;
  61093. const techEl = tech && tech.el_;
  61094. const techAriaAttrs = {
  61095. title: "aria-labelledby",
  61096. description: "aria-describedby"
  61097. };
  61098. ["title", "description"].forEach((k) => {
  61099. const value = this.state[k];
  61100. const el = this.els[k];
  61101. const techAriaAttr = techAriaAttrs[k];
  61102. emptyEl$1(el);
  61103. if (value) {
  61104. textContent$1(el, value);
  61105. }
  61106. if (techEl) {
  61107. techEl.removeAttribute(techAriaAttr);
  61108. if (value) {
  61109. techEl.setAttribute(techAriaAttr, el.id);
  61110. }
  61111. }
  61112. });
  61113. if (this.state.title || this.state.description) {
  61114. this.show();
  61115. } else {
  61116. this.hide();
  61117. }
  61118. }
  61119. update(options2) {
  61120. this.setState(options2);
  61121. }
  61122. dispose() {
  61123. const tech = this.player_.tech_;
  61124. const techEl = tech && tech.el_;
  61125. if (techEl) {
  61126. techEl.removeAttribute("aria-labelledby");
  61127. techEl.removeAttribute("aria-describedby");
  61128. }
  61129. super.dispose();
  61130. this.els = null;
  61131. }
  61132. }
  61133. Component$1$1.registerComponent("TitleBar", TitleBar);
  61134. const sourcesetLoad$1 = (tech) => {
  61135. const el = tech.el();
  61136. if (el.hasAttribute("src")) {
  61137. tech.triggerSourceset(el.src);
  61138. return true;
  61139. }
  61140. const sources = tech.$$("source");
  61141. const srcUrls = [];
  61142. let src = "";
  61143. if (!sources.length) {
  61144. return false;
  61145. }
  61146. for (let i2 = 0; i2 < sources.length; i2++) {
  61147. const url = sources[i2].src;
  61148. if (url && srcUrls.indexOf(url) === -1) {
  61149. srcUrls.push(url);
  61150. }
  61151. }
  61152. if (!srcUrls.length) {
  61153. return false;
  61154. }
  61155. if (srcUrls.length === 1) {
  61156. src = srcUrls[0];
  61157. }
  61158. tech.triggerSourceset(src);
  61159. return true;
  61160. };
  61161. const innerHTMLDescriptorPolyfill$1 = Object.defineProperty({}, "innerHTML", {
  61162. get() {
  61163. return this.cloneNode(true).innerHTML;
  61164. },
  61165. set(v) {
  61166. const dummy = document_1.createElement(this.nodeName.toLowerCase());
  61167. dummy.innerHTML = v;
  61168. const docFrag = document_1.createDocumentFragment();
  61169. while (dummy.childNodes.length) {
  61170. docFrag.appendChild(dummy.childNodes[0]);
  61171. }
  61172. this.innerText = "";
  61173. window_1.Element.prototype.appendChild.call(this, docFrag);
  61174. return this.innerHTML;
  61175. }
  61176. });
  61177. const getDescriptor$1 = (priority, prop) => {
  61178. let descriptor = {};
  61179. for (let i2 = 0; i2 < priority.length; i2++) {
  61180. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  61181. if (descriptor && descriptor.set && descriptor.get) {
  61182. break;
  61183. }
  61184. }
  61185. descriptor.enumerable = true;
  61186. descriptor.configurable = true;
  61187. return descriptor;
  61188. };
  61189. const getInnerHTMLDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill$1], "innerHTML");
  61190. const firstSourceWatch$1 = function(tech) {
  61191. const el = tech.el();
  61192. if (el.resetSourceWatch_) {
  61193. return;
  61194. }
  61195. const old = {};
  61196. const innerDescriptor = getInnerHTMLDescriptor$1(tech);
  61197. const appendWrapper = (appendFn) => (...args) => {
  61198. const retval = appendFn.apply(el, args);
  61199. sourcesetLoad$1(tech);
  61200. return retval;
  61201. };
  61202. ["append", "appendChild", "insertAdjacentHTML"].forEach((k) => {
  61203. if (!el[k]) {
  61204. return;
  61205. }
  61206. old[k] = el[k];
  61207. el[k] = appendWrapper(old[k]);
  61208. });
  61209. Object.defineProperty(el, "innerHTML", merge$1(innerDescriptor, {
  61210. set: appendWrapper(innerDescriptor.set)
  61211. }));
  61212. el.resetSourceWatch_ = () => {
  61213. el.resetSourceWatch_ = null;
  61214. Object.keys(old).forEach((k) => {
  61215. el[k] = old[k];
  61216. });
  61217. Object.defineProperty(el, "innerHTML", innerDescriptor);
  61218. };
  61219. tech.one("sourceset", el.resetSourceWatch_);
  61220. };
  61221. const srcDescriptorPolyfill$1 = Object.defineProperty({}, "src", {
  61222. get() {
  61223. if (this.hasAttribute("src")) {
  61224. return getAbsoluteURL$1(window_1.Element.prototype.getAttribute.call(this, "src"));
  61225. }
  61226. return "";
  61227. },
  61228. set(v) {
  61229. window_1.Element.prototype.setAttribute.call(this, "src", v);
  61230. return v;
  61231. }
  61232. });
  61233. const getSrcDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill$1], "src");
  61234. const setupSourceset$1 = function(tech) {
  61235. if (!tech.featuresSourceset) {
  61236. return;
  61237. }
  61238. const el = tech.el();
  61239. if (el.resetSourceset_) {
  61240. return;
  61241. }
  61242. const srcDescriptor = getSrcDescriptor$1(tech);
  61243. const oldSetAttribute = el.setAttribute;
  61244. const oldLoad = el.load;
  61245. Object.defineProperty(el, "src", merge$1(srcDescriptor, {
  61246. set: (v) => {
  61247. const retval = srcDescriptor.set.call(el, v);
  61248. tech.triggerSourceset(el.src);
  61249. return retval;
  61250. }
  61251. }));
  61252. el.setAttribute = (n, v) => {
  61253. const retval = oldSetAttribute.call(el, n, v);
  61254. if (/src/i.test(n)) {
  61255. tech.triggerSourceset(el.src);
  61256. }
  61257. return retval;
  61258. };
  61259. el.load = () => {
  61260. const retval = oldLoad.call(el);
  61261. if (!sourcesetLoad$1(tech)) {
  61262. tech.triggerSourceset("");
  61263. firstSourceWatch$1(tech);
  61264. }
  61265. return retval;
  61266. };
  61267. if (el.currentSrc) {
  61268. tech.triggerSourceset(el.currentSrc);
  61269. } else if (!sourcesetLoad$1(tech)) {
  61270. firstSourceWatch$1(tech);
  61271. }
  61272. el.resetSourceset_ = () => {
  61273. el.resetSourceset_ = null;
  61274. el.load = oldLoad;
  61275. el.setAttribute = oldSetAttribute;
  61276. Object.defineProperty(el, "src", srcDescriptor);
  61277. if (el.resetSourceWatch_) {
  61278. el.resetSourceWatch_();
  61279. }
  61280. };
  61281. };
  61282. class Html5$2 extends Tech$2 {
  61283. constructor(options2, ready) {
  61284. super(options2, ready);
  61285. const source = options2.source;
  61286. let crossoriginTracks = false;
  61287. this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === "VIDEO";
  61288. if (source && (this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  61289. this.setSource(source);
  61290. } else {
  61291. this.handleLateInit_(this.el_);
  61292. }
  61293. if (options2.enableSourceset) {
  61294. this.setupSourcesetHandling_();
  61295. }
  61296. this.isScrubbing_ = false;
  61297. if (this.el_.hasChildNodes()) {
  61298. const nodes = this.el_.childNodes;
  61299. let nodesLength = nodes.length;
  61300. const removeNodes = [];
  61301. while (nodesLength--) {
  61302. const node = nodes[nodesLength];
  61303. const nodeName = node.nodeName.toLowerCase();
  61304. if (nodeName === "track") {
  61305. if (!this.featuresNativeTextTracks) {
  61306. removeNodes.push(node);
  61307. } else {
  61308. this.remoteTextTrackEls().addTrackElement_(node);
  61309. this.remoteTextTracks().addTrack(node.track);
  61310. this.textTracks().addTrack(node.track);
  61311. if (!crossoriginTracks && !this.el_.hasAttribute("crossorigin") && isCrossOrigin$1(node.src)) {
  61312. crossoriginTracks = true;
  61313. }
  61314. }
  61315. }
  61316. }
  61317. for (let i2 = 0; i2 < removeNodes.length; i2++) {
  61318. this.el_.removeChild(removeNodes[i2]);
  61319. }
  61320. }
  61321. this.proxyNativeTracks_();
  61322. if (this.featuresNativeTextTracks && crossoriginTracks) {
  61323. log$1$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  61324. }
  61325. this.restoreMetadataTracksInIOSNativePlayer_();
  61326. if ((TOUCH_ENABLED$1 || IS_IPHONE$1) && options2.nativeControlsForTouch === true) {
  61327. this.setControls(true);
  61328. }
  61329. this.proxyWebkitFullscreen_();
  61330. this.triggerReady();
  61331. }
  61332. dispose() {
  61333. if (this.el_ && this.el_.resetSourceset_) {
  61334. this.el_.resetSourceset_();
  61335. }
  61336. Html5$2.disposeMediaElement(this.el_);
  61337. this.options_ = null;
  61338. super.dispose();
  61339. }
  61340. setupSourcesetHandling_() {
  61341. setupSourceset$1(this);
  61342. }
  61343. restoreMetadataTracksInIOSNativePlayer_() {
  61344. const textTracks = this.textTracks();
  61345. let metadataTracksPreFullscreenState;
  61346. const takeMetadataTrackSnapshot = () => {
  61347. metadataTracksPreFullscreenState = [];
  61348. for (let i2 = 0; i2 < textTracks.length; i2++) {
  61349. const track = textTracks[i2];
  61350. if (track.kind === "metadata") {
  61351. metadataTracksPreFullscreenState.push({
  61352. track,
  61353. storedMode: track.mode
  61354. });
  61355. }
  61356. }
  61357. };
  61358. takeMetadataTrackSnapshot();
  61359. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61360. this.on("dispose", () => textTracks.removeEventListener("change", takeMetadataTrackSnapshot));
  61361. const restoreTrackMode = () => {
  61362. for (let i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  61363. const storedTrack = metadataTracksPreFullscreenState[i2];
  61364. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  61365. storedTrack.track.mode = storedTrack.storedMode;
  61366. }
  61367. }
  61368. textTracks.removeEventListener("change", restoreTrackMode);
  61369. };
  61370. this.on("webkitbeginfullscreen", () => {
  61371. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61372. textTracks.removeEventListener("change", restoreTrackMode);
  61373. textTracks.addEventListener("change", restoreTrackMode);
  61374. });
  61375. this.on("webkitendfullscreen", () => {
  61376. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61377. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61378. textTracks.removeEventListener("change", restoreTrackMode);
  61379. });
  61380. }
  61381. overrideNative_(type2, override) {
  61382. if (override !== this[`featuresNative${type2}Tracks`]) {
  61383. return;
  61384. }
  61385. const lowerCaseType = type2.toLowerCase();
  61386. if (this[`${lowerCaseType}TracksListeners_`]) {
  61387. Object.keys(this[`${lowerCaseType}TracksListeners_`]).forEach((eventName) => {
  61388. const elTracks = this.el()[`${lowerCaseType}Tracks`];
  61389. elTracks.removeEventListener(eventName, this[`${lowerCaseType}TracksListeners_`][eventName]);
  61390. });
  61391. }
  61392. this[`featuresNative${type2}Tracks`] = !override;
  61393. this[`${lowerCaseType}TracksListeners_`] = null;
  61394. this.proxyNativeTracksForType_(lowerCaseType);
  61395. }
  61396. overrideNativeAudioTracks(override) {
  61397. this.overrideNative_("Audio", override);
  61398. }
  61399. overrideNativeVideoTracks(override) {
  61400. this.overrideNative_("Video", override);
  61401. }
  61402. proxyNativeTracksForType_(name) {
  61403. const props = NORMAL$1[name];
  61404. const elTracks = this.el()[props.getterName];
  61405. const techTracks = this[props.getterName]();
  61406. if (!this[`featuresNative${props.capitalName}Tracks`] || !elTracks || !elTracks.addEventListener) {
  61407. return;
  61408. }
  61409. const listeners = {
  61410. change: (e) => {
  61411. const event2 = {
  61412. type: "change",
  61413. target: techTracks,
  61414. currentTarget: techTracks,
  61415. srcElement: techTracks
  61416. };
  61417. techTracks.trigger(event2);
  61418. if (name === "text") {
  61419. this[REMOTE$1.remoteText.getterName]().trigger(event2);
  61420. }
  61421. },
  61422. addtrack(e) {
  61423. techTracks.addTrack(e.track);
  61424. },
  61425. removetrack(e) {
  61426. techTracks.removeTrack(e.track);
  61427. }
  61428. };
  61429. const removeOldTracks = function() {
  61430. const removeTracks = [];
  61431. for (let i2 = 0; i2 < techTracks.length; i2++) {
  61432. let found = false;
  61433. for (let j = 0; j < elTracks.length; j++) {
  61434. if (elTracks[j] === techTracks[i2]) {
  61435. found = true;
  61436. break;
  61437. }
  61438. }
  61439. if (!found) {
  61440. removeTracks.push(techTracks[i2]);
  61441. }
  61442. }
  61443. while (removeTracks.length) {
  61444. techTracks.removeTrack(removeTracks.shift());
  61445. }
  61446. };
  61447. this[props.getterName + "Listeners_"] = listeners;
  61448. Object.keys(listeners).forEach((eventName) => {
  61449. const listener = listeners[eventName];
  61450. elTracks.addEventListener(eventName, listener);
  61451. this.on("dispose", (e) => elTracks.removeEventListener(eventName, listener));
  61452. });
  61453. this.on("loadstart", removeOldTracks);
  61454. this.on("dispose", (e) => this.off("loadstart", removeOldTracks));
  61455. }
  61456. proxyNativeTracks_() {
  61457. NORMAL$1.names.forEach((name) => {
  61458. this.proxyNativeTracksForType_(name);
  61459. });
  61460. }
  61461. createEl() {
  61462. let el = this.options_.tag;
  61463. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  61464. if (el) {
  61465. const clone = el.cloneNode(true);
  61466. if (el.parentNode) {
  61467. el.parentNode.insertBefore(clone, el);
  61468. }
  61469. Html5$2.disposeMediaElement(el);
  61470. el = clone;
  61471. } else {
  61472. el = document_1.createElement("video");
  61473. const tagAttributes = this.options_.tag && getAttributes$1(this.options_.tag);
  61474. const attributes = merge$1({}, tagAttributes);
  61475. if (!TOUCH_ENABLED$1 || this.options_.nativeControlsForTouch !== true) {
  61476. delete attributes.controls;
  61477. }
  61478. setAttributes$1(el, Object.assign(attributes, {
  61479. id: this.options_.techId,
  61480. class: "vjs-tech"
  61481. }));
  61482. }
  61483. el.playerId = this.options_.playerId;
  61484. }
  61485. if (typeof this.options_.preload !== "undefined") {
  61486. setAttribute$1(el, "preload", this.options_.preload);
  61487. }
  61488. if (this.options_.disablePictureInPicture !== void 0) {
  61489. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  61490. }
  61491. const settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  61492. for (let i2 = 0; i2 < settingsAttrs.length; i2++) {
  61493. const attr = settingsAttrs[i2];
  61494. const value = this.options_[attr];
  61495. if (typeof value !== "undefined") {
  61496. if (value) {
  61497. setAttribute$1(el, attr, attr);
  61498. } else {
  61499. removeAttribute$1(el, attr);
  61500. }
  61501. el[attr] = value;
  61502. }
  61503. }
  61504. return el;
  61505. }
  61506. handleLateInit_(el) {
  61507. if (el.networkState === 0 || el.networkState === 3) {
  61508. return;
  61509. }
  61510. if (el.readyState === 0) {
  61511. let loadstartFired = false;
  61512. const setLoadstartFired = function() {
  61513. loadstartFired = true;
  61514. };
  61515. this.on("loadstart", setLoadstartFired);
  61516. const triggerLoadstart = function() {
  61517. if (!loadstartFired) {
  61518. this.trigger("loadstart");
  61519. }
  61520. };
  61521. this.on("loadedmetadata", triggerLoadstart);
  61522. this.ready(function() {
  61523. this.off("loadstart", setLoadstartFired);
  61524. this.off("loadedmetadata", triggerLoadstart);
  61525. if (!loadstartFired) {
  61526. this.trigger("loadstart");
  61527. }
  61528. });
  61529. return;
  61530. }
  61531. const eventsToTrigger = ["loadstart"];
  61532. eventsToTrigger.push("loadedmetadata");
  61533. if (el.readyState >= 2) {
  61534. eventsToTrigger.push("loadeddata");
  61535. }
  61536. if (el.readyState >= 3) {
  61537. eventsToTrigger.push("canplay");
  61538. }
  61539. if (el.readyState >= 4) {
  61540. eventsToTrigger.push("canplaythrough");
  61541. }
  61542. this.ready(function() {
  61543. eventsToTrigger.forEach(function(type2) {
  61544. this.trigger(type2);
  61545. }, this);
  61546. });
  61547. }
  61548. setScrubbing(isScrubbing) {
  61549. this.isScrubbing_ = isScrubbing;
  61550. }
  61551. scrubbing() {
  61552. return this.isScrubbing_;
  61553. }
  61554. setCurrentTime(seconds) {
  61555. try {
  61556. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI$1) {
  61557. this.el_.fastSeek(seconds);
  61558. } else {
  61559. this.el_.currentTime = seconds;
  61560. }
  61561. } catch (e) {
  61562. log$1$1(e, "Video is not ready. (Video.js)");
  61563. }
  61564. }
  61565. duration() {
  61566. if (this.el_.duration === Infinity && IS_ANDROID$1 && IS_CHROME$1 && this.el_.currentTime === 0) {
  61567. const checkProgress = () => {
  61568. if (this.el_.currentTime > 0) {
  61569. if (this.el_.duration === Infinity) {
  61570. this.trigger("durationchange");
  61571. }
  61572. this.off("timeupdate", checkProgress);
  61573. }
  61574. };
  61575. this.on("timeupdate", checkProgress);
  61576. return NaN;
  61577. }
  61578. return this.el_.duration || NaN;
  61579. }
  61580. width() {
  61581. return this.el_.offsetWidth;
  61582. }
  61583. height() {
  61584. return this.el_.offsetHeight;
  61585. }
  61586. proxyWebkitFullscreen_() {
  61587. if (!("webkitDisplayingFullscreen" in this.el_)) {
  61588. return;
  61589. }
  61590. const endFn = function() {
  61591. this.trigger("fullscreenchange", {
  61592. isFullscreen: false
  61593. });
  61594. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  61595. this.el_.controls = false;
  61596. }
  61597. };
  61598. const beginFn = function() {
  61599. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  61600. this.one("webkitendfullscreen", endFn);
  61601. this.trigger("fullscreenchange", {
  61602. isFullscreen: true,
  61603. nativeIOSFullscreen: true
  61604. });
  61605. }
  61606. };
  61607. this.on("webkitbeginfullscreen", beginFn);
  61608. this.on("dispose", () => {
  61609. this.off("webkitbeginfullscreen", beginFn);
  61610. this.off("webkitendfullscreen", endFn);
  61611. });
  61612. }
  61613. supportsFullScreen() {
  61614. return typeof this.el_.webkitEnterFullScreen === "function";
  61615. }
  61616. enterFullScreen() {
  61617. const video = this.el_;
  61618. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  61619. silencePromise$1(this.el_.play());
  61620. this.setTimeout(function() {
  61621. video.pause();
  61622. try {
  61623. video.webkitEnterFullScreen();
  61624. } catch (e) {
  61625. this.trigger("fullscreenerror", e);
  61626. }
  61627. }, 0);
  61628. } else {
  61629. try {
  61630. video.webkitEnterFullScreen();
  61631. } catch (e) {
  61632. this.trigger("fullscreenerror", e);
  61633. }
  61634. }
  61635. }
  61636. exitFullScreen() {
  61637. if (!this.el_.webkitDisplayingFullscreen) {
  61638. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  61639. return;
  61640. }
  61641. this.el_.webkitExitFullScreen();
  61642. }
  61643. requestPictureInPicture() {
  61644. return this.el_.requestPictureInPicture();
  61645. }
  61646. requestVideoFrameCallback(cb) {
  61647. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61648. return this.el_.requestVideoFrameCallback(cb);
  61649. }
  61650. return super.requestVideoFrameCallback(cb);
  61651. }
  61652. cancelVideoFrameCallback(id) {
  61653. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61654. this.el_.cancelVideoFrameCallback(id);
  61655. } else {
  61656. super.cancelVideoFrameCallback(id);
  61657. }
  61658. }
  61659. src(src) {
  61660. if (src === void 0) {
  61661. return this.el_.src;
  61662. }
  61663. this.setSrc(src);
  61664. }
  61665. reset() {
  61666. Html5$2.resetMediaElement(this.el_);
  61667. }
  61668. currentSrc() {
  61669. if (this.currentSource_) {
  61670. return this.currentSource_.src;
  61671. }
  61672. return this.el_.currentSrc;
  61673. }
  61674. setControls(val) {
  61675. this.el_.controls = !!val;
  61676. }
  61677. addTextTrack(kind, label2, language) {
  61678. if (!this.featuresNativeTextTracks) {
  61679. return super.addTextTrack(kind, label2, language);
  61680. }
  61681. return this.el_.addTextTrack(kind, label2, language);
  61682. }
  61683. createRemoteTextTrack(options2) {
  61684. if (!this.featuresNativeTextTracks) {
  61685. return super.createRemoteTextTrack(options2);
  61686. }
  61687. const htmlTrackElement = document_1.createElement("track");
  61688. if (options2.kind) {
  61689. htmlTrackElement.kind = options2.kind;
  61690. }
  61691. if (options2.label) {
  61692. htmlTrackElement.label = options2.label;
  61693. }
  61694. if (options2.language || options2.srclang) {
  61695. htmlTrackElement.srclang = options2.language || options2.srclang;
  61696. }
  61697. if (options2.default) {
  61698. htmlTrackElement.default = options2.default;
  61699. }
  61700. if (options2.id) {
  61701. htmlTrackElement.id = options2.id;
  61702. }
  61703. if (options2.src) {
  61704. htmlTrackElement.src = options2.src;
  61705. }
  61706. return htmlTrackElement;
  61707. }
  61708. addRemoteTextTrack(options2, manualCleanup) {
  61709. const htmlTrackElement = super.addRemoteTextTrack(options2, manualCleanup);
  61710. if (this.featuresNativeTextTracks) {
  61711. this.el().appendChild(htmlTrackElement);
  61712. }
  61713. return htmlTrackElement;
  61714. }
  61715. removeRemoteTextTrack(track) {
  61716. super.removeRemoteTextTrack(track);
  61717. if (this.featuresNativeTextTracks) {
  61718. const tracks = this.$$("track");
  61719. let i2 = tracks.length;
  61720. while (i2--) {
  61721. if (track === tracks[i2] || track === tracks[i2].track) {
  61722. this.el().removeChild(tracks[i2]);
  61723. }
  61724. }
  61725. }
  61726. }
  61727. getVideoPlaybackQuality() {
  61728. if (typeof this.el().getVideoPlaybackQuality === "function") {
  61729. return this.el().getVideoPlaybackQuality();
  61730. }
  61731. const videoPlaybackQuality = {};
  61732. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  61733. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  61734. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  61735. }
  61736. if (window_1.performance) {
  61737. videoPlaybackQuality.creationTime = window_1.performance.now();
  61738. }
  61739. return videoPlaybackQuality;
  61740. }
  61741. }
  61742. defineLazyProperty$1(Html5$2, "TEST_VID", function() {
  61743. if (!isReal$1()) {
  61744. return;
  61745. }
  61746. const video = document_1.createElement("video");
  61747. const track = document_1.createElement("track");
  61748. track.kind = "captions";
  61749. track.srclang = "en";
  61750. track.label = "English";
  61751. video.appendChild(track);
  61752. return video;
  61753. });
  61754. Html5$2.isSupported = function() {
  61755. try {
  61756. Html5$2.TEST_VID.volume = 0.5;
  61757. } catch (e) {
  61758. return false;
  61759. }
  61760. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.canPlayType);
  61761. };
  61762. Html5$2.canPlayType = function(type2) {
  61763. return Html5$2.TEST_VID.canPlayType(type2);
  61764. };
  61765. Html5$2.canPlaySource = function(srcObj, options2) {
  61766. return Html5$2.canPlayType(srcObj.type);
  61767. };
  61768. Html5$2.canControlVolume = function() {
  61769. try {
  61770. const volume = Html5$2.TEST_VID.volume;
  61771. Html5$2.TEST_VID.volume = volume / 2 + 0.1;
  61772. const canControl = volume !== Html5$2.TEST_VID.volume;
  61773. if (canControl && IS_IOS$1) {
  61774. window_1.setTimeout(() => {
  61775. if (Html5$2 && Html5$2.prototype) {
  61776. Html5$2.prototype.featuresVolumeControl = volume !== Html5$2.TEST_VID.volume;
  61777. }
  61778. });
  61779. return false;
  61780. }
  61781. return canControl;
  61782. } catch (e) {
  61783. return false;
  61784. }
  61785. };
  61786. Html5$2.canMuteVolume = function() {
  61787. try {
  61788. const muted = Html5$2.TEST_VID.muted;
  61789. Html5$2.TEST_VID.muted = !muted;
  61790. if (Html5$2.TEST_VID.muted) {
  61791. setAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61792. } else {
  61793. removeAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61794. }
  61795. return muted !== Html5$2.TEST_VID.muted;
  61796. } catch (e) {
  61797. return false;
  61798. }
  61799. };
  61800. Html5$2.canControlPlaybackRate = function() {
  61801. if (IS_ANDROID$1 && IS_CHROME$1 && CHROME_VERSION$1 < 58) {
  61802. return false;
  61803. }
  61804. try {
  61805. const playbackRate = Html5$2.TEST_VID.playbackRate;
  61806. Html5$2.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  61807. return playbackRate !== Html5$2.TEST_VID.playbackRate;
  61808. } catch (e) {
  61809. return false;
  61810. }
  61811. };
  61812. Html5$2.canOverrideAttributes = function() {
  61813. try {
  61814. const noop2 = () => {
  61815. };
  61816. Object.defineProperty(document_1.createElement("video"), "src", {
  61817. get: noop2,
  61818. set: noop2
  61819. });
  61820. Object.defineProperty(document_1.createElement("audio"), "src", {
  61821. get: noop2,
  61822. set: noop2
  61823. });
  61824. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  61825. get: noop2,
  61826. set: noop2
  61827. });
  61828. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  61829. get: noop2,
  61830. set: noop2
  61831. });
  61832. } catch (e) {
  61833. return false;
  61834. }
  61835. return true;
  61836. };
  61837. Html5$2.supportsNativeTextTracks = function() {
  61838. return IS_ANY_SAFARI$1 || IS_IOS$1 && IS_CHROME$1;
  61839. };
  61840. Html5$2.supportsNativeVideoTracks = function() {
  61841. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.videoTracks);
  61842. };
  61843. Html5$2.supportsNativeAudioTracks = function() {
  61844. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.audioTracks);
  61845. };
  61846. Html5$2.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  61847. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function([key, fn2]) {
  61848. defineLazyProperty$1(Html5$2.prototype, key, () => Html5$2[fn2](), true);
  61849. });
  61850. Html5$2.prototype.featuresVolumeControl = Html5$2.canControlVolume();
  61851. Html5$2.prototype.movingMediaElementInDOM = !IS_IOS$1;
  61852. Html5$2.prototype.featuresFullscreenResize = true;
  61853. Html5$2.prototype.featuresProgressEvents = true;
  61854. Html5$2.prototype.featuresTimeupdateEvents = true;
  61855. Html5$2.prototype.featuresVideoFrameCallback = !!(Html5$2.TEST_VID && Html5$2.TEST_VID.requestVideoFrameCallback);
  61856. Html5$2.disposeMediaElement = function(el) {
  61857. if (!el) {
  61858. return;
  61859. }
  61860. if (el.parentNode) {
  61861. el.parentNode.removeChild(el);
  61862. }
  61863. while (el.hasChildNodes()) {
  61864. el.removeChild(el.firstChild);
  61865. }
  61866. el.removeAttribute("src");
  61867. if (typeof el.load === "function") {
  61868. (function() {
  61869. try {
  61870. el.load();
  61871. } catch (e) {
  61872. }
  61873. })();
  61874. }
  61875. };
  61876. Html5$2.resetMediaElement = function(el) {
  61877. if (!el) {
  61878. return;
  61879. }
  61880. const sources = el.querySelectorAll("source");
  61881. let i2 = sources.length;
  61882. while (i2--) {
  61883. el.removeChild(sources[i2]);
  61884. }
  61885. el.removeAttribute("src");
  61886. if (typeof el.load === "function") {
  61887. (function() {
  61888. try {
  61889. el.load();
  61890. } catch (e) {
  61891. }
  61892. })();
  61893. }
  61894. };
  61895. [
  61896. "muted",
  61897. "defaultMuted",
  61898. "autoplay",
  61899. "controls",
  61900. "loop",
  61901. "playsinline"
  61902. ].forEach(function(prop) {
  61903. Html5$2.prototype[prop] = function() {
  61904. return this.el_[prop] || this.el_.hasAttribute(prop);
  61905. };
  61906. });
  61907. [
  61908. "muted",
  61909. "defaultMuted",
  61910. "autoplay",
  61911. "loop",
  61912. "playsinline"
  61913. ].forEach(function(prop) {
  61914. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61915. this.el_[prop] = v;
  61916. if (v) {
  61917. this.el_.setAttribute(prop, prop);
  61918. } else {
  61919. this.el_.removeAttribute(prop);
  61920. }
  61921. };
  61922. });
  61923. [
  61924. "paused",
  61925. "currentTime",
  61926. "buffered",
  61927. "volume",
  61928. "poster",
  61929. "preload",
  61930. "error",
  61931. "seeking",
  61932. "seekable",
  61933. "ended",
  61934. "playbackRate",
  61935. "defaultPlaybackRate",
  61936. "disablePictureInPicture",
  61937. "played",
  61938. "networkState",
  61939. "readyState",
  61940. "videoWidth",
  61941. "videoHeight",
  61942. "crossOrigin"
  61943. ].forEach(function(prop) {
  61944. Html5$2.prototype[prop] = function() {
  61945. return this.el_[prop];
  61946. };
  61947. });
  61948. [
  61949. "volume",
  61950. "src",
  61951. "poster",
  61952. "preload",
  61953. "playbackRate",
  61954. "defaultPlaybackRate",
  61955. "disablePictureInPicture",
  61956. "crossOrigin"
  61957. ].forEach(function(prop) {
  61958. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61959. this.el_[prop] = v;
  61960. };
  61961. });
  61962. [
  61963. "pause",
  61964. "load",
  61965. "play"
  61966. ].forEach(function(prop) {
  61967. Html5$2.prototype[prop] = function() {
  61968. return this.el_[prop]();
  61969. };
  61970. });
  61971. Tech$2.withSourceHandlers(Html5$2);
  61972. Html5$2.nativeSourceHandler = {};
  61973. Html5$2.nativeSourceHandler.canPlayType = function(type2) {
  61974. try {
  61975. return Html5$2.TEST_VID.canPlayType(type2);
  61976. } catch (e) {
  61977. return "";
  61978. }
  61979. };
  61980. Html5$2.nativeSourceHandler.canHandleSource = function(source, options2) {
  61981. if (source.type) {
  61982. return Html5$2.nativeSourceHandler.canPlayType(source.type);
  61983. } else if (source.src) {
  61984. const ext = getFileExtension$1(source.src);
  61985. return Html5$2.nativeSourceHandler.canPlayType(`video/${ext}`);
  61986. }
  61987. return "";
  61988. };
  61989. Html5$2.nativeSourceHandler.handleSource = function(source, tech, options2) {
  61990. tech.setSrc(source.src);
  61991. };
  61992. Html5$2.nativeSourceHandler.dispose = function() {
  61993. };
  61994. Html5$2.registerSourceHandler(Html5$2.nativeSourceHandler);
  61995. Tech$2.registerTech("Html5", Html5$2);
  61996. const TECH_EVENTS_RETRIGGER$1 = [
  61997. "progress",
  61998. "abort",
  61999. "suspend",
  62000. "emptied",
  62001. "stalled",
  62002. "loadedmetadata",
  62003. "loadeddata",
  62004. "timeupdate",
  62005. "resize",
  62006. "volumechange",
  62007. "texttrackchange"
  62008. ];
  62009. const TECH_EVENTS_QUEUE$1 = {
  62010. canplay: "CanPlay",
  62011. canplaythrough: "CanPlayThrough",
  62012. playing: "Playing",
  62013. seeked: "Seeked"
  62014. };
  62015. const BREAKPOINT_ORDER$1 = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  62016. const BREAKPOINT_CLASSES$1 = {};
  62017. BREAKPOINT_ORDER$1.forEach((k) => {
  62018. const v = k.charAt(0) === "x" ? `x-${k.substring(1)}` : k;
  62019. BREAKPOINT_CLASSES$1[k] = `vjs-layout-${v}`;
  62020. });
  62021. const DEFAULT_BREAKPOINTS$1 = {
  62022. tiny: 210,
  62023. xsmall: 320,
  62024. small: 425,
  62025. medium: 768,
  62026. large: 1440,
  62027. xlarge: 2560,
  62028. huge: Infinity
  62029. };
  62030. class Player$1 extends Component$1$1 {
  62031. constructor(tag, options2, ready) {
  62032. tag.id = tag.id || options2.id || `vjs_video_${newGUID$1()}`;
  62033. options2 = Object.assign(Player$1.getTagSettings(tag), options2);
  62034. options2.initChildren = false;
  62035. options2.createEl = false;
  62036. options2.evented = false;
  62037. options2.reportTouchActivity = false;
  62038. if (!options2.language) {
  62039. const closest = tag.closest("[lang]");
  62040. if (closest) {
  62041. options2.language = closest.getAttribute("lang");
  62042. }
  62043. }
  62044. super(null, options2, ready);
  62045. this.boundDocumentFullscreenChange_ = (e) => this.documentFullscreenChange_(e);
  62046. this.boundFullWindowOnEscKey_ = (e) => this.fullWindowOnEscKey(e);
  62047. this.boundUpdateStyleEl_ = (e) => this.updateStyleEl_(e);
  62048. this.boundApplyInitTime_ = (e) => this.applyInitTime_(e);
  62049. this.boundUpdateCurrentBreakpoint_ = (e) => this.updateCurrentBreakpoint_(e);
  62050. this.boundHandleTechClick_ = (e) => this.handleTechClick_(e);
  62051. this.boundHandleTechDoubleClick_ = (e) => this.handleTechDoubleClick_(e);
  62052. this.boundHandleTechTouchStart_ = (e) => this.handleTechTouchStart_(e);
  62053. this.boundHandleTechTouchMove_ = (e) => this.handleTechTouchMove_(e);
  62054. this.boundHandleTechTouchEnd_ = (e) => this.handleTechTouchEnd_(e);
  62055. this.boundHandleTechTap_ = (e) => this.handleTechTap_(e);
  62056. this.isFullscreen_ = false;
  62057. this.log = createLogger$2(this.id_);
  62058. this.fsApi_ = FullscreenApi$1;
  62059. this.isPosterFromTech_ = false;
  62060. this.queuedCallbacks_ = [];
  62061. this.isReady_ = false;
  62062. this.hasStarted_ = false;
  62063. this.userActive_ = false;
  62064. this.debugEnabled_ = false;
  62065. this.audioOnlyMode_ = false;
  62066. this.audioPosterMode_ = false;
  62067. this.audioOnlyCache_ = {
  62068. playerHeight: null,
  62069. hiddenChildren: []
  62070. };
  62071. if (!this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) {
  62072. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  62073. }
  62074. this.tag = tag;
  62075. this.tagAttributes = tag && getAttributes$1(tag);
  62076. this.language(this.options_.language);
  62077. if (options2.languages) {
  62078. const languagesToLower = {};
  62079. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  62080. languagesToLower[name.toLowerCase()] = options2.languages[name];
  62081. });
  62082. this.languages_ = languagesToLower;
  62083. } else {
  62084. this.languages_ = Player$1.prototype.options_.languages;
  62085. }
  62086. this.resetCache_();
  62087. this.poster_ = options2.poster || "";
  62088. this.controls_ = !!options2.controls;
  62089. tag.controls = false;
  62090. tag.removeAttribute("controls");
  62091. this.changingSrc_ = false;
  62092. this.playCallbacks_ = [];
  62093. this.playTerminatedQueue_ = [];
  62094. if (tag.hasAttribute("autoplay")) {
  62095. this.autoplay(true);
  62096. } else {
  62097. this.autoplay(this.options_.autoplay);
  62098. }
  62099. if (options2.plugins) {
  62100. Object.keys(options2.plugins).forEach((name) => {
  62101. if (typeof this[name] !== "function") {
  62102. throw new Error(`plugin "${name}" does not exist`);
  62103. }
  62104. });
  62105. }
  62106. this.scrubbing_ = false;
  62107. this.el_ = this.createEl();
  62108. evented$1(this, {
  62109. eventBusKey: "el_"
  62110. });
  62111. if (this.fsApi_.requestFullscreen) {
  62112. on$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62113. this.on(this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62114. }
  62115. if (this.fluid_) {
  62116. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62117. }
  62118. const playerOptionsCopy = merge$1(this.options_);
  62119. if (options2.plugins) {
  62120. Object.keys(options2.plugins).forEach((name) => {
  62121. this[name](options2.plugins[name]);
  62122. });
  62123. }
  62124. if (options2.debug) {
  62125. this.debug(true);
  62126. }
  62127. this.options_.playerOptions = playerOptionsCopy;
  62128. this.middleware_ = [];
  62129. this.playbackRates(options2.playbackRates);
  62130. this.initChildren();
  62131. this.isAudio(tag.nodeName.toLowerCase() === "audio");
  62132. if (this.controls()) {
  62133. this.addClass("vjs-controls-enabled");
  62134. } else {
  62135. this.addClass("vjs-controls-disabled");
  62136. }
  62137. this.el_.setAttribute("role", "region");
  62138. if (this.isAudio()) {
  62139. this.el_.setAttribute("aria-label", this.localize("Audio Player"));
  62140. } else {
  62141. this.el_.setAttribute("aria-label", this.localize("Video Player"));
  62142. }
  62143. if (this.isAudio()) {
  62144. this.addClass("vjs-audio");
  62145. }
  62146. if (TOUCH_ENABLED$1) {
  62147. this.addClass("vjs-touch-enabled");
  62148. }
  62149. if (!IS_IOS$1) {
  62150. this.addClass("vjs-workinghover");
  62151. }
  62152. Player$1.players[this.id_] = this;
  62153. const majorVersion = version$6$1.split(".")[0];
  62154. this.addClass(`vjs-v${majorVersion}`);
  62155. this.userActive(true);
  62156. this.reportUserActivity();
  62157. this.one("play", (e) => this.listenForUserActivity_(e));
  62158. this.on("keydown", (e) => this.handleKeyDown(e));
  62159. this.on("languagechange", (e) => this.handleLanguagechange(e));
  62160. this.breakpoints(this.options_.breakpoints);
  62161. this.responsive(this.options_.responsive);
  62162. this.on("ready", () => {
  62163. this.audioPosterMode(this.options_.audioPosterMode);
  62164. this.audioOnlyMode(this.options_.audioOnlyMode);
  62165. });
  62166. }
  62167. dispose() {
  62168. this.trigger("dispose");
  62169. this.off("dispose");
  62170. off$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62171. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  62172. if (this.styleEl_ && this.styleEl_.parentNode) {
  62173. this.styleEl_.parentNode.removeChild(this.styleEl_);
  62174. this.styleEl_ = null;
  62175. }
  62176. Player$1.players[this.id_] = null;
  62177. if (this.tag && this.tag.player) {
  62178. this.tag.player = null;
  62179. }
  62180. if (this.el_ && this.el_.player) {
  62181. this.el_.player = null;
  62182. }
  62183. if (this.tech_) {
  62184. this.tech_.dispose();
  62185. this.isPosterFromTech_ = false;
  62186. this.poster_ = "";
  62187. }
  62188. if (this.playerElIngest_) {
  62189. this.playerElIngest_ = null;
  62190. }
  62191. if (this.tag) {
  62192. this.tag = null;
  62193. }
  62194. clearCacheForPlayer$1(this);
  62195. ALL$1.names.forEach((name) => {
  62196. const props = ALL$1[name];
  62197. const list = this[props.getterName]();
  62198. if (list && list.off) {
  62199. list.off();
  62200. }
  62201. });
  62202. super.dispose({
  62203. restoreEl: this.options_.restoreEl
  62204. });
  62205. }
  62206. createEl() {
  62207. let tag = this.tag;
  62208. let el;
  62209. let playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  62210. const divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  62211. if (playerElIngest) {
  62212. el = this.el_ = tag.parentNode;
  62213. } else if (!divEmbed) {
  62214. el = this.el_ = super.createEl("div");
  62215. }
  62216. const attrs = getAttributes$1(tag);
  62217. if (divEmbed) {
  62218. el = this.el_ = tag;
  62219. tag = this.tag = document_1.createElement("video");
  62220. while (el.children.length) {
  62221. tag.appendChild(el.firstChild);
  62222. }
  62223. if (!hasClass$1(el, "video-js")) {
  62224. addClass$1(el, "video-js");
  62225. }
  62226. el.appendChild(tag);
  62227. playerElIngest = this.playerElIngest_ = el;
  62228. Object.keys(el).forEach((k) => {
  62229. try {
  62230. tag[k] = el[k];
  62231. } catch (e) {
  62232. }
  62233. });
  62234. }
  62235. tag.setAttribute("tabindex", "-1");
  62236. attrs.tabindex = "-1";
  62237. if (IS_CHROME$1 && IS_WINDOWS$1) {
  62238. tag.setAttribute("role", "application");
  62239. attrs.role = "application";
  62240. }
  62241. tag.removeAttribute("width");
  62242. tag.removeAttribute("height");
  62243. if ("width" in attrs) {
  62244. delete attrs.width;
  62245. }
  62246. if ("height" in attrs) {
  62247. delete attrs.height;
  62248. }
  62249. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  62250. if (!(divEmbed && attr === "class")) {
  62251. el.setAttribute(attr, attrs[attr]);
  62252. }
  62253. if (divEmbed) {
  62254. tag.setAttribute(attr, attrs[attr]);
  62255. }
  62256. });
  62257. tag.playerId = tag.id;
  62258. tag.id += "_html5_api";
  62259. tag.className = "vjs-tech";
  62260. tag.player = el.player = this;
  62261. this.addClass("vjs-paused");
  62262. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  62263. this.styleEl_ = createStyleElement$1("vjs-styles-dimensions");
  62264. const defaultsStyleEl = $$1(".vjs-styles-defaults");
  62265. const head = $$1("head");
  62266. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  62267. }
  62268. this.fill_ = false;
  62269. this.fluid_ = false;
  62270. this.width(this.options_.width);
  62271. this.height(this.options_.height);
  62272. this.fill(this.options_.fill);
  62273. this.fluid(this.options_.fluid);
  62274. this.aspectRatio(this.options_.aspectRatio);
  62275. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  62276. const links = tag.getElementsByTagName("a");
  62277. for (let i2 = 0; i2 < links.length; i2++) {
  62278. const linkEl = links.item(i2);
  62279. addClass$1(linkEl, "vjs-hidden");
  62280. linkEl.setAttribute("hidden", "hidden");
  62281. }
  62282. tag.initNetworkState_ = tag.networkState;
  62283. if (tag.parentNode && !playerElIngest) {
  62284. tag.parentNode.insertBefore(el, tag);
  62285. }
  62286. prependTo$1(tag, el);
  62287. this.children_.unshift(tag);
  62288. this.el_.setAttribute("lang", this.language_);
  62289. this.el_.setAttribute("translate", "no");
  62290. this.el_ = el;
  62291. return el;
  62292. }
  62293. crossOrigin(value) {
  62294. if (typeof value === "undefined") {
  62295. return this.techGet_("crossOrigin");
  62296. }
  62297. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  62298. log$1$1.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  62299. return;
  62300. }
  62301. this.techCall_("setCrossOrigin", value);
  62302. if (this.posterImage) {
  62303. this.posterImage.crossOrigin(value);
  62304. }
  62305. return;
  62306. }
  62307. width(value) {
  62308. return this.dimension("width", value);
  62309. }
  62310. height(value) {
  62311. return this.dimension("height", value);
  62312. }
  62313. dimension(dimension, value) {
  62314. const privDimension = dimension + "_";
  62315. if (value === void 0) {
  62316. return this[privDimension] || 0;
  62317. }
  62318. if (value === "" || value === "auto") {
  62319. this[privDimension] = void 0;
  62320. this.updateStyleEl_();
  62321. return;
  62322. }
  62323. const parsedVal = parseFloat(value);
  62324. if (isNaN(parsedVal)) {
  62325. log$1$1.error(`Improper value "${value}" supplied for for ${dimension}`);
  62326. return;
  62327. }
  62328. this[privDimension] = parsedVal;
  62329. this.updateStyleEl_();
  62330. }
  62331. fluid(bool) {
  62332. if (bool === void 0) {
  62333. return !!this.fluid_;
  62334. }
  62335. this.fluid_ = !!bool;
  62336. if (isEvented$1(this)) {
  62337. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62338. }
  62339. if (bool) {
  62340. this.addClass("vjs-fluid");
  62341. this.fill(false);
  62342. addEventedCallback$1(this, () => {
  62343. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62344. });
  62345. } else {
  62346. this.removeClass("vjs-fluid");
  62347. }
  62348. this.updateStyleEl_();
  62349. }
  62350. fill(bool) {
  62351. if (bool === void 0) {
  62352. return !!this.fill_;
  62353. }
  62354. this.fill_ = !!bool;
  62355. if (bool) {
  62356. this.addClass("vjs-fill");
  62357. this.fluid(false);
  62358. } else {
  62359. this.removeClass("vjs-fill");
  62360. }
  62361. }
  62362. aspectRatio(ratio) {
  62363. if (ratio === void 0) {
  62364. return this.aspectRatio_;
  62365. }
  62366. if (!/^\d+\:\d+$/.test(ratio)) {
  62367. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  62368. }
  62369. this.aspectRatio_ = ratio;
  62370. this.fluid(true);
  62371. this.updateStyleEl_();
  62372. }
  62373. updateStyleEl_() {
  62374. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  62375. const width3 = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  62376. const height3 = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  62377. const techEl = this.tech_ && this.tech_.el();
  62378. if (techEl) {
  62379. if (width3 >= 0) {
  62380. techEl.width = width3;
  62381. }
  62382. if (height3 >= 0) {
  62383. techEl.height = height3;
  62384. }
  62385. }
  62386. return;
  62387. }
  62388. let width2;
  62389. let height2;
  62390. let aspectRatio;
  62391. let idClass;
  62392. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  62393. aspectRatio = this.aspectRatio_;
  62394. } else if (this.videoWidth() > 0) {
  62395. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  62396. } else {
  62397. aspectRatio = "16:9";
  62398. }
  62399. const ratioParts = aspectRatio.split(":");
  62400. const ratioMultiplier = ratioParts[1] / ratioParts[0];
  62401. if (this.width_ !== void 0) {
  62402. width2 = this.width_;
  62403. } else if (this.height_ !== void 0) {
  62404. width2 = this.height_ / ratioMultiplier;
  62405. } else {
  62406. width2 = this.videoWidth() || 300;
  62407. }
  62408. if (this.height_ !== void 0) {
  62409. height2 = this.height_;
  62410. } else {
  62411. height2 = width2 * ratioMultiplier;
  62412. }
  62413. if (/^[^a-zA-Z]/.test(this.id())) {
  62414. idClass = "dimensions-" + this.id();
  62415. } else {
  62416. idClass = this.id() + "-dimensions";
  62417. }
  62418. this.addClass(idClass);
  62419. setTextContent$1(this.styleEl_, `
  62420. .${idClass} {
  62421. width: ${width2}px;
  62422. height: ${height2}px;
  62423. }
  62424. .${idClass}.vjs-fluid:not(.vjs-audio-only-mode) {
  62425. padding-top: ${ratioMultiplier * 100}%;
  62426. }
  62427. `);
  62428. }
  62429. loadTech_(techName, source) {
  62430. if (this.tech_) {
  62431. this.unloadTech_();
  62432. }
  62433. const titleTechName = toTitleCase$1$1(techName);
  62434. const camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  62435. if (titleTechName !== "Html5" && this.tag) {
  62436. Tech$2.getTech("Html5").disposeMediaElement(this.tag);
  62437. this.tag.player = null;
  62438. this.tag = null;
  62439. }
  62440. this.techName_ = titleTechName;
  62441. this.isReady_ = false;
  62442. let autoplay = this.autoplay();
  62443. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  62444. autoplay = false;
  62445. }
  62446. const techOptions = {
  62447. source,
  62448. autoplay,
  62449. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  62450. "playerId": this.id(),
  62451. "techId": `${this.id()}_${camelTechName}_api`,
  62452. "playsinline": this.options_.playsinline,
  62453. "preload": this.options_.preload,
  62454. "loop": this.options_.loop,
  62455. "disablePictureInPicture": this.options_.disablePictureInPicture,
  62456. "muted": this.options_.muted,
  62457. "poster": this.poster(),
  62458. "language": this.language(),
  62459. "playerElIngest": this.playerElIngest_ || false,
  62460. "vtt.js": this.options_["vtt.js"],
  62461. "canOverridePoster": !!this.options_.techCanOverridePoster,
  62462. "enableSourceset": this.options_.enableSourceset
  62463. };
  62464. ALL$1.names.forEach((name) => {
  62465. const props = ALL$1[name];
  62466. techOptions[props.getterName] = this[props.privateName];
  62467. });
  62468. Object.assign(techOptions, this.options_[titleTechName]);
  62469. Object.assign(techOptions, this.options_[camelTechName]);
  62470. Object.assign(techOptions, this.options_[techName.toLowerCase()]);
  62471. if (this.tag) {
  62472. techOptions.tag = this.tag;
  62473. }
  62474. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  62475. techOptions.startTime = this.cache_.currentTime;
  62476. }
  62477. const TechClass = Tech$2.getTech(techName);
  62478. if (!TechClass) {
  62479. throw new Error(`No Tech named '${titleTechName}' exists! '${titleTechName}' should be registered using videojs.registerTech()'`);
  62480. }
  62481. this.tech_ = new TechClass(techOptions);
  62482. this.tech_.ready(bind_(this, this.handleTechReady_), true);
  62483. textTrackConverter$1.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  62484. TECH_EVENTS_RETRIGGER$1.forEach((event2) => {
  62485. this.on(this.tech_, event2, (e) => this[`handleTech${toTitleCase$1$1(event2)}_`](e));
  62486. });
  62487. Object.keys(TECH_EVENTS_QUEUE$1).forEach((event2) => {
  62488. this.on(this.tech_, event2, (eventObj) => {
  62489. if (this.tech_.playbackRate() === 0 && this.tech_.seeking()) {
  62490. this.queuedCallbacks_.push({
  62491. callback: this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`].bind(this),
  62492. event: eventObj
  62493. });
  62494. return;
  62495. }
  62496. this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`](eventObj);
  62497. });
  62498. });
  62499. this.on(this.tech_, "loadstart", (e) => this.handleTechLoadStart_(e));
  62500. this.on(this.tech_, "sourceset", (e) => this.handleTechSourceset_(e));
  62501. this.on(this.tech_, "waiting", (e) => this.handleTechWaiting_(e));
  62502. this.on(this.tech_, "ended", (e) => this.handleTechEnded_(e));
  62503. this.on(this.tech_, "seeking", (e) => this.handleTechSeeking_(e));
  62504. this.on(this.tech_, "play", (e) => this.handleTechPlay_(e));
  62505. this.on(this.tech_, "pause", (e) => this.handleTechPause_(e));
  62506. this.on(this.tech_, "durationchange", (e) => this.handleTechDurationChange_(e));
  62507. this.on(this.tech_, "fullscreenchange", (e, data) => this.handleTechFullscreenChange_(e, data));
  62508. this.on(this.tech_, "fullscreenerror", (e, err) => this.handleTechFullscreenError_(e, err));
  62509. this.on(this.tech_, "enterpictureinpicture", (e) => this.handleTechEnterPictureInPicture_(e));
  62510. this.on(this.tech_, "leavepictureinpicture", (e) => this.handleTechLeavePictureInPicture_(e));
  62511. this.on(this.tech_, "error", (e) => this.handleTechError_(e));
  62512. this.on(this.tech_, "posterchange", (e) => this.handleTechPosterChange_(e));
  62513. this.on(this.tech_, "textdata", (e) => this.handleTechTextData_(e));
  62514. this.on(this.tech_, "ratechange", (e) => this.handleTechRateChange_(e));
  62515. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  62516. this.usingNativeControls(this.techGet_("controls"));
  62517. if (this.controls() && !this.usingNativeControls()) {
  62518. this.addTechControlsListeners_();
  62519. }
  62520. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  62521. prependTo$1(this.tech_.el(), this.el());
  62522. }
  62523. if (this.tag) {
  62524. this.tag.player = null;
  62525. this.tag = null;
  62526. }
  62527. }
  62528. unloadTech_() {
  62529. ALL$1.names.forEach((name) => {
  62530. const props = ALL$1[name];
  62531. this[props.privateName] = this[props.getterName]();
  62532. });
  62533. this.textTracksJson_ = textTrackConverter$1.textTracksToJson(this.tech_);
  62534. this.isReady_ = false;
  62535. this.tech_.dispose();
  62536. this.tech_ = false;
  62537. if (this.isPosterFromTech_) {
  62538. this.poster_ = "";
  62539. this.trigger("posterchange");
  62540. }
  62541. this.isPosterFromTech_ = false;
  62542. }
  62543. tech(safety) {
  62544. if (safety === void 0) {
  62545. log$1$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  62546. }
  62547. return this.tech_;
  62548. }
  62549. addTechControlsListeners_() {
  62550. this.removeTechControlsListeners_();
  62551. this.on(this.tech_, "click", this.boundHandleTechClick_);
  62552. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62553. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62554. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62555. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62556. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  62557. }
  62558. removeTechControlsListeners_() {
  62559. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  62560. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62561. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62562. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62563. this.off(this.tech_, "click", this.boundHandleTechClick_);
  62564. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62565. }
  62566. handleTechReady_() {
  62567. this.triggerReady();
  62568. if (this.cache_.volume) {
  62569. this.techCall_("setVolume", this.cache_.volume);
  62570. }
  62571. this.handleTechPosterChange_();
  62572. this.handleTechDurationChange_();
  62573. }
  62574. handleTechLoadStart_() {
  62575. this.removeClass("vjs-ended", "vjs-seeking");
  62576. this.error(null);
  62577. this.handleTechDurationChange_();
  62578. if (!this.paused()) {
  62579. this.trigger("loadstart");
  62580. } else {
  62581. this.hasStarted(false);
  62582. this.trigger("loadstart");
  62583. }
  62584. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  62585. }
  62586. manualAutoplay_(type2) {
  62587. if (!this.tech_ || typeof type2 !== "string") {
  62588. return;
  62589. }
  62590. const resolveMuted = () => {
  62591. const previouslyMuted = this.muted();
  62592. this.muted(true);
  62593. const restoreMuted = () => {
  62594. this.muted(previouslyMuted);
  62595. };
  62596. this.playTerminatedQueue_.push(restoreMuted);
  62597. const mutedPromise = this.play();
  62598. if (!isPromise$1(mutedPromise)) {
  62599. return;
  62600. }
  62601. return mutedPromise.catch((err) => {
  62602. restoreMuted();
  62603. throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${err ? err : ""}`);
  62604. });
  62605. };
  62606. let promise;
  62607. if (type2 === "any" && !this.muted()) {
  62608. promise = this.play();
  62609. if (isPromise$1(promise)) {
  62610. promise = promise.catch(resolveMuted);
  62611. }
  62612. } else if (type2 === "muted" && !this.muted()) {
  62613. promise = resolveMuted();
  62614. } else {
  62615. promise = this.play();
  62616. }
  62617. if (!isPromise$1(promise)) {
  62618. return;
  62619. }
  62620. return promise.then(() => {
  62621. this.trigger({
  62622. type: "autoplay-success",
  62623. autoplay: type2
  62624. });
  62625. }).catch(() => {
  62626. this.trigger({
  62627. type: "autoplay-failure",
  62628. autoplay: type2
  62629. });
  62630. });
  62631. }
  62632. updateSourceCaches_(srcObj = "") {
  62633. let src = srcObj;
  62634. let type2 = "";
  62635. if (typeof src !== "string") {
  62636. src = srcObj.src;
  62637. type2 = srcObj.type;
  62638. }
  62639. this.cache_.source = this.cache_.source || {};
  62640. this.cache_.sources = this.cache_.sources || [];
  62641. if (src && !type2) {
  62642. type2 = findMimetype$1(this, src);
  62643. }
  62644. this.cache_.source = merge$1({}, srcObj, {
  62645. src,
  62646. type: type2
  62647. });
  62648. const matchingSources = this.cache_.sources.filter((s) => s.src && s.src === src);
  62649. const sourceElSources = [];
  62650. const sourceEls = this.$$("source");
  62651. const matchingSourceEls = [];
  62652. for (let i2 = 0; i2 < sourceEls.length; i2++) {
  62653. const sourceObj = getAttributes$1(sourceEls[i2]);
  62654. sourceElSources.push(sourceObj);
  62655. if (sourceObj.src && sourceObj.src === src) {
  62656. matchingSourceEls.push(sourceObj.src);
  62657. }
  62658. }
  62659. if (matchingSourceEls.length && !matchingSources.length) {
  62660. this.cache_.sources = sourceElSources;
  62661. } else if (!matchingSources.length) {
  62662. this.cache_.sources = [this.cache_.source];
  62663. }
  62664. this.cache_.src = src;
  62665. }
  62666. handleTechSourceset_(event2) {
  62667. if (!this.changingSrc_) {
  62668. let updateSourceCaches = (src) => this.updateSourceCaches_(src);
  62669. const playerSrc = this.currentSource().src;
  62670. const eventSrc = event2.src;
  62671. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  62672. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  62673. updateSourceCaches = () => {
  62674. };
  62675. }
  62676. }
  62677. updateSourceCaches(eventSrc);
  62678. if (!event2.src) {
  62679. this.tech_.any(["sourceset", "loadstart"], (e) => {
  62680. if (e.type === "sourceset") {
  62681. return;
  62682. }
  62683. const techSrc = this.techGet("currentSrc");
  62684. this.lastSource_.tech = techSrc;
  62685. this.updateSourceCaches_(techSrc);
  62686. });
  62687. }
  62688. }
  62689. this.lastSource_ = {
  62690. player: this.currentSource().src,
  62691. tech: event2.src
  62692. };
  62693. this.trigger({
  62694. src: event2.src,
  62695. type: "sourceset"
  62696. });
  62697. }
  62698. hasStarted(request) {
  62699. if (request === void 0) {
  62700. return this.hasStarted_;
  62701. }
  62702. if (request === this.hasStarted_) {
  62703. return;
  62704. }
  62705. this.hasStarted_ = request;
  62706. if (this.hasStarted_) {
  62707. this.addClass("vjs-has-started");
  62708. } else {
  62709. this.removeClass("vjs-has-started");
  62710. }
  62711. }
  62712. handleTechPlay_() {
  62713. this.removeClass("vjs-ended", "vjs-paused");
  62714. this.addClass("vjs-playing");
  62715. this.hasStarted(true);
  62716. this.trigger("play");
  62717. }
  62718. handleTechRateChange_() {
  62719. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  62720. this.queuedCallbacks_.forEach((queued) => queued.callback(queued.event));
  62721. this.queuedCallbacks_ = [];
  62722. }
  62723. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  62724. this.trigger("ratechange");
  62725. }
  62726. handleTechWaiting_() {
  62727. this.addClass("vjs-waiting");
  62728. this.trigger("waiting");
  62729. const timeWhenWaiting = this.currentTime();
  62730. const timeUpdateListener = () => {
  62731. if (timeWhenWaiting !== this.currentTime()) {
  62732. this.removeClass("vjs-waiting");
  62733. this.off("timeupdate", timeUpdateListener);
  62734. }
  62735. };
  62736. this.on("timeupdate", timeUpdateListener);
  62737. }
  62738. handleTechCanPlay_() {
  62739. this.removeClass("vjs-waiting");
  62740. this.trigger("canplay");
  62741. }
  62742. handleTechCanPlayThrough_() {
  62743. this.removeClass("vjs-waiting");
  62744. this.trigger("canplaythrough");
  62745. }
  62746. handleTechPlaying_() {
  62747. this.removeClass("vjs-waiting");
  62748. this.trigger("playing");
  62749. }
  62750. handleTechSeeking_() {
  62751. this.addClass("vjs-seeking");
  62752. this.trigger("seeking");
  62753. }
  62754. handleTechSeeked_() {
  62755. this.removeClass("vjs-seeking", "vjs-ended");
  62756. this.trigger("seeked");
  62757. }
  62758. handleTechPause_() {
  62759. this.removeClass("vjs-playing");
  62760. this.addClass("vjs-paused");
  62761. this.trigger("pause");
  62762. }
  62763. handleTechEnded_() {
  62764. this.addClass("vjs-ended");
  62765. this.removeClass("vjs-waiting");
  62766. if (this.options_.loop) {
  62767. this.currentTime(0);
  62768. this.play();
  62769. } else if (!this.paused()) {
  62770. this.pause();
  62771. }
  62772. this.trigger("ended");
  62773. }
  62774. handleTechDurationChange_() {
  62775. this.duration(this.techGet_("duration"));
  62776. }
  62777. handleTechClick_(event2) {
  62778. if (!this.controls_) {
  62779. return;
  62780. }
  62781. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  62782. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  62783. this.options_.userActions.click.call(this, event2);
  62784. } else if (this.paused()) {
  62785. silencePromise$1(this.play());
  62786. } else {
  62787. this.pause();
  62788. }
  62789. }
  62790. }
  62791. handleTechDoubleClick_(event2) {
  62792. if (!this.controls_) {
  62793. return;
  62794. }
  62795. const inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), (el) => el.contains(event2.target));
  62796. if (!inAllowedEls) {
  62797. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  62798. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  62799. this.options_.userActions.doubleClick.call(this, event2);
  62800. } else if (this.isFullscreen()) {
  62801. this.exitFullscreen();
  62802. } else {
  62803. this.requestFullscreen();
  62804. }
  62805. }
  62806. }
  62807. }
  62808. handleTechTap_() {
  62809. this.userActive(!this.userActive());
  62810. }
  62811. handleTechTouchStart_() {
  62812. this.userWasActive = this.userActive();
  62813. }
  62814. handleTechTouchMove_() {
  62815. if (this.userWasActive) {
  62816. this.reportUserActivity();
  62817. }
  62818. }
  62819. handleTechTouchEnd_(event2) {
  62820. if (event2.cancelable) {
  62821. event2.preventDefault();
  62822. }
  62823. }
  62824. toggleFullscreenClass_() {
  62825. if (this.isFullscreen()) {
  62826. this.addClass("vjs-fullscreen");
  62827. } else {
  62828. this.removeClass("vjs-fullscreen");
  62829. }
  62830. }
  62831. documentFullscreenChange_(e) {
  62832. const targetPlayer = e.target.player;
  62833. if (targetPlayer && targetPlayer !== this) {
  62834. return;
  62835. }
  62836. const el = this.el();
  62837. let isFs = document_1[this.fsApi_.fullscreenElement] === el;
  62838. if (!isFs && el.matches) {
  62839. isFs = el.matches(":" + this.fsApi_.fullscreen);
  62840. } else if (!isFs && el.msMatchesSelector) {
  62841. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  62842. }
  62843. this.isFullscreen(isFs);
  62844. }
  62845. handleTechFullscreenChange_(event2, data) {
  62846. if (data) {
  62847. if (data.nativeIOSFullscreen) {
  62848. this.addClass("vjs-ios-native-fs");
  62849. this.tech_.one("webkitendfullscreen", () => {
  62850. this.removeClass("vjs-ios-native-fs");
  62851. });
  62852. }
  62853. this.isFullscreen(data.isFullscreen);
  62854. }
  62855. }
  62856. handleTechFullscreenError_(event2, err) {
  62857. this.trigger("fullscreenerror", err);
  62858. }
  62859. togglePictureInPictureClass_() {
  62860. if (this.isInPictureInPicture()) {
  62861. this.addClass("vjs-picture-in-picture");
  62862. } else {
  62863. this.removeClass("vjs-picture-in-picture");
  62864. }
  62865. }
  62866. handleTechEnterPictureInPicture_(event2) {
  62867. this.isInPictureInPicture(true);
  62868. }
  62869. handleTechLeavePictureInPicture_(event2) {
  62870. this.isInPictureInPicture(false);
  62871. }
  62872. handleTechError_() {
  62873. const error = this.tech_.error();
  62874. this.error(error);
  62875. }
  62876. handleTechTextData_() {
  62877. let data = null;
  62878. if (arguments.length > 1) {
  62879. data = arguments[1];
  62880. }
  62881. this.trigger("textdata", data);
  62882. }
  62883. getCache() {
  62884. return this.cache_;
  62885. }
  62886. resetCache_() {
  62887. this.cache_ = {
  62888. currentTime: 0,
  62889. initTime: 0,
  62890. inactivityTimeout: this.options_.inactivityTimeout,
  62891. duration: NaN,
  62892. lastVolume: 1,
  62893. lastPlaybackRate: this.defaultPlaybackRate(),
  62894. media: null,
  62895. src: "",
  62896. source: {},
  62897. sources: [],
  62898. playbackRates: [],
  62899. volume: 1
  62900. };
  62901. }
  62902. techCall_(method, arg) {
  62903. this.ready(function() {
  62904. if (method in allowedSetters$1) {
  62905. return set$1(this.middleware_, this.tech_, method, arg);
  62906. } else if (method in allowedMediators$1) {
  62907. return mediate$1(this.middleware_, this.tech_, method, arg);
  62908. }
  62909. try {
  62910. if (this.tech_) {
  62911. this.tech_[method](arg);
  62912. }
  62913. } catch (e) {
  62914. log$1$1(e);
  62915. throw e;
  62916. }
  62917. }, true);
  62918. }
  62919. techGet_(method) {
  62920. if (!this.tech_ || !this.tech_.isReady_) {
  62921. return;
  62922. }
  62923. if (method in allowedGetters$1) {
  62924. return get$1(this.middleware_, this.tech_, method);
  62925. } else if (method in allowedMediators$1) {
  62926. return mediate$1(this.middleware_, this.tech_, method);
  62927. }
  62928. try {
  62929. return this.tech_[method]();
  62930. } catch (e) {
  62931. if (this.tech_[method] === void 0) {
  62932. log$1$1(`Video.js: ${method} method not defined for ${this.techName_} playback technology.`, e);
  62933. throw e;
  62934. }
  62935. if (e.name === "TypeError") {
  62936. log$1$1(`Video.js: ${method} unavailable on ${this.techName_} playback technology element.`, e);
  62937. this.tech_.isReady_ = false;
  62938. throw e;
  62939. }
  62940. log$1$1(e);
  62941. throw e;
  62942. }
  62943. }
  62944. play() {
  62945. return new Promise((resolve2) => {
  62946. this.play_(resolve2);
  62947. });
  62948. }
  62949. play_(callback2 = silencePromise$1) {
  62950. this.playCallbacks_.push(callback2);
  62951. const isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  62952. const isSafariOrIOS = Boolean(IS_ANY_SAFARI$1 || IS_IOS$1);
  62953. if (this.waitToPlay_) {
  62954. this.off(["ready", "loadstart"], this.waitToPlay_);
  62955. this.waitToPlay_ = null;
  62956. }
  62957. if (!this.isReady_ || !isSrcReady) {
  62958. this.waitToPlay_ = (e) => {
  62959. this.play_();
  62960. };
  62961. this.one(["ready", "loadstart"], this.waitToPlay_);
  62962. if (!isSrcReady && isSafariOrIOS) {
  62963. this.load();
  62964. }
  62965. return;
  62966. }
  62967. const val = this.techGet_("play");
  62968. const isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  62969. if (isNativeReplay) {
  62970. this.resetProgressBar_();
  62971. }
  62972. if (val === null) {
  62973. this.runPlayTerminatedQueue_();
  62974. } else {
  62975. this.runPlayCallbacks_(val);
  62976. }
  62977. }
  62978. runPlayTerminatedQueue_() {
  62979. const queue = this.playTerminatedQueue_.slice(0);
  62980. this.playTerminatedQueue_ = [];
  62981. queue.forEach(function(q2) {
  62982. q2();
  62983. });
  62984. }
  62985. runPlayCallbacks_(val) {
  62986. const callbacks = this.playCallbacks_.slice(0);
  62987. this.playCallbacks_ = [];
  62988. this.playTerminatedQueue_ = [];
  62989. callbacks.forEach(function(cb) {
  62990. cb(val);
  62991. });
  62992. }
  62993. pause() {
  62994. this.techCall_("pause");
  62995. }
  62996. paused() {
  62997. return this.techGet_("paused") === false ? false : true;
  62998. }
  62999. played() {
  63000. return this.techGet_("played") || createTimeRanges$1(0, 0);
  63001. }
  63002. scrubbing(isScrubbing) {
  63003. if (typeof isScrubbing === "undefined") {
  63004. return this.scrubbing_;
  63005. }
  63006. this.scrubbing_ = !!isScrubbing;
  63007. this.techCall_("setScrubbing", this.scrubbing_);
  63008. if (isScrubbing) {
  63009. this.addClass("vjs-scrubbing");
  63010. } else {
  63011. this.removeClass("vjs-scrubbing");
  63012. }
  63013. }
  63014. currentTime(seconds) {
  63015. if (typeof seconds !== "undefined") {
  63016. if (seconds < 0) {
  63017. seconds = 0;
  63018. }
  63019. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  63020. this.cache_.initTime = seconds;
  63021. this.off("canplay", this.boundApplyInitTime_);
  63022. this.one("canplay", this.boundApplyInitTime_);
  63023. return;
  63024. }
  63025. this.techCall_("setCurrentTime", seconds);
  63026. this.cache_.initTime = 0;
  63027. return;
  63028. }
  63029. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  63030. return this.cache_.currentTime;
  63031. }
  63032. applyInitTime_() {
  63033. this.currentTime(this.cache_.initTime);
  63034. }
  63035. duration(seconds) {
  63036. if (seconds === void 0) {
  63037. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  63038. }
  63039. seconds = parseFloat(seconds);
  63040. if (seconds < 0) {
  63041. seconds = Infinity;
  63042. }
  63043. if (seconds !== this.cache_.duration) {
  63044. this.cache_.duration = seconds;
  63045. if (seconds === Infinity) {
  63046. this.addClass("vjs-live");
  63047. } else {
  63048. this.removeClass("vjs-live");
  63049. }
  63050. if (!isNaN(seconds)) {
  63051. this.trigger("durationchange");
  63052. }
  63053. }
  63054. }
  63055. remainingTime() {
  63056. return this.duration() - this.currentTime();
  63057. }
  63058. remainingTimeDisplay() {
  63059. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  63060. }
  63061. buffered() {
  63062. let buffered = this.techGet_("buffered");
  63063. if (!buffered || !buffered.length) {
  63064. buffered = createTimeRanges$1(0, 0);
  63065. }
  63066. return buffered;
  63067. }
  63068. bufferedPercent() {
  63069. return bufferedPercent$1(this.buffered(), this.duration());
  63070. }
  63071. bufferedEnd() {
  63072. const buffered = this.buffered();
  63073. const duration5 = this.duration();
  63074. let end = buffered.end(buffered.length - 1);
  63075. if (end > duration5) {
  63076. end = duration5;
  63077. }
  63078. return end;
  63079. }
  63080. volume(percentAsDecimal) {
  63081. let vol;
  63082. if (percentAsDecimal !== void 0) {
  63083. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  63084. this.cache_.volume = vol;
  63085. this.techCall_("setVolume", vol);
  63086. if (vol > 0) {
  63087. this.lastVolume_(vol);
  63088. }
  63089. return;
  63090. }
  63091. vol = parseFloat(this.techGet_("volume"));
  63092. return isNaN(vol) ? 1 : vol;
  63093. }
  63094. muted(muted) {
  63095. if (muted !== void 0) {
  63096. this.techCall_("setMuted", muted);
  63097. return;
  63098. }
  63099. return this.techGet_("muted") || false;
  63100. }
  63101. defaultMuted(defaultMuted) {
  63102. if (defaultMuted !== void 0) {
  63103. return this.techCall_("setDefaultMuted", defaultMuted);
  63104. }
  63105. return this.techGet_("defaultMuted") || false;
  63106. }
  63107. lastVolume_(percentAsDecimal) {
  63108. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  63109. this.cache_.lastVolume = percentAsDecimal;
  63110. return;
  63111. }
  63112. return this.cache_.lastVolume;
  63113. }
  63114. supportsFullScreen() {
  63115. return this.techGet_("supportsFullScreen") || false;
  63116. }
  63117. isFullscreen(isFS) {
  63118. if (isFS !== void 0) {
  63119. const oldValue = this.isFullscreen_;
  63120. this.isFullscreen_ = Boolean(isFS);
  63121. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  63122. this.trigger("fullscreenchange");
  63123. }
  63124. this.toggleFullscreenClass_();
  63125. return;
  63126. }
  63127. return this.isFullscreen_;
  63128. }
  63129. requestFullscreen(fullscreenOptions) {
  63130. if (this.isInPictureInPicture()) {
  63131. this.exitPictureInPicture();
  63132. }
  63133. const self2 = this;
  63134. return new Promise((resolve2, reject2) => {
  63135. function offHandler() {
  63136. self2.off("fullscreenerror", errorHandler);
  63137. self2.off("fullscreenchange", changeHandler);
  63138. }
  63139. function changeHandler() {
  63140. offHandler();
  63141. resolve2();
  63142. }
  63143. function errorHandler(e, err) {
  63144. offHandler();
  63145. reject2(err);
  63146. }
  63147. self2.one("fullscreenchange", changeHandler);
  63148. self2.one("fullscreenerror", errorHandler);
  63149. const promise = self2.requestFullscreenHelper_(fullscreenOptions);
  63150. if (promise) {
  63151. promise.then(offHandler, offHandler);
  63152. promise.then(resolve2, reject2);
  63153. }
  63154. });
  63155. }
  63156. requestFullscreenHelper_(fullscreenOptions) {
  63157. let fsOptions;
  63158. if (!this.fsApi_.prefixed) {
  63159. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  63160. if (fullscreenOptions !== void 0) {
  63161. fsOptions = fullscreenOptions;
  63162. }
  63163. }
  63164. if (this.fsApi_.requestFullscreen) {
  63165. const promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  63166. if (promise) {
  63167. promise.then(() => this.isFullscreen(true), () => this.isFullscreen(false));
  63168. }
  63169. return promise;
  63170. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63171. this.techCall_("enterFullScreen");
  63172. } else {
  63173. this.enterFullWindow();
  63174. }
  63175. }
  63176. exitFullscreen() {
  63177. const self2 = this;
  63178. return new Promise((resolve2, reject2) => {
  63179. function offHandler() {
  63180. self2.off("fullscreenerror", errorHandler);
  63181. self2.off("fullscreenchange", changeHandler);
  63182. }
  63183. function changeHandler() {
  63184. offHandler();
  63185. resolve2();
  63186. }
  63187. function errorHandler(e, err) {
  63188. offHandler();
  63189. reject2(err);
  63190. }
  63191. self2.one("fullscreenchange", changeHandler);
  63192. self2.one("fullscreenerror", errorHandler);
  63193. const promise = self2.exitFullscreenHelper_();
  63194. if (promise) {
  63195. promise.then(offHandler, offHandler);
  63196. promise.then(resolve2, reject2);
  63197. }
  63198. });
  63199. }
  63200. exitFullscreenHelper_() {
  63201. if (this.fsApi_.requestFullscreen) {
  63202. const promise = document_1[this.fsApi_.exitFullscreen]();
  63203. if (promise) {
  63204. silencePromise$1(promise.then(() => this.isFullscreen(false)));
  63205. }
  63206. return promise;
  63207. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63208. this.techCall_("exitFullScreen");
  63209. } else {
  63210. this.exitFullWindow();
  63211. }
  63212. }
  63213. enterFullWindow() {
  63214. this.isFullscreen(true);
  63215. this.isFullWindow = true;
  63216. this.docOrigOverflow = document_1.documentElement.style.overflow;
  63217. on$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63218. document_1.documentElement.style.overflow = "hidden";
  63219. addClass$1(document_1.body, "vjs-full-window");
  63220. this.trigger("enterFullWindow");
  63221. }
  63222. fullWindowOnEscKey(event2) {
  63223. if (keycode.isEventKey(event2, "Esc")) {
  63224. if (this.isFullscreen() === true) {
  63225. if (!this.isFullWindow) {
  63226. this.exitFullscreen();
  63227. } else {
  63228. this.exitFullWindow();
  63229. }
  63230. }
  63231. }
  63232. }
  63233. exitFullWindow() {
  63234. this.isFullscreen(false);
  63235. this.isFullWindow = false;
  63236. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63237. document_1.documentElement.style.overflow = this.docOrigOverflow;
  63238. removeClass$1(document_1.body, "vjs-full-window");
  63239. this.trigger("exitFullWindow");
  63240. }
  63241. disablePictureInPicture(value) {
  63242. if (value === void 0) {
  63243. return this.techGet_("disablePictureInPicture");
  63244. }
  63245. this.techCall_("setDisablePictureInPicture", value);
  63246. this.options_.disablePictureInPicture = value;
  63247. this.trigger("disablepictureinpicturechanged");
  63248. }
  63249. isInPictureInPicture(isPiP) {
  63250. if (isPiP !== void 0) {
  63251. this.isInPictureInPicture_ = !!isPiP;
  63252. this.togglePictureInPictureClass_();
  63253. return;
  63254. }
  63255. return !!this.isInPictureInPicture_;
  63256. }
  63257. requestPictureInPicture() {
  63258. if (this.options_.enableDocumentPictureInPicture && window_1.documentPictureInPicture) {
  63259. const pipContainer = document_1.createElement(this.el().tagName);
  63260. pipContainer.classList = this.el().classList;
  63261. pipContainer.classList.add("vjs-pip-container");
  63262. if (this.posterImage) {
  63263. pipContainer.appendChild(this.posterImage.el().cloneNode(true));
  63264. }
  63265. if (this.titleBar) {
  63266. pipContainer.appendChild(this.titleBar.el().cloneNode(true));
  63267. }
  63268. pipContainer.appendChild(createEl$1("p", {
  63269. className: "vjs-pip-text"
  63270. }, {}, this.localize("Playing in picture-in-picture")));
  63271. return window_1.documentPictureInPicture.requestWindow({
  63272. initialAspectRatio: this.videoWidth() / this.videoHeight(),
  63273. copyStyleSheets: true
  63274. }).then((pipWindow) => {
  63275. this.el_.parentNode.insertBefore(pipContainer, this.el_);
  63276. pipWindow.document.body.append(this.el_);
  63277. pipWindow.document.body.classList.add("vjs-pip-window");
  63278. this.player_.isInPictureInPicture(true);
  63279. this.player_.trigger("enterpictureinpicture");
  63280. pipWindow.addEventListener("unload", (event2) => {
  63281. const pipVideo = event2.target.querySelector(".video-js");
  63282. pipContainer.replaceWith(pipVideo);
  63283. this.player_.isInPictureInPicture(false);
  63284. this.player_.trigger("leavepictureinpicture");
  63285. });
  63286. return pipWindow;
  63287. });
  63288. }
  63289. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  63290. return this.techGet_("requestPictureInPicture");
  63291. }
  63292. return Promise.reject("No PiP mode is available");
  63293. }
  63294. exitPictureInPicture() {
  63295. if (window_1.documentPictureInPicture && window_1.documentPictureInPicture.window) {
  63296. window_1.documentPictureInPicture.window.close();
  63297. return Promise.resolve();
  63298. }
  63299. if ("pictureInPictureEnabled" in document_1) {
  63300. return document_1.exitPictureInPicture();
  63301. }
  63302. }
  63303. handleKeyDown(event2) {
  63304. const {
  63305. userActions
  63306. } = this.options_;
  63307. if (!userActions || !userActions.hotkeys) {
  63308. return;
  63309. }
  63310. const excludeElement = (el) => {
  63311. const tagName = el.tagName.toLowerCase();
  63312. if (el.isContentEditable) {
  63313. return true;
  63314. }
  63315. const allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  63316. if (tagName === "input") {
  63317. return allowedInputTypes.indexOf(el.type) === -1;
  63318. }
  63319. const excludedTags = ["textarea"];
  63320. return excludedTags.indexOf(tagName) !== -1;
  63321. };
  63322. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  63323. return;
  63324. }
  63325. if (typeof userActions.hotkeys === "function") {
  63326. userActions.hotkeys.call(this, event2);
  63327. } else {
  63328. this.handleHotkeys(event2);
  63329. }
  63330. }
  63331. handleHotkeys(event2) {
  63332. const hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  63333. const {
  63334. fullscreenKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "f"),
  63335. muteKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "m"),
  63336. playPauseKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space")
  63337. } = hotkeys;
  63338. if (fullscreenKey.call(this, event2)) {
  63339. event2.preventDefault();
  63340. event2.stopPropagation();
  63341. const FSToggle = Component$1$1.getComponent("FullscreenToggle");
  63342. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  63343. FSToggle.prototype.handleClick.call(this, event2);
  63344. }
  63345. } else if (muteKey.call(this, event2)) {
  63346. event2.preventDefault();
  63347. event2.stopPropagation();
  63348. const MuteToggle2 = Component$1$1.getComponent("MuteToggle");
  63349. MuteToggle2.prototype.handleClick.call(this, event2);
  63350. } else if (playPauseKey.call(this, event2)) {
  63351. event2.preventDefault();
  63352. event2.stopPropagation();
  63353. const PlayToggle2 = Component$1$1.getComponent("PlayToggle");
  63354. PlayToggle2.prototype.handleClick.call(this, event2);
  63355. }
  63356. }
  63357. canPlayType(type2) {
  63358. let can;
  63359. for (let i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  63360. const techName = j[i2];
  63361. let tech = Tech$2.getTech(techName);
  63362. if (!tech) {
  63363. tech = Component$1$1.getComponent(techName);
  63364. }
  63365. if (!tech) {
  63366. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63367. continue;
  63368. }
  63369. if (tech.isSupported()) {
  63370. can = tech.canPlayType(type2);
  63371. if (can) {
  63372. return can;
  63373. }
  63374. }
  63375. }
  63376. return "";
  63377. }
  63378. selectSource(sources) {
  63379. const techs = this.options_.techOrder.map((techName) => {
  63380. return [techName, Tech$2.getTech(techName)];
  63381. }).filter(([techName, tech]) => {
  63382. if (tech) {
  63383. return tech.isSupported();
  63384. }
  63385. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63386. return false;
  63387. });
  63388. const findFirstPassingTechSourcePair = function(outerArray, innerArray, tester) {
  63389. let found;
  63390. outerArray.some((outerChoice) => {
  63391. return innerArray.some((innerChoice) => {
  63392. found = tester(outerChoice, innerChoice);
  63393. if (found) {
  63394. return true;
  63395. }
  63396. });
  63397. });
  63398. return found;
  63399. };
  63400. let foundSourceAndTech;
  63401. const flip = (fn2) => (a, b) => fn2(b, a);
  63402. const finder = ([techName, tech], source) => {
  63403. if (tech.canPlaySource(source, this.options_[techName.toLowerCase()])) {
  63404. return {
  63405. source,
  63406. tech: techName
  63407. };
  63408. }
  63409. };
  63410. if (this.options_.sourceOrder) {
  63411. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  63412. } else {
  63413. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  63414. }
  63415. return foundSourceAndTech || false;
  63416. }
  63417. handleSrc_(source, isRetry) {
  63418. if (typeof source === "undefined") {
  63419. return this.cache_.src || "";
  63420. }
  63421. if (this.resetRetryOnError_) {
  63422. this.resetRetryOnError_();
  63423. }
  63424. const sources = filterSource$1(source);
  63425. if (!sources.length) {
  63426. this.setTimeout(function() {
  63427. this.error({
  63428. code: 4,
  63429. message: this.options_.notSupportedMessage
  63430. });
  63431. }, 0);
  63432. return;
  63433. }
  63434. this.changingSrc_ = true;
  63435. if (!isRetry) {
  63436. this.cache_.sources = sources;
  63437. }
  63438. this.updateSourceCaches_(sources[0]);
  63439. setSource$1(this, sources[0], (middlewareSource, mws) => {
  63440. this.middleware_ = mws;
  63441. if (!isRetry) {
  63442. this.cache_.sources = sources;
  63443. }
  63444. this.updateSourceCaches_(middlewareSource);
  63445. const err = this.src_(middlewareSource);
  63446. if (err) {
  63447. if (sources.length > 1) {
  63448. return this.handleSrc_(sources.slice(1));
  63449. }
  63450. this.changingSrc_ = false;
  63451. this.setTimeout(function() {
  63452. this.error({
  63453. code: 4,
  63454. message: this.options_.notSupportedMessage
  63455. });
  63456. }, 0);
  63457. this.triggerReady();
  63458. return;
  63459. }
  63460. setTech$1(mws, this.tech_);
  63461. });
  63462. if (sources.length > 1) {
  63463. const retry = () => {
  63464. this.error(null);
  63465. this.handleSrc_(sources.slice(1), true);
  63466. };
  63467. const stopListeningForErrors = () => {
  63468. this.off("error", retry);
  63469. };
  63470. this.one("error", retry);
  63471. this.one("playing", stopListeningForErrors);
  63472. this.resetRetryOnError_ = () => {
  63473. this.off("error", retry);
  63474. this.off("playing", stopListeningForErrors);
  63475. };
  63476. }
  63477. }
  63478. src(source) {
  63479. return this.handleSrc_(source, false);
  63480. }
  63481. src_(source) {
  63482. const sourceTech = this.selectSource([source]);
  63483. if (!sourceTech) {
  63484. return true;
  63485. }
  63486. if (!titleCaseEquals$1(sourceTech.tech, this.techName_)) {
  63487. this.changingSrc_ = true;
  63488. this.loadTech_(sourceTech.tech, sourceTech.source);
  63489. this.tech_.ready(() => {
  63490. this.changingSrc_ = false;
  63491. });
  63492. return false;
  63493. }
  63494. this.ready(function() {
  63495. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  63496. this.techCall_("setSource", source);
  63497. } else {
  63498. this.techCall_("src", source.src);
  63499. }
  63500. this.changingSrc_ = false;
  63501. }, true);
  63502. return false;
  63503. }
  63504. load() {
  63505. this.techCall_("load");
  63506. }
  63507. reset() {
  63508. if (this.paused()) {
  63509. this.doReset_();
  63510. } else {
  63511. const playPromise = this.play();
  63512. silencePromise$1(playPromise.then(() => this.doReset_()));
  63513. }
  63514. }
  63515. doReset_() {
  63516. if (this.tech_) {
  63517. this.tech_.clearTracks("text");
  63518. }
  63519. this.resetCache_();
  63520. this.poster("");
  63521. this.loadTech_(this.options_.techOrder[0], null);
  63522. this.techCall_("reset");
  63523. this.resetControlBarUI_();
  63524. if (isEvented$1(this)) {
  63525. this.trigger("playerreset");
  63526. }
  63527. }
  63528. resetControlBarUI_() {
  63529. this.resetProgressBar_();
  63530. this.resetPlaybackRate_();
  63531. this.resetVolumeBar_();
  63532. }
  63533. resetProgressBar_() {
  63534. this.currentTime(0);
  63535. const {
  63536. currentTimeDisplay,
  63537. durationDisplay,
  63538. progressControl,
  63539. remainingTimeDisplay
  63540. } = this.controlBar || {};
  63541. const {
  63542. seekBar
  63543. } = progressControl || {};
  63544. if (currentTimeDisplay) {
  63545. currentTimeDisplay.updateContent();
  63546. }
  63547. if (durationDisplay) {
  63548. durationDisplay.updateContent();
  63549. }
  63550. if (remainingTimeDisplay) {
  63551. remainingTimeDisplay.updateContent();
  63552. }
  63553. if (seekBar) {
  63554. seekBar.update();
  63555. if (seekBar.loadProgressBar) {
  63556. seekBar.loadProgressBar.update();
  63557. }
  63558. }
  63559. }
  63560. resetPlaybackRate_() {
  63561. this.playbackRate(this.defaultPlaybackRate());
  63562. this.handleTechRateChange_();
  63563. }
  63564. resetVolumeBar_() {
  63565. this.volume(1);
  63566. this.trigger("volumechange");
  63567. }
  63568. currentSources() {
  63569. const source = this.currentSource();
  63570. const sources = [];
  63571. if (Object.keys(source).length !== 0) {
  63572. sources.push(source);
  63573. }
  63574. return this.cache_.sources || sources;
  63575. }
  63576. currentSource() {
  63577. return this.cache_.source || {};
  63578. }
  63579. currentSrc() {
  63580. return this.currentSource() && this.currentSource().src || "";
  63581. }
  63582. currentType() {
  63583. return this.currentSource() && this.currentSource().type || "";
  63584. }
  63585. preload(value) {
  63586. if (value !== void 0) {
  63587. this.techCall_("setPreload", value);
  63588. this.options_.preload = value;
  63589. return;
  63590. }
  63591. return this.techGet_("preload");
  63592. }
  63593. autoplay(value) {
  63594. if (value === void 0) {
  63595. return this.options_.autoplay || false;
  63596. }
  63597. let techAutoplay;
  63598. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  63599. this.options_.autoplay = value;
  63600. this.manualAutoplay_(typeof value === "string" ? value : "play");
  63601. techAutoplay = false;
  63602. } else if (!value) {
  63603. this.options_.autoplay = false;
  63604. } else {
  63605. this.options_.autoplay = true;
  63606. }
  63607. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  63608. if (this.tech_) {
  63609. this.techCall_("setAutoplay", techAutoplay);
  63610. }
  63611. }
  63612. playsinline(value) {
  63613. if (value !== void 0) {
  63614. this.techCall_("setPlaysinline", value);
  63615. this.options_.playsinline = value;
  63616. return this;
  63617. }
  63618. return this.techGet_("playsinline");
  63619. }
  63620. loop(value) {
  63621. if (value !== void 0) {
  63622. this.techCall_("setLoop", value);
  63623. this.options_.loop = value;
  63624. return;
  63625. }
  63626. return this.techGet_("loop");
  63627. }
  63628. poster(src) {
  63629. if (src === void 0) {
  63630. return this.poster_;
  63631. }
  63632. if (!src) {
  63633. src = "";
  63634. }
  63635. if (src === this.poster_) {
  63636. return;
  63637. }
  63638. this.poster_ = src;
  63639. this.techCall_("setPoster", src);
  63640. this.isPosterFromTech_ = false;
  63641. this.trigger("posterchange");
  63642. }
  63643. handleTechPosterChange_() {
  63644. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  63645. const newPoster = this.tech_.poster() || "";
  63646. if (newPoster !== this.poster_) {
  63647. this.poster_ = newPoster;
  63648. this.isPosterFromTech_ = true;
  63649. this.trigger("posterchange");
  63650. }
  63651. }
  63652. }
  63653. controls(bool) {
  63654. if (bool === void 0) {
  63655. return !!this.controls_;
  63656. }
  63657. bool = !!bool;
  63658. if (this.controls_ === bool) {
  63659. return;
  63660. }
  63661. this.controls_ = bool;
  63662. if (this.usingNativeControls()) {
  63663. this.techCall_("setControls", bool);
  63664. }
  63665. if (this.controls_) {
  63666. this.removeClass("vjs-controls-disabled");
  63667. this.addClass("vjs-controls-enabled");
  63668. this.trigger("controlsenabled");
  63669. if (!this.usingNativeControls()) {
  63670. this.addTechControlsListeners_();
  63671. }
  63672. } else {
  63673. this.removeClass("vjs-controls-enabled");
  63674. this.addClass("vjs-controls-disabled");
  63675. this.trigger("controlsdisabled");
  63676. if (!this.usingNativeControls()) {
  63677. this.removeTechControlsListeners_();
  63678. }
  63679. }
  63680. }
  63681. usingNativeControls(bool) {
  63682. if (bool === void 0) {
  63683. return !!this.usingNativeControls_;
  63684. }
  63685. bool = !!bool;
  63686. if (this.usingNativeControls_ === bool) {
  63687. return;
  63688. }
  63689. this.usingNativeControls_ = bool;
  63690. if (this.usingNativeControls_) {
  63691. this.addClass("vjs-using-native-controls");
  63692. this.trigger("usingnativecontrols");
  63693. } else {
  63694. this.removeClass("vjs-using-native-controls");
  63695. this.trigger("usingcustomcontrols");
  63696. }
  63697. }
  63698. error(err) {
  63699. if (err === void 0) {
  63700. return this.error_ || null;
  63701. }
  63702. hooks$1("beforeerror").forEach((hookFunction) => {
  63703. const newErr = hookFunction(this, err);
  63704. if (!(isObject$2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  63705. this.log.error("please return a value that MediaError expects in beforeerror hooks");
  63706. return;
  63707. }
  63708. err = newErr;
  63709. });
  63710. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  63711. const triggerSuppressedError = function() {
  63712. this.error(err);
  63713. };
  63714. this.options_.suppressNotSupportedError = false;
  63715. this.any(["click", "touchstart"], triggerSuppressedError);
  63716. this.one("loadstart", function() {
  63717. this.off(["click", "touchstart"], triggerSuppressedError);
  63718. });
  63719. return;
  63720. }
  63721. if (err === null) {
  63722. this.error_ = err;
  63723. this.removeClass("vjs-error");
  63724. if (this.errorDisplay) {
  63725. this.errorDisplay.close();
  63726. }
  63727. return;
  63728. }
  63729. this.error_ = new MediaError$1(err);
  63730. this.addClass("vjs-error");
  63731. log$1$1.error(`(CODE:${this.error_.code} ${MediaError$1.errorTypes[this.error_.code]})`, this.error_.message, this.error_);
  63732. this.trigger("error");
  63733. hooks$1("error").forEach((hookFunction) => hookFunction(this, this.error_));
  63734. return;
  63735. }
  63736. reportUserActivity(event2) {
  63737. this.userActivity_ = true;
  63738. }
  63739. userActive(bool) {
  63740. if (bool === void 0) {
  63741. return this.userActive_;
  63742. }
  63743. bool = !!bool;
  63744. if (bool === this.userActive_) {
  63745. return;
  63746. }
  63747. this.userActive_ = bool;
  63748. if (this.userActive_) {
  63749. this.userActivity_ = true;
  63750. this.removeClass("vjs-user-inactive");
  63751. this.addClass("vjs-user-active");
  63752. this.trigger("useractive");
  63753. return;
  63754. }
  63755. if (this.tech_) {
  63756. this.tech_.one("mousemove", function(e) {
  63757. e.stopPropagation();
  63758. e.preventDefault();
  63759. });
  63760. }
  63761. this.userActivity_ = false;
  63762. this.removeClass("vjs-user-active");
  63763. this.addClass("vjs-user-inactive");
  63764. this.trigger("userinactive");
  63765. }
  63766. listenForUserActivity_() {
  63767. let mouseInProgress;
  63768. let lastMoveX;
  63769. let lastMoveY;
  63770. const handleActivity = bind_(this, this.reportUserActivity);
  63771. const handleMouseMove = function(e) {
  63772. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  63773. lastMoveX = e.screenX;
  63774. lastMoveY = e.screenY;
  63775. handleActivity();
  63776. }
  63777. };
  63778. const handleMouseDown = function() {
  63779. handleActivity();
  63780. this.clearInterval(mouseInProgress);
  63781. mouseInProgress = this.setInterval(handleActivity, 250);
  63782. };
  63783. const handleMouseUpAndMouseLeave = function(event2) {
  63784. handleActivity();
  63785. this.clearInterval(mouseInProgress);
  63786. };
  63787. this.on("mousedown", handleMouseDown);
  63788. this.on("mousemove", handleMouseMove);
  63789. this.on("mouseup", handleMouseUpAndMouseLeave);
  63790. this.on("mouseleave", handleMouseUpAndMouseLeave);
  63791. const controlBar = this.getChild("controlBar");
  63792. if (controlBar && !IS_IOS$1 && !IS_ANDROID$1) {
  63793. controlBar.on("mouseenter", function(event2) {
  63794. if (this.player().options_.inactivityTimeout !== 0) {
  63795. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  63796. }
  63797. this.player().options_.inactivityTimeout = 0;
  63798. });
  63799. controlBar.on("mouseleave", function(event2) {
  63800. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  63801. });
  63802. }
  63803. this.on("keydown", handleActivity);
  63804. this.on("keyup", handleActivity);
  63805. let inactivityTimeout;
  63806. this.setInterval(function() {
  63807. if (!this.userActivity_) {
  63808. return;
  63809. }
  63810. this.userActivity_ = false;
  63811. this.userActive(true);
  63812. this.clearTimeout(inactivityTimeout);
  63813. const timeout = this.options_.inactivityTimeout;
  63814. if (timeout <= 0) {
  63815. return;
  63816. }
  63817. inactivityTimeout = this.setTimeout(function() {
  63818. if (!this.userActivity_) {
  63819. this.userActive(false);
  63820. }
  63821. }, timeout);
  63822. }, 250);
  63823. }
  63824. playbackRate(rate) {
  63825. if (rate !== void 0) {
  63826. this.techCall_("setPlaybackRate", rate);
  63827. return;
  63828. }
  63829. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63830. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  63831. }
  63832. return 1;
  63833. }
  63834. defaultPlaybackRate(rate) {
  63835. if (rate !== void 0) {
  63836. return this.techCall_("setDefaultPlaybackRate", rate);
  63837. }
  63838. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63839. return this.techGet_("defaultPlaybackRate");
  63840. }
  63841. return 1;
  63842. }
  63843. isAudio(bool) {
  63844. if (bool !== void 0) {
  63845. this.isAudio_ = !!bool;
  63846. return;
  63847. }
  63848. return !!this.isAudio_;
  63849. }
  63850. enableAudioOnlyUI_() {
  63851. this.addClass("vjs-audio-only-mode");
  63852. const playerChildren = this.children();
  63853. const controlBar = this.getChild("ControlBar");
  63854. const controlBarHeight = controlBar && controlBar.currentHeight();
  63855. playerChildren.forEach((child) => {
  63856. if (child === controlBar) {
  63857. return;
  63858. }
  63859. if (child.el_ && !child.hasClass("vjs-hidden")) {
  63860. child.hide();
  63861. this.audioOnlyCache_.hiddenChildren.push(child);
  63862. }
  63863. });
  63864. this.audioOnlyCache_.playerHeight = this.currentHeight();
  63865. this.height(controlBarHeight);
  63866. this.trigger("audioonlymodechange");
  63867. }
  63868. disableAudioOnlyUI_() {
  63869. this.removeClass("vjs-audio-only-mode");
  63870. this.audioOnlyCache_.hiddenChildren.forEach((child) => child.show());
  63871. this.height(this.audioOnlyCache_.playerHeight);
  63872. this.trigger("audioonlymodechange");
  63873. }
  63874. audioOnlyMode(value) {
  63875. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  63876. return this.audioOnlyMode_;
  63877. }
  63878. this.audioOnlyMode_ = value;
  63879. if (value) {
  63880. const exitPromises = [];
  63881. if (this.isInPictureInPicture()) {
  63882. exitPromises.push(this.exitPictureInPicture());
  63883. }
  63884. if (this.isFullscreen()) {
  63885. exitPromises.push(this.exitFullscreen());
  63886. }
  63887. if (this.audioPosterMode()) {
  63888. exitPromises.push(this.audioPosterMode(false));
  63889. }
  63890. return Promise.all(exitPromises).then(() => this.enableAudioOnlyUI_());
  63891. }
  63892. return Promise.resolve().then(() => this.disableAudioOnlyUI_());
  63893. }
  63894. enablePosterModeUI_() {
  63895. const tech = this.tech_ && this.tech_;
  63896. tech.hide();
  63897. this.addClass("vjs-audio-poster-mode");
  63898. this.trigger("audiopostermodechange");
  63899. }
  63900. disablePosterModeUI_() {
  63901. const tech = this.tech_ && this.tech_;
  63902. tech.show();
  63903. this.removeClass("vjs-audio-poster-mode");
  63904. this.trigger("audiopostermodechange");
  63905. }
  63906. audioPosterMode(value) {
  63907. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  63908. return this.audioPosterMode_;
  63909. }
  63910. this.audioPosterMode_ = value;
  63911. if (value) {
  63912. if (this.audioOnlyMode()) {
  63913. const audioOnlyModePromise = this.audioOnlyMode(false);
  63914. return audioOnlyModePromise.then(() => {
  63915. this.enablePosterModeUI_();
  63916. });
  63917. }
  63918. return Promise.resolve().then(() => {
  63919. this.enablePosterModeUI_();
  63920. });
  63921. }
  63922. return Promise.resolve().then(() => {
  63923. this.disablePosterModeUI_();
  63924. });
  63925. }
  63926. addTextTrack(kind, label2, language) {
  63927. if (this.tech_) {
  63928. return this.tech_.addTextTrack(kind, label2, language);
  63929. }
  63930. }
  63931. addRemoteTextTrack(options2, manualCleanup) {
  63932. if (this.tech_) {
  63933. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  63934. }
  63935. }
  63936. removeRemoteTextTrack(obj = {}) {
  63937. let {
  63938. track
  63939. } = obj;
  63940. if (!track) {
  63941. track = obj;
  63942. }
  63943. if (this.tech_) {
  63944. return this.tech_.removeRemoteTextTrack(track);
  63945. }
  63946. }
  63947. getVideoPlaybackQuality() {
  63948. return this.techGet_("getVideoPlaybackQuality");
  63949. }
  63950. videoWidth() {
  63951. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  63952. }
  63953. videoHeight() {
  63954. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  63955. }
  63956. language(code) {
  63957. if (code === void 0) {
  63958. return this.language_;
  63959. }
  63960. if (this.language_ !== String(code).toLowerCase()) {
  63961. this.language_ = String(code).toLowerCase();
  63962. if (isEvented$1(this)) {
  63963. this.trigger("languagechange");
  63964. }
  63965. }
  63966. }
  63967. languages() {
  63968. return merge$1(Player$1.prototype.options_.languages, this.languages_);
  63969. }
  63970. toJSON() {
  63971. const options2 = merge$1(this.options_);
  63972. const tracks = options2.tracks;
  63973. options2.tracks = [];
  63974. for (let i2 = 0; i2 < tracks.length; i2++) {
  63975. let track = tracks[i2];
  63976. track = merge$1(track);
  63977. track.player = void 0;
  63978. options2.tracks[i2] = track;
  63979. }
  63980. return options2;
  63981. }
  63982. createModal(content, options2) {
  63983. options2 = options2 || {};
  63984. options2.content = content || "";
  63985. const modal = new ModalDialog$1(this, options2);
  63986. this.addChild(modal);
  63987. modal.on("dispose", () => {
  63988. this.removeChild(modal);
  63989. });
  63990. modal.open();
  63991. return modal;
  63992. }
  63993. updateCurrentBreakpoint_() {
  63994. if (!this.responsive()) {
  63995. return;
  63996. }
  63997. const currentBreakpoint = this.currentBreakpoint();
  63998. const currentWidth = this.currentWidth();
  63999. for (let i2 = 0; i2 < BREAKPOINT_ORDER$1.length; i2++) {
  64000. const candidateBreakpoint = BREAKPOINT_ORDER$1[i2];
  64001. const maxWidth = this.breakpoints_[candidateBreakpoint];
  64002. if (currentWidth <= maxWidth) {
  64003. if (currentBreakpoint === candidateBreakpoint) {
  64004. return;
  64005. }
  64006. if (currentBreakpoint) {
  64007. this.removeClass(BREAKPOINT_CLASSES$1[currentBreakpoint]);
  64008. }
  64009. this.addClass(BREAKPOINT_CLASSES$1[candidateBreakpoint]);
  64010. this.breakpoint_ = candidateBreakpoint;
  64011. break;
  64012. }
  64013. }
  64014. }
  64015. removeCurrentBreakpoint_() {
  64016. const className = this.currentBreakpointClass();
  64017. this.breakpoint_ = "";
  64018. if (className) {
  64019. this.removeClass(className);
  64020. }
  64021. }
  64022. breakpoints(breakpoints) {
  64023. if (breakpoints === void 0) {
  64024. return Object.assign(this.breakpoints_);
  64025. }
  64026. this.breakpoint_ = "";
  64027. this.breakpoints_ = Object.assign({}, DEFAULT_BREAKPOINTS$1, breakpoints);
  64028. this.updateCurrentBreakpoint_();
  64029. return Object.assign(this.breakpoints_);
  64030. }
  64031. responsive(value) {
  64032. if (value === void 0) {
  64033. return this.responsive_;
  64034. }
  64035. value = Boolean(value);
  64036. const current = this.responsive_;
  64037. if (value === current) {
  64038. return;
  64039. }
  64040. this.responsive_ = value;
  64041. if (value) {
  64042. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  64043. this.updateCurrentBreakpoint_();
  64044. } else {
  64045. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  64046. this.removeCurrentBreakpoint_();
  64047. }
  64048. return value;
  64049. }
  64050. currentBreakpoint() {
  64051. return this.breakpoint_;
  64052. }
  64053. currentBreakpointClass() {
  64054. return BREAKPOINT_CLASSES$1[this.breakpoint_] || "";
  64055. }
  64056. loadMedia(media, ready) {
  64057. if (!media || typeof media !== "object") {
  64058. return;
  64059. }
  64060. this.reset();
  64061. this.cache_.media = merge$1(media);
  64062. const {
  64063. artist,
  64064. artwork,
  64065. description,
  64066. poster,
  64067. src,
  64068. textTracks,
  64069. title
  64070. } = this.cache_.media;
  64071. if (!artwork && poster) {
  64072. this.cache_.media.artwork = [{
  64073. src: poster,
  64074. type: getMimetype$1(poster)
  64075. }];
  64076. }
  64077. if (src) {
  64078. this.src(src);
  64079. }
  64080. if (poster) {
  64081. this.poster(poster);
  64082. }
  64083. if (Array.isArray(textTracks)) {
  64084. textTracks.forEach((tt2) => this.addRemoteTextTrack(tt2, false));
  64085. }
  64086. if (this.titleBar) {
  64087. this.titleBar.update({
  64088. title,
  64089. description: description || artist || ""
  64090. });
  64091. }
  64092. this.ready(ready);
  64093. }
  64094. getMedia() {
  64095. if (!this.cache_.media) {
  64096. const poster = this.poster();
  64097. const src = this.currentSources();
  64098. const textTracks = Array.prototype.map.call(this.remoteTextTracks(), (tt2) => ({
  64099. kind: tt2.kind,
  64100. label: tt2.label,
  64101. language: tt2.language,
  64102. src: tt2.src
  64103. }));
  64104. const media = {
  64105. src,
  64106. textTracks
  64107. };
  64108. if (poster) {
  64109. media.poster = poster;
  64110. media.artwork = [{
  64111. src: media.poster,
  64112. type: getMimetype$1(media.poster)
  64113. }];
  64114. }
  64115. return media;
  64116. }
  64117. return merge$1(this.cache_.media);
  64118. }
  64119. static getTagSettings(tag) {
  64120. const baseOptions = {
  64121. sources: [],
  64122. tracks: []
  64123. };
  64124. const tagOptions = getAttributes$1(tag);
  64125. const dataSetup = tagOptions["data-setup"];
  64126. if (hasClass$1(tag, "vjs-fill")) {
  64127. tagOptions.fill = true;
  64128. }
  64129. if (hasClass$1(tag, "vjs-fluid")) {
  64130. tagOptions.fluid = true;
  64131. }
  64132. if (dataSetup !== null) {
  64133. const [err, data] = tuple(dataSetup || "{}");
  64134. if (err) {
  64135. log$1$1.error(err);
  64136. }
  64137. Object.assign(tagOptions, data);
  64138. }
  64139. Object.assign(baseOptions, tagOptions);
  64140. if (tag.hasChildNodes()) {
  64141. const children = tag.childNodes;
  64142. for (let i2 = 0, j = children.length; i2 < j; i2++) {
  64143. const child = children[i2];
  64144. const childName = child.nodeName.toLowerCase();
  64145. if (childName === "source") {
  64146. baseOptions.sources.push(getAttributes$1(child));
  64147. } else if (childName === "track") {
  64148. baseOptions.tracks.push(getAttributes$1(child));
  64149. }
  64150. }
  64151. }
  64152. return baseOptions;
  64153. }
  64154. debug(enabled) {
  64155. if (enabled === void 0) {
  64156. return this.debugEnabled_;
  64157. }
  64158. if (enabled) {
  64159. this.trigger("debugon");
  64160. this.previousLogLevel_ = this.log.level;
  64161. this.log.level("debug");
  64162. this.debugEnabled_ = true;
  64163. } else {
  64164. this.trigger("debugoff");
  64165. this.log.level(this.previousLogLevel_);
  64166. this.previousLogLevel_ = void 0;
  64167. this.debugEnabled_ = false;
  64168. }
  64169. }
  64170. playbackRates(newRates) {
  64171. if (newRates === void 0) {
  64172. return this.cache_.playbackRates;
  64173. }
  64174. if (!Array.isArray(newRates)) {
  64175. return;
  64176. }
  64177. if (!newRates.every((rate) => typeof rate === "number")) {
  64178. return;
  64179. }
  64180. this.cache_.playbackRates = newRates;
  64181. this.trigger("playbackrateschange");
  64182. }
  64183. }
  64184. ALL$1.names.forEach(function(name) {
  64185. const props = ALL$1[name];
  64186. Player$1.prototype[props.getterName] = function() {
  64187. if (this.tech_) {
  64188. return this.tech_[props.getterName]();
  64189. }
  64190. this[props.privateName] = this[props.privateName] || new props.ListClass();
  64191. return this[props.privateName];
  64192. };
  64193. });
  64194. Player$1.prototype.crossorigin = Player$1.prototype.crossOrigin;
  64195. Player$1.players = {};
  64196. const navigator$3 = window_1.navigator;
  64197. Player$1.prototype.options_ = {
  64198. techOrder: Tech$2.defaultTechOrder_,
  64199. html5: {},
  64200. enableSourceset: true,
  64201. inactivityTimeout: 2e3,
  64202. playbackRates: [],
  64203. liveui: false,
  64204. children: ["mediaLoader", "posterImage", "titleBar", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  64205. language: navigator$3 && (navigator$3.languages && navigator$3.languages[0] || navigator$3.userLanguage || navigator$3.language) || "en",
  64206. languages: {},
  64207. notSupportedMessage: "No compatible source was found for this media.",
  64208. normalizeAutoplay: false,
  64209. fullscreen: {
  64210. options: {
  64211. navigationUI: "hide"
  64212. }
  64213. },
  64214. breakpoints: {},
  64215. responsive: false,
  64216. audioOnlyMode: false,
  64217. audioPosterMode: false
  64218. };
  64219. [
  64220. "ended",
  64221. "seeking",
  64222. "seekable",
  64223. "networkState",
  64224. "readyState"
  64225. ].forEach(function(fn2) {
  64226. Player$1.prototype[fn2] = function() {
  64227. return this.techGet_(fn2);
  64228. };
  64229. });
  64230. TECH_EVENTS_RETRIGGER$1.forEach(function(event2) {
  64231. Player$1.prototype[`handleTech${toTitleCase$1$1(event2)}_`] = function() {
  64232. return this.trigger(event2);
  64233. };
  64234. });
  64235. Component$1$1.registerComponent("Player", Player$1);
  64236. const BASE_PLUGIN_NAME$1 = "plugin";
  64237. const PLUGIN_CACHE_KEY$1 = "activePlugins_";
  64238. const pluginStorage$1 = {};
  64239. const pluginExists$1 = (name) => pluginStorage$1.hasOwnProperty(name);
  64240. const getPlugin$1 = (name) => pluginExists$1(name) ? pluginStorage$1[name] : void 0;
  64241. const markPluginAsActive$1 = (player, name) => {
  64242. player[PLUGIN_CACHE_KEY$1] = player[PLUGIN_CACHE_KEY$1] || {};
  64243. player[PLUGIN_CACHE_KEY$1][name] = true;
  64244. };
  64245. const triggerSetupEvent$1 = (player, hash, before) => {
  64246. const eventName = (before ? "before" : "") + "pluginsetup";
  64247. player.trigger(eventName, hash);
  64248. player.trigger(eventName + ":" + hash.name, hash);
  64249. };
  64250. const createBasicPlugin$1 = function(name, plugin) {
  64251. const basicPluginWrapper = function() {
  64252. triggerSetupEvent$1(this, {
  64253. name,
  64254. plugin,
  64255. instance: null
  64256. }, true);
  64257. const instance = plugin.apply(this, arguments);
  64258. markPluginAsActive$1(this, name);
  64259. triggerSetupEvent$1(this, {
  64260. name,
  64261. plugin,
  64262. instance
  64263. });
  64264. return instance;
  64265. };
  64266. Object.keys(plugin).forEach(function(prop) {
  64267. basicPluginWrapper[prop] = plugin[prop];
  64268. });
  64269. return basicPluginWrapper;
  64270. };
  64271. const createPluginFactory$1 = (name, PluginSubClass) => {
  64272. PluginSubClass.prototype.name = name;
  64273. return function(...args) {
  64274. triggerSetupEvent$1(this, {
  64275. name,
  64276. plugin: PluginSubClass,
  64277. instance: null
  64278. }, true);
  64279. const instance = new PluginSubClass(...[this, ...args]);
  64280. this[name] = () => instance;
  64281. triggerSetupEvent$1(this, instance.getEventHash());
  64282. return instance;
  64283. };
  64284. };
  64285. class Plugin$1 {
  64286. constructor(player) {
  64287. if (this.constructor === Plugin$1) {
  64288. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  64289. }
  64290. this.player = player;
  64291. if (!this.log) {
  64292. this.log = this.player.log.createLogger(this.name);
  64293. }
  64294. evented$1(this);
  64295. delete this.trigger;
  64296. stateful$1(this, this.constructor.defaultState);
  64297. markPluginAsActive$1(player, this.name);
  64298. this.dispose = this.dispose.bind(this);
  64299. player.on("dispose", this.dispose);
  64300. }
  64301. version() {
  64302. return this.constructor.VERSION;
  64303. }
  64304. getEventHash(hash = {}) {
  64305. hash.name = this.name;
  64306. hash.plugin = this.constructor;
  64307. hash.instance = this;
  64308. return hash;
  64309. }
  64310. trigger(event2, hash = {}) {
  64311. return trigger$1(this.eventBusEl_, event2, this.getEventHash(hash));
  64312. }
  64313. handleStateChanged(e) {
  64314. }
  64315. dispose() {
  64316. const {
  64317. name,
  64318. player
  64319. } = this;
  64320. this.trigger("dispose");
  64321. this.off();
  64322. player.off("dispose", this.dispose);
  64323. player[PLUGIN_CACHE_KEY$1][name] = false;
  64324. this.player = this.state = null;
  64325. player[name] = createPluginFactory$1(name, pluginStorage$1[name]);
  64326. }
  64327. static isBasic(plugin) {
  64328. const p = typeof plugin === "string" ? getPlugin$1(plugin) : plugin;
  64329. return typeof p === "function" && !Plugin$1.prototype.isPrototypeOf(p.prototype);
  64330. }
  64331. static registerPlugin(name, plugin) {
  64332. if (typeof name !== "string") {
  64333. throw new Error(`Illegal plugin name, "${name}", must be a string, was ${typeof name}.`);
  64334. }
  64335. if (pluginExists$1(name)) {
  64336. log$1$1.warn(`A plugin named "${name}" already exists. You may want to avoid re-registering plugins!`);
  64337. } else if (Player$1.prototype.hasOwnProperty(name)) {
  64338. throw new Error(`Illegal plugin name, "${name}", cannot share a name with an existing player method!`);
  64339. }
  64340. if (typeof plugin !== "function") {
  64341. throw new Error(`Illegal plugin for "${name}", must be a function, was ${typeof plugin}.`);
  64342. }
  64343. pluginStorage$1[name] = plugin;
  64344. if (name !== BASE_PLUGIN_NAME$1) {
  64345. if (Plugin$1.isBasic(plugin)) {
  64346. Player$1.prototype[name] = createBasicPlugin$1(name, plugin);
  64347. } else {
  64348. Player$1.prototype[name] = createPluginFactory$1(name, plugin);
  64349. }
  64350. }
  64351. return plugin;
  64352. }
  64353. static deregisterPlugin(name) {
  64354. if (name === BASE_PLUGIN_NAME$1) {
  64355. throw new Error("Cannot de-register base plugin.");
  64356. }
  64357. if (pluginExists$1(name)) {
  64358. delete pluginStorage$1[name];
  64359. delete Player$1.prototype[name];
  64360. }
  64361. }
  64362. static getPlugins(names2 = Object.keys(pluginStorage$1)) {
  64363. let result;
  64364. names2.forEach((name) => {
  64365. const plugin = getPlugin$1(name);
  64366. if (plugin) {
  64367. result = result || {};
  64368. result[name] = plugin;
  64369. }
  64370. });
  64371. return result;
  64372. }
  64373. static getPluginVersion(name) {
  64374. const plugin = getPlugin$1(name);
  64375. return plugin && plugin.VERSION || "";
  64376. }
  64377. }
  64378. Plugin$1.getPlugin = getPlugin$1;
  64379. Plugin$1.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME$1;
  64380. Plugin$1.registerPlugin(BASE_PLUGIN_NAME$1, Plugin$1);
  64381. Player$1.prototype.usingPlugin = function(name) {
  64382. return !!this[PLUGIN_CACHE_KEY$1] && this[PLUGIN_CACHE_KEY$1][name] === true;
  64383. };
  64384. Player$1.prototype.hasPlugin = function(name) {
  64385. return !!pluginExists$1(name);
  64386. };
  64387. function deprecate(message, fn2) {
  64388. let warned = false;
  64389. return function(...args) {
  64390. if (!warned) {
  64391. log$1$1.warn(message);
  64392. }
  64393. warned = true;
  64394. return fn2.apply(this, args);
  64395. };
  64396. }
  64397. function deprecateForMajor(major, oldName, newName, fn2) {
  64398. return deprecate(`${oldName} is deprecated and will be removed in ${major}.0; please use ${newName} instead.`, fn2);
  64399. }
  64400. const normalizeId$1 = (id) => id.indexOf("#") === 0 ? id.slice(1) : id;
  64401. function videojs$2(id, options2, ready) {
  64402. let player = videojs$2.getPlayer(id);
  64403. if (player) {
  64404. if (options2) {
  64405. log$1$1.warn(`Player "${id}" is already initialised. Options will not be applied.`);
  64406. }
  64407. if (ready) {
  64408. player.ready(ready);
  64409. }
  64410. return player;
  64411. }
  64412. const el = typeof id === "string" ? $$1("#" + normalizeId$1(id)) : id;
  64413. if (!isEl$1(el)) {
  64414. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  64415. }
  64416. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  64417. log$1$1.warn("The element supplied is not included in the DOM");
  64418. }
  64419. options2 = options2 || {};
  64420. if (options2.restoreEl === true) {
  64421. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  64422. }
  64423. hooks$1("beforesetup").forEach((hookFunction) => {
  64424. const opts = hookFunction(el, merge$1(options2));
  64425. if (!isObject$2(opts) || Array.isArray(opts)) {
  64426. log$1$1.error("please return an object in beforesetup hooks");
  64427. return;
  64428. }
  64429. options2 = merge$1(options2, opts);
  64430. });
  64431. const PlayerComponent = Component$1$1.getComponent("Player");
  64432. player = new PlayerComponent(el, options2, ready);
  64433. hooks$1("setup").forEach((hookFunction) => hookFunction(player));
  64434. return player;
  64435. }
  64436. videojs$2.hooks_ = hooks_$1;
  64437. videojs$2.hooks = hooks$1;
  64438. videojs$2.hook = hook$1;
  64439. videojs$2.hookOnce = hookOnce$1;
  64440. videojs$2.removeHook = removeHook$1;
  64441. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal$1()) {
  64442. let style = $$1(".vjs-styles-defaults");
  64443. if (!style) {
  64444. style = createStyleElement$1("vjs-styles-defaults");
  64445. const head = $$1("head");
  64446. if (head) {
  64447. head.insertBefore(style, head.firstChild);
  64448. }
  64449. setTextContent$1(style, `
  64450. .video-js {
  64451. width: 300px;
  64452. height: 150px;
  64453. }
  64454. .vjs-fluid:not(.vjs-audio-only-mode) {
  64455. padding-top: 56.25%
  64456. }
  64457. `);
  64458. }
  64459. }
  64460. autoSetupTimeout$1(1, videojs$2);
  64461. videojs$2.VERSION = version$6$1;
  64462. videojs$2.options = Player$1.prototype.options_;
  64463. videojs$2.getPlayers = () => Player$1.players;
  64464. videojs$2.getPlayer = (id) => {
  64465. const players = Player$1.players;
  64466. let tag;
  64467. if (typeof id === "string") {
  64468. const nId = normalizeId$1(id);
  64469. const player = players[nId];
  64470. if (player) {
  64471. return player;
  64472. }
  64473. tag = $$1("#" + nId);
  64474. } else {
  64475. tag = id;
  64476. }
  64477. if (isEl$1(tag)) {
  64478. const {
  64479. player,
  64480. playerId
  64481. } = tag;
  64482. if (player || players[playerId]) {
  64483. return player || players[playerId];
  64484. }
  64485. }
  64486. };
  64487. videojs$2.getAllPlayers = () => Object.keys(Player$1.players).map((k) => Player$1.players[k]).filter(Boolean);
  64488. videojs$2.players = Player$1.players;
  64489. videojs$2.getComponent = Component$1$1.getComponent;
  64490. videojs$2.registerComponent = (name, comp) => {
  64491. if (Tech$2.isTech(comp)) {
  64492. log$1$1.warn(`The ${name} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);
  64493. }
  64494. Component$1$1.registerComponent.call(Component$1$1, name, comp);
  64495. };
  64496. videojs$2.getTech = Tech$2.getTech;
  64497. videojs$2.registerTech = Tech$2.registerTech;
  64498. videojs$2.use = use$1;
  64499. Object.defineProperty(videojs$2, "middleware", {
  64500. value: {},
  64501. writeable: false,
  64502. enumerable: true
  64503. });
  64504. Object.defineProperty(videojs$2.middleware, "TERMINATOR", {
  64505. value: TERMINATOR$1,
  64506. writeable: false,
  64507. enumerable: true
  64508. });
  64509. videojs$2.browser = browser$1;
  64510. videojs$2.obj = Obj;
  64511. videojs$2.mergeOptions = deprecateForMajor(9, "videojs.mergeOptions", "videojs.obj.merge", merge$1);
  64512. videojs$2.defineLazyProperty = deprecateForMajor(9, "videojs.defineLazyProperty", "videojs.obj.defineLazyProperty", defineLazyProperty$1);
  64513. videojs$2.bind = deprecateForMajor(9, "videojs.bind", "native Function.prototype.bind", bind_);
  64514. videojs$2.registerPlugin = Plugin$1.registerPlugin;
  64515. videojs$2.deregisterPlugin = Plugin$1.deregisterPlugin;
  64516. videojs$2.plugin = (name, plugin) => {
  64517. log$1$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  64518. return Plugin$1.registerPlugin(name, plugin);
  64519. };
  64520. videojs$2.getPlugins = Plugin$1.getPlugins;
  64521. videojs$2.getPlugin = Plugin$1.getPlugin;
  64522. videojs$2.getPluginVersion = Plugin$1.getPluginVersion;
  64523. videojs$2.addLanguage = function(code, data) {
  64524. code = ("" + code).toLowerCase();
  64525. videojs$2.options.languages = merge$1(videojs$2.options.languages, {
  64526. [code]: data
  64527. });
  64528. return videojs$2.options.languages[code];
  64529. };
  64530. videojs$2.log = log$1$1;
  64531. videojs$2.createLogger = createLogger$2;
  64532. videojs$2.time = Time;
  64533. videojs$2.createTimeRange = deprecateForMajor(9, "videojs.createTimeRange", "videojs.time.createTimeRanges", createTimeRanges$1);
  64534. videojs$2.createTimeRanges = deprecateForMajor(9, "videojs.createTimeRanges", "videojs.time.createTimeRanges", createTimeRanges$1);
  64535. videojs$2.formatTime = deprecateForMajor(9, "videojs.formatTime", "videojs.time.formatTime", formatTime$1);
  64536. videojs$2.setFormatTime = deprecateForMajor(9, "videojs.setFormatTime", "videojs.time.setFormatTime", setFormatTime$1);
  64537. videojs$2.resetFormatTime = deprecateForMajor(9, "videojs.resetFormatTime", "videojs.time.resetFormatTime", resetFormatTime$1);
  64538. videojs$2.parseUrl = deprecateForMajor(9, "videojs.parseUrl", "videojs.url.parseUrl", parseUrl$1);
  64539. videojs$2.isCrossOrigin = deprecateForMajor(9, "videojs.isCrossOrigin", "videojs.url.isCrossOrigin", isCrossOrigin$1);
  64540. videojs$2.EventTarget = EventTarget$2$1;
  64541. videojs$2.any = any$1;
  64542. videojs$2.on = on$1;
  64543. videojs$2.one = one$1;
  64544. videojs$2.off = off$1;
  64545. videojs$2.trigger = trigger$1;
  64546. videojs$2.xhr = XHR;
  64547. videojs$2.TextTrack = TextTrack$1;
  64548. videojs$2.AudioTrack = AudioTrack$1;
  64549. videojs$2.VideoTrack = VideoTrack$1;
  64550. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach((k) => {
  64551. videojs$2[k] = function() {
  64552. log$1$1.warn(`videojs.${k}() is deprecated; use videojs.dom.${k}() instead`);
  64553. return Dom$2[k].apply(null, arguments);
  64554. };
  64555. });
  64556. videojs$2.computedStyle = deprecateForMajor(9, "videojs.computedStyle", "videojs.dom.computedStyle", computedStyle$1);
  64557. videojs$2.dom = Dom$2;
  64558. videojs$2.fn = Fn;
  64559. videojs$2.num = Num;
  64560. videojs$2.str = Str;
  64561. videojs$2.url = Url$2;
  64562. /*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */
  64563. class QualityLevel {
  64564. constructor(representation) {
  64565. let level = this;
  64566. level.id = representation.id;
  64567. level.label = level.id;
  64568. level.width = representation.width;
  64569. level.height = representation.height;
  64570. level.bitrate = representation.bandwidth;
  64571. level.frameRate = representation.frameRate;
  64572. level.enabled_ = representation.enabled;
  64573. Object.defineProperty(level, "enabled", {
  64574. get() {
  64575. return level.enabled_();
  64576. },
  64577. set(enable) {
  64578. level.enabled_(enable);
  64579. }
  64580. });
  64581. return level;
  64582. }
  64583. }
  64584. class QualityLevelList extends videojs$2.EventTarget {
  64585. constructor() {
  64586. super();
  64587. let list = this;
  64588. list.levels_ = [];
  64589. list.selectedIndex_ = -1;
  64590. Object.defineProperty(list, "selectedIndex", {
  64591. get() {
  64592. return list.selectedIndex_;
  64593. }
  64594. });
  64595. Object.defineProperty(list, "length", {
  64596. get() {
  64597. return list.levels_.length;
  64598. }
  64599. });
  64600. return list;
  64601. }
  64602. addQualityLevel(representation) {
  64603. let qualityLevel = this.getQualityLevelById(representation.id);
  64604. if (qualityLevel) {
  64605. return qualityLevel;
  64606. }
  64607. const index2 = this.levels_.length;
  64608. qualityLevel = new QualityLevel(representation);
  64609. if (!("" + index2 in this)) {
  64610. Object.defineProperty(this, index2, {
  64611. get() {
  64612. return this.levels_[index2];
  64613. }
  64614. });
  64615. }
  64616. this.levels_.push(qualityLevel);
  64617. this.trigger({
  64618. qualityLevel,
  64619. type: "addqualitylevel"
  64620. });
  64621. return qualityLevel;
  64622. }
  64623. removeQualityLevel(qualityLevel) {
  64624. let removed = null;
  64625. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64626. if (this[i2] === qualityLevel) {
  64627. removed = this.levels_.splice(i2, 1)[0];
  64628. if (this.selectedIndex_ === i2) {
  64629. this.selectedIndex_ = -1;
  64630. } else if (this.selectedIndex_ > i2) {
  64631. this.selectedIndex_--;
  64632. }
  64633. break;
  64634. }
  64635. }
  64636. if (removed) {
  64637. this.trigger({
  64638. qualityLevel,
  64639. type: "removequalitylevel"
  64640. });
  64641. }
  64642. return removed;
  64643. }
  64644. getQualityLevelById(id) {
  64645. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64646. const level = this[i2];
  64647. if (level.id === id) {
  64648. return level;
  64649. }
  64650. }
  64651. return null;
  64652. }
  64653. dispose() {
  64654. this.selectedIndex_ = -1;
  64655. this.levels_.length = 0;
  64656. }
  64657. }
  64658. QualityLevelList.prototype.allowedEvents_ = {
  64659. change: "change",
  64660. addqualitylevel: "addqualitylevel",
  64661. removequalitylevel: "removequalitylevel"
  64662. };
  64663. for (const event2 in QualityLevelList.prototype.allowedEvents_) {
  64664. QualityLevelList.prototype["on" + event2] = null;
  64665. }
  64666. var version$5$1 = "3.0.0";
  64667. const registerPlugin$1 = videojs$2.registerPlugin || videojs$2.plugin;
  64668. const initPlugin$1 = function(player, options2) {
  64669. const originalPluginFn = player.qualityLevels;
  64670. const qualityLevelList = new QualityLevelList();
  64671. const disposeHandler = function() {
  64672. qualityLevelList.dispose();
  64673. player.qualityLevels = originalPluginFn;
  64674. player.off("dispose", disposeHandler);
  64675. };
  64676. player.on("dispose", disposeHandler);
  64677. player.qualityLevels = () => qualityLevelList;
  64678. player.qualityLevels.VERSION = version$5$1;
  64679. return qualityLevelList;
  64680. };
  64681. const qualityLevels = function(options2) {
  64682. return initPlugin$1(this, videojs$2.mergeOptions({}, options2));
  64683. };
  64684. registerPlugin$1("qualityLevels", qualityLevels);
  64685. qualityLevels.VERSION = version$5$1;
  64686. /*! @name @videojs/http-streaming @version 3.0.2 @license Apache-2.0 */
  64687. const resolveUrl$2 = resolveUrl$4;
  64688. const resolveManifestRedirect$1 = (url, req) => {
  64689. if (req && req.responseURL && url !== req.responseURL) {
  64690. return req.responseURL;
  64691. }
  64692. return url;
  64693. };
  64694. const logger$1 = (source) => {
  64695. if (videojs$2.log.debug) {
  64696. return videojs$2.log.debug.bind(videojs$2, "VHS:", `${source} >`);
  64697. }
  64698. return function() {
  64699. };
  64700. };
  64701. function merge$2(...args) {
  64702. const context = videojs$2.obj || videojs$2;
  64703. const fn2 = context.merge || context.mergeOptions;
  64704. return fn2.apply(context, args);
  64705. }
  64706. function createTimeRanges$2(...args) {
  64707. const context = videojs$2.time || videojs$2;
  64708. const fn2 = context.createTimeRanges || context.createTimeRanges;
  64709. return fn2.apply(context, args);
  64710. }
  64711. const TIME_FUDGE_FACTOR$1 = 1 / 30;
  64712. const SAFE_TIME_DELTA$1 = TIME_FUDGE_FACTOR$1 * 3;
  64713. const filterRanges$1 = function(timeRanges, predicate) {
  64714. const results = [];
  64715. let i2;
  64716. if (timeRanges && timeRanges.length) {
  64717. for (i2 = 0; i2 < timeRanges.length; i2++) {
  64718. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  64719. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  64720. }
  64721. }
  64722. }
  64723. return createTimeRanges$2(results);
  64724. };
  64725. const findRange$1 = function(buffered, time) {
  64726. return filterRanges$1(buffered, function(start2, end) {
  64727. return start2 - SAFE_TIME_DELTA$1 <= time && end + SAFE_TIME_DELTA$1 >= time;
  64728. });
  64729. };
  64730. const findNextRange$1 = function(timeRanges, time) {
  64731. return filterRanges$1(timeRanges, function(start2) {
  64732. return start2 - TIME_FUDGE_FACTOR$1 >= time;
  64733. });
  64734. };
  64735. const findGaps$1 = function(buffered) {
  64736. if (buffered.length < 2) {
  64737. return createTimeRanges$2();
  64738. }
  64739. const ranges = [];
  64740. for (let i2 = 1; i2 < buffered.length; i2++) {
  64741. const start2 = buffered.end(i2 - 1);
  64742. const end = buffered.start(i2);
  64743. ranges.push([start2, end]);
  64744. }
  64745. return createTimeRanges$2(ranges);
  64746. };
  64747. const bufferIntersection$1 = function(bufferA, bufferB) {
  64748. let start2 = null;
  64749. let end = null;
  64750. let arity = 0;
  64751. const extents = [];
  64752. const ranges = [];
  64753. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  64754. return createTimeRanges$2();
  64755. }
  64756. let count = bufferA.length;
  64757. while (count--) {
  64758. extents.push({
  64759. time: bufferA.start(count),
  64760. type: "start"
  64761. });
  64762. extents.push({
  64763. time: bufferA.end(count),
  64764. type: "end"
  64765. });
  64766. }
  64767. count = bufferB.length;
  64768. while (count--) {
  64769. extents.push({
  64770. time: bufferB.start(count),
  64771. type: "start"
  64772. });
  64773. extents.push({
  64774. time: bufferB.end(count),
  64775. type: "end"
  64776. });
  64777. }
  64778. extents.sort(function(a, b) {
  64779. return a.time - b.time;
  64780. });
  64781. for (count = 0; count < extents.length; count++) {
  64782. if (extents[count].type === "start") {
  64783. arity++;
  64784. if (arity === 2) {
  64785. start2 = extents[count].time;
  64786. }
  64787. } else if (extents[count].type === "end") {
  64788. arity--;
  64789. if (arity === 1) {
  64790. end = extents[count].time;
  64791. }
  64792. }
  64793. if (start2 !== null && end !== null) {
  64794. ranges.push([start2, end]);
  64795. start2 = null;
  64796. end = null;
  64797. }
  64798. }
  64799. return createTimeRanges$2(ranges);
  64800. };
  64801. const printableRange$1 = (range3) => {
  64802. const strArr = [];
  64803. if (!range3 || !range3.length) {
  64804. return "";
  64805. }
  64806. for (let i2 = 0; i2 < range3.length; i2++) {
  64807. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  64808. }
  64809. return strArr.join(", ");
  64810. };
  64811. const timeUntilRebuffer$1 = function(buffered, currentTime, playbackRate = 1) {
  64812. const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  64813. return (bufferedEnd - currentTime) / playbackRate;
  64814. };
  64815. const timeRangesToArray$1 = (timeRanges) => {
  64816. const timeRangesList = [];
  64817. for (let i2 = 0; i2 < timeRanges.length; i2++) {
  64818. timeRangesList.push({
  64819. start: timeRanges.start(i2),
  64820. end: timeRanges.end(i2)
  64821. });
  64822. }
  64823. return timeRangesList;
  64824. };
  64825. const isRangeDifferent$1 = function(a, b) {
  64826. if (a === b) {
  64827. return false;
  64828. }
  64829. if (!a && b || !b && a) {
  64830. return true;
  64831. }
  64832. if (a.length !== b.length) {
  64833. return true;
  64834. }
  64835. for (let i2 = 0; i2 < a.length; i2++) {
  64836. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  64837. return true;
  64838. }
  64839. }
  64840. return false;
  64841. };
  64842. const lastBufferedEnd$1 = function(a) {
  64843. if (!a || !a.length || !a.end) {
  64844. return;
  64845. }
  64846. return a.end(a.length - 1);
  64847. };
  64848. const timeAheadOf$1 = function(range3, startTime) {
  64849. let time = 0;
  64850. if (!range3 || !range3.length) {
  64851. return time;
  64852. }
  64853. for (let i2 = 0; i2 < range3.length; i2++) {
  64854. const start2 = range3.start(i2);
  64855. const end = range3.end(i2);
  64856. if (startTime > end) {
  64857. continue;
  64858. }
  64859. if (startTime > start2 && startTime <= end) {
  64860. time += end - startTime;
  64861. continue;
  64862. }
  64863. time += end - start2;
  64864. }
  64865. return time;
  64866. };
  64867. const segmentDurationWithParts$1 = (playlist, segment) => {
  64868. if (!segment.preload) {
  64869. return segment.duration;
  64870. }
  64871. let result = 0;
  64872. (segment.parts || []).forEach(function(p) {
  64873. result += p.duration;
  64874. });
  64875. (segment.preloadHints || []).forEach(function(p) {
  64876. if (p.type === "PART") {
  64877. result += playlist.partTargetDuration;
  64878. }
  64879. });
  64880. return result;
  64881. };
  64882. const getPartsAndSegments$1 = (playlist) => (playlist.segments || []).reduce((acc, segment, si) => {
  64883. if (segment.parts) {
  64884. segment.parts.forEach(function(part, pi) {
  64885. acc.push({
  64886. duration: part.duration,
  64887. segmentIndex: si,
  64888. partIndex: pi,
  64889. part,
  64890. segment
  64891. });
  64892. });
  64893. } else {
  64894. acc.push({
  64895. duration: segment.duration,
  64896. segmentIndex: si,
  64897. partIndex: null,
  64898. segment,
  64899. part: null
  64900. });
  64901. }
  64902. return acc;
  64903. }, []);
  64904. const getLastParts$1 = (media) => {
  64905. const lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  64906. return lastSegment && lastSegment.parts || [];
  64907. };
  64908. const getKnownPartCount$1 = ({
  64909. preloadSegment
  64910. }) => {
  64911. if (!preloadSegment) {
  64912. return;
  64913. }
  64914. const {
  64915. parts,
  64916. preloadHints
  64917. } = preloadSegment;
  64918. let partCount = (preloadHints || []).reduce((count, hint) => count + (hint.type === "PART" ? 1 : 0), 0);
  64919. partCount += parts && parts.length ? parts.length : 0;
  64920. return partCount;
  64921. };
  64922. const liveEdgeDelay$1 = (main, media) => {
  64923. if (media.endList) {
  64924. return 0;
  64925. }
  64926. if (main && main.suggestedPresentationDelay) {
  64927. return main.suggestedPresentationDelay;
  64928. }
  64929. const hasParts = getLastParts$1(media).length > 0;
  64930. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  64931. return media.serverControl.partHoldBack;
  64932. } else if (hasParts && media.partTargetDuration) {
  64933. return media.partTargetDuration * 3;
  64934. } else if (media.serverControl && media.serverControl.holdBack) {
  64935. return media.serverControl.holdBack;
  64936. } else if (media.targetDuration) {
  64937. return media.targetDuration * 3;
  64938. }
  64939. return 0;
  64940. };
  64941. const backwardDuration$1 = function(playlist, endSequence) {
  64942. let result = 0;
  64943. let i2 = endSequence - playlist.mediaSequence;
  64944. let segment = playlist.segments[i2];
  64945. if (segment) {
  64946. if (typeof segment.start !== "undefined") {
  64947. return {
  64948. result: segment.start,
  64949. precise: true
  64950. };
  64951. }
  64952. if (typeof segment.end !== "undefined") {
  64953. return {
  64954. result: segment.end - segment.duration,
  64955. precise: true
  64956. };
  64957. }
  64958. }
  64959. while (i2--) {
  64960. segment = playlist.segments[i2];
  64961. if (typeof segment.end !== "undefined") {
  64962. return {
  64963. result: result + segment.end,
  64964. precise: true
  64965. };
  64966. }
  64967. result += segmentDurationWithParts$1(playlist, segment);
  64968. if (typeof segment.start !== "undefined") {
  64969. return {
  64970. result: result + segment.start,
  64971. precise: true
  64972. };
  64973. }
  64974. }
  64975. return {
  64976. result,
  64977. precise: false
  64978. };
  64979. };
  64980. const forwardDuration$1 = function(playlist, endSequence) {
  64981. let result = 0;
  64982. let segment;
  64983. let i2 = endSequence - playlist.mediaSequence;
  64984. for (; i2 < playlist.segments.length; i2++) {
  64985. segment = playlist.segments[i2];
  64986. if (typeof segment.start !== "undefined") {
  64987. return {
  64988. result: segment.start - result,
  64989. precise: true
  64990. };
  64991. }
  64992. result += segmentDurationWithParts$1(playlist, segment);
  64993. if (typeof segment.end !== "undefined") {
  64994. return {
  64995. result: segment.end - result,
  64996. precise: true
  64997. };
  64998. }
  64999. }
  65000. return {
  65001. result: -1,
  65002. precise: false
  65003. };
  65004. };
  65005. const intervalDuration$1 = function(playlist, endSequence, expired) {
  65006. if (typeof endSequence === "undefined") {
  65007. endSequence = playlist.mediaSequence + playlist.segments.length;
  65008. }
  65009. if (endSequence < playlist.mediaSequence) {
  65010. return 0;
  65011. }
  65012. const backward = backwardDuration$1(playlist, endSequence);
  65013. if (backward.precise) {
  65014. return backward.result;
  65015. }
  65016. const forward = forwardDuration$1(playlist, endSequence);
  65017. if (forward.precise) {
  65018. return forward.result;
  65019. }
  65020. return backward.result + expired;
  65021. };
  65022. const duration$1 = function(playlist, endSequence, expired) {
  65023. if (!playlist) {
  65024. return 0;
  65025. }
  65026. if (typeof expired !== "number") {
  65027. expired = 0;
  65028. }
  65029. if (typeof endSequence === "undefined") {
  65030. if (playlist.totalDuration) {
  65031. return playlist.totalDuration;
  65032. }
  65033. if (!playlist.endList) {
  65034. return window_1.Infinity;
  65035. }
  65036. }
  65037. return intervalDuration$1(playlist, endSequence, expired);
  65038. };
  65039. const sumDurations$1 = function({
  65040. defaultDuration,
  65041. durationList,
  65042. startIndex,
  65043. endIndex
  65044. }) {
  65045. let durations = 0;
  65046. if (startIndex > endIndex) {
  65047. [startIndex, endIndex] = [endIndex, startIndex];
  65048. }
  65049. if (startIndex < 0) {
  65050. for (let i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  65051. durations += defaultDuration;
  65052. }
  65053. startIndex = 0;
  65054. }
  65055. for (let i2 = startIndex; i2 < endIndex; i2++) {
  65056. durations += durationList[i2].duration;
  65057. }
  65058. return durations;
  65059. };
  65060. const playlistEnd$1 = function(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  65061. if (!playlist || !playlist.segments) {
  65062. return null;
  65063. }
  65064. if (playlist.endList) {
  65065. return duration$1(playlist);
  65066. }
  65067. if (expired === null) {
  65068. return null;
  65069. }
  65070. expired = expired || 0;
  65071. let lastSegmentEndTime = intervalDuration$1(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  65072. if (useSafeLiveEnd) {
  65073. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay$1(null, playlist);
  65074. lastSegmentEndTime -= liveEdgePadding;
  65075. }
  65076. return Math.max(0, lastSegmentEndTime);
  65077. };
  65078. const seekable$1 = function(playlist, expired, liveEdgePadding) {
  65079. const useSafeLiveEnd = true;
  65080. const seekableStart = expired || 0;
  65081. const seekableEnd = playlistEnd$1(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  65082. if (seekableEnd === null) {
  65083. return createTimeRanges$2();
  65084. }
  65085. return createTimeRanges$2(seekableStart, seekableEnd);
  65086. };
  65087. const getMediaInfoForTime$1 = function({
  65088. playlist,
  65089. currentTime,
  65090. startingSegmentIndex,
  65091. startingPartIndex,
  65092. startTime,
  65093. exactManifestTimings
  65094. }) {
  65095. let time = currentTime - startTime;
  65096. const partsAndSegments = getPartsAndSegments$1(playlist);
  65097. let startIndex = 0;
  65098. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  65099. const partAndSegment = partsAndSegments[i2];
  65100. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  65101. continue;
  65102. }
  65103. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  65104. continue;
  65105. }
  65106. startIndex = i2;
  65107. break;
  65108. }
  65109. if (time < 0) {
  65110. if (startIndex > 0) {
  65111. for (let i2 = startIndex - 1; i2 >= 0; i2--) {
  65112. const partAndSegment = partsAndSegments[i2];
  65113. time += partAndSegment.duration;
  65114. if (exactManifestTimings) {
  65115. if (time < 0) {
  65116. continue;
  65117. }
  65118. } else if (time + TIME_FUDGE_FACTOR$1 <= 0) {
  65119. continue;
  65120. }
  65121. return {
  65122. partIndex: partAndSegment.partIndex,
  65123. segmentIndex: partAndSegment.segmentIndex,
  65124. startTime: startTime - sumDurations$1({
  65125. defaultDuration: playlist.targetDuration,
  65126. durationList: partsAndSegments,
  65127. startIndex,
  65128. endIndex: i2
  65129. })
  65130. };
  65131. }
  65132. }
  65133. return {
  65134. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65135. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65136. startTime: currentTime
  65137. };
  65138. }
  65139. if (startIndex < 0) {
  65140. for (let i2 = startIndex; i2 < 0; i2++) {
  65141. time -= playlist.targetDuration;
  65142. if (time < 0) {
  65143. return {
  65144. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65145. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65146. startTime: currentTime
  65147. };
  65148. }
  65149. }
  65150. startIndex = 0;
  65151. }
  65152. for (let i2 = startIndex; i2 < partsAndSegments.length; i2++) {
  65153. const partAndSegment = partsAndSegments[i2];
  65154. time -= partAndSegment.duration;
  65155. if (exactManifestTimings) {
  65156. if (time > 0) {
  65157. continue;
  65158. }
  65159. } else if (time - TIME_FUDGE_FACTOR$1 >= 0) {
  65160. continue;
  65161. }
  65162. return {
  65163. partIndex: partAndSegment.partIndex,
  65164. segmentIndex: partAndSegment.segmentIndex,
  65165. startTime: startTime + sumDurations$1({
  65166. defaultDuration: playlist.targetDuration,
  65167. durationList: partsAndSegments,
  65168. startIndex,
  65169. endIndex: i2
  65170. })
  65171. };
  65172. }
  65173. return {
  65174. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  65175. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  65176. startTime: currentTime
  65177. };
  65178. };
  65179. const isExcluded = function(playlist) {
  65180. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  65181. };
  65182. const isIncompatible$1 = function(playlist) {
  65183. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  65184. };
  65185. const isEnabled$1 = function(playlist) {
  65186. const excluded = isExcluded(playlist);
  65187. return !playlist.disabled && !excluded;
  65188. };
  65189. const isDisabled$1 = function(playlist) {
  65190. return playlist.disabled;
  65191. };
  65192. const isAes$1 = function(media) {
  65193. for (let i2 = 0; i2 < media.segments.length; i2++) {
  65194. if (media.segments[i2].key) {
  65195. return true;
  65196. }
  65197. }
  65198. return false;
  65199. };
  65200. const hasAttribute$1 = function(attr, playlist) {
  65201. return playlist.attributes && playlist.attributes[attr];
  65202. };
  65203. const estimateSegmentRequestTime$1 = function(segmentDuration, bandwidth2, playlist, bytesReceived = 0) {
  65204. if (!hasAttribute$1("BANDWIDTH", playlist)) {
  65205. return NaN;
  65206. }
  65207. const size = segmentDuration * playlist.attributes.BANDWIDTH;
  65208. return (size - bytesReceived * 8) / bandwidth2;
  65209. };
  65210. const isLowestEnabledRendition$1 = (main, media) => {
  65211. if (main.playlists.length === 1) {
  65212. return true;
  65213. }
  65214. const currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  65215. return main.playlists.filter((playlist) => {
  65216. if (!isEnabled$1(playlist)) {
  65217. return false;
  65218. }
  65219. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  65220. }).length === 0;
  65221. };
  65222. const playlistMatch$1 = (a, b) => {
  65223. if (!a && !b || !a && b || a && !b) {
  65224. return false;
  65225. }
  65226. if (a === b) {
  65227. return true;
  65228. }
  65229. if (a.id && b.id && a.id === b.id) {
  65230. return true;
  65231. }
  65232. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  65233. return true;
  65234. }
  65235. if (a.uri && b.uri && a.uri === b.uri) {
  65236. return true;
  65237. }
  65238. return false;
  65239. };
  65240. const someAudioVariant$1 = function(main, callback2) {
  65241. const AUDIO5 = main && main.mediaGroups && main.mediaGroups.AUDIO || {};
  65242. let found = false;
  65243. for (const groupName in AUDIO5) {
  65244. for (const label2 in AUDIO5[groupName]) {
  65245. found = callback2(AUDIO5[groupName][label2]);
  65246. if (found) {
  65247. break;
  65248. }
  65249. }
  65250. if (found) {
  65251. break;
  65252. }
  65253. }
  65254. return !!found;
  65255. };
  65256. const isAudioOnly$1 = (main) => {
  65257. if (!main || !main.playlists || !main.playlists.length) {
  65258. const found = someAudioVariant$1(main, (variant) => variant.playlists && variant.playlists.length || variant.uri);
  65259. return found;
  65260. }
  65261. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65262. const playlist = main.playlists[i2];
  65263. const CODECS = playlist.attributes && playlist.attributes.CODECS;
  65264. if (CODECS && CODECS.split(",").every((c) => isAudioCodec$1(c))) {
  65265. continue;
  65266. }
  65267. const found = someAudioVariant$1(main, (variant) => playlistMatch$1(playlist, variant));
  65268. if (found) {
  65269. continue;
  65270. }
  65271. return false;
  65272. }
  65273. return true;
  65274. };
  65275. var Playlist$1 = {
  65276. liveEdgeDelay: liveEdgeDelay$1,
  65277. duration: duration$1,
  65278. seekable: seekable$1,
  65279. getMediaInfoForTime: getMediaInfoForTime$1,
  65280. isEnabled: isEnabled$1,
  65281. isDisabled: isDisabled$1,
  65282. isExcluded,
  65283. isIncompatible: isIncompatible$1,
  65284. playlistEnd: playlistEnd$1,
  65285. isAes: isAes$1,
  65286. hasAttribute: hasAttribute$1,
  65287. estimateSegmentRequestTime: estimateSegmentRequestTime$1,
  65288. isLowestEnabledRendition: isLowestEnabledRendition$1,
  65289. isAudioOnly: isAudioOnly$1,
  65290. playlistMatch: playlistMatch$1,
  65291. segmentDurationWithParts: segmentDurationWithParts$1
  65292. };
  65293. const {
  65294. log: log$2
  65295. } = videojs$2;
  65296. const createPlaylistID$1 = (index2, uri) => {
  65297. return `${index2}-${uri}`;
  65298. };
  65299. const groupID$1 = (type2, group, label2) => {
  65300. return `placeholder-uri-${type2}-${group}-${label2}`;
  65301. };
  65302. const parseManifest$1 = ({
  65303. onwarn,
  65304. oninfo,
  65305. manifestString,
  65306. customTagParsers = [],
  65307. customTagMappers = [],
  65308. llhls
  65309. }) => {
  65310. const parser2 = new Parser$1();
  65311. if (onwarn) {
  65312. parser2.on("warn", onwarn);
  65313. }
  65314. if (oninfo) {
  65315. parser2.on("info", oninfo);
  65316. }
  65317. customTagParsers.forEach((customParser) => parser2.addParser(customParser));
  65318. customTagMappers.forEach((mapper) => parser2.addTagMapper(mapper));
  65319. parser2.push(manifestString);
  65320. parser2.end();
  65321. const manifest = parser2.manifest;
  65322. if (!llhls) {
  65323. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  65324. if (manifest.hasOwnProperty(k)) {
  65325. delete manifest[k];
  65326. }
  65327. });
  65328. if (manifest.segments) {
  65329. manifest.segments.forEach(function(segment) {
  65330. ["parts", "preloadHints"].forEach(function(k) {
  65331. if (segment.hasOwnProperty(k)) {
  65332. delete segment[k];
  65333. }
  65334. });
  65335. });
  65336. }
  65337. }
  65338. if (!manifest.targetDuration) {
  65339. let targetDuration = 10;
  65340. if (manifest.segments && manifest.segments.length) {
  65341. targetDuration = manifest.segments.reduce((acc, s) => Math.max(acc, s.duration), 0);
  65342. }
  65343. if (onwarn) {
  65344. onwarn(`manifest has no targetDuration defaulting to ${targetDuration}`);
  65345. }
  65346. manifest.targetDuration = targetDuration;
  65347. }
  65348. const parts = getLastParts$1(manifest);
  65349. if (parts.length && !manifest.partTargetDuration) {
  65350. const partTargetDuration = parts.reduce((acc, p) => Math.max(acc, p.duration), 0);
  65351. if (onwarn) {
  65352. onwarn(`manifest has no partTargetDuration defaulting to ${partTargetDuration}`);
  65353. log$2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  65354. }
  65355. manifest.partTargetDuration = partTargetDuration;
  65356. }
  65357. return manifest;
  65358. };
  65359. const forEachMediaGroup$2 = (main, callback2) => {
  65360. if (!main.mediaGroups) {
  65361. return;
  65362. }
  65363. ["AUDIO", "SUBTITLES"].forEach((mediaType) => {
  65364. if (!main.mediaGroups[mediaType]) {
  65365. return;
  65366. }
  65367. for (const groupKey in main.mediaGroups[mediaType]) {
  65368. for (const labelKey in main.mediaGroups[mediaType][groupKey]) {
  65369. const mediaProperties = main.mediaGroups[mediaType][groupKey][labelKey];
  65370. callback2(mediaProperties, mediaType, groupKey, labelKey);
  65371. }
  65372. }
  65373. });
  65374. };
  65375. const setupMediaPlaylist$1 = ({
  65376. playlist,
  65377. uri,
  65378. id
  65379. }) => {
  65380. playlist.id = id;
  65381. playlist.playlistErrors_ = 0;
  65382. if (uri) {
  65383. playlist.uri = uri;
  65384. }
  65385. playlist.attributes = playlist.attributes || {};
  65386. };
  65387. const setupMediaPlaylists$1 = (main) => {
  65388. let i2 = main.playlists.length;
  65389. while (i2--) {
  65390. const playlist = main.playlists[i2];
  65391. setupMediaPlaylist$1({
  65392. playlist,
  65393. id: createPlaylistID$1(i2, playlist.uri)
  65394. });
  65395. playlist.resolvedUri = resolveUrl$2(main.uri, playlist.uri);
  65396. main.playlists[playlist.id] = playlist;
  65397. main.playlists[playlist.uri] = playlist;
  65398. if (!playlist.attributes.BANDWIDTH) {
  65399. log$2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  65400. }
  65401. }
  65402. };
  65403. const resolveMediaGroupUris$1 = (main) => {
  65404. forEachMediaGroup$2(main, (properties) => {
  65405. if (properties.uri) {
  65406. properties.resolvedUri = resolveUrl$2(main.uri, properties.uri);
  65407. }
  65408. });
  65409. };
  65410. const mainForMedia = (media, uri) => {
  65411. const id = createPlaylistID$1(0, uri);
  65412. const main = {
  65413. mediaGroups: {
  65414. "AUDIO": {},
  65415. "VIDEO": {},
  65416. "CLOSED-CAPTIONS": {},
  65417. "SUBTITLES": {}
  65418. },
  65419. uri: window_1.location.href,
  65420. resolvedUri: window_1.location.href,
  65421. playlists: [{
  65422. uri,
  65423. id,
  65424. resolvedUri: uri,
  65425. attributes: {}
  65426. }]
  65427. };
  65428. main.playlists[id] = main.playlists[0];
  65429. main.playlists[uri] = main.playlists[0];
  65430. return main;
  65431. };
  65432. const addPropertiesToMain = (main, uri, createGroupID = groupID$1) => {
  65433. main.uri = uri;
  65434. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65435. if (!main.playlists[i2].uri) {
  65436. const phonyUri = `placeholder-uri-${i2}`;
  65437. main.playlists[i2].uri = phonyUri;
  65438. }
  65439. }
  65440. const audioOnlyMain = isAudioOnly$1(main);
  65441. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65442. if (!properties.playlists || !properties.playlists.length) {
  65443. if (audioOnlyMain && mediaType === "AUDIO" && !properties.uri) {
  65444. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65445. const p = main.playlists[i2];
  65446. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  65447. return;
  65448. }
  65449. }
  65450. }
  65451. properties.playlists = [_extends$2({}, properties)];
  65452. }
  65453. properties.playlists.forEach(function(p, i2) {
  65454. const groupId = createGroupID(mediaType, groupKey, labelKey, p);
  65455. const id = createPlaylistID$1(i2, groupId);
  65456. if (p.uri) {
  65457. p.resolvedUri = p.resolvedUri || resolveUrl$2(main.uri, p.uri);
  65458. } else {
  65459. p.uri = i2 === 0 ? groupId : id;
  65460. p.resolvedUri = p.uri;
  65461. }
  65462. p.id = p.id || id;
  65463. p.attributes = p.attributes || {};
  65464. main.playlists[p.id] = p;
  65465. main.playlists[p.uri] = p;
  65466. });
  65467. });
  65468. setupMediaPlaylists$1(main);
  65469. resolveMediaGroupUris$1(main);
  65470. };
  65471. const {
  65472. EventTarget: EventTarget$1$1
  65473. } = videojs$2;
  65474. const addLLHLSQueryDirectives$1 = (uri, media) => {
  65475. if (media.endList || !media.serverControl) {
  65476. return uri;
  65477. }
  65478. const parameters = {};
  65479. if (media.serverControl.canBlockReload) {
  65480. const {
  65481. preloadSegment
  65482. } = media;
  65483. let nextMSN = media.mediaSequence + media.segments.length;
  65484. if (preloadSegment) {
  65485. const parts = preloadSegment.parts || [];
  65486. const nextPart = getKnownPartCount$1(media) - 1;
  65487. if (nextPart > -1 && nextPart !== parts.length - 1) {
  65488. parameters._HLS_part = nextPart;
  65489. }
  65490. if (nextPart > -1 || parts.length) {
  65491. nextMSN--;
  65492. }
  65493. }
  65494. parameters._HLS_msn = nextMSN;
  65495. }
  65496. if (media.serverControl && media.serverControl.canSkipUntil) {
  65497. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  65498. }
  65499. if (Object.keys(parameters).length) {
  65500. const parsedUri = new window_1.URL(uri);
  65501. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  65502. if (!parameters.hasOwnProperty(name)) {
  65503. return;
  65504. }
  65505. parsedUri.searchParams.set(name, parameters[name]);
  65506. });
  65507. uri = parsedUri.toString();
  65508. }
  65509. return uri;
  65510. };
  65511. const updateSegment$1 = (a, b) => {
  65512. if (!a) {
  65513. return b;
  65514. }
  65515. const result = merge$2(a, b);
  65516. if (a.preloadHints && !b.preloadHints) {
  65517. delete result.preloadHints;
  65518. }
  65519. if (a.parts && !b.parts) {
  65520. delete result.parts;
  65521. } else if (a.parts && b.parts) {
  65522. for (let i2 = 0; i2 < b.parts.length; i2++) {
  65523. if (a.parts && a.parts[i2]) {
  65524. result.parts[i2] = merge$2(a.parts[i2], b.parts[i2]);
  65525. }
  65526. }
  65527. }
  65528. if (!a.skipped && b.skipped) {
  65529. result.skipped = false;
  65530. }
  65531. if (a.preload && !b.preload) {
  65532. result.preload = false;
  65533. }
  65534. return result;
  65535. };
  65536. const updateSegments$1 = (original, update, offset) => {
  65537. const oldSegments = original.slice();
  65538. const newSegments = update.slice();
  65539. offset = offset || 0;
  65540. const result = [];
  65541. let currentMap;
  65542. for (let newIndex = 0; newIndex < newSegments.length; newIndex++) {
  65543. const oldSegment = oldSegments[newIndex + offset];
  65544. const newSegment = newSegments[newIndex];
  65545. if (oldSegment) {
  65546. currentMap = oldSegment.map || currentMap;
  65547. result.push(updateSegment$1(oldSegment, newSegment));
  65548. } else {
  65549. if (currentMap && !newSegment.map) {
  65550. newSegment.map = currentMap;
  65551. }
  65552. result.push(newSegment);
  65553. }
  65554. }
  65555. return result;
  65556. };
  65557. const resolveSegmentUris$1 = (segment, baseUri) => {
  65558. if (!segment.resolvedUri && segment.uri) {
  65559. segment.resolvedUri = resolveUrl$2(baseUri, segment.uri);
  65560. }
  65561. if (segment.key && !segment.key.resolvedUri) {
  65562. segment.key.resolvedUri = resolveUrl$2(baseUri, segment.key.uri);
  65563. }
  65564. if (segment.map && !segment.map.resolvedUri) {
  65565. segment.map.resolvedUri = resolveUrl$2(baseUri, segment.map.uri);
  65566. }
  65567. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  65568. segment.map.key.resolvedUri = resolveUrl$2(baseUri, segment.map.key.uri);
  65569. }
  65570. if (segment.parts && segment.parts.length) {
  65571. segment.parts.forEach((p) => {
  65572. if (p.resolvedUri) {
  65573. return;
  65574. }
  65575. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65576. });
  65577. }
  65578. if (segment.preloadHints && segment.preloadHints.length) {
  65579. segment.preloadHints.forEach((p) => {
  65580. if (p.resolvedUri) {
  65581. return;
  65582. }
  65583. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65584. });
  65585. }
  65586. };
  65587. const getAllSegments$1 = function(media) {
  65588. const segments = media.segments || [];
  65589. const preloadSegment = media.preloadSegment;
  65590. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  65591. if (preloadSegment.preloadHints) {
  65592. for (let i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  65593. if (preloadSegment.preloadHints[i2].type === "MAP") {
  65594. return segments;
  65595. }
  65596. }
  65597. }
  65598. preloadSegment.duration = media.targetDuration;
  65599. preloadSegment.preload = true;
  65600. segments.push(preloadSegment);
  65601. }
  65602. return segments;
  65603. };
  65604. const isPlaylistUnchanged$1 = (a, b) => a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  65605. const updateMain$1 = (main, newMedia, unchangedCheck = isPlaylistUnchanged$1) => {
  65606. const result = merge$2(main, {});
  65607. const oldMedia = result.playlists[newMedia.id];
  65608. if (!oldMedia) {
  65609. return null;
  65610. }
  65611. if (unchangedCheck(oldMedia, newMedia)) {
  65612. return null;
  65613. }
  65614. newMedia.segments = getAllSegments$1(newMedia);
  65615. const mergedPlaylist = merge$2(oldMedia, newMedia);
  65616. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  65617. delete mergedPlaylist.preloadSegment;
  65618. }
  65619. if (oldMedia.segments) {
  65620. if (newMedia.skip) {
  65621. newMedia.segments = newMedia.segments || [];
  65622. for (let i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  65623. newMedia.segments.unshift({
  65624. skipped: true
  65625. });
  65626. }
  65627. }
  65628. mergedPlaylist.segments = updateSegments$1(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  65629. }
  65630. mergedPlaylist.segments.forEach((segment) => {
  65631. resolveSegmentUris$1(segment, mergedPlaylist.resolvedUri);
  65632. });
  65633. for (let i2 = 0; i2 < result.playlists.length; i2++) {
  65634. if (result.playlists[i2].id === newMedia.id) {
  65635. result.playlists[i2] = mergedPlaylist;
  65636. }
  65637. }
  65638. result.playlists[newMedia.id] = mergedPlaylist;
  65639. result.playlists[newMedia.uri] = mergedPlaylist;
  65640. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65641. if (!properties.playlists) {
  65642. return;
  65643. }
  65644. for (let i2 = 0; i2 < properties.playlists.length; i2++) {
  65645. if (newMedia.id === properties.playlists[i2].id) {
  65646. properties.playlists[i2] = mergedPlaylist;
  65647. }
  65648. }
  65649. });
  65650. return result;
  65651. };
  65652. const refreshDelay$1 = (media, update) => {
  65653. const segments = media.segments || [];
  65654. const lastSegment = segments[segments.length - 1];
  65655. const lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  65656. const lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  65657. if (update && lastDuration) {
  65658. return lastDuration * 1e3;
  65659. }
  65660. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  65661. };
  65662. class PlaylistLoader$1 extends EventTarget$1$1 {
  65663. constructor(src, vhs, options2 = {}) {
  65664. super();
  65665. if (!src) {
  65666. throw new Error("A non-empty playlist URL or object is required");
  65667. }
  65668. this.logger_ = logger$1("PlaylistLoader");
  65669. const {
  65670. withCredentials = false
  65671. } = options2;
  65672. this.src = src;
  65673. this.vhs_ = vhs;
  65674. this.withCredentials = withCredentials;
  65675. const vhsOptions = vhs.options_;
  65676. this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  65677. this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  65678. this.llhls = vhsOptions && vhsOptions.llhls;
  65679. this.state = "HAVE_NOTHING";
  65680. this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this);
  65681. this.on("mediaupdatetimeout", this.handleMediaupdatetimeout_);
  65682. }
  65683. handleMediaupdatetimeout_() {
  65684. if (this.state !== "HAVE_METADATA") {
  65685. return;
  65686. }
  65687. const media = this.media();
  65688. let uri = resolveUrl$2(this.main.uri, media.uri);
  65689. if (this.llhls) {
  65690. uri = addLLHLSQueryDirectives$1(uri, media);
  65691. }
  65692. this.state = "HAVE_CURRENT_METADATA";
  65693. this.request = this.vhs_.xhr({
  65694. uri,
  65695. withCredentials: this.withCredentials
  65696. }, (error, req) => {
  65697. if (!this.request) {
  65698. return;
  65699. }
  65700. if (error) {
  65701. return this.playlistRequestError(this.request, this.media(), "HAVE_METADATA");
  65702. }
  65703. this.haveMetadata({
  65704. playlistString: this.request.responseText,
  65705. url: this.media().uri,
  65706. id: this.media().id
  65707. });
  65708. });
  65709. }
  65710. playlistRequestError(xhr, playlist, startingState) {
  65711. const {
  65712. uri,
  65713. id
  65714. } = playlist;
  65715. this.request = null;
  65716. if (startingState) {
  65717. this.state = startingState;
  65718. }
  65719. this.error = {
  65720. playlist: this.main.playlists[id],
  65721. status: xhr.status,
  65722. message: `HLS playlist request error at URL: ${uri}.`,
  65723. responseText: xhr.responseText,
  65724. code: xhr.status >= 500 ? 4 : 2
  65725. };
  65726. this.trigger("error");
  65727. }
  65728. parseManifest_({
  65729. url,
  65730. manifestString
  65731. }) {
  65732. return parseManifest$1({
  65733. onwarn: ({
  65734. message
  65735. }) => this.logger_(`m3u8-parser warn for ${url}: ${message}`),
  65736. oninfo: ({
  65737. message
  65738. }) => this.logger_(`m3u8-parser info for ${url}: ${message}`),
  65739. manifestString,
  65740. customTagParsers: this.customTagParsers,
  65741. customTagMappers: this.customTagMappers,
  65742. llhls: this.llhls
  65743. });
  65744. }
  65745. haveMetadata({
  65746. playlistString,
  65747. playlistObject,
  65748. url,
  65749. id
  65750. }) {
  65751. this.request = null;
  65752. this.state = "HAVE_METADATA";
  65753. const playlist = playlistObject || this.parseManifest_({
  65754. url,
  65755. manifestString: playlistString
  65756. });
  65757. playlist.lastRequest = Date.now();
  65758. setupMediaPlaylist$1({
  65759. playlist,
  65760. uri: url,
  65761. id
  65762. });
  65763. const update = updateMain$1(this.main, playlist);
  65764. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  65765. this.pendingMedia_ = null;
  65766. if (update) {
  65767. this.main = update;
  65768. this.media_ = this.main.playlists[id];
  65769. } else {
  65770. this.trigger("playlistunchanged");
  65771. }
  65772. this.updateMediaUpdateTimeout_(refreshDelay$1(this.media(), !!update));
  65773. this.trigger("loadedplaylist");
  65774. }
  65775. dispose() {
  65776. this.trigger("dispose");
  65777. this.stopRequest();
  65778. window_1.clearTimeout(this.mediaUpdateTimeout);
  65779. window_1.clearTimeout(this.finalRenditionTimeout);
  65780. this.off();
  65781. }
  65782. stopRequest() {
  65783. if (this.request) {
  65784. const oldRequest = this.request;
  65785. this.request = null;
  65786. oldRequest.onreadystatechange = null;
  65787. oldRequest.abort();
  65788. }
  65789. }
  65790. media(playlist, shouldDelay) {
  65791. if (!playlist) {
  65792. return this.media_;
  65793. }
  65794. if (this.state === "HAVE_NOTHING") {
  65795. throw new Error("Cannot switch media playlist from " + this.state);
  65796. }
  65797. if (typeof playlist === "string") {
  65798. if (!this.main.playlists[playlist]) {
  65799. throw new Error("Unknown playlist URI: " + playlist);
  65800. }
  65801. playlist = this.main.playlists[playlist];
  65802. }
  65803. window_1.clearTimeout(this.finalRenditionTimeout);
  65804. if (shouldDelay) {
  65805. const delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  65806. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  65807. return;
  65808. }
  65809. const startingState = this.state;
  65810. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  65811. const mainPlaylistRef = this.main.playlists[playlist.id];
  65812. if (mainPlaylistRef && mainPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  65813. if (this.request) {
  65814. this.request.onreadystatechange = null;
  65815. this.request.abort();
  65816. this.request = null;
  65817. }
  65818. this.state = "HAVE_METADATA";
  65819. this.media_ = playlist;
  65820. if (mediaChange) {
  65821. this.trigger("mediachanging");
  65822. if (startingState === "HAVE_MAIN_MANIFEST") {
  65823. this.trigger("loadedmetadata");
  65824. } else {
  65825. this.trigger("mediachange");
  65826. }
  65827. }
  65828. return;
  65829. }
  65830. this.updateMediaUpdateTimeout_(refreshDelay$1(playlist, true));
  65831. if (!mediaChange) {
  65832. return;
  65833. }
  65834. this.state = "SWITCHING_MEDIA";
  65835. if (this.request) {
  65836. if (playlist.resolvedUri === this.request.url) {
  65837. return;
  65838. }
  65839. this.request.onreadystatechange = null;
  65840. this.request.abort();
  65841. this.request = null;
  65842. }
  65843. if (this.media_) {
  65844. this.trigger("mediachanging");
  65845. }
  65846. this.pendingMedia_ = playlist;
  65847. this.request = this.vhs_.xhr({
  65848. uri: playlist.resolvedUri,
  65849. withCredentials: this.withCredentials
  65850. }, (error, req) => {
  65851. if (!this.request) {
  65852. return;
  65853. }
  65854. playlist.lastRequest = Date.now();
  65855. playlist.resolvedUri = resolveManifestRedirect$1(playlist.resolvedUri, req);
  65856. if (error) {
  65857. return this.playlistRequestError(this.request, playlist, startingState);
  65858. }
  65859. this.haveMetadata({
  65860. playlistString: req.responseText,
  65861. url: playlist.uri,
  65862. id: playlist.id
  65863. });
  65864. if (startingState === "HAVE_MAIN_MANIFEST") {
  65865. this.trigger("loadedmetadata");
  65866. } else {
  65867. this.trigger("mediachange");
  65868. }
  65869. });
  65870. }
  65871. pause() {
  65872. if (this.mediaUpdateTimeout) {
  65873. window_1.clearTimeout(this.mediaUpdateTimeout);
  65874. this.mediaUpdateTimeout = null;
  65875. }
  65876. this.stopRequest();
  65877. if (this.state === "HAVE_NOTHING") {
  65878. this.started = false;
  65879. }
  65880. if (this.state === "SWITCHING_MEDIA") {
  65881. if (this.media_) {
  65882. this.state = "HAVE_METADATA";
  65883. } else {
  65884. this.state = "HAVE_MAIN_MANIFEST";
  65885. }
  65886. } else if (this.state === "HAVE_CURRENT_METADATA") {
  65887. this.state = "HAVE_METADATA";
  65888. }
  65889. }
  65890. load(shouldDelay) {
  65891. if (this.mediaUpdateTimeout) {
  65892. window_1.clearTimeout(this.mediaUpdateTimeout);
  65893. this.mediaUpdateTimeout = null;
  65894. }
  65895. const media = this.media();
  65896. if (shouldDelay) {
  65897. const delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  65898. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65899. this.mediaUpdateTimeout = null;
  65900. this.load();
  65901. }, delay);
  65902. return;
  65903. }
  65904. if (!this.started) {
  65905. this.start();
  65906. return;
  65907. }
  65908. if (media && !media.endList) {
  65909. this.trigger("mediaupdatetimeout");
  65910. } else {
  65911. this.trigger("loadedplaylist");
  65912. }
  65913. }
  65914. updateMediaUpdateTimeout_(delay) {
  65915. if (this.mediaUpdateTimeout) {
  65916. window_1.clearTimeout(this.mediaUpdateTimeout);
  65917. this.mediaUpdateTimeout = null;
  65918. }
  65919. if (!this.media() || this.media().endList) {
  65920. return;
  65921. }
  65922. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65923. this.mediaUpdateTimeout = null;
  65924. this.trigger("mediaupdatetimeout");
  65925. this.updateMediaUpdateTimeout_(delay);
  65926. }, delay);
  65927. }
  65928. start() {
  65929. this.started = true;
  65930. if (typeof this.src === "object") {
  65931. if (!this.src.uri) {
  65932. this.src.uri = window_1.location.href;
  65933. }
  65934. this.src.resolvedUri = this.src.uri;
  65935. setTimeout(() => {
  65936. this.setupInitialPlaylist(this.src);
  65937. }, 0);
  65938. return;
  65939. }
  65940. this.request = this.vhs_.xhr({
  65941. uri: this.src,
  65942. withCredentials: this.withCredentials
  65943. }, (error, req) => {
  65944. if (!this.request) {
  65945. return;
  65946. }
  65947. this.request = null;
  65948. if (error) {
  65949. this.error = {
  65950. status: req.status,
  65951. message: `HLS playlist request error at URL: ${this.src}.`,
  65952. responseText: req.responseText,
  65953. code: 2
  65954. };
  65955. if (this.state === "HAVE_NOTHING") {
  65956. this.started = false;
  65957. }
  65958. return this.trigger("error");
  65959. }
  65960. this.src = resolveManifestRedirect$1(this.src, req);
  65961. const manifest = this.parseManifest_({
  65962. manifestString: req.responseText,
  65963. url: this.src
  65964. });
  65965. this.setupInitialPlaylist(manifest);
  65966. });
  65967. }
  65968. srcUri() {
  65969. return typeof this.src === "string" ? this.src : this.src.uri;
  65970. }
  65971. setupInitialPlaylist(manifest) {
  65972. this.state = "HAVE_MAIN_MANIFEST";
  65973. if (manifest.playlists) {
  65974. this.main = manifest;
  65975. addPropertiesToMain(this.main, this.srcUri());
  65976. manifest.playlists.forEach((playlist) => {
  65977. playlist.segments = getAllSegments$1(playlist);
  65978. playlist.segments.forEach((segment) => {
  65979. resolveSegmentUris$1(segment, playlist.resolvedUri);
  65980. });
  65981. });
  65982. this.trigger("loadedplaylist");
  65983. if (!this.request) {
  65984. this.media(this.main.playlists[0]);
  65985. }
  65986. return;
  65987. }
  65988. const uri = this.srcUri() || window_1.location.href;
  65989. this.main = mainForMedia(manifest, uri);
  65990. this.haveMetadata({
  65991. playlistObject: manifest,
  65992. url: uri,
  65993. id: this.main.playlists[0].id
  65994. });
  65995. this.trigger("loadedmetadata");
  65996. }
  65997. }
  65998. const {
  65999. xhr: videojsXHR$1
  66000. } = videojs$2;
  66001. const callbackWrapper$1 = function(request, error, response, callback2) {
  66002. const reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  66003. if (!error && reqResponse) {
  66004. request.responseTime = Date.now();
  66005. request.roundTripTime = request.responseTime - request.requestTime;
  66006. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  66007. if (!request.bandwidth) {
  66008. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  66009. }
  66010. }
  66011. if (response.headers) {
  66012. request.responseHeaders = response.headers;
  66013. }
  66014. if (error && error.code === "ETIMEDOUT") {
  66015. request.timedout = true;
  66016. }
  66017. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  66018. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  66019. }
  66020. callback2(error, request);
  66021. };
  66022. const xhrFactory$1 = function() {
  66023. const xhr = function XhrFunction(options2, callback2) {
  66024. options2 = merge$2({
  66025. timeout: 45e3
  66026. }, options2);
  66027. const beforeRequest = XhrFunction.beforeRequest || videojs$2.Vhs.xhr.beforeRequest;
  66028. if (beforeRequest && typeof beforeRequest === "function") {
  66029. const newOptions = beforeRequest(options2);
  66030. if (newOptions) {
  66031. options2 = newOptions;
  66032. }
  66033. }
  66034. const xhrMethod = videojs$2.Vhs.xhr.original === true ? videojsXHR$1 : videojs$2.Vhs.xhr;
  66035. const request = xhrMethod(options2, function(error, response) {
  66036. return callbackWrapper$1(request, error, response, callback2);
  66037. });
  66038. const originalAbort = request.abort;
  66039. request.abort = function() {
  66040. request.aborted = true;
  66041. return originalAbort.apply(request, arguments);
  66042. };
  66043. request.uri = options2.uri;
  66044. request.requestTime = Date.now();
  66045. return request;
  66046. };
  66047. xhr.original = true;
  66048. return xhr;
  66049. };
  66050. const byterangeStr$1 = function(byterange) {
  66051. let byterangeEnd;
  66052. const byterangeStart = byterange.offset;
  66053. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  66054. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  66055. } else {
  66056. byterangeEnd = byterange.offset + byterange.length - 1;
  66057. }
  66058. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  66059. };
  66060. const segmentXhrHeaders$1 = function(segment) {
  66061. const headers = {};
  66062. if (segment.byterange) {
  66063. headers.Range = byterangeStr$1(segment.byterange);
  66064. }
  66065. return headers;
  66066. };
  66067. const textRange$1 = function(range3, i2) {
  66068. return range3.start(i2) + "-" + range3.end(i2);
  66069. };
  66070. const formatHexString$1 = function(e, i2) {
  66071. const value = e.toString(16);
  66072. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  66073. };
  66074. const formatAsciiString$1 = function(e) {
  66075. if (e >= 32 && e < 126) {
  66076. return String.fromCharCode(e);
  66077. }
  66078. return ".";
  66079. };
  66080. const createTransferableMessage$1 = function(message) {
  66081. const transferable = {};
  66082. Object.keys(message).forEach((key) => {
  66083. const value = message[key];
  66084. if (isArrayBufferView$1(value)) {
  66085. transferable[key] = {
  66086. bytes: value.buffer,
  66087. byteOffset: value.byteOffset,
  66088. byteLength: value.byteLength
  66089. };
  66090. } else {
  66091. transferable[key] = value;
  66092. }
  66093. });
  66094. return transferable;
  66095. };
  66096. const initSegmentId$1 = function(initSegment) {
  66097. const byterange = initSegment.byterange || {
  66098. length: Infinity,
  66099. offset: 0
  66100. };
  66101. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  66102. };
  66103. const segmentKeyId$1 = function(key) {
  66104. return key.resolvedUri;
  66105. };
  66106. const hexDump$1 = (data) => {
  66107. const bytes = Array.prototype.slice.call(data);
  66108. const step = 16;
  66109. let result = "";
  66110. let hex;
  66111. let ascii;
  66112. for (let j = 0; j < bytes.length / step; j++) {
  66113. hex = bytes.slice(j * step, j * step + step).map(formatHexString$1).join("");
  66114. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString$1).join("");
  66115. result += hex + " " + ascii + "\n";
  66116. }
  66117. return result;
  66118. };
  66119. const tagDump$1 = ({
  66120. bytes
  66121. }) => hexDump$1(bytes);
  66122. const textRanges$1 = (ranges) => {
  66123. let result = "";
  66124. let i2;
  66125. for (i2 = 0; i2 < ranges.length; i2++) {
  66126. result += textRange$1(ranges, i2) + " ";
  66127. }
  66128. return result;
  66129. };
  66130. var utils$1 = /* @__PURE__ */ Object.freeze({
  66131. __proto__: null,
  66132. createTransferableMessage: createTransferableMessage$1,
  66133. initSegmentId: initSegmentId$1,
  66134. segmentKeyId: segmentKeyId$1,
  66135. hexDump: hexDump$1,
  66136. tagDump: tagDump$1,
  66137. textRanges: textRanges$1
  66138. });
  66139. const SEGMENT_END_FUDGE_PERCENT$1 = 0.25;
  66140. const playerTimeToProgramTime$1 = (playerTime, segment) => {
  66141. if (!segment.dateTimeObject) {
  66142. return null;
  66143. }
  66144. const transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  66145. const transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  66146. const startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  66147. const offsetFromSegmentStart = playerTime - startOfSegment;
  66148. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  66149. };
  66150. const originalSegmentVideoDuration$1 = (videoTimingInfo) => {
  66151. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  66152. };
  66153. const findSegmentForProgramTime$1 = (programTime, playlist) => {
  66154. let dateTimeObject;
  66155. try {
  66156. dateTimeObject = new Date(programTime);
  66157. } catch (e) {
  66158. return null;
  66159. }
  66160. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66161. return null;
  66162. }
  66163. let segment = playlist.segments[0];
  66164. if (dateTimeObject < segment.dateTimeObject) {
  66165. return null;
  66166. }
  66167. for (let i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  66168. segment = playlist.segments[i2];
  66169. const nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  66170. if (dateTimeObject < nextSegmentStart) {
  66171. break;
  66172. }
  66173. }
  66174. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66175. const lastSegmentStart = lastSegment.dateTimeObject;
  66176. const lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration$1(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1;
  66177. const lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  66178. if (dateTimeObject > lastSegmentEnd) {
  66179. return null;
  66180. }
  66181. if (dateTimeObject > lastSegmentStart) {
  66182. segment = lastSegment;
  66183. }
  66184. return {
  66185. segment,
  66186. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist$1.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  66187. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66188. };
  66189. };
  66190. const findSegmentForPlayerTime$1 = (time, playlist) => {
  66191. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66192. return null;
  66193. }
  66194. let segmentEnd = 0;
  66195. let segment;
  66196. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66197. segment = playlist.segments[i2];
  66198. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  66199. if (time <= segmentEnd) {
  66200. break;
  66201. }
  66202. }
  66203. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66204. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  66205. return null;
  66206. }
  66207. if (time > segmentEnd) {
  66208. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1) {
  66209. return null;
  66210. }
  66211. segment = lastSegment;
  66212. }
  66213. return {
  66214. segment,
  66215. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  66216. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66217. };
  66218. };
  66219. const getOffsetFromTimestamp$1 = (comparisonTimeStamp, programTime) => {
  66220. let segmentDateTime;
  66221. let programDateTime;
  66222. try {
  66223. segmentDateTime = new Date(comparisonTimeStamp);
  66224. programDateTime = new Date(programTime);
  66225. } catch (e) {
  66226. }
  66227. const segmentTimeEpoch = segmentDateTime.getTime();
  66228. const programTimeEpoch = programDateTime.getTime();
  66229. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  66230. };
  66231. const verifyProgramDateTimeTags$1 = (playlist) => {
  66232. if (!playlist.segments || playlist.segments.length === 0) {
  66233. return false;
  66234. }
  66235. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66236. const segment = playlist.segments[i2];
  66237. if (!segment.dateTimeObject) {
  66238. return false;
  66239. }
  66240. }
  66241. return true;
  66242. };
  66243. const getProgramTime$1 = ({
  66244. playlist,
  66245. time = void 0,
  66246. callback: callback2
  66247. }) => {
  66248. if (!callback2) {
  66249. throw new Error("getProgramTime: callback must be provided");
  66250. }
  66251. if (!playlist || time === void 0) {
  66252. return callback2({
  66253. message: "getProgramTime: playlist and time must be provided"
  66254. });
  66255. }
  66256. const matchedSegment = findSegmentForPlayerTime$1(time, playlist);
  66257. if (!matchedSegment) {
  66258. return callback2({
  66259. message: "valid programTime was not found"
  66260. });
  66261. }
  66262. if (matchedSegment.type === "estimate") {
  66263. return callback2({
  66264. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  66265. seekTime: matchedSegment.estimatedStart
  66266. });
  66267. }
  66268. const programTimeObject = {
  66269. mediaSeconds: time
  66270. };
  66271. const programTime = playerTimeToProgramTime$1(time, matchedSegment.segment);
  66272. if (programTime) {
  66273. programTimeObject.programDateTime = programTime.toISOString();
  66274. }
  66275. return callback2(null, programTimeObject);
  66276. };
  66277. const seekToProgramTime$1 = ({
  66278. programTime,
  66279. playlist,
  66280. retryCount = 2,
  66281. seekTo,
  66282. pauseAfterSeek = true,
  66283. tech,
  66284. callback: callback2
  66285. }) => {
  66286. if (!callback2) {
  66287. throw new Error("seekToProgramTime: callback must be provided");
  66288. }
  66289. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  66290. return callback2({
  66291. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  66292. });
  66293. }
  66294. if (!playlist.endList && !tech.hasStarted_) {
  66295. return callback2({
  66296. message: "player must be playing a live stream to start buffering"
  66297. });
  66298. }
  66299. if (!verifyProgramDateTimeTags$1(playlist)) {
  66300. return callback2({
  66301. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  66302. });
  66303. }
  66304. const matchedSegment = findSegmentForProgramTime$1(programTime, playlist);
  66305. if (!matchedSegment) {
  66306. return callback2({
  66307. message: `${programTime} was not found in the stream`
  66308. });
  66309. }
  66310. const segment = matchedSegment.segment;
  66311. const mediaOffset = getOffsetFromTimestamp$1(segment.dateTimeObject, programTime);
  66312. if (matchedSegment.type === "estimate") {
  66313. if (retryCount === 0) {
  66314. return callback2({
  66315. message: `${programTime} is not buffered yet. Try again`
  66316. });
  66317. }
  66318. seekTo(matchedSegment.estimatedStart + mediaOffset);
  66319. tech.one("seeked", () => {
  66320. seekToProgramTime$1({
  66321. programTime,
  66322. playlist,
  66323. retryCount: retryCount - 1,
  66324. seekTo,
  66325. pauseAfterSeek,
  66326. tech,
  66327. callback: callback2
  66328. });
  66329. });
  66330. return;
  66331. }
  66332. const seekToTime = segment.start + mediaOffset;
  66333. const seekedCallback = () => {
  66334. return callback2(null, tech.currentTime());
  66335. };
  66336. tech.one("seeked", seekedCallback);
  66337. if (pauseAfterSeek) {
  66338. tech.pause();
  66339. }
  66340. seekTo(seekToTime);
  66341. };
  66342. const callbackOnCompleted$1 = (request, cb) => {
  66343. if (request.readyState === 4) {
  66344. return cb();
  66345. }
  66346. return;
  66347. };
  66348. const containerRequest$1 = (uri, xhr, cb) => {
  66349. let bytes = [];
  66350. let id3Offset;
  66351. let finished = false;
  66352. const endRequestAndCallback = function(err, req, type2, _bytes) {
  66353. req.abort();
  66354. finished = true;
  66355. return cb(err, req, type2, _bytes);
  66356. };
  66357. const progressListener = function(error, request2) {
  66358. if (finished) {
  66359. return;
  66360. }
  66361. if (error) {
  66362. return endRequestAndCallback(error, request2, "", bytes);
  66363. }
  66364. const newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  66365. bytes = concatTypedArrays$1(bytes, stringToBytes$1(newPart, true));
  66366. id3Offset = id3Offset || getId3Offset$1(bytes);
  66367. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  66368. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66369. }
  66370. const type2 = detectContainerForBytes$1(bytes);
  66371. if (type2 === "ts" && bytes.length < 188) {
  66372. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66373. }
  66374. if (!type2 && bytes.length < 376) {
  66375. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66376. }
  66377. return endRequestAndCallback(null, request2, type2, bytes);
  66378. };
  66379. const options2 = {
  66380. uri,
  66381. beforeSend(request2) {
  66382. request2.overrideMimeType("text/plain; charset=x-user-defined");
  66383. request2.addEventListener("progress", function({
  66384. total,
  66385. loaded
  66386. }) {
  66387. return callbackWrapper$1(request2, null, {
  66388. statusCode: request2.status
  66389. }, progressListener);
  66390. });
  66391. }
  66392. };
  66393. const request = xhr(options2, function(error, response) {
  66394. return callbackWrapper$1(request, error, response, progressListener);
  66395. });
  66396. return request;
  66397. };
  66398. const {
  66399. EventTarget: EventTarget$3
  66400. } = videojs$2;
  66401. const dashPlaylistUnchanged$1 = function(a, b) {
  66402. if (!isPlaylistUnchanged$1(a, b)) {
  66403. return false;
  66404. }
  66405. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  66406. return false;
  66407. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  66408. return false;
  66409. }
  66410. if (a.segments && !b.segments || !a.segments && b.segments) {
  66411. return false;
  66412. }
  66413. if (!a.segments && !b.segments) {
  66414. return true;
  66415. }
  66416. for (let i2 = 0; i2 < a.segments.length; i2++) {
  66417. const aSegment = a.segments[i2];
  66418. const bSegment = b.segments[i2];
  66419. if (aSegment.uri !== bSegment.uri) {
  66420. return false;
  66421. }
  66422. if (!aSegment.byterange && !bSegment.byterange) {
  66423. continue;
  66424. }
  66425. const aByterange = aSegment.byterange;
  66426. const bByterange = bSegment.byterange;
  66427. if (aByterange && !bByterange || !aByterange && bByterange) {
  66428. return false;
  66429. }
  66430. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  66431. return false;
  66432. }
  66433. }
  66434. return true;
  66435. };
  66436. const dashGroupId$1 = (type2, group, label2, playlist) => {
  66437. const playlistId = playlist.attributes.NAME || label2;
  66438. return `placeholder-uri-${type2}-${group}-${playlistId}`;
  66439. };
  66440. const parseMainXml = ({
  66441. mainXml,
  66442. srcUrl,
  66443. clientOffset,
  66444. sidxMapping,
  66445. previousManifest
  66446. }) => {
  66447. const manifest = parse$1(mainXml, {
  66448. manifestUri: srcUrl,
  66449. clientOffset,
  66450. sidxMapping,
  66451. previousManifest
  66452. });
  66453. addPropertiesToMain(manifest, srcUrl, dashGroupId$1);
  66454. return manifest;
  66455. };
  66456. const removeOldMediaGroupLabels$1 = (update, newMain) => {
  66457. forEachMediaGroup$2(update, (properties, type2, group, label2) => {
  66458. if (!(label2 in newMain.mediaGroups[type2][group])) {
  66459. delete update.mediaGroups[type2][group][label2];
  66460. }
  66461. });
  66462. };
  66463. const updateMain = (oldMain, newMain, sidxMapping) => {
  66464. let noChanges = true;
  66465. let update = merge$2(oldMain, {
  66466. duration: newMain.duration,
  66467. minimumUpdatePeriod: newMain.minimumUpdatePeriod,
  66468. timelineStarts: newMain.timelineStarts
  66469. });
  66470. for (let i2 = 0; i2 < newMain.playlists.length; i2++) {
  66471. const playlist = newMain.playlists[i2];
  66472. if (playlist.sidx) {
  66473. const sidxKey = generateSidxKey$1(playlist.sidx);
  66474. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  66475. addSidxSegmentsToPlaylist$1$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  66476. }
  66477. }
  66478. const playlistUpdate = updateMain$1(update, playlist, dashPlaylistUnchanged$1);
  66479. if (playlistUpdate) {
  66480. update = playlistUpdate;
  66481. noChanges = false;
  66482. }
  66483. }
  66484. forEachMediaGroup$2(newMain, (properties, type2, group, label2) => {
  66485. if (properties.playlists && properties.playlists.length) {
  66486. const id = properties.playlists[0].id;
  66487. const playlistUpdate = updateMain$1(update, properties.playlists[0], dashPlaylistUnchanged$1);
  66488. if (playlistUpdate) {
  66489. update = playlistUpdate;
  66490. if (!(label2 in update.mediaGroups[type2][group])) {
  66491. update.mediaGroups[type2][group][label2] = properties;
  66492. }
  66493. update.mediaGroups[type2][group][label2].playlists[0] = update.playlists[id];
  66494. noChanges = false;
  66495. }
  66496. }
  66497. });
  66498. removeOldMediaGroupLabels$1(update, newMain);
  66499. if (newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66500. noChanges = false;
  66501. }
  66502. if (noChanges) {
  66503. return null;
  66504. }
  66505. return update;
  66506. };
  66507. const equivalentSidx$1 = (a, b) => {
  66508. const neitherMap = Boolean(!a.map && !b.map);
  66509. const equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  66510. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  66511. };
  66512. const compareSidxEntry$1 = (playlists, oldSidxMapping) => {
  66513. const newSidxMapping = {};
  66514. for (const id in playlists) {
  66515. const playlist = playlists[id];
  66516. const currentSidxInfo = playlist.sidx;
  66517. if (currentSidxInfo) {
  66518. const key = generateSidxKey$1(currentSidxInfo);
  66519. if (!oldSidxMapping[key]) {
  66520. break;
  66521. }
  66522. const savedSidxInfo = oldSidxMapping[key].sidxInfo;
  66523. if (equivalentSidx$1(savedSidxInfo, currentSidxInfo)) {
  66524. newSidxMapping[key] = oldSidxMapping[key];
  66525. }
  66526. }
  66527. }
  66528. return newSidxMapping;
  66529. };
  66530. const filterChangedSidxMappings$1 = (main, oldSidxMapping) => {
  66531. const videoSidx = compareSidxEntry$1(main.playlists, oldSidxMapping);
  66532. let mediaGroupSidx = videoSidx;
  66533. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  66534. if (properties.playlists && properties.playlists.length) {
  66535. const playlists = properties.playlists;
  66536. mediaGroupSidx = merge$2(mediaGroupSidx, compareSidxEntry$1(playlists, oldSidxMapping));
  66537. }
  66538. });
  66539. return mediaGroupSidx;
  66540. };
  66541. class DashPlaylistLoader$1 extends EventTarget$3 {
  66542. constructor(srcUrlOrPlaylist, vhs, options2 = {}, mainPlaylistLoader) {
  66543. super();
  66544. this.mainPlaylistLoader_ = mainPlaylistLoader || this;
  66545. if (!mainPlaylistLoader) {
  66546. this.isMain_ = true;
  66547. }
  66548. const {
  66549. withCredentials = false
  66550. } = options2;
  66551. this.vhs_ = vhs;
  66552. this.withCredentials = withCredentials;
  66553. if (!srcUrlOrPlaylist) {
  66554. throw new Error("A non-empty playlist URL or object is required");
  66555. }
  66556. this.on("minimumUpdatePeriod", () => {
  66557. this.refreshXml_();
  66558. });
  66559. this.on("mediaupdatetimeout", () => {
  66560. this.refreshMedia_(this.media().id);
  66561. });
  66562. this.state = "HAVE_NOTHING";
  66563. this.loadedPlaylists_ = {};
  66564. this.logger_ = logger$1("DashPlaylistLoader");
  66565. if (this.isMain_) {
  66566. this.mainPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  66567. this.mainPlaylistLoader_.sidxMapping_ = {};
  66568. } else {
  66569. this.childPlaylist_ = srcUrlOrPlaylist;
  66570. }
  66571. }
  66572. requestErrored_(err, request, startingState) {
  66573. if (!this.request) {
  66574. return true;
  66575. }
  66576. this.request = null;
  66577. if (err) {
  66578. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  66579. status: request.status,
  66580. message: "DASH request error at URL: " + request.uri,
  66581. response: request.response,
  66582. code: 2
  66583. };
  66584. if (startingState) {
  66585. this.state = startingState;
  66586. }
  66587. this.trigger("error");
  66588. return true;
  66589. }
  66590. }
  66591. addSidxSegments_(playlist, startingState, cb) {
  66592. const sidxKey = playlist.sidx && generateSidxKey$1(playlist.sidx);
  66593. if (!playlist.sidx || !sidxKey || this.mainPlaylistLoader_.sidxMapping_[sidxKey]) {
  66594. this.mediaRequest_ = window_1.setTimeout(() => cb(false), 0);
  66595. return;
  66596. }
  66597. const uri = resolveManifestRedirect$1(playlist.sidx.resolvedUri);
  66598. const fin = (err, request) => {
  66599. if (this.requestErrored_(err, request, startingState)) {
  66600. return;
  66601. }
  66602. const sidxMapping = this.mainPlaylistLoader_.sidxMapping_;
  66603. let sidx;
  66604. try {
  66605. sidx = parseSidx_1$1(toUint8$1(request.response).subarray(8));
  66606. } catch (e) {
  66607. this.requestErrored_(e, request, startingState);
  66608. return;
  66609. }
  66610. sidxMapping[sidxKey] = {
  66611. sidxInfo: playlist.sidx,
  66612. sidx
  66613. };
  66614. addSidxSegmentsToPlaylist$1$1(playlist, sidx, playlist.sidx.resolvedUri);
  66615. return cb(true);
  66616. };
  66617. this.request = containerRequest$1(uri, this.vhs_.xhr, (err, request, container, bytes) => {
  66618. if (err) {
  66619. return fin(err, request);
  66620. }
  66621. if (!container || container !== "mp4") {
  66622. return fin({
  66623. status: request.status,
  66624. message: `Unsupported ${container || "unknown"} container type for sidx segment at URL: ${uri}`,
  66625. response: "",
  66626. playlist,
  66627. internal: true,
  66628. playlistExclusionDuration: Infinity,
  66629. code: 2
  66630. }, request);
  66631. }
  66632. const {
  66633. offset,
  66634. length
  66635. } = playlist.sidx.byterange;
  66636. if (bytes.length >= length + offset) {
  66637. return fin(err, {
  66638. response: bytes.subarray(offset, offset + length),
  66639. status: request.status,
  66640. uri: request.uri
  66641. });
  66642. }
  66643. this.request = this.vhs_.xhr({
  66644. uri,
  66645. responseType: "arraybuffer",
  66646. headers: segmentXhrHeaders$1({
  66647. byterange: playlist.sidx.byterange
  66648. })
  66649. }, fin);
  66650. });
  66651. }
  66652. dispose() {
  66653. this.trigger("dispose");
  66654. this.stopRequest();
  66655. this.loadedPlaylists_ = {};
  66656. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  66657. window_1.clearTimeout(this.mediaRequest_);
  66658. window_1.clearTimeout(this.mediaUpdateTimeout);
  66659. this.mediaUpdateTimeout = null;
  66660. this.mediaRequest_ = null;
  66661. this.minimumUpdatePeriodTimeout_ = null;
  66662. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66663. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66664. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66665. }
  66666. this.off();
  66667. }
  66668. hasPendingRequest() {
  66669. return this.request || this.mediaRequest_;
  66670. }
  66671. stopRequest() {
  66672. if (this.request) {
  66673. const oldRequest = this.request;
  66674. this.request = null;
  66675. oldRequest.onreadystatechange = null;
  66676. oldRequest.abort();
  66677. }
  66678. }
  66679. media(playlist) {
  66680. if (!playlist) {
  66681. return this.media_;
  66682. }
  66683. if (this.state === "HAVE_NOTHING") {
  66684. throw new Error("Cannot switch media playlist from " + this.state);
  66685. }
  66686. const startingState = this.state;
  66687. if (typeof playlist === "string") {
  66688. if (!this.mainPlaylistLoader_.main.playlists[playlist]) {
  66689. throw new Error("Unknown playlist URI: " + playlist);
  66690. }
  66691. playlist = this.mainPlaylistLoader_.main.playlists[playlist];
  66692. }
  66693. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  66694. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  66695. this.state = "HAVE_METADATA";
  66696. this.media_ = playlist;
  66697. if (mediaChange) {
  66698. this.trigger("mediachanging");
  66699. this.trigger("mediachange");
  66700. }
  66701. return;
  66702. }
  66703. if (!mediaChange) {
  66704. return;
  66705. }
  66706. if (this.media_) {
  66707. this.trigger("mediachanging");
  66708. }
  66709. this.addSidxSegments_(playlist, startingState, (sidxChanged) => {
  66710. this.haveMetadata({
  66711. startingState,
  66712. playlist
  66713. });
  66714. });
  66715. }
  66716. haveMetadata({
  66717. startingState,
  66718. playlist
  66719. }) {
  66720. this.state = "HAVE_METADATA";
  66721. this.loadedPlaylists_[playlist.id] = playlist;
  66722. this.mediaRequest_ = null;
  66723. this.refreshMedia_(playlist.id);
  66724. if (startingState === "HAVE_MAIN_MANIFEST") {
  66725. this.trigger("loadedmetadata");
  66726. } else {
  66727. this.trigger("mediachange");
  66728. }
  66729. }
  66730. pause() {
  66731. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66732. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66733. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66734. }
  66735. this.stopRequest();
  66736. window_1.clearTimeout(this.mediaUpdateTimeout);
  66737. this.mediaUpdateTimeout = null;
  66738. if (this.isMain_) {
  66739. window_1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);
  66740. this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  66741. }
  66742. if (this.state === "HAVE_NOTHING") {
  66743. this.started = false;
  66744. }
  66745. }
  66746. load(isFinalRendition) {
  66747. window_1.clearTimeout(this.mediaUpdateTimeout);
  66748. this.mediaUpdateTimeout = null;
  66749. const media = this.media();
  66750. if (isFinalRendition) {
  66751. const delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  66752. this.mediaUpdateTimeout = window_1.setTimeout(() => this.load(), delay);
  66753. return;
  66754. }
  66755. if (!this.started) {
  66756. this.start();
  66757. return;
  66758. }
  66759. if (media && !media.endList) {
  66760. if (this.isMain_ && !this.minimumUpdatePeriodTimeout_) {
  66761. this.trigger("minimumUpdatePeriod");
  66762. this.updateMinimumUpdatePeriodTimeout_();
  66763. }
  66764. this.trigger("mediaupdatetimeout");
  66765. } else {
  66766. this.trigger("loadedplaylist");
  66767. }
  66768. }
  66769. start() {
  66770. this.started = true;
  66771. if (!this.isMain_) {
  66772. this.mediaRequest_ = window_1.setTimeout(() => this.haveMain_(), 0);
  66773. return;
  66774. }
  66775. this.requestMain_((req, mainChanged) => {
  66776. this.haveMain_();
  66777. if (!this.hasPendingRequest() && !this.media_) {
  66778. this.media(this.mainPlaylistLoader_.main.playlists[0]);
  66779. }
  66780. });
  66781. }
  66782. requestMain_(cb) {
  66783. this.request = this.vhs_.xhr({
  66784. uri: this.mainPlaylistLoader_.srcUrl,
  66785. withCredentials: this.withCredentials
  66786. }, (error, req) => {
  66787. if (this.requestErrored_(error, req)) {
  66788. if (this.state === "HAVE_NOTHING") {
  66789. this.started = false;
  66790. }
  66791. return;
  66792. }
  66793. const mainChanged = req.responseText !== this.mainPlaylistLoader_.mainXml_;
  66794. this.mainPlaylistLoader_.mainXml_ = req.responseText;
  66795. if (req.responseHeaders && req.responseHeaders.date) {
  66796. this.mainLoaded_ = Date.parse(req.responseHeaders.date);
  66797. } else {
  66798. this.mainLoaded_ = Date.now();
  66799. }
  66800. this.mainPlaylistLoader_.srcUrl = resolveManifestRedirect$1(this.mainPlaylistLoader_.srcUrl, req);
  66801. if (mainChanged) {
  66802. this.handleMain_();
  66803. this.syncClientServerClock_(() => {
  66804. return cb(req, mainChanged);
  66805. });
  66806. return;
  66807. }
  66808. return cb(req, mainChanged);
  66809. });
  66810. }
  66811. syncClientServerClock_(done) {
  66812. const utcTiming = parseUTCTiming$1(this.mainPlaylistLoader_.mainXml_);
  66813. if (utcTiming === null) {
  66814. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66815. return done();
  66816. }
  66817. if (utcTiming.method === "DIRECT") {
  66818. this.mainPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  66819. return done();
  66820. }
  66821. this.request = this.vhs_.xhr({
  66822. uri: resolveUrl$2(this.mainPlaylistLoader_.srcUrl, utcTiming.value),
  66823. method: utcTiming.method,
  66824. withCredentials: this.withCredentials
  66825. }, (error, req) => {
  66826. if (!this.request) {
  66827. return;
  66828. }
  66829. if (error) {
  66830. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66831. return done();
  66832. }
  66833. let serverTime;
  66834. if (utcTiming.method === "HEAD") {
  66835. if (!req.responseHeaders || !req.responseHeaders.date) {
  66836. serverTime = this.mainLoaded_;
  66837. } else {
  66838. serverTime = Date.parse(req.responseHeaders.date);
  66839. }
  66840. } else {
  66841. serverTime = Date.parse(req.responseText);
  66842. }
  66843. this.mainPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  66844. done();
  66845. });
  66846. }
  66847. haveMain_() {
  66848. this.state = "HAVE_MAIN_MANIFEST";
  66849. if (this.isMain_) {
  66850. this.trigger("loadedplaylist");
  66851. } else if (!this.media_) {
  66852. this.media(this.childPlaylist_);
  66853. }
  66854. }
  66855. handleMain_() {
  66856. this.mediaRequest_ = null;
  66857. const oldMain = this.mainPlaylistLoader_.main;
  66858. let newMain = parseMainXml({
  66859. mainXml: this.mainPlaylistLoader_.mainXml_,
  66860. srcUrl: this.mainPlaylistLoader_.srcUrl,
  66861. clientOffset: this.mainPlaylistLoader_.clientOffset_,
  66862. sidxMapping: this.mainPlaylistLoader_.sidxMapping_,
  66863. previousManifest: oldMain
  66864. });
  66865. if (oldMain) {
  66866. newMain = updateMain(oldMain, newMain, this.mainPlaylistLoader_.sidxMapping_);
  66867. }
  66868. this.mainPlaylistLoader_.main = newMain ? newMain : oldMain;
  66869. const location = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0];
  66870. if (location && location !== this.mainPlaylistLoader_.srcUrl) {
  66871. this.mainPlaylistLoader_.srcUrl = location;
  66872. }
  66873. if (!oldMain || newMain && newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66874. this.updateMinimumUpdatePeriodTimeout_();
  66875. }
  66876. return Boolean(newMain);
  66877. }
  66878. updateMinimumUpdatePeriodTimeout_() {
  66879. const mpl = this.mainPlaylistLoader_;
  66880. if (mpl.createMupOnMedia_) {
  66881. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  66882. mpl.createMupOnMedia_ = null;
  66883. }
  66884. if (mpl.minimumUpdatePeriodTimeout_) {
  66885. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  66886. mpl.minimumUpdatePeriodTimeout_ = null;
  66887. }
  66888. let mup = mpl.main && mpl.main.minimumUpdatePeriod;
  66889. if (mup === 0) {
  66890. if (mpl.media()) {
  66891. mup = mpl.media().targetDuration * 1e3;
  66892. } else {
  66893. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  66894. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  66895. }
  66896. }
  66897. if (typeof mup !== "number" || mup <= 0) {
  66898. if (mup < 0) {
  66899. this.logger_(`found invalid minimumUpdatePeriod of ${mup}, not setting a timeout`);
  66900. }
  66901. return;
  66902. }
  66903. this.createMUPTimeout_(mup);
  66904. }
  66905. createMUPTimeout_(mup) {
  66906. const mpl = this.mainPlaylistLoader_;
  66907. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(() => {
  66908. mpl.minimumUpdatePeriodTimeout_ = null;
  66909. mpl.trigger("minimumUpdatePeriod");
  66910. mpl.createMUPTimeout_(mup);
  66911. }, mup);
  66912. }
  66913. refreshXml_() {
  66914. this.requestMain_((req, mainChanged) => {
  66915. if (!mainChanged) {
  66916. return;
  66917. }
  66918. if (this.media_) {
  66919. this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id];
  66920. }
  66921. this.mainPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_);
  66922. this.addSidxSegments_(this.media(), this.state, (sidxChanged) => {
  66923. this.refreshMedia_(this.media().id);
  66924. });
  66925. });
  66926. }
  66927. refreshMedia_(mediaID) {
  66928. if (!mediaID) {
  66929. throw new Error("refreshMedia_ must take a media id");
  66930. }
  66931. if (this.media_ && this.isMain_) {
  66932. this.handleMain_();
  66933. }
  66934. const playlists = this.mainPlaylistLoader_.main.playlists;
  66935. const mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  66936. if (mediaChanged) {
  66937. this.media_ = playlists[mediaID];
  66938. } else {
  66939. this.trigger("playlistunchanged");
  66940. }
  66941. if (!this.mediaUpdateTimeout) {
  66942. const createMediaUpdateTimeout = () => {
  66943. if (this.media().endList) {
  66944. return;
  66945. }
  66946. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  66947. this.trigger("mediaupdatetimeout");
  66948. createMediaUpdateTimeout();
  66949. }, refreshDelay$1(this.media(), Boolean(mediaChanged)));
  66950. };
  66951. createMediaUpdateTimeout();
  66952. }
  66953. this.trigger("loadedplaylist");
  66954. }
  66955. }
  66956. var Config$1 = {
  66957. GOAL_BUFFER_LENGTH: 30,
  66958. MAX_GOAL_BUFFER_LENGTH: 60,
  66959. BACK_BUFFER_LENGTH: 30,
  66960. GOAL_BUFFER_LENGTH_RATE: 1,
  66961. INITIAL_BANDWIDTH: 4194304,
  66962. BANDWIDTH_VARIANCE: 1.2,
  66963. BUFFER_LOW_WATER_LINE: 0,
  66964. MAX_BUFFER_LOW_WATER_LINE: 30,
  66965. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  66966. BUFFER_LOW_WATER_LINE_RATE: 1,
  66967. BUFFER_HIGH_WATER_LINE: 30
  66968. };
  66969. const stringToArrayBuffer$1 = (string) => {
  66970. const view = new Uint8Array(new ArrayBuffer(string.length));
  66971. for (let i2 = 0; i2 < string.length; i2++) {
  66972. view[i2] = string.charCodeAt(i2);
  66973. }
  66974. return view.buffer;
  66975. };
  66976. const browserWorkerPolyFill$1 = function(workerObj) {
  66977. workerObj.on = workerObj.addEventListener;
  66978. workerObj.off = workerObj.removeEventListener;
  66979. return workerObj;
  66980. };
  66981. const createObjectURL$1 = function(str) {
  66982. try {
  66983. return URL.createObjectURL(new Blob([str], {
  66984. type: "application/javascript"
  66985. }));
  66986. } catch (e) {
  66987. const blob = new BlobBuilder();
  66988. blob.append(str);
  66989. return URL.createObjectURL(blob.getBlob());
  66990. }
  66991. };
  66992. const factory$1 = function(code) {
  66993. return function() {
  66994. const objectUrl = createObjectURL$1(code);
  66995. const worker = browserWorkerPolyFill$1(new Worker(objectUrl));
  66996. worker.objURL = objectUrl;
  66997. const terminate = worker.terminate;
  66998. worker.on = worker.addEventListener;
  66999. worker.off = worker.removeEventListener;
  67000. worker.terminate = function() {
  67001. URL.revokeObjectURL(objectUrl);
  67002. return terminate.call(this);
  67003. };
  67004. return worker;
  67005. };
  67006. };
  67007. const transform$1 = function(code) {
  67008. return `var browserWorkerPolyFill = ${browserWorkerPolyFill$1.toString()};
  67009. browserWorkerPolyFill(self);
  67010. ` + code;
  67011. };
  67012. const getWorkerString$1 = function(fn2) {
  67013. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  67014. };
  67015. const workerCode$1$1 = transform$1(getWorkerString$1(function() {
  67016. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  67017. var Stream$8 = function() {
  67018. this.init = function() {
  67019. var listeners = {};
  67020. this.on = function(type3, listener) {
  67021. if (!listeners[type3]) {
  67022. listeners[type3] = [];
  67023. }
  67024. listeners[type3] = listeners[type3].concat(listener);
  67025. };
  67026. this.off = function(type3, listener) {
  67027. var index2;
  67028. if (!listeners[type3]) {
  67029. return false;
  67030. }
  67031. index2 = listeners[type3].indexOf(listener);
  67032. listeners[type3] = listeners[type3].slice();
  67033. listeners[type3].splice(index2, 1);
  67034. return index2 > -1;
  67035. };
  67036. this.trigger = function(type3) {
  67037. var callbacks, i2, length, args;
  67038. callbacks = listeners[type3];
  67039. if (!callbacks) {
  67040. return;
  67041. }
  67042. if (arguments.length === 2) {
  67043. length = callbacks.length;
  67044. for (i2 = 0; i2 < length; ++i2) {
  67045. callbacks[i2].call(this, arguments[1]);
  67046. }
  67047. } else {
  67048. args = [];
  67049. i2 = arguments.length;
  67050. for (i2 = 1; i2 < arguments.length; ++i2) {
  67051. args.push(arguments[i2]);
  67052. }
  67053. length = callbacks.length;
  67054. for (i2 = 0; i2 < length; ++i2) {
  67055. callbacks[i2].apply(this, args);
  67056. }
  67057. }
  67058. };
  67059. this.dispose = function() {
  67060. listeners = {};
  67061. };
  67062. };
  67063. };
  67064. Stream$8.prototype.pipe = function(destination2) {
  67065. this.on("data", function(data) {
  67066. destination2.push(data);
  67067. });
  67068. this.on("done", function(flushSource) {
  67069. destination2.flush(flushSource);
  67070. });
  67071. this.on("partialdone", function(flushSource) {
  67072. destination2.partialFlush(flushSource);
  67073. });
  67074. this.on("endedtimeline", function(flushSource) {
  67075. destination2.endTimeline(flushSource);
  67076. });
  67077. this.on("reset", function(flushSource) {
  67078. destination2.reset(flushSource);
  67079. });
  67080. return destination2;
  67081. };
  67082. Stream$8.prototype.push = function(data) {
  67083. this.trigger("data", data);
  67084. };
  67085. Stream$8.prototype.flush = function(flushSource) {
  67086. this.trigger("done", flushSource);
  67087. };
  67088. Stream$8.prototype.partialFlush = function(flushSource) {
  67089. this.trigger("partialdone", flushSource);
  67090. };
  67091. Stream$8.prototype.endTimeline = function(flushSource) {
  67092. this.trigger("endedtimeline", flushSource);
  67093. };
  67094. Stream$8.prototype.reset = function(flushSource) {
  67095. this.trigger("reset", flushSource);
  67096. };
  67097. var stream = Stream$8;
  67098. var MAX_UINT32$12 = Math.pow(2, 32);
  67099. var getUint64$32 = function(uint8) {
  67100. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  67101. var value;
  67102. if (dv.getBigUint64) {
  67103. value = dv.getBigUint64(0);
  67104. if (value < Number.MAX_SAFE_INTEGER) {
  67105. return Number(value);
  67106. }
  67107. return value;
  67108. }
  67109. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  67110. };
  67111. var numbers2 = {
  67112. getUint64: getUint64$32,
  67113. MAX_UINT32: MAX_UINT32$12
  67114. };
  67115. var MAX_UINT322 = numbers2.MAX_UINT32;
  67116. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  67117. (function() {
  67118. var i2;
  67119. types = {
  67120. avc1: [],
  67121. avcC: [],
  67122. btrt: [],
  67123. dinf: [],
  67124. dref: [],
  67125. esds: [],
  67126. ftyp: [],
  67127. hdlr: [],
  67128. mdat: [],
  67129. mdhd: [],
  67130. mdia: [],
  67131. mfhd: [],
  67132. minf: [],
  67133. moof: [],
  67134. moov: [],
  67135. mp4a: [],
  67136. mvex: [],
  67137. mvhd: [],
  67138. pasp: [],
  67139. sdtp: [],
  67140. smhd: [],
  67141. stbl: [],
  67142. stco: [],
  67143. stsc: [],
  67144. stsd: [],
  67145. stsz: [],
  67146. stts: [],
  67147. styp: [],
  67148. tfdt: [],
  67149. tfhd: [],
  67150. traf: [],
  67151. trak: [],
  67152. trun: [],
  67153. trex: [],
  67154. tkhd: [],
  67155. vmhd: []
  67156. };
  67157. if (typeof Uint8Array === "undefined") {
  67158. return;
  67159. }
  67160. for (i2 in types) {
  67161. if (types.hasOwnProperty(i2)) {
  67162. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  67163. }
  67164. }
  67165. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  67166. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  67167. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  67168. VIDEO_HDLR = new Uint8Array([
  67169. 0,
  67170. 0,
  67171. 0,
  67172. 0,
  67173. 0,
  67174. 0,
  67175. 0,
  67176. 0,
  67177. 118,
  67178. 105,
  67179. 100,
  67180. 101,
  67181. 0,
  67182. 0,
  67183. 0,
  67184. 0,
  67185. 0,
  67186. 0,
  67187. 0,
  67188. 0,
  67189. 0,
  67190. 0,
  67191. 0,
  67192. 0,
  67193. 86,
  67194. 105,
  67195. 100,
  67196. 101,
  67197. 111,
  67198. 72,
  67199. 97,
  67200. 110,
  67201. 100,
  67202. 108,
  67203. 101,
  67204. 114,
  67205. 0
  67206. ]);
  67207. AUDIO_HDLR = new Uint8Array([
  67208. 0,
  67209. 0,
  67210. 0,
  67211. 0,
  67212. 0,
  67213. 0,
  67214. 0,
  67215. 0,
  67216. 115,
  67217. 111,
  67218. 117,
  67219. 110,
  67220. 0,
  67221. 0,
  67222. 0,
  67223. 0,
  67224. 0,
  67225. 0,
  67226. 0,
  67227. 0,
  67228. 0,
  67229. 0,
  67230. 0,
  67231. 0,
  67232. 83,
  67233. 111,
  67234. 117,
  67235. 110,
  67236. 100,
  67237. 72,
  67238. 97,
  67239. 110,
  67240. 100,
  67241. 108,
  67242. 101,
  67243. 114,
  67244. 0
  67245. ]);
  67246. HDLR_TYPES = {
  67247. video: VIDEO_HDLR,
  67248. audio: AUDIO_HDLR
  67249. };
  67250. DREF = new Uint8Array([
  67251. 0,
  67252. 0,
  67253. 0,
  67254. 0,
  67255. 0,
  67256. 0,
  67257. 0,
  67258. 1,
  67259. 0,
  67260. 0,
  67261. 0,
  67262. 12,
  67263. 117,
  67264. 114,
  67265. 108,
  67266. 32,
  67267. 0,
  67268. 0,
  67269. 0,
  67270. 1
  67271. ]);
  67272. SMHD = new Uint8Array([
  67273. 0,
  67274. 0,
  67275. 0,
  67276. 0,
  67277. 0,
  67278. 0,
  67279. 0,
  67280. 0
  67281. ]);
  67282. STCO = new Uint8Array([
  67283. 0,
  67284. 0,
  67285. 0,
  67286. 0,
  67287. 0,
  67288. 0,
  67289. 0,
  67290. 0
  67291. ]);
  67292. STSC = STCO;
  67293. STSZ = new Uint8Array([
  67294. 0,
  67295. 0,
  67296. 0,
  67297. 0,
  67298. 0,
  67299. 0,
  67300. 0,
  67301. 0,
  67302. 0,
  67303. 0,
  67304. 0,
  67305. 0
  67306. ]);
  67307. STTS = STCO;
  67308. VMHD = new Uint8Array([
  67309. 0,
  67310. 0,
  67311. 0,
  67312. 1,
  67313. 0,
  67314. 0,
  67315. 0,
  67316. 0,
  67317. 0,
  67318. 0,
  67319. 0,
  67320. 0
  67321. ]);
  67322. })();
  67323. box = function(type3) {
  67324. var payload = [], size = 0, i2, result, view;
  67325. for (i2 = 1; i2 < arguments.length; i2++) {
  67326. payload.push(arguments[i2]);
  67327. }
  67328. i2 = payload.length;
  67329. while (i2--) {
  67330. size += payload[i2].byteLength;
  67331. }
  67332. result = new Uint8Array(size + 8);
  67333. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  67334. view.setUint32(0, result.byteLength);
  67335. result.set(type3, 4);
  67336. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  67337. result.set(payload[i2], size);
  67338. size += payload[i2].byteLength;
  67339. }
  67340. return result;
  67341. };
  67342. dinf = function() {
  67343. return box(types.dinf, box(types.dref, DREF));
  67344. };
  67345. esds = function(track) {
  67346. return box(types.esds, new Uint8Array([
  67347. 0,
  67348. 0,
  67349. 0,
  67350. 0,
  67351. 3,
  67352. 25,
  67353. 0,
  67354. 0,
  67355. 0,
  67356. 4,
  67357. 17,
  67358. 64,
  67359. 21,
  67360. 0,
  67361. 6,
  67362. 0,
  67363. 0,
  67364. 0,
  67365. 218,
  67366. 192,
  67367. 0,
  67368. 0,
  67369. 218,
  67370. 192,
  67371. 5,
  67372. 2,
  67373. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  67374. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  67375. 6,
  67376. 1,
  67377. 2
  67378. ]));
  67379. };
  67380. ftyp = function() {
  67381. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  67382. };
  67383. hdlr = function(type3) {
  67384. return box(types.hdlr, HDLR_TYPES[type3]);
  67385. };
  67386. mdat = function(data) {
  67387. return box(types.mdat, data);
  67388. };
  67389. mdhd = function(track) {
  67390. var result = new Uint8Array([
  67391. 0,
  67392. 0,
  67393. 0,
  67394. 0,
  67395. 0,
  67396. 0,
  67397. 0,
  67398. 2,
  67399. 0,
  67400. 0,
  67401. 0,
  67402. 3,
  67403. 0,
  67404. 1,
  67405. 95,
  67406. 144,
  67407. track.duration >>> 24 & 255,
  67408. track.duration >>> 16 & 255,
  67409. track.duration >>> 8 & 255,
  67410. track.duration & 255,
  67411. 85,
  67412. 196,
  67413. 0,
  67414. 0
  67415. ]);
  67416. if (track.samplerate) {
  67417. result[12] = track.samplerate >>> 24 & 255;
  67418. result[13] = track.samplerate >>> 16 & 255;
  67419. result[14] = track.samplerate >>> 8 & 255;
  67420. result[15] = track.samplerate & 255;
  67421. }
  67422. return box(types.mdhd, result);
  67423. };
  67424. mdia = function(track) {
  67425. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  67426. };
  67427. mfhd = function(sequenceNumber) {
  67428. return box(types.mfhd, new Uint8Array([
  67429. 0,
  67430. 0,
  67431. 0,
  67432. 0,
  67433. (sequenceNumber & 4278190080) >> 24,
  67434. (sequenceNumber & 16711680) >> 16,
  67435. (sequenceNumber & 65280) >> 8,
  67436. sequenceNumber & 255
  67437. ]));
  67438. };
  67439. minf = function(track) {
  67440. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  67441. };
  67442. moof = function(sequenceNumber, tracks) {
  67443. var trackFragments = [], i2 = tracks.length;
  67444. while (i2--) {
  67445. trackFragments[i2] = traf(tracks[i2]);
  67446. }
  67447. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  67448. };
  67449. moov = function(tracks) {
  67450. var i2 = tracks.length, boxes = [];
  67451. while (i2--) {
  67452. boxes[i2] = trak(tracks[i2]);
  67453. }
  67454. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  67455. };
  67456. mvex = function(tracks) {
  67457. var i2 = tracks.length, boxes = [];
  67458. while (i2--) {
  67459. boxes[i2] = trex(tracks[i2]);
  67460. }
  67461. return box.apply(null, [types.mvex].concat(boxes));
  67462. };
  67463. mvhd = function(duration5) {
  67464. var bytes = new Uint8Array([
  67465. 0,
  67466. 0,
  67467. 0,
  67468. 0,
  67469. 0,
  67470. 0,
  67471. 0,
  67472. 1,
  67473. 0,
  67474. 0,
  67475. 0,
  67476. 2,
  67477. 0,
  67478. 1,
  67479. 95,
  67480. 144,
  67481. (duration5 & 4278190080) >> 24,
  67482. (duration5 & 16711680) >> 16,
  67483. (duration5 & 65280) >> 8,
  67484. duration5 & 255,
  67485. 0,
  67486. 1,
  67487. 0,
  67488. 0,
  67489. 1,
  67490. 0,
  67491. 0,
  67492. 0,
  67493. 0,
  67494. 0,
  67495. 0,
  67496. 0,
  67497. 0,
  67498. 0,
  67499. 0,
  67500. 0,
  67501. 0,
  67502. 1,
  67503. 0,
  67504. 0,
  67505. 0,
  67506. 0,
  67507. 0,
  67508. 0,
  67509. 0,
  67510. 0,
  67511. 0,
  67512. 0,
  67513. 0,
  67514. 0,
  67515. 0,
  67516. 0,
  67517. 0,
  67518. 1,
  67519. 0,
  67520. 0,
  67521. 0,
  67522. 0,
  67523. 0,
  67524. 0,
  67525. 0,
  67526. 0,
  67527. 0,
  67528. 0,
  67529. 0,
  67530. 0,
  67531. 0,
  67532. 0,
  67533. 64,
  67534. 0,
  67535. 0,
  67536. 0,
  67537. 0,
  67538. 0,
  67539. 0,
  67540. 0,
  67541. 0,
  67542. 0,
  67543. 0,
  67544. 0,
  67545. 0,
  67546. 0,
  67547. 0,
  67548. 0,
  67549. 0,
  67550. 0,
  67551. 0,
  67552. 0,
  67553. 0,
  67554. 0,
  67555. 0,
  67556. 0,
  67557. 0,
  67558. 0,
  67559. 0,
  67560. 0,
  67561. 255,
  67562. 255,
  67563. 255,
  67564. 255
  67565. ]);
  67566. return box(types.mvhd, bytes);
  67567. };
  67568. sdtp = function(track) {
  67569. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  67570. for (i2 = 0; i2 < samples.length; i2++) {
  67571. flags = samples[i2].flags;
  67572. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  67573. }
  67574. return box(types.sdtp, bytes);
  67575. };
  67576. stbl = function(track) {
  67577. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  67578. };
  67579. (function() {
  67580. var videoSample, audioSample;
  67581. stsd = function(track) {
  67582. return box(types.stsd, new Uint8Array([
  67583. 0,
  67584. 0,
  67585. 0,
  67586. 0,
  67587. 0,
  67588. 0,
  67589. 0,
  67590. 1
  67591. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  67592. };
  67593. videoSample = function(track) {
  67594. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  67595. for (i2 = 0; i2 < sps.length; i2++) {
  67596. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  67597. sequenceParameterSets.push(sps[i2].byteLength & 255);
  67598. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  67599. }
  67600. for (i2 = 0; i2 < pps.length; i2++) {
  67601. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  67602. pictureParameterSets.push(pps[i2].byteLength & 255);
  67603. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  67604. }
  67605. avc1Box = [types.avc1, new Uint8Array([
  67606. 0,
  67607. 0,
  67608. 0,
  67609. 0,
  67610. 0,
  67611. 0,
  67612. 0,
  67613. 1,
  67614. 0,
  67615. 0,
  67616. 0,
  67617. 0,
  67618. 0,
  67619. 0,
  67620. 0,
  67621. 0,
  67622. 0,
  67623. 0,
  67624. 0,
  67625. 0,
  67626. 0,
  67627. 0,
  67628. 0,
  67629. 0,
  67630. (track.width & 65280) >> 8,
  67631. track.width & 255,
  67632. (track.height & 65280) >> 8,
  67633. track.height & 255,
  67634. 0,
  67635. 72,
  67636. 0,
  67637. 0,
  67638. 0,
  67639. 72,
  67640. 0,
  67641. 0,
  67642. 0,
  67643. 0,
  67644. 0,
  67645. 0,
  67646. 0,
  67647. 1,
  67648. 19,
  67649. 118,
  67650. 105,
  67651. 100,
  67652. 101,
  67653. 111,
  67654. 106,
  67655. 115,
  67656. 45,
  67657. 99,
  67658. 111,
  67659. 110,
  67660. 116,
  67661. 114,
  67662. 105,
  67663. 98,
  67664. 45,
  67665. 104,
  67666. 108,
  67667. 115,
  67668. 0,
  67669. 0,
  67670. 0,
  67671. 0,
  67672. 0,
  67673. 0,
  67674. 0,
  67675. 0,
  67676. 0,
  67677. 0,
  67678. 0,
  67679. 0,
  67680. 0,
  67681. 24,
  67682. 17,
  67683. 17
  67684. ]), box(types.avcC, new Uint8Array([
  67685. 1,
  67686. track.profileIdc,
  67687. track.profileCompatibility,
  67688. track.levelIdc,
  67689. 255
  67690. ].concat(
  67691. [sps.length],
  67692. sequenceParameterSets,
  67693. [pps.length],
  67694. pictureParameterSets
  67695. ))), box(types.btrt, new Uint8Array([
  67696. 0,
  67697. 28,
  67698. 156,
  67699. 128,
  67700. 0,
  67701. 45,
  67702. 198,
  67703. 192,
  67704. 0,
  67705. 45,
  67706. 198,
  67707. 192
  67708. ]))];
  67709. if (track.sarRatio) {
  67710. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  67711. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  67712. }
  67713. return box.apply(null, avc1Box);
  67714. };
  67715. audioSample = function(track) {
  67716. return box(types.mp4a, new Uint8Array([
  67717. 0,
  67718. 0,
  67719. 0,
  67720. 0,
  67721. 0,
  67722. 0,
  67723. 0,
  67724. 1,
  67725. 0,
  67726. 0,
  67727. 0,
  67728. 0,
  67729. 0,
  67730. 0,
  67731. 0,
  67732. 0,
  67733. (track.channelcount & 65280) >> 8,
  67734. track.channelcount & 255,
  67735. (track.samplesize & 65280) >> 8,
  67736. track.samplesize & 255,
  67737. 0,
  67738. 0,
  67739. 0,
  67740. 0,
  67741. (track.samplerate & 65280) >> 8,
  67742. track.samplerate & 255,
  67743. 0,
  67744. 0
  67745. ]), esds(track));
  67746. };
  67747. })();
  67748. tkhd = function(track) {
  67749. var result = new Uint8Array([
  67750. 0,
  67751. 0,
  67752. 0,
  67753. 7,
  67754. 0,
  67755. 0,
  67756. 0,
  67757. 0,
  67758. 0,
  67759. 0,
  67760. 0,
  67761. 0,
  67762. (track.id & 4278190080) >> 24,
  67763. (track.id & 16711680) >> 16,
  67764. (track.id & 65280) >> 8,
  67765. track.id & 255,
  67766. 0,
  67767. 0,
  67768. 0,
  67769. 0,
  67770. (track.duration & 4278190080) >> 24,
  67771. (track.duration & 16711680) >> 16,
  67772. (track.duration & 65280) >> 8,
  67773. track.duration & 255,
  67774. 0,
  67775. 0,
  67776. 0,
  67777. 0,
  67778. 0,
  67779. 0,
  67780. 0,
  67781. 0,
  67782. 0,
  67783. 0,
  67784. 0,
  67785. 0,
  67786. 1,
  67787. 0,
  67788. 0,
  67789. 0,
  67790. 0,
  67791. 1,
  67792. 0,
  67793. 0,
  67794. 0,
  67795. 0,
  67796. 0,
  67797. 0,
  67798. 0,
  67799. 0,
  67800. 0,
  67801. 0,
  67802. 0,
  67803. 0,
  67804. 0,
  67805. 0,
  67806. 0,
  67807. 1,
  67808. 0,
  67809. 0,
  67810. 0,
  67811. 0,
  67812. 0,
  67813. 0,
  67814. 0,
  67815. 0,
  67816. 0,
  67817. 0,
  67818. 0,
  67819. 0,
  67820. 0,
  67821. 0,
  67822. 64,
  67823. 0,
  67824. 0,
  67825. 0,
  67826. (track.width & 65280) >> 8,
  67827. track.width & 255,
  67828. 0,
  67829. 0,
  67830. (track.height & 65280) >> 8,
  67831. track.height & 255,
  67832. 0,
  67833. 0
  67834. ]);
  67835. return box(types.tkhd, result);
  67836. };
  67837. traf = function(track) {
  67838. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  67839. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  67840. 0,
  67841. 0,
  67842. 0,
  67843. 58,
  67844. (track.id & 4278190080) >> 24,
  67845. (track.id & 16711680) >> 16,
  67846. (track.id & 65280) >> 8,
  67847. track.id & 255,
  67848. 0,
  67849. 0,
  67850. 0,
  67851. 1,
  67852. 0,
  67853. 0,
  67854. 0,
  67855. 0,
  67856. 0,
  67857. 0,
  67858. 0,
  67859. 0,
  67860. 0,
  67861. 0,
  67862. 0,
  67863. 0
  67864. ]));
  67865. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  67866. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  67867. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  67868. 1,
  67869. 0,
  67870. 0,
  67871. 0,
  67872. upperWordBaseMediaDecodeTime >>> 24 & 255,
  67873. upperWordBaseMediaDecodeTime >>> 16 & 255,
  67874. upperWordBaseMediaDecodeTime >>> 8 & 255,
  67875. upperWordBaseMediaDecodeTime & 255,
  67876. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  67877. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  67878. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  67879. lowerWordBaseMediaDecodeTime & 255
  67880. ]));
  67881. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  67882. if (track.type === "audio") {
  67883. trackFragmentRun = trun$1(track, dataOffset);
  67884. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  67885. }
  67886. sampleDependencyTable = sdtp(track);
  67887. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  67888. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  67889. };
  67890. trak = function(track) {
  67891. track.duration = track.duration || 4294967295;
  67892. return box(types.trak, tkhd(track), mdia(track));
  67893. };
  67894. trex = function(track) {
  67895. var result = new Uint8Array([
  67896. 0,
  67897. 0,
  67898. 0,
  67899. 0,
  67900. (track.id & 4278190080) >> 24,
  67901. (track.id & 16711680) >> 16,
  67902. (track.id & 65280) >> 8,
  67903. track.id & 255,
  67904. 0,
  67905. 0,
  67906. 0,
  67907. 1,
  67908. 0,
  67909. 0,
  67910. 0,
  67911. 0,
  67912. 0,
  67913. 0,
  67914. 0,
  67915. 0,
  67916. 0,
  67917. 1,
  67918. 0,
  67919. 1
  67920. ]);
  67921. if (track.type !== "video") {
  67922. result[result.length - 1] = 0;
  67923. }
  67924. return box(types.trex, result);
  67925. };
  67926. (function() {
  67927. var audioTrun, videoTrun, trunHeader;
  67928. trunHeader = function(samples, offset) {
  67929. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  67930. if (samples.length) {
  67931. if (samples[0].duration !== void 0) {
  67932. durationPresent = 1;
  67933. }
  67934. if (samples[0].size !== void 0) {
  67935. sizePresent = 2;
  67936. }
  67937. if (samples[0].flags !== void 0) {
  67938. flagsPresent = 4;
  67939. }
  67940. if (samples[0].compositionTimeOffset !== void 0) {
  67941. compositionTimeOffset = 8;
  67942. }
  67943. }
  67944. return [
  67945. 0,
  67946. 0,
  67947. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  67948. 1,
  67949. (samples.length & 4278190080) >>> 24,
  67950. (samples.length & 16711680) >>> 16,
  67951. (samples.length & 65280) >>> 8,
  67952. samples.length & 255,
  67953. (offset & 4278190080) >>> 24,
  67954. (offset & 16711680) >>> 16,
  67955. (offset & 65280) >>> 8,
  67956. offset & 255
  67957. ];
  67958. };
  67959. videoTrun = function(track, offset) {
  67960. var bytesOffest, bytes, header, samples, sample, i2;
  67961. samples = track.samples || [];
  67962. offset += 8 + 12 + 16 * samples.length;
  67963. header = trunHeader(samples, offset);
  67964. bytes = new Uint8Array(header.length + samples.length * 16);
  67965. bytes.set(header);
  67966. bytesOffest = header.length;
  67967. for (i2 = 0; i2 < samples.length; i2++) {
  67968. sample = samples[i2];
  67969. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67970. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  67971. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  67972. bytes[bytesOffest++] = sample.duration & 255;
  67973. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  67974. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  67975. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  67976. bytes[bytesOffest++] = sample.size & 255;
  67977. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  67978. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  67979. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  67980. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  67981. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  67982. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  67983. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  67984. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  67985. }
  67986. return box(types.trun, bytes);
  67987. };
  67988. audioTrun = function(track, offset) {
  67989. var bytes, bytesOffest, header, samples, sample, i2;
  67990. samples = track.samples || [];
  67991. offset += 8 + 12 + 8 * samples.length;
  67992. header = trunHeader(samples, offset);
  67993. bytes = new Uint8Array(header.length + samples.length * 8);
  67994. bytes.set(header);
  67995. bytesOffest = header.length;
  67996. for (i2 = 0; i2 < samples.length; i2++) {
  67997. sample = samples[i2];
  67998. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67999. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  68000. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  68001. bytes[bytesOffest++] = sample.duration & 255;
  68002. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  68003. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  68004. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  68005. bytes[bytesOffest++] = sample.size & 255;
  68006. }
  68007. return box(types.trun, bytes);
  68008. };
  68009. trun$1 = function(track, offset) {
  68010. if (track.type === "audio") {
  68011. return audioTrun(track, offset);
  68012. }
  68013. return videoTrun(track, offset);
  68014. };
  68015. })();
  68016. var mp4Generator = {
  68017. ftyp,
  68018. mdat,
  68019. moof,
  68020. moov,
  68021. initSegment: function(tracks) {
  68022. var fileType = ftyp(), movie = moov(tracks), result;
  68023. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  68024. result.set(fileType);
  68025. result.set(movie, fileType.byteLength);
  68026. return result;
  68027. }
  68028. };
  68029. var groupNalsIntoFrames = function(nalUnits) {
  68030. var i2, currentNal, currentFrame = [], frames = [];
  68031. frames.byteLength = 0;
  68032. frames.nalCount = 0;
  68033. frames.duration = 0;
  68034. currentFrame.byteLength = 0;
  68035. for (i2 = 0; i2 < nalUnits.length; i2++) {
  68036. currentNal = nalUnits[i2];
  68037. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  68038. if (currentFrame.length) {
  68039. currentFrame.duration = currentNal.dts - currentFrame.dts;
  68040. frames.byteLength += currentFrame.byteLength;
  68041. frames.nalCount += currentFrame.length;
  68042. frames.duration += currentFrame.duration;
  68043. frames.push(currentFrame);
  68044. }
  68045. currentFrame = [currentNal];
  68046. currentFrame.byteLength = currentNal.data.byteLength;
  68047. currentFrame.pts = currentNal.pts;
  68048. currentFrame.dts = currentNal.dts;
  68049. } else {
  68050. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  68051. currentFrame.keyFrame = true;
  68052. }
  68053. currentFrame.duration = currentNal.dts - currentFrame.dts;
  68054. currentFrame.byteLength += currentNal.data.byteLength;
  68055. currentFrame.push(currentNal);
  68056. }
  68057. }
  68058. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  68059. currentFrame.duration = frames[frames.length - 1].duration;
  68060. }
  68061. frames.byteLength += currentFrame.byteLength;
  68062. frames.nalCount += currentFrame.length;
  68063. frames.duration += currentFrame.duration;
  68064. frames.push(currentFrame);
  68065. return frames;
  68066. };
  68067. var groupFramesIntoGops = function(frames) {
  68068. var i2, currentFrame, currentGop = [], gops = [];
  68069. currentGop.byteLength = 0;
  68070. currentGop.nalCount = 0;
  68071. currentGop.duration = 0;
  68072. currentGop.pts = frames[0].pts;
  68073. currentGop.dts = frames[0].dts;
  68074. gops.byteLength = 0;
  68075. gops.nalCount = 0;
  68076. gops.duration = 0;
  68077. gops.pts = frames[0].pts;
  68078. gops.dts = frames[0].dts;
  68079. for (i2 = 0; i2 < frames.length; i2++) {
  68080. currentFrame = frames[i2];
  68081. if (currentFrame.keyFrame) {
  68082. if (currentGop.length) {
  68083. gops.push(currentGop);
  68084. gops.byteLength += currentGop.byteLength;
  68085. gops.nalCount += currentGop.nalCount;
  68086. gops.duration += currentGop.duration;
  68087. }
  68088. currentGop = [currentFrame];
  68089. currentGop.nalCount = currentFrame.length;
  68090. currentGop.byteLength = currentFrame.byteLength;
  68091. currentGop.pts = currentFrame.pts;
  68092. currentGop.dts = currentFrame.dts;
  68093. currentGop.duration = currentFrame.duration;
  68094. } else {
  68095. currentGop.duration += currentFrame.duration;
  68096. currentGop.nalCount += currentFrame.length;
  68097. currentGop.byteLength += currentFrame.byteLength;
  68098. currentGop.push(currentFrame);
  68099. }
  68100. }
  68101. if (gops.length && currentGop.duration <= 0) {
  68102. currentGop.duration = gops[gops.length - 1].duration;
  68103. }
  68104. gops.byteLength += currentGop.byteLength;
  68105. gops.nalCount += currentGop.nalCount;
  68106. gops.duration += currentGop.duration;
  68107. gops.push(currentGop);
  68108. return gops;
  68109. };
  68110. var extendFirstKeyFrame = function(gops) {
  68111. var currentGop;
  68112. if (!gops[0][0].keyFrame && gops.length > 1) {
  68113. currentGop = gops.shift();
  68114. gops.byteLength -= currentGop.byteLength;
  68115. gops.nalCount -= currentGop.nalCount;
  68116. gops[0][0].dts = currentGop.dts;
  68117. gops[0][0].pts = currentGop.pts;
  68118. gops[0][0].duration += currentGop.duration;
  68119. }
  68120. return gops;
  68121. };
  68122. var createDefaultSample = function() {
  68123. return {
  68124. size: 0,
  68125. flags: {
  68126. isLeading: 0,
  68127. dependsOn: 1,
  68128. isDependedOn: 0,
  68129. hasRedundancy: 0,
  68130. degradationPriority: 0,
  68131. isNonSyncSample: 1
  68132. }
  68133. };
  68134. };
  68135. var sampleForFrame = function(frame, dataOffset) {
  68136. var sample = createDefaultSample();
  68137. sample.dataOffset = dataOffset;
  68138. sample.compositionTimeOffset = frame.pts - frame.dts;
  68139. sample.duration = frame.duration;
  68140. sample.size = 4 * frame.length;
  68141. sample.size += frame.byteLength;
  68142. if (frame.keyFrame) {
  68143. sample.flags.dependsOn = 2;
  68144. sample.flags.isNonSyncSample = 0;
  68145. }
  68146. return sample;
  68147. };
  68148. var generateSampleTable$1 = function(gops, baseDataOffset) {
  68149. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  68150. for (h2 = 0; h2 < gops.length; h2++) {
  68151. currentGop = gops[h2];
  68152. for (i2 = 0; i2 < currentGop.length; i2++) {
  68153. currentFrame = currentGop[i2];
  68154. sample = sampleForFrame(currentFrame, dataOffset);
  68155. dataOffset += sample.size;
  68156. samples.push(sample);
  68157. }
  68158. }
  68159. return samples;
  68160. };
  68161. var concatenateNalData = function(gops) {
  68162. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68163. for (h2 = 0; h2 < gops.length; h2++) {
  68164. currentGop = gops[h2];
  68165. for (i2 = 0; i2 < currentGop.length; i2++) {
  68166. currentFrame = currentGop[i2];
  68167. for (j = 0; j < currentFrame.length; j++) {
  68168. currentNal = currentFrame[j];
  68169. view.setUint32(dataOffset, currentNal.data.byteLength);
  68170. dataOffset += 4;
  68171. data.set(currentNal.data, dataOffset);
  68172. dataOffset += currentNal.data.byteLength;
  68173. }
  68174. }
  68175. }
  68176. return data;
  68177. };
  68178. var generateSampleTableForFrame = function(frame, baseDataOffset) {
  68179. var sample, dataOffset = baseDataOffset || 0, samples = [];
  68180. sample = sampleForFrame(frame, dataOffset);
  68181. samples.push(sample);
  68182. return samples;
  68183. };
  68184. var concatenateNalDataForFrame = function(frame) {
  68185. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68186. for (i2 = 0; i2 < frame.length; i2++) {
  68187. currentNal = frame[i2];
  68188. view.setUint32(dataOffset, currentNal.data.byteLength);
  68189. dataOffset += 4;
  68190. data.set(currentNal.data, dataOffset);
  68191. dataOffset += currentNal.data.byteLength;
  68192. }
  68193. return data;
  68194. };
  68195. var frameUtils$1 = {
  68196. groupNalsIntoFrames,
  68197. groupFramesIntoGops,
  68198. extendFirstKeyFrame,
  68199. generateSampleTable: generateSampleTable$1,
  68200. concatenateNalData,
  68201. generateSampleTableForFrame,
  68202. concatenateNalDataForFrame
  68203. };
  68204. var highPrefix = [33, 16, 5, 32, 164, 27];
  68205. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  68206. var zeroFill = function(count) {
  68207. var a = [];
  68208. while (count--) {
  68209. a.push(0);
  68210. }
  68211. return a;
  68212. };
  68213. var makeTable = function(metaTable) {
  68214. return Object.keys(metaTable).reduce(function(obj, key) {
  68215. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  68216. return arr.concat(part);
  68217. }, []));
  68218. return obj;
  68219. }, {});
  68220. };
  68221. var silence;
  68222. var silence_1 = function() {
  68223. if (!silence) {
  68224. var coneOfSilence2 = {
  68225. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  68226. 88200: [highPrefix, [231], zeroFill(170), [56]],
  68227. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  68228. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  68229. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  68230. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  68231. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  68232. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  68233. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  68234. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  68235. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  68236. };
  68237. silence = makeTable(coneOfSilence2);
  68238. }
  68239. return silence;
  68240. };
  68241. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  68242. secondsToVideoTs2 = function(seconds) {
  68243. return seconds * ONE_SECOND_IN_TS$4;
  68244. };
  68245. secondsToAudioTs2 = function(seconds, sampleRate) {
  68246. return seconds * sampleRate;
  68247. };
  68248. videoTsToSeconds2 = function(timestamp) {
  68249. return timestamp / ONE_SECOND_IN_TS$4;
  68250. };
  68251. audioTsToSeconds2 = function(timestamp, sampleRate) {
  68252. return timestamp / sampleRate;
  68253. };
  68254. audioTsToVideoTs2 = function(timestamp, sampleRate) {
  68255. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  68256. };
  68257. videoTsToAudioTs2 = function(timestamp, sampleRate) {
  68258. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  68259. };
  68260. metadataTsToSeconds2 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  68261. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  68262. };
  68263. var clock$2 = {
  68264. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  68265. secondsToVideoTs: secondsToVideoTs2,
  68266. secondsToAudioTs: secondsToAudioTs2,
  68267. videoTsToSeconds: videoTsToSeconds2,
  68268. audioTsToSeconds: audioTsToSeconds2,
  68269. audioTsToVideoTs: audioTsToVideoTs2,
  68270. videoTsToAudioTs: videoTsToAudioTs2,
  68271. metadataTsToSeconds: metadataTsToSeconds2
  68272. };
  68273. var coneOfSilence = silence_1;
  68274. var clock$12 = clock$2;
  68275. var sumFrameByteLengths = function(array) {
  68276. var i2, currentObj, sum = 0;
  68277. for (i2 = 0; i2 < array.length; i2++) {
  68278. currentObj = array[i2];
  68279. sum += currentObj.data.byteLength;
  68280. }
  68281. return sum;
  68282. };
  68283. var prefixWithSilence = function(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  68284. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  68285. if (!frames.length) {
  68286. return;
  68287. }
  68288. baseMediaDecodeTimeTs = clock$12.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  68289. frameDuration = Math.ceil(clock$12.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  68290. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  68291. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  68292. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  68293. audioFillDuration = audioFillFrameCount * frameDuration;
  68294. }
  68295. if (audioFillFrameCount < 1 || audioFillDuration > clock$12.ONE_SECOND_IN_TS / 2) {
  68296. return;
  68297. }
  68298. silentFrame = coneOfSilence()[track.samplerate];
  68299. if (!silentFrame) {
  68300. silentFrame = frames[0].data;
  68301. }
  68302. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  68303. firstFrame = frames[0];
  68304. frames.splice(0, 0, {
  68305. data: silentFrame,
  68306. dts: firstFrame.dts - frameDuration,
  68307. pts: firstFrame.pts - frameDuration
  68308. });
  68309. }
  68310. track.baseMediaDecodeTime -= Math.floor(clock$12.videoTsToAudioTs(audioFillDuration, track.samplerate));
  68311. return audioFillDuration;
  68312. };
  68313. var trimAdtsFramesByEarliestDts = function(adtsFrames, track, earliestAllowedDts) {
  68314. if (track.minSegmentDts >= earliestAllowedDts) {
  68315. return adtsFrames;
  68316. }
  68317. track.minSegmentDts = Infinity;
  68318. return adtsFrames.filter(function(currentFrame) {
  68319. if (currentFrame.dts >= earliestAllowedDts) {
  68320. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  68321. track.minSegmentPts = track.minSegmentDts;
  68322. return true;
  68323. }
  68324. return false;
  68325. });
  68326. };
  68327. var generateSampleTable = function(frames) {
  68328. var i2, currentFrame, samples = [];
  68329. for (i2 = 0; i2 < frames.length; i2++) {
  68330. currentFrame = frames[i2];
  68331. samples.push({
  68332. size: currentFrame.data.byteLength,
  68333. duration: 1024
  68334. });
  68335. }
  68336. return samples;
  68337. };
  68338. var concatenateFrameData = function(frames) {
  68339. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  68340. for (i2 = 0; i2 < frames.length; i2++) {
  68341. currentFrame = frames[i2];
  68342. data.set(currentFrame.data, dataOffset);
  68343. dataOffset += currentFrame.data.byteLength;
  68344. }
  68345. return data;
  68346. };
  68347. var audioFrameUtils$1 = {
  68348. prefixWithSilence,
  68349. trimAdtsFramesByEarliestDts,
  68350. generateSampleTable,
  68351. concatenateFrameData
  68352. };
  68353. var ONE_SECOND_IN_TS$3 = clock$2.ONE_SECOND_IN_TS;
  68354. var collectDtsInfo = function(track, data) {
  68355. if (typeof data.pts === "number") {
  68356. if (track.timelineStartInfo.pts === void 0) {
  68357. track.timelineStartInfo.pts = data.pts;
  68358. }
  68359. if (track.minSegmentPts === void 0) {
  68360. track.minSegmentPts = data.pts;
  68361. } else {
  68362. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  68363. }
  68364. if (track.maxSegmentPts === void 0) {
  68365. track.maxSegmentPts = data.pts;
  68366. } else {
  68367. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  68368. }
  68369. }
  68370. if (typeof data.dts === "number") {
  68371. if (track.timelineStartInfo.dts === void 0) {
  68372. track.timelineStartInfo.dts = data.dts;
  68373. }
  68374. if (track.minSegmentDts === void 0) {
  68375. track.minSegmentDts = data.dts;
  68376. } else {
  68377. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  68378. }
  68379. if (track.maxSegmentDts === void 0) {
  68380. track.maxSegmentDts = data.dts;
  68381. } else {
  68382. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  68383. }
  68384. }
  68385. };
  68386. var clearDtsInfo = function(track) {
  68387. delete track.minSegmentDts;
  68388. delete track.maxSegmentDts;
  68389. delete track.minSegmentPts;
  68390. delete track.maxSegmentPts;
  68391. };
  68392. var calculateTrackBaseMediaDecodeTime = function(track, keepOriginalTimestamps) {
  68393. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  68394. if (!keepOriginalTimestamps) {
  68395. minSegmentDts -= track.timelineStartInfo.dts;
  68396. }
  68397. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  68398. baseMediaDecodeTime += minSegmentDts;
  68399. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  68400. if (track.type === "audio") {
  68401. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  68402. baseMediaDecodeTime *= scale;
  68403. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  68404. }
  68405. return baseMediaDecodeTime;
  68406. };
  68407. var trackDecodeInfo$1 = {
  68408. clearDtsInfo,
  68409. calculateTrackBaseMediaDecodeTime,
  68410. collectDtsInfo
  68411. };
  68412. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  68413. var parseSei = function(bytes) {
  68414. var i2 = 0, result = {
  68415. payloadType: -1,
  68416. payloadSize: 0
  68417. }, payloadType = 0, payloadSize = 0;
  68418. while (i2 < bytes.byteLength) {
  68419. if (bytes[i2] === RBSP_TRAILING_BITS) {
  68420. break;
  68421. }
  68422. while (bytes[i2] === 255) {
  68423. payloadType += 255;
  68424. i2++;
  68425. }
  68426. payloadType += bytes[i2++];
  68427. while (bytes[i2] === 255) {
  68428. payloadSize += 255;
  68429. i2++;
  68430. }
  68431. payloadSize += bytes[i2++];
  68432. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  68433. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  68434. if (userIdentifier === "GA94") {
  68435. result.payloadType = payloadType;
  68436. result.payloadSize = payloadSize;
  68437. result.payload = bytes.subarray(i2, i2 + payloadSize);
  68438. break;
  68439. } else {
  68440. result.payload = void 0;
  68441. }
  68442. }
  68443. i2 += payloadSize;
  68444. payloadType = 0;
  68445. payloadSize = 0;
  68446. }
  68447. return result;
  68448. };
  68449. var parseUserData = function(sei) {
  68450. if (sei.payload[0] !== 181) {
  68451. return null;
  68452. }
  68453. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  68454. return null;
  68455. }
  68456. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  68457. return null;
  68458. }
  68459. if (sei.payload[7] !== 3) {
  68460. return null;
  68461. }
  68462. return sei.payload.subarray(8, sei.payload.length - 1);
  68463. };
  68464. var parseCaptionPackets = function(pts, userData) {
  68465. var results = [], i2, count, offset, data;
  68466. if (!(userData[0] & 64)) {
  68467. return results;
  68468. }
  68469. count = userData[0] & 31;
  68470. for (i2 = 0; i2 < count; i2++) {
  68471. offset = i2 * 3;
  68472. data = {
  68473. type: userData[offset + 2] & 3,
  68474. pts
  68475. };
  68476. if (userData[offset + 2] & 4) {
  68477. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  68478. results.push(data);
  68479. }
  68480. }
  68481. return results;
  68482. };
  68483. var discardEmulationPreventionBytes$12 = function(data) {
  68484. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  68485. while (i2 < length - 2) {
  68486. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  68487. emulationPreventionBytesPositions.push(i2 + 2);
  68488. i2 += 2;
  68489. } else {
  68490. i2++;
  68491. }
  68492. }
  68493. if (emulationPreventionBytesPositions.length === 0) {
  68494. return data;
  68495. }
  68496. newLength = length - emulationPreventionBytesPositions.length;
  68497. newData = new Uint8Array(newLength);
  68498. var sourceIndex = 0;
  68499. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  68500. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  68501. sourceIndex++;
  68502. emulationPreventionBytesPositions.shift();
  68503. }
  68504. newData[i2] = data[sourceIndex];
  68505. }
  68506. return newData;
  68507. };
  68508. var captionPacketParser = {
  68509. parseSei,
  68510. parseUserData,
  68511. parseCaptionPackets,
  68512. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  68513. USER_DATA_REGISTERED_ITU_T_T35
  68514. };
  68515. var Stream$7 = stream;
  68516. var cea708Parser = captionPacketParser;
  68517. var CaptionStream$2 = function(options2) {
  68518. options2 = options2 || {};
  68519. CaptionStream$2.prototype.init.call(this);
  68520. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  68521. this.captionPackets_ = [];
  68522. this.ccStreams_ = [
  68523. new Cea608Stream(0, 0),
  68524. new Cea608Stream(0, 1),
  68525. new Cea608Stream(1, 0),
  68526. new Cea608Stream(1, 1)
  68527. ];
  68528. if (this.parse708captions_) {
  68529. this.cc708Stream_ = new Cea708Stream({
  68530. captionServices: options2.captionServices
  68531. });
  68532. }
  68533. this.reset();
  68534. this.ccStreams_.forEach(function(cc) {
  68535. cc.on("data", this.trigger.bind(this, "data"));
  68536. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  68537. cc.on("done", this.trigger.bind(this, "done"));
  68538. }, this);
  68539. if (this.parse708captions_) {
  68540. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  68541. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  68542. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  68543. }
  68544. };
  68545. CaptionStream$2.prototype = new Stream$7();
  68546. CaptionStream$2.prototype.push = function(event2) {
  68547. var sei, userData, newCaptionPackets;
  68548. if (event2.nalUnitType !== "sei_rbsp") {
  68549. return;
  68550. }
  68551. sei = cea708Parser.parseSei(event2.escapedRBSP);
  68552. if (!sei.payload) {
  68553. return;
  68554. }
  68555. if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {
  68556. return;
  68557. }
  68558. userData = cea708Parser.parseUserData(sei);
  68559. if (!userData) {
  68560. return;
  68561. }
  68562. if (event2.dts < this.latestDts_) {
  68563. this.ignoreNextEqualDts_ = true;
  68564. return;
  68565. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  68566. this.numSameDts_--;
  68567. if (!this.numSameDts_) {
  68568. this.ignoreNextEqualDts_ = false;
  68569. }
  68570. return;
  68571. }
  68572. newCaptionPackets = cea708Parser.parseCaptionPackets(event2.pts, userData);
  68573. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  68574. if (this.latestDts_ !== event2.dts) {
  68575. this.numSameDts_ = 0;
  68576. }
  68577. this.numSameDts_++;
  68578. this.latestDts_ = event2.dts;
  68579. };
  68580. CaptionStream$2.prototype.flushCCStreams = function(flushType) {
  68581. this.ccStreams_.forEach(function(cc) {
  68582. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  68583. }, this);
  68584. };
  68585. CaptionStream$2.prototype.flushStream = function(flushType) {
  68586. if (!this.captionPackets_.length) {
  68587. this.flushCCStreams(flushType);
  68588. return;
  68589. }
  68590. this.captionPackets_.forEach(function(elem, idx) {
  68591. elem.presortIndex = idx;
  68592. });
  68593. this.captionPackets_.sort(function(a, b) {
  68594. if (a.pts === b.pts) {
  68595. return a.presortIndex - b.presortIndex;
  68596. }
  68597. return a.pts - b.pts;
  68598. });
  68599. this.captionPackets_.forEach(function(packet) {
  68600. if (packet.type < 2) {
  68601. this.dispatchCea608Packet(packet);
  68602. } else {
  68603. this.dispatchCea708Packet(packet);
  68604. }
  68605. }, this);
  68606. this.captionPackets_.length = 0;
  68607. this.flushCCStreams(flushType);
  68608. };
  68609. CaptionStream$2.prototype.flush = function() {
  68610. return this.flushStream("flush");
  68611. };
  68612. CaptionStream$2.prototype.partialFlush = function() {
  68613. return this.flushStream("partialFlush");
  68614. };
  68615. CaptionStream$2.prototype.reset = function() {
  68616. this.latestDts_ = null;
  68617. this.ignoreNextEqualDts_ = false;
  68618. this.numSameDts_ = 0;
  68619. this.activeCea608Channel_ = [null, null];
  68620. this.ccStreams_.forEach(function(ccStream) {
  68621. ccStream.reset();
  68622. });
  68623. };
  68624. CaptionStream$2.prototype.dispatchCea608Packet = function(packet) {
  68625. if (this.setsTextOrXDSActive(packet)) {
  68626. this.activeCea608Channel_[packet.type] = null;
  68627. } else if (this.setsChannel1Active(packet)) {
  68628. this.activeCea608Channel_[packet.type] = 0;
  68629. } else if (this.setsChannel2Active(packet)) {
  68630. this.activeCea608Channel_[packet.type] = 1;
  68631. }
  68632. if (this.activeCea608Channel_[packet.type] === null) {
  68633. return;
  68634. }
  68635. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  68636. };
  68637. CaptionStream$2.prototype.setsChannel1Active = function(packet) {
  68638. return (packet.ccData & 30720) === 4096;
  68639. };
  68640. CaptionStream$2.prototype.setsChannel2Active = function(packet) {
  68641. return (packet.ccData & 30720) === 6144;
  68642. };
  68643. CaptionStream$2.prototype.setsTextOrXDSActive = function(packet) {
  68644. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  68645. };
  68646. CaptionStream$2.prototype.dispatchCea708Packet = function(packet) {
  68647. if (this.parse708captions_) {
  68648. this.cc708Stream_.push(packet);
  68649. }
  68650. };
  68651. var CHARACTER_TRANSLATION_708 = {
  68652. 127: 9834,
  68653. 4128: 32,
  68654. 4129: 160,
  68655. 4133: 8230,
  68656. 4138: 352,
  68657. 4140: 338,
  68658. 4144: 9608,
  68659. 4145: 8216,
  68660. 4146: 8217,
  68661. 4147: 8220,
  68662. 4148: 8221,
  68663. 4149: 8226,
  68664. 4153: 8482,
  68665. 4154: 353,
  68666. 4156: 339,
  68667. 4157: 8480,
  68668. 4159: 376,
  68669. 4214: 8539,
  68670. 4215: 8540,
  68671. 4216: 8541,
  68672. 4217: 8542,
  68673. 4218: 9168,
  68674. 4219: 9124,
  68675. 4220: 9123,
  68676. 4221: 9135,
  68677. 4222: 9126,
  68678. 4223: 9121,
  68679. 4256: 12600
  68680. };
  68681. var get708CharFromCode = function(code) {
  68682. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  68683. if (code & 4096 && code === newCode) {
  68684. return "";
  68685. }
  68686. return String.fromCharCode(newCode);
  68687. };
  68688. var within708TextBlock = function(b) {
  68689. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  68690. };
  68691. var Cea708Window = function(windowNum) {
  68692. this.windowNum = windowNum;
  68693. this.reset();
  68694. };
  68695. Cea708Window.prototype.reset = function() {
  68696. this.clearText();
  68697. this.pendingNewLine = false;
  68698. this.winAttr = {};
  68699. this.penAttr = {};
  68700. this.penLoc = {};
  68701. this.penColor = {};
  68702. this.visible = 0;
  68703. this.rowLock = 0;
  68704. this.columnLock = 0;
  68705. this.priority = 0;
  68706. this.relativePositioning = 0;
  68707. this.anchorVertical = 0;
  68708. this.anchorHorizontal = 0;
  68709. this.anchorPoint = 0;
  68710. this.rowCount = 1;
  68711. this.virtualRowCount = this.rowCount + 1;
  68712. this.columnCount = 41;
  68713. this.windowStyle = 0;
  68714. this.penStyle = 0;
  68715. };
  68716. Cea708Window.prototype.getText = function() {
  68717. return this.rows.join("\n");
  68718. };
  68719. Cea708Window.prototype.clearText = function() {
  68720. this.rows = [""];
  68721. this.rowIdx = 0;
  68722. };
  68723. Cea708Window.prototype.newLine = function(pts) {
  68724. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  68725. this.beforeRowOverflow(pts);
  68726. }
  68727. if (this.rows.length > 0) {
  68728. this.rows.push("");
  68729. this.rowIdx++;
  68730. }
  68731. while (this.rows.length > this.virtualRowCount) {
  68732. this.rows.shift();
  68733. this.rowIdx--;
  68734. }
  68735. };
  68736. Cea708Window.prototype.isEmpty = function() {
  68737. if (this.rows.length === 0) {
  68738. return true;
  68739. } else if (this.rows.length === 1) {
  68740. return this.rows[0] === "";
  68741. }
  68742. return false;
  68743. };
  68744. Cea708Window.prototype.addText = function(text) {
  68745. this.rows[this.rowIdx] += text;
  68746. };
  68747. Cea708Window.prototype.backspace = function() {
  68748. if (!this.isEmpty()) {
  68749. var row = this.rows[this.rowIdx];
  68750. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  68751. }
  68752. };
  68753. var Cea708Service = function(serviceNum, encoding, stream2) {
  68754. this.serviceNum = serviceNum;
  68755. this.text = "";
  68756. this.currentWindow = new Cea708Window(-1);
  68757. this.windows = [];
  68758. this.stream = stream2;
  68759. if (typeof encoding === "string") {
  68760. this.createTextDecoder(encoding);
  68761. }
  68762. };
  68763. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  68764. this.startPts = pts;
  68765. for (var win3 = 0; win3 < 8; win3++) {
  68766. this.windows[win3] = new Cea708Window(win3);
  68767. if (typeof beforeRowOverflow === "function") {
  68768. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  68769. }
  68770. }
  68771. };
  68772. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  68773. this.currentWindow = this.windows[windowNum];
  68774. };
  68775. Cea708Service.prototype.createTextDecoder = function(encoding) {
  68776. if (typeof TextDecoder === "undefined") {
  68777. this.stream.trigger("log", {
  68778. level: "warn",
  68779. message: "The `encoding` option is unsupported without TextDecoder support"
  68780. });
  68781. } else {
  68782. try {
  68783. this.textDecoder_ = new TextDecoder(encoding);
  68784. } catch (error) {
  68785. this.stream.trigger("log", {
  68786. level: "warn",
  68787. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  68788. });
  68789. }
  68790. }
  68791. };
  68792. var Cea708Stream = function(options2) {
  68793. options2 = options2 || {};
  68794. Cea708Stream.prototype.init.call(this);
  68795. var self2 = this;
  68796. var captionServices = options2.captionServices || {};
  68797. var captionServiceEncodings = {};
  68798. var serviceProps;
  68799. Object.keys(captionServices).forEach((serviceName) => {
  68800. serviceProps = captionServices[serviceName];
  68801. if (/^SERVICE/.test(serviceName)) {
  68802. captionServiceEncodings[serviceName] = serviceProps.encoding;
  68803. }
  68804. });
  68805. this.serviceEncodings = captionServiceEncodings;
  68806. this.current708Packet = null;
  68807. this.services = {};
  68808. this.push = function(packet) {
  68809. if (packet.type === 3) {
  68810. self2.new708Packet();
  68811. self2.add708Bytes(packet);
  68812. } else {
  68813. if (self2.current708Packet === null) {
  68814. self2.new708Packet();
  68815. }
  68816. self2.add708Bytes(packet);
  68817. }
  68818. };
  68819. };
  68820. Cea708Stream.prototype = new Stream$7();
  68821. Cea708Stream.prototype.new708Packet = function() {
  68822. if (this.current708Packet !== null) {
  68823. this.push708Packet();
  68824. }
  68825. this.current708Packet = {
  68826. data: [],
  68827. ptsVals: []
  68828. };
  68829. };
  68830. Cea708Stream.prototype.add708Bytes = function(packet) {
  68831. var data = packet.ccData;
  68832. var byte0 = data >>> 8;
  68833. var byte1 = data & 255;
  68834. this.current708Packet.ptsVals.push(packet.pts);
  68835. this.current708Packet.data.push(byte0);
  68836. this.current708Packet.data.push(byte1);
  68837. };
  68838. Cea708Stream.prototype.push708Packet = function() {
  68839. var packet708 = this.current708Packet;
  68840. var packetData = packet708.data;
  68841. var serviceNum = null;
  68842. var blockSize = null;
  68843. var i2 = 0;
  68844. var b = packetData[i2++];
  68845. packet708.seq = b >> 6;
  68846. packet708.sizeCode = b & 63;
  68847. for (; i2 < packetData.length; i2++) {
  68848. b = packetData[i2++];
  68849. serviceNum = b >> 5;
  68850. blockSize = b & 31;
  68851. if (serviceNum === 7 && blockSize > 0) {
  68852. b = packetData[i2++];
  68853. serviceNum = b;
  68854. }
  68855. this.pushServiceBlock(serviceNum, i2, blockSize);
  68856. if (blockSize > 0) {
  68857. i2 += blockSize - 1;
  68858. }
  68859. }
  68860. };
  68861. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  68862. var b;
  68863. var i2 = start2;
  68864. var packetData = this.current708Packet.data;
  68865. var service = this.services[serviceNum];
  68866. if (!service) {
  68867. service = this.initService(serviceNum, i2);
  68868. }
  68869. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  68870. b = packetData[i2];
  68871. if (within708TextBlock(b)) {
  68872. i2 = this.handleText(i2, service);
  68873. } else if (b === 24) {
  68874. i2 = this.multiByteCharacter(i2, service);
  68875. } else if (b === 16) {
  68876. i2 = this.extendedCommands(i2, service);
  68877. } else if (128 <= b && b <= 135) {
  68878. i2 = this.setCurrentWindow(i2, service);
  68879. } else if (152 <= b && b <= 159) {
  68880. i2 = this.defineWindow(i2, service);
  68881. } else if (b === 136) {
  68882. i2 = this.clearWindows(i2, service);
  68883. } else if (b === 140) {
  68884. i2 = this.deleteWindows(i2, service);
  68885. } else if (b === 137) {
  68886. i2 = this.displayWindows(i2, service);
  68887. } else if (b === 138) {
  68888. i2 = this.hideWindows(i2, service);
  68889. } else if (b === 139) {
  68890. i2 = this.toggleWindows(i2, service);
  68891. } else if (b === 151) {
  68892. i2 = this.setWindowAttributes(i2, service);
  68893. } else if (b === 144) {
  68894. i2 = this.setPenAttributes(i2, service);
  68895. } else if (b === 145) {
  68896. i2 = this.setPenColor(i2, service);
  68897. } else if (b === 146) {
  68898. i2 = this.setPenLocation(i2, service);
  68899. } else if (b === 143) {
  68900. service = this.reset(i2, service);
  68901. } else if (b === 8) {
  68902. service.currentWindow.backspace();
  68903. } else if (b === 12) {
  68904. service.currentWindow.clearText();
  68905. } else if (b === 13) {
  68906. service.currentWindow.pendingNewLine = true;
  68907. } else if (b === 14) {
  68908. service.currentWindow.clearText();
  68909. } else if (b === 141) {
  68910. i2++;
  68911. } else
  68912. ;
  68913. }
  68914. };
  68915. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  68916. var packetData = this.current708Packet.data;
  68917. var b = packetData[++i2];
  68918. if (within708TextBlock(b)) {
  68919. i2 = this.handleText(i2, service, {
  68920. isExtended: true
  68921. });
  68922. }
  68923. return i2;
  68924. };
  68925. Cea708Stream.prototype.getPts = function(byteIndex) {
  68926. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  68927. };
  68928. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  68929. var serviceName = "SERVICE" + serviceNum;
  68930. var self2 = this;
  68931. var serviceName;
  68932. var encoding;
  68933. if (serviceName in this.serviceEncodings) {
  68934. encoding = this.serviceEncodings[serviceName];
  68935. }
  68936. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  68937. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  68938. self2.flushDisplayed(pts, self2.services[serviceNum]);
  68939. });
  68940. return this.services[serviceNum];
  68941. };
  68942. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  68943. var isExtended = options2 && options2.isExtended;
  68944. var isMultiByte = options2 && options2.isMultiByte;
  68945. var packetData = this.current708Packet.data;
  68946. var extended = isExtended ? 4096 : 0;
  68947. var currentByte = packetData[i2];
  68948. var nextByte = packetData[i2 + 1];
  68949. var win3 = service.currentWindow;
  68950. var char;
  68951. var charCodeArray;
  68952. if (service.textDecoder_ && !isExtended) {
  68953. if (isMultiByte) {
  68954. charCodeArray = [currentByte, nextByte];
  68955. i2++;
  68956. } else {
  68957. charCodeArray = [currentByte];
  68958. }
  68959. char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  68960. } else {
  68961. char = get708CharFromCode(extended | currentByte);
  68962. }
  68963. if (win3.pendingNewLine && !win3.isEmpty()) {
  68964. win3.newLine(this.getPts(i2));
  68965. }
  68966. win3.pendingNewLine = false;
  68967. win3.addText(char);
  68968. return i2;
  68969. };
  68970. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  68971. var packetData = this.current708Packet.data;
  68972. var firstByte = packetData[i2 + 1];
  68973. var secondByte = packetData[i2 + 2];
  68974. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  68975. i2 = this.handleText(++i2, service, {
  68976. isMultiByte: true
  68977. });
  68978. }
  68979. return i2;
  68980. };
  68981. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  68982. var packetData = this.current708Packet.data;
  68983. var b = packetData[i2];
  68984. var windowNum = b & 7;
  68985. service.setCurrentWindow(windowNum);
  68986. return i2;
  68987. };
  68988. Cea708Stream.prototype.defineWindow = function(i2, service) {
  68989. var packetData = this.current708Packet.data;
  68990. var b = packetData[i2];
  68991. var windowNum = b & 7;
  68992. service.setCurrentWindow(windowNum);
  68993. var win3 = service.currentWindow;
  68994. b = packetData[++i2];
  68995. win3.visible = (b & 32) >> 5;
  68996. win3.rowLock = (b & 16) >> 4;
  68997. win3.columnLock = (b & 8) >> 3;
  68998. win3.priority = b & 7;
  68999. b = packetData[++i2];
  69000. win3.relativePositioning = (b & 128) >> 7;
  69001. win3.anchorVertical = b & 127;
  69002. b = packetData[++i2];
  69003. win3.anchorHorizontal = b;
  69004. b = packetData[++i2];
  69005. win3.anchorPoint = (b & 240) >> 4;
  69006. win3.rowCount = b & 15;
  69007. b = packetData[++i2];
  69008. win3.columnCount = b & 63;
  69009. b = packetData[++i2];
  69010. win3.windowStyle = (b & 56) >> 3;
  69011. win3.penStyle = b & 7;
  69012. win3.virtualRowCount = win3.rowCount + 1;
  69013. return i2;
  69014. };
  69015. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  69016. var packetData = this.current708Packet.data;
  69017. var b = packetData[i2];
  69018. var winAttr = service.currentWindow.winAttr;
  69019. b = packetData[++i2];
  69020. winAttr.fillOpacity = (b & 192) >> 6;
  69021. winAttr.fillRed = (b & 48) >> 4;
  69022. winAttr.fillGreen = (b & 12) >> 2;
  69023. winAttr.fillBlue = b & 3;
  69024. b = packetData[++i2];
  69025. winAttr.borderType = (b & 192) >> 6;
  69026. winAttr.borderRed = (b & 48) >> 4;
  69027. winAttr.borderGreen = (b & 12) >> 2;
  69028. winAttr.borderBlue = b & 3;
  69029. b = packetData[++i2];
  69030. winAttr.borderType += (b & 128) >> 5;
  69031. winAttr.wordWrap = (b & 64) >> 6;
  69032. winAttr.printDirection = (b & 48) >> 4;
  69033. winAttr.scrollDirection = (b & 12) >> 2;
  69034. winAttr.justify = b & 3;
  69035. b = packetData[++i2];
  69036. winAttr.effectSpeed = (b & 240) >> 4;
  69037. winAttr.effectDirection = (b & 12) >> 2;
  69038. winAttr.displayEffect = b & 3;
  69039. return i2;
  69040. };
  69041. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  69042. var displayedText = [];
  69043. for (var winId = 0; winId < 8; winId++) {
  69044. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  69045. displayedText.push(service.windows[winId].getText());
  69046. }
  69047. }
  69048. service.endPts = pts;
  69049. service.text = displayedText.join("\n\n");
  69050. this.pushCaption(service);
  69051. service.startPts = pts;
  69052. };
  69053. Cea708Stream.prototype.pushCaption = function(service) {
  69054. if (service.text !== "") {
  69055. this.trigger("data", {
  69056. startPts: service.startPts,
  69057. endPts: service.endPts,
  69058. text: service.text,
  69059. stream: "cc708_" + service.serviceNum
  69060. });
  69061. service.text = "";
  69062. service.startPts = service.endPts;
  69063. }
  69064. };
  69065. Cea708Stream.prototype.displayWindows = function(i2, service) {
  69066. var packetData = this.current708Packet.data;
  69067. var b = packetData[++i2];
  69068. var pts = this.getPts(i2);
  69069. this.flushDisplayed(pts, service);
  69070. for (var winId = 0; winId < 8; winId++) {
  69071. if (b & 1 << winId) {
  69072. service.windows[winId].visible = 1;
  69073. }
  69074. }
  69075. return i2;
  69076. };
  69077. Cea708Stream.prototype.hideWindows = function(i2, service) {
  69078. var packetData = this.current708Packet.data;
  69079. var b = packetData[++i2];
  69080. var pts = this.getPts(i2);
  69081. this.flushDisplayed(pts, service);
  69082. for (var winId = 0; winId < 8; winId++) {
  69083. if (b & 1 << winId) {
  69084. service.windows[winId].visible = 0;
  69085. }
  69086. }
  69087. return i2;
  69088. };
  69089. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  69090. var packetData = this.current708Packet.data;
  69091. var b = packetData[++i2];
  69092. var pts = this.getPts(i2);
  69093. this.flushDisplayed(pts, service);
  69094. for (var winId = 0; winId < 8; winId++) {
  69095. if (b & 1 << winId) {
  69096. service.windows[winId].visible ^= 1;
  69097. }
  69098. }
  69099. return i2;
  69100. };
  69101. Cea708Stream.prototype.clearWindows = function(i2, service) {
  69102. var packetData = this.current708Packet.data;
  69103. var b = packetData[++i2];
  69104. var pts = this.getPts(i2);
  69105. this.flushDisplayed(pts, service);
  69106. for (var winId = 0; winId < 8; winId++) {
  69107. if (b & 1 << winId) {
  69108. service.windows[winId].clearText();
  69109. }
  69110. }
  69111. return i2;
  69112. };
  69113. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  69114. var packetData = this.current708Packet.data;
  69115. var b = packetData[++i2];
  69116. var pts = this.getPts(i2);
  69117. this.flushDisplayed(pts, service);
  69118. for (var winId = 0; winId < 8; winId++) {
  69119. if (b & 1 << winId) {
  69120. service.windows[winId].reset();
  69121. }
  69122. }
  69123. return i2;
  69124. };
  69125. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  69126. var packetData = this.current708Packet.data;
  69127. var b = packetData[i2];
  69128. var penAttr = service.currentWindow.penAttr;
  69129. b = packetData[++i2];
  69130. penAttr.textTag = (b & 240) >> 4;
  69131. penAttr.offset = (b & 12) >> 2;
  69132. penAttr.penSize = b & 3;
  69133. b = packetData[++i2];
  69134. penAttr.italics = (b & 128) >> 7;
  69135. penAttr.underline = (b & 64) >> 6;
  69136. penAttr.edgeType = (b & 56) >> 3;
  69137. penAttr.fontStyle = b & 7;
  69138. return i2;
  69139. };
  69140. Cea708Stream.prototype.setPenColor = function(i2, service) {
  69141. var packetData = this.current708Packet.data;
  69142. var b = packetData[i2];
  69143. var penColor = service.currentWindow.penColor;
  69144. b = packetData[++i2];
  69145. penColor.fgOpacity = (b & 192) >> 6;
  69146. penColor.fgRed = (b & 48) >> 4;
  69147. penColor.fgGreen = (b & 12) >> 2;
  69148. penColor.fgBlue = b & 3;
  69149. b = packetData[++i2];
  69150. penColor.bgOpacity = (b & 192) >> 6;
  69151. penColor.bgRed = (b & 48) >> 4;
  69152. penColor.bgGreen = (b & 12) >> 2;
  69153. penColor.bgBlue = b & 3;
  69154. b = packetData[++i2];
  69155. penColor.edgeRed = (b & 48) >> 4;
  69156. penColor.edgeGreen = (b & 12) >> 2;
  69157. penColor.edgeBlue = b & 3;
  69158. return i2;
  69159. };
  69160. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  69161. var packetData = this.current708Packet.data;
  69162. var b = packetData[i2];
  69163. var penLoc = service.currentWindow.penLoc;
  69164. service.currentWindow.pendingNewLine = true;
  69165. b = packetData[++i2];
  69166. penLoc.row = b & 15;
  69167. b = packetData[++i2];
  69168. penLoc.column = b & 63;
  69169. return i2;
  69170. };
  69171. Cea708Stream.prototype.reset = function(i2, service) {
  69172. var pts = this.getPts(i2);
  69173. this.flushDisplayed(pts, service);
  69174. return this.initService(service.serviceNum, i2);
  69175. };
  69176. var CHARACTER_TRANSLATION = {
  69177. 42: 225,
  69178. 92: 233,
  69179. 94: 237,
  69180. 95: 243,
  69181. 96: 250,
  69182. 123: 231,
  69183. 124: 247,
  69184. 125: 209,
  69185. 126: 241,
  69186. 127: 9608,
  69187. 304: 174,
  69188. 305: 176,
  69189. 306: 189,
  69190. 307: 191,
  69191. 308: 8482,
  69192. 309: 162,
  69193. 310: 163,
  69194. 311: 9834,
  69195. 312: 224,
  69196. 313: 160,
  69197. 314: 232,
  69198. 315: 226,
  69199. 316: 234,
  69200. 317: 238,
  69201. 318: 244,
  69202. 319: 251,
  69203. 544: 193,
  69204. 545: 201,
  69205. 546: 211,
  69206. 547: 218,
  69207. 548: 220,
  69208. 549: 252,
  69209. 550: 8216,
  69210. 551: 161,
  69211. 552: 42,
  69212. 553: 39,
  69213. 554: 8212,
  69214. 555: 169,
  69215. 556: 8480,
  69216. 557: 8226,
  69217. 558: 8220,
  69218. 559: 8221,
  69219. 560: 192,
  69220. 561: 194,
  69221. 562: 199,
  69222. 563: 200,
  69223. 564: 202,
  69224. 565: 203,
  69225. 566: 235,
  69226. 567: 206,
  69227. 568: 207,
  69228. 569: 239,
  69229. 570: 212,
  69230. 571: 217,
  69231. 572: 249,
  69232. 573: 219,
  69233. 574: 171,
  69234. 575: 187,
  69235. 800: 195,
  69236. 801: 227,
  69237. 802: 205,
  69238. 803: 204,
  69239. 804: 236,
  69240. 805: 210,
  69241. 806: 242,
  69242. 807: 213,
  69243. 808: 245,
  69244. 809: 123,
  69245. 810: 125,
  69246. 811: 92,
  69247. 812: 94,
  69248. 813: 95,
  69249. 814: 124,
  69250. 815: 126,
  69251. 816: 196,
  69252. 817: 228,
  69253. 818: 214,
  69254. 819: 246,
  69255. 820: 223,
  69256. 821: 165,
  69257. 822: 164,
  69258. 823: 9474,
  69259. 824: 197,
  69260. 825: 229,
  69261. 826: 216,
  69262. 827: 248,
  69263. 828: 9484,
  69264. 829: 9488,
  69265. 830: 9492,
  69266. 831: 9496
  69267. };
  69268. var getCharFromCode = function(code) {
  69269. if (code === null) {
  69270. return "";
  69271. }
  69272. code = CHARACTER_TRANSLATION[code] || code;
  69273. return String.fromCharCode(code);
  69274. };
  69275. var BOTTOM_ROW = 14;
  69276. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  69277. var createDisplayBuffer = function() {
  69278. var result = [], i2 = BOTTOM_ROW + 1;
  69279. while (i2--) {
  69280. result.push("");
  69281. }
  69282. return result;
  69283. };
  69284. var Cea608Stream = function(field, dataChannel) {
  69285. Cea608Stream.prototype.init.call(this);
  69286. this.field_ = field || 0;
  69287. this.dataChannel_ = dataChannel || 0;
  69288. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  69289. this.setConstants();
  69290. this.reset();
  69291. this.push = function(packet) {
  69292. var data, swap, char0, char1, text;
  69293. data = packet.ccData & 32639;
  69294. if (data === this.lastControlCode_) {
  69295. this.lastControlCode_ = null;
  69296. return;
  69297. }
  69298. if ((data & 61440) === 4096) {
  69299. this.lastControlCode_ = data;
  69300. } else if (data !== this.PADDING_) {
  69301. this.lastControlCode_ = null;
  69302. }
  69303. char0 = data >>> 8;
  69304. char1 = data & 255;
  69305. if (data === this.PADDING_) {
  69306. return;
  69307. } else if (data === this.RESUME_CAPTION_LOADING_) {
  69308. this.mode_ = "popOn";
  69309. } else if (data === this.END_OF_CAPTION_) {
  69310. this.mode_ = "popOn";
  69311. this.clearFormatting(packet.pts);
  69312. this.flushDisplayed(packet.pts);
  69313. swap = this.displayed_;
  69314. this.displayed_ = this.nonDisplayed_;
  69315. this.nonDisplayed_ = swap;
  69316. this.startPts_ = packet.pts;
  69317. } else if (data === this.ROLL_UP_2_ROWS_) {
  69318. this.rollUpRows_ = 2;
  69319. this.setRollUp(packet.pts);
  69320. } else if (data === this.ROLL_UP_3_ROWS_) {
  69321. this.rollUpRows_ = 3;
  69322. this.setRollUp(packet.pts);
  69323. } else if (data === this.ROLL_UP_4_ROWS_) {
  69324. this.rollUpRows_ = 4;
  69325. this.setRollUp(packet.pts);
  69326. } else if (data === this.CARRIAGE_RETURN_) {
  69327. this.clearFormatting(packet.pts);
  69328. this.flushDisplayed(packet.pts);
  69329. this.shiftRowsUp_();
  69330. this.startPts_ = packet.pts;
  69331. } else if (data === this.BACKSPACE_) {
  69332. if (this.mode_ === "popOn") {
  69333. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69334. } else {
  69335. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69336. }
  69337. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  69338. this.flushDisplayed(packet.pts);
  69339. this.displayed_ = createDisplayBuffer();
  69340. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  69341. this.nonDisplayed_ = createDisplayBuffer();
  69342. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  69343. if (this.mode_ !== "paintOn") {
  69344. this.flushDisplayed(packet.pts);
  69345. this.displayed_ = createDisplayBuffer();
  69346. }
  69347. this.mode_ = "paintOn";
  69348. this.startPts_ = packet.pts;
  69349. } else if (this.isSpecialCharacter(char0, char1)) {
  69350. char0 = (char0 & 3) << 8;
  69351. text = getCharFromCode(char0 | char1);
  69352. this[this.mode_](packet.pts, text);
  69353. this.column_++;
  69354. } else if (this.isExtCharacter(char0, char1)) {
  69355. if (this.mode_ === "popOn") {
  69356. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69357. } else {
  69358. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69359. }
  69360. char0 = (char0 & 3) << 8;
  69361. text = getCharFromCode(char0 | char1);
  69362. this[this.mode_](packet.pts, text);
  69363. this.column_++;
  69364. } else if (this.isMidRowCode(char0, char1)) {
  69365. this.clearFormatting(packet.pts);
  69366. this[this.mode_](packet.pts, " ");
  69367. this.column_++;
  69368. if ((char1 & 14) === 14) {
  69369. this.addFormatting(packet.pts, ["i"]);
  69370. }
  69371. if ((char1 & 1) === 1) {
  69372. this.addFormatting(packet.pts, ["u"]);
  69373. }
  69374. } else if (this.isOffsetControlCode(char0, char1)) {
  69375. this.column_ += char1 & 3;
  69376. } else if (this.isPAC(char0, char1)) {
  69377. var row = ROWS.indexOf(data & 7968);
  69378. if (this.mode_ === "rollUp") {
  69379. if (row - this.rollUpRows_ + 1 < 0) {
  69380. row = this.rollUpRows_ - 1;
  69381. }
  69382. this.setRollUp(packet.pts, row);
  69383. }
  69384. if (row !== this.row_) {
  69385. this.clearFormatting(packet.pts);
  69386. this.row_ = row;
  69387. }
  69388. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  69389. this.addFormatting(packet.pts, ["u"]);
  69390. }
  69391. if ((data & 16) === 16) {
  69392. this.column_ = ((data & 14) >> 1) * 4;
  69393. }
  69394. if (this.isColorPAC(char1)) {
  69395. if ((char1 & 14) === 14) {
  69396. this.addFormatting(packet.pts, ["i"]);
  69397. }
  69398. }
  69399. } else if (this.isNormalChar(char0)) {
  69400. if (char1 === 0) {
  69401. char1 = null;
  69402. }
  69403. text = getCharFromCode(char0);
  69404. text += getCharFromCode(char1);
  69405. this[this.mode_](packet.pts, text);
  69406. this.column_ += text.length;
  69407. }
  69408. };
  69409. };
  69410. Cea608Stream.prototype = new Stream$7();
  69411. Cea608Stream.prototype.flushDisplayed = function(pts) {
  69412. var content = this.displayed_.map(function(row, index2) {
  69413. try {
  69414. return row.trim();
  69415. } catch (e) {
  69416. this.trigger("log", {
  69417. level: "warn",
  69418. message: "Skipping a malformed 608 caption at index " + index2 + "."
  69419. });
  69420. return "";
  69421. }
  69422. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  69423. if (content.length) {
  69424. this.trigger("data", {
  69425. startPts: this.startPts_,
  69426. endPts: pts,
  69427. text: content,
  69428. stream: this.name_
  69429. });
  69430. }
  69431. };
  69432. Cea608Stream.prototype.reset = function() {
  69433. this.mode_ = "popOn";
  69434. this.topRow_ = 0;
  69435. this.startPts_ = 0;
  69436. this.displayed_ = createDisplayBuffer();
  69437. this.nonDisplayed_ = createDisplayBuffer();
  69438. this.lastControlCode_ = null;
  69439. this.column_ = 0;
  69440. this.row_ = BOTTOM_ROW;
  69441. this.rollUpRows_ = 2;
  69442. this.formatting_ = [];
  69443. };
  69444. Cea608Stream.prototype.setConstants = function() {
  69445. if (this.dataChannel_ === 0) {
  69446. this.BASE_ = 16;
  69447. this.EXT_ = 17;
  69448. this.CONTROL_ = (20 | this.field_) << 8;
  69449. this.OFFSET_ = 23;
  69450. } else if (this.dataChannel_ === 1) {
  69451. this.BASE_ = 24;
  69452. this.EXT_ = 25;
  69453. this.CONTROL_ = (28 | this.field_) << 8;
  69454. this.OFFSET_ = 31;
  69455. }
  69456. this.PADDING_ = 0;
  69457. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  69458. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  69459. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  69460. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  69461. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  69462. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  69463. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  69464. this.BACKSPACE_ = this.CONTROL_ | 33;
  69465. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  69466. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  69467. };
  69468. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  69469. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  69470. };
  69471. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  69472. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  69473. };
  69474. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  69475. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  69476. };
  69477. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  69478. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  69479. };
  69480. Cea608Stream.prototype.isPAC = function(char0, char1) {
  69481. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  69482. };
  69483. Cea608Stream.prototype.isColorPAC = function(char1) {
  69484. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  69485. };
  69486. Cea608Stream.prototype.isNormalChar = function(char) {
  69487. return char >= 32 && char <= 127;
  69488. };
  69489. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  69490. if (this.mode_ !== "rollUp") {
  69491. this.row_ = BOTTOM_ROW;
  69492. this.mode_ = "rollUp";
  69493. this.flushDisplayed(pts);
  69494. this.nonDisplayed_ = createDisplayBuffer();
  69495. this.displayed_ = createDisplayBuffer();
  69496. }
  69497. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  69498. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  69499. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  69500. this.displayed_[this.row_ - i2] = "";
  69501. }
  69502. }
  69503. if (newBaseRow === void 0) {
  69504. newBaseRow = this.row_;
  69505. }
  69506. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  69507. };
  69508. Cea608Stream.prototype.addFormatting = function(pts, format) {
  69509. this.formatting_ = this.formatting_.concat(format);
  69510. var text = format.reduce(function(text2, format2) {
  69511. return text2 + "<" + format2 + ">";
  69512. }, "");
  69513. this[this.mode_](pts, text);
  69514. };
  69515. Cea608Stream.prototype.clearFormatting = function(pts) {
  69516. if (!this.formatting_.length) {
  69517. return;
  69518. }
  69519. var text = this.formatting_.reverse().reduce(function(text2, format) {
  69520. return text2 + "</" + format + ">";
  69521. }, "");
  69522. this.formatting_ = [];
  69523. this[this.mode_](pts, text);
  69524. };
  69525. Cea608Stream.prototype.popOn = function(pts, text) {
  69526. var baseRow = this.nonDisplayed_[this.row_];
  69527. baseRow += text;
  69528. this.nonDisplayed_[this.row_] = baseRow;
  69529. };
  69530. Cea608Stream.prototype.rollUp = function(pts, text) {
  69531. var baseRow = this.displayed_[this.row_];
  69532. baseRow += text;
  69533. this.displayed_[this.row_] = baseRow;
  69534. };
  69535. Cea608Stream.prototype.shiftRowsUp_ = function() {
  69536. var i2;
  69537. for (i2 = 0; i2 < this.topRow_; i2++) {
  69538. this.displayed_[i2] = "";
  69539. }
  69540. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  69541. this.displayed_[i2] = "";
  69542. }
  69543. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  69544. this.displayed_[i2] = this.displayed_[i2 + 1];
  69545. }
  69546. this.displayed_[this.row_] = "";
  69547. };
  69548. Cea608Stream.prototype.paintOn = function(pts, text) {
  69549. var baseRow = this.displayed_[this.row_];
  69550. baseRow += text;
  69551. this.displayed_[this.row_] = baseRow;
  69552. };
  69553. var captionStream = {
  69554. CaptionStream: CaptionStream$2,
  69555. Cea608Stream,
  69556. Cea708Stream
  69557. };
  69558. var streamTypes = {
  69559. H264_STREAM_TYPE: 27,
  69560. ADTS_STREAM_TYPE: 15,
  69561. METADATA_STREAM_TYPE: 21
  69562. };
  69563. var Stream$6 = stream;
  69564. var MAX_TS = 8589934592;
  69565. var RO_THRESH = 4294967296;
  69566. var TYPE_SHARED = "shared";
  69567. var handleRollover$1 = function(value, reference) {
  69568. var direction = 1;
  69569. if (value > reference) {
  69570. direction = -1;
  69571. }
  69572. while (Math.abs(reference - value) > RO_THRESH) {
  69573. value += direction * MAX_TS;
  69574. }
  69575. return value;
  69576. };
  69577. var TimestampRolloverStream$1 = function(type3) {
  69578. var lastDTS, referenceDTS;
  69579. TimestampRolloverStream$1.prototype.init.call(this);
  69580. this.type_ = type3 || TYPE_SHARED;
  69581. this.push = function(data) {
  69582. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  69583. return;
  69584. }
  69585. if (referenceDTS === void 0) {
  69586. referenceDTS = data.dts;
  69587. }
  69588. data.dts = handleRollover$1(data.dts, referenceDTS);
  69589. data.pts = handleRollover$1(data.pts, referenceDTS);
  69590. lastDTS = data.dts;
  69591. this.trigger("data", data);
  69592. };
  69593. this.flush = function() {
  69594. referenceDTS = lastDTS;
  69595. this.trigger("done");
  69596. };
  69597. this.endTimeline = function() {
  69598. this.flush();
  69599. this.trigger("endedtimeline");
  69600. };
  69601. this.discontinuity = function() {
  69602. referenceDTS = void 0;
  69603. lastDTS = void 0;
  69604. };
  69605. this.reset = function() {
  69606. this.discontinuity();
  69607. this.trigger("reset");
  69608. };
  69609. };
  69610. TimestampRolloverStream$1.prototype = new Stream$6();
  69611. var timestampRolloverStream = {
  69612. TimestampRolloverStream: TimestampRolloverStream$1,
  69613. handleRollover: handleRollover$1
  69614. };
  69615. var typedArrayIndexOf$1 = (typedArray2, element, fromIndex) => {
  69616. if (!typedArray2) {
  69617. return -1;
  69618. }
  69619. var currentIndex = fromIndex;
  69620. for (; currentIndex < typedArray2.length; currentIndex++) {
  69621. if (typedArray2[currentIndex] === element) {
  69622. return currentIndex;
  69623. }
  69624. }
  69625. return -1;
  69626. };
  69627. var typedArray = {
  69628. typedArrayIndexOf: typedArrayIndexOf$1
  69629. };
  69630. var typedArrayIndexOf = typedArray.typedArrayIndexOf, textEncodingDescriptionByte = {
  69631. Iso88591: 0,
  69632. Utf16: 1,
  69633. Utf16be: 2,
  69634. Utf8: 3
  69635. }, percentEncode$1 = function(bytes, start2, end) {
  69636. var i2, result = "";
  69637. for (i2 = start2; i2 < end; i2++) {
  69638. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  69639. }
  69640. return result;
  69641. }, parseUtf8 = function(bytes, start2, end) {
  69642. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  69643. }, parseIso88591$1 = function(bytes, start2, end) {
  69644. return unescape(percentEncode$1(bytes, start2, end));
  69645. }, parseSyncSafeInteger$1 = function(data) {
  69646. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  69647. }, frameParsers = {
  69648. "APIC": function(frame) {
  69649. var i2 = 1, mimeTypeEndIndex, descriptionEndIndex, LINK_MIME_TYPE = "-->";
  69650. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69651. return;
  69652. }
  69653. mimeTypeEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69654. if (mimeTypeEndIndex < 0) {
  69655. return;
  69656. }
  69657. frame.mimeType = parseIso88591$1(frame.data, i2, mimeTypeEndIndex);
  69658. i2 = mimeTypeEndIndex + 1;
  69659. frame.pictureType = frame.data[i2];
  69660. i2++;
  69661. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69662. if (descriptionEndIndex < 0) {
  69663. return;
  69664. }
  69665. frame.description = parseUtf8(frame.data, i2, descriptionEndIndex);
  69666. i2 = descriptionEndIndex + 1;
  69667. if (frame.mimeType === LINK_MIME_TYPE) {
  69668. frame.url = parseIso88591$1(frame.data, i2, frame.data.length);
  69669. } else {
  69670. frame.pictureData = frame.data.subarray(i2, frame.data.length);
  69671. }
  69672. },
  69673. "T*": function(frame) {
  69674. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69675. return;
  69676. }
  69677. frame.value = parseUtf8(frame.data, 1, frame.data.length).replace(/\0*$/, "");
  69678. frame.values = frame.value.split("\0");
  69679. },
  69680. "TXXX": function(frame) {
  69681. var descriptionEndIndex;
  69682. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69683. return;
  69684. }
  69685. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69686. if (descriptionEndIndex === -1) {
  69687. return;
  69688. }
  69689. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69690. frame.value = parseUtf8(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0*$/, "");
  69691. frame.data = frame.value;
  69692. },
  69693. "W*": function(frame) {
  69694. frame.url = parseIso88591$1(frame.data, 0, frame.data.length).replace(/\0.*$/, "");
  69695. },
  69696. "WXXX": function(frame) {
  69697. var descriptionEndIndex;
  69698. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69699. return;
  69700. }
  69701. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69702. if (descriptionEndIndex === -1) {
  69703. return;
  69704. }
  69705. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69706. frame.url = parseIso88591$1(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0.*$/, "");
  69707. },
  69708. "PRIV": function(frame) {
  69709. var i2;
  69710. for (i2 = 0; i2 < frame.data.length; i2++) {
  69711. if (frame.data[i2] === 0) {
  69712. frame.owner = parseIso88591$1(frame.data, 0, i2);
  69713. break;
  69714. }
  69715. }
  69716. frame.privateData = frame.data.subarray(i2 + 1);
  69717. frame.data = frame.privateData;
  69718. }
  69719. };
  69720. var parseId3Frames$1 = function(data) {
  69721. var frameSize, frameHeader, frameStart = 10, tagSize = 0, frames = [];
  69722. if (data.length < 10 || data[0] !== "I".charCodeAt(0) || data[1] !== "D".charCodeAt(0) || data[2] !== "3".charCodeAt(0)) {
  69723. return;
  69724. }
  69725. tagSize = parseSyncSafeInteger$1(data.subarray(6, 10));
  69726. tagSize += 10;
  69727. var hasExtendedHeader = data[5] & 64;
  69728. if (hasExtendedHeader) {
  69729. frameStart += 4;
  69730. frameStart += parseSyncSafeInteger$1(data.subarray(10, 14));
  69731. tagSize -= parseSyncSafeInteger$1(data.subarray(16, 20));
  69732. }
  69733. do {
  69734. frameSize = parseSyncSafeInteger$1(data.subarray(frameStart + 4, frameStart + 8));
  69735. if (frameSize < 1) {
  69736. break;
  69737. }
  69738. frameHeader = String.fromCharCode(data[frameStart], data[frameStart + 1], data[frameStart + 2], data[frameStart + 3]);
  69739. var frame = {
  69740. id: frameHeader,
  69741. data: data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69742. };
  69743. frame.key = frame.id;
  69744. if (frameParsers[frame.id]) {
  69745. frameParsers[frame.id](frame);
  69746. } else if (frame.id[0] === "T") {
  69747. frameParsers["T*"](frame);
  69748. } else if (frame.id[0] === "W") {
  69749. frameParsers["W*"](frame);
  69750. }
  69751. frames.push(frame);
  69752. frameStart += 10;
  69753. frameStart += frameSize;
  69754. } while (frameStart < tagSize);
  69755. return frames;
  69756. };
  69757. var parseId3 = {
  69758. parseId3Frames: parseId3Frames$1,
  69759. parseSyncSafeInteger: parseSyncSafeInteger$1,
  69760. frameParsers
  69761. };
  69762. var Stream$5 = stream, StreamTypes$3 = streamTypes, id3 = parseId3, MetadataStream;
  69763. MetadataStream = function(options2) {
  69764. var settings = {
  69765. descriptor: options2 && options2.descriptor
  69766. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  69767. MetadataStream.prototype.init.call(this);
  69768. this.dispatchType = StreamTypes$3.METADATA_STREAM_TYPE.toString(16);
  69769. if (settings.descriptor) {
  69770. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  69771. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  69772. }
  69773. }
  69774. this.push = function(chunk) {
  69775. var tag, frameStart, frameSize, frame, i3, frameHeader;
  69776. if (chunk.type !== "timed-metadata") {
  69777. return;
  69778. }
  69779. if (chunk.dataAlignmentIndicator) {
  69780. bufferSize = 0;
  69781. buffer.length = 0;
  69782. }
  69783. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  69784. this.trigger("log", {
  69785. level: "warn",
  69786. message: "Skipping unrecognized metadata packet"
  69787. });
  69788. return;
  69789. }
  69790. buffer.push(chunk);
  69791. bufferSize += chunk.data.byteLength;
  69792. if (buffer.length === 1) {
  69793. tagSize = id3.parseSyncSafeInteger(chunk.data.subarray(6, 10));
  69794. tagSize += 10;
  69795. }
  69796. if (bufferSize < tagSize) {
  69797. return;
  69798. }
  69799. tag = {
  69800. data: new Uint8Array(tagSize),
  69801. frames: [],
  69802. pts: buffer[0].pts,
  69803. dts: buffer[0].dts
  69804. };
  69805. for (i3 = 0; i3 < tagSize; ) {
  69806. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  69807. i3 += buffer[0].data.byteLength;
  69808. bufferSize -= buffer[0].data.byteLength;
  69809. buffer.shift();
  69810. }
  69811. frameStart = 10;
  69812. if (tag.data[5] & 64) {
  69813. frameStart += 4;
  69814. frameStart += id3.parseSyncSafeInteger(tag.data.subarray(10, 14));
  69815. tagSize -= id3.parseSyncSafeInteger(tag.data.subarray(16, 20));
  69816. }
  69817. do {
  69818. frameSize = id3.parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));
  69819. if (frameSize < 1) {
  69820. this.trigger("log", {
  69821. level: "warn",
  69822. message: "Malformed ID3 frame encountered. Skipping remaining metadata parsing."
  69823. });
  69824. break;
  69825. }
  69826. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  69827. frame = {
  69828. id: frameHeader,
  69829. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69830. };
  69831. frame.key = frame.id;
  69832. if (id3.frameParsers[frame.id]) {
  69833. id3.frameParsers[frame.id](frame);
  69834. } else if (frame.id[0] === "T") {
  69835. id3.frameParsers["T*"](frame);
  69836. } else if (frame.id[0] === "W") {
  69837. id3.frameParsers["W*"](frame);
  69838. }
  69839. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  69840. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  69841. size *= 4;
  69842. size += d2[7] & 3;
  69843. frame.timeStamp = size;
  69844. if (tag.pts === void 0 && tag.dts === void 0) {
  69845. tag.pts = frame.timeStamp;
  69846. tag.dts = frame.timeStamp;
  69847. }
  69848. this.trigger("timestamp", frame);
  69849. }
  69850. tag.frames.push(frame);
  69851. frameStart += 10;
  69852. frameStart += frameSize;
  69853. } while (frameStart < tagSize);
  69854. this.trigger("data", tag);
  69855. };
  69856. };
  69857. MetadataStream.prototype = new Stream$5();
  69858. var metadataStream = MetadataStream;
  69859. var Stream$4 = stream, CaptionStream$1 = captionStream, StreamTypes$2 = streamTypes, TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  69860. var TransportPacketStream, TransportParseStream, ElementaryStream;
  69861. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  69862. TransportPacketStream = function() {
  69863. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  69864. TransportPacketStream.prototype.init.call(this);
  69865. this.push = function(bytes) {
  69866. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  69867. if (bytesInBuffer) {
  69868. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  69869. everything.set(buffer.subarray(0, bytesInBuffer));
  69870. everything.set(bytes, bytesInBuffer);
  69871. bytesInBuffer = 0;
  69872. } else {
  69873. everything = bytes;
  69874. }
  69875. while (endIndex < everything.byteLength) {
  69876. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  69877. this.trigger("data", everything.subarray(startIndex, endIndex));
  69878. startIndex += MP2T_PACKET_LENGTH$1;
  69879. endIndex += MP2T_PACKET_LENGTH$1;
  69880. continue;
  69881. }
  69882. startIndex++;
  69883. endIndex++;
  69884. }
  69885. if (startIndex < everything.byteLength) {
  69886. buffer.set(everything.subarray(startIndex), 0);
  69887. bytesInBuffer = everything.byteLength - startIndex;
  69888. }
  69889. };
  69890. this.flush = function() {
  69891. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  69892. this.trigger("data", buffer);
  69893. bytesInBuffer = 0;
  69894. }
  69895. this.trigger("done");
  69896. };
  69897. this.endTimeline = function() {
  69898. this.flush();
  69899. this.trigger("endedtimeline");
  69900. };
  69901. this.reset = function() {
  69902. bytesInBuffer = 0;
  69903. this.trigger("reset");
  69904. };
  69905. };
  69906. TransportPacketStream.prototype = new Stream$4();
  69907. TransportParseStream = function() {
  69908. var parsePsi, parsePat2, parsePmt2, self2;
  69909. TransportParseStream.prototype.init.call(this);
  69910. self2 = this;
  69911. this.packetsWaitingForPmt = [];
  69912. this.programMapTable = void 0;
  69913. parsePsi = function(payload, psi) {
  69914. var offset = 0;
  69915. if (psi.payloadUnitStartIndicator) {
  69916. offset += payload[offset] + 1;
  69917. }
  69918. if (psi.type === "pat") {
  69919. parsePat2(payload.subarray(offset), psi);
  69920. } else {
  69921. parsePmt2(payload.subarray(offset), psi);
  69922. }
  69923. };
  69924. parsePat2 = function(payload, pat) {
  69925. pat.section_number = payload[7];
  69926. pat.last_section_number = payload[8];
  69927. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  69928. pat.pmtPid = self2.pmtPid;
  69929. };
  69930. parsePmt2 = function(payload, pmt) {
  69931. var sectionLength, tableEnd, programInfoLength, offset;
  69932. if (!(payload[5] & 1)) {
  69933. return;
  69934. }
  69935. self2.programMapTable = {
  69936. video: null,
  69937. audio: null,
  69938. "timed-metadata": {}
  69939. };
  69940. sectionLength = (payload[1] & 15) << 8 | payload[2];
  69941. tableEnd = 3 + sectionLength - 4;
  69942. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  69943. offset = 12 + programInfoLength;
  69944. while (offset < tableEnd) {
  69945. var streamType = payload[offset];
  69946. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  69947. if (streamType === StreamTypes$2.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  69948. self2.programMapTable.video = pid;
  69949. } else if (streamType === StreamTypes$2.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  69950. self2.programMapTable.audio = pid;
  69951. } else if (streamType === StreamTypes$2.METADATA_STREAM_TYPE) {
  69952. self2.programMapTable["timed-metadata"][pid] = streamType;
  69953. }
  69954. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  69955. }
  69956. pmt.programMapTable = self2.programMapTable;
  69957. };
  69958. this.push = function(packet) {
  69959. var result = {}, offset = 4;
  69960. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  69961. result.pid = packet[1] & 31;
  69962. result.pid <<= 8;
  69963. result.pid |= packet[2];
  69964. if ((packet[3] & 48) >>> 4 > 1) {
  69965. offset += packet[offset] + 1;
  69966. }
  69967. if (result.pid === 0) {
  69968. result.type = "pat";
  69969. parsePsi(packet.subarray(offset), result);
  69970. this.trigger("data", result);
  69971. } else if (result.pid === this.pmtPid) {
  69972. result.type = "pmt";
  69973. parsePsi(packet.subarray(offset), result);
  69974. this.trigger("data", result);
  69975. while (this.packetsWaitingForPmt.length) {
  69976. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  69977. }
  69978. } else if (this.programMapTable === void 0) {
  69979. this.packetsWaitingForPmt.push([packet, offset, result]);
  69980. } else {
  69981. this.processPes_(packet, offset, result);
  69982. }
  69983. };
  69984. this.processPes_ = function(packet, offset, result) {
  69985. if (result.pid === this.programMapTable.video) {
  69986. result.streamType = StreamTypes$2.H264_STREAM_TYPE;
  69987. } else if (result.pid === this.programMapTable.audio) {
  69988. result.streamType = StreamTypes$2.ADTS_STREAM_TYPE;
  69989. } else {
  69990. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  69991. }
  69992. result.type = "pes";
  69993. result.data = packet.subarray(offset);
  69994. this.trigger("data", result);
  69995. };
  69996. };
  69997. TransportParseStream.prototype = new Stream$4();
  69998. TransportParseStream.STREAM_TYPES = {
  69999. h264: 27,
  70000. adts: 15
  70001. };
  70002. ElementaryStream = function() {
  70003. var self2 = this, segmentHadPmt = false, video = {
  70004. data: [],
  70005. size: 0
  70006. }, audio = {
  70007. data: [],
  70008. size: 0
  70009. }, timedMetadata = {
  70010. data: [],
  70011. size: 0
  70012. }, programMapTable, parsePes = function(payload, pes) {
  70013. var ptsDtsFlags;
  70014. const startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  70015. pes.data = new Uint8Array();
  70016. if (startPrefix !== 1) {
  70017. return;
  70018. }
  70019. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  70020. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  70021. ptsDtsFlags = payload[7];
  70022. if (ptsDtsFlags & 192) {
  70023. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  70024. pes.pts *= 4;
  70025. pes.pts += (payload[13] & 6) >>> 1;
  70026. pes.dts = pes.pts;
  70027. if (ptsDtsFlags & 64) {
  70028. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  70029. pes.dts *= 4;
  70030. pes.dts += (payload[18] & 6) >>> 1;
  70031. }
  70032. }
  70033. pes.data = payload.subarray(9 + payload[8]);
  70034. }, flushStream = function(stream2, type3, forceFlush) {
  70035. var packetData = new Uint8Array(stream2.size), event2 = {
  70036. type: type3
  70037. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  70038. if (!stream2.data.length || stream2.size < 9) {
  70039. return;
  70040. }
  70041. event2.trackId = stream2.data[0].pid;
  70042. for (i2 = 0; i2 < stream2.data.length; i2++) {
  70043. fragment = stream2.data[i2];
  70044. packetData.set(fragment.data, offset);
  70045. offset += fragment.data.byteLength;
  70046. }
  70047. parsePes(packetData, event2);
  70048. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  70049. if (forceFlush || packetFlushable) {
  70050. stream2.size = 0;
  70051. stream2.data.length = 0;
  70052. }
  70053. if (packetFlushable) {
  70054. self2.trigger("data", event2);
  70055. }
  70056. };
  70057. ElementaryStream.prototype.init.call(this);
  70058. this.push = function(data) {
  70059. ({
  70060. pat: function() {
  70061. },
  70062. pes: function() {
  70063. var stream2, streamType;
  70064. switch (data.streamType) {
  70065. case StreamTypes$2.H264_STREAM_TYPE:
  70066. stream2 = video;
  70067. streamType = "video";
  70068. break;
  70069. case StreamTypes$2.ADTS_STREAM_TYPE:
  70070. stream2 = audio;
  70071. streamType = "audio";
  70072. break;
  70073. case StreamTypes$2.METADATA_STREAM_TYPE:
  70074. stream2 = timedMetadata;
  70075. streamType = "timed-metadata";
  70076. break;
  70077. default:
  70078. return;
  70079. }
  70080. if (data.payloadUnitStartIndicator) {
  70081. flushStream(stream2, streamType, true);
  70082. }
  70083. stream2.data.push(data);
  70084. stream2.size += data.data.byteLength;
  70085. },
  70086. pmt: function() {
  70087. var event2 = {
  70088. type: "metadata",
  70089. tracks: []
  70090. };
  70091. programMapTable = data.programMapTable;
  70092. if (programMapTable.video !== null) {
  70093. event2.tracks.push({
  70094. timelineStartInfo: {
  70095. baseMediaDecodeTime: 0
  70096. },
  70097. id: +programMapTable.video,
  70098. codec: "avc",
  70099. type: "video"
  70100. });
  70101. }
  70102. if (programMapTable.audio !== null) {
  70103. event2.tracks.push({
  70104. timelineStartInfo: {
  70105. baseMediaDecodeTime: 0
  70106. },
  70107. id: +programMapTable.audio,
  70108. codec: "adts",
  70109. type: "audio"
  70110. });
  70111. }
  70112. segmentHadPmt = true;
  70113. self2.trigger("data", event2);
  70114. }
  70115. })[data.type]();
  70116. };
  70117. this.reset = function() {
  70118. video.size = 0;
  70119. video.data.length = 0;
  70120. audio.size = 0;
  70121. audio.data.length = 0;
  70122. this.trigger("reset");
  70123. };
  70124. this.flushStreams_ = function() {
  70125. flushStream(video, "video");
  70126. flushStream(audio, "audio");
  70127. flushStream(timedMetadata, "timed-metadata");
  70128. };
  70129. this.flush = function() {
  70130. if (!segmentHadPmt && programMapTable) {
  70131. var pmt = {
  70132. type: "metadata",
  70133. tracks: []
  70134. };
  70135. if (programMapTable.video !== null) {
  70136. pmt.tracks.push({
  70137. timelineStartInfo: {
  70138. baseMediaDecodeTime: 0
  70139. },
  70140. id: +programMapTable.video,
  70141. codec: "avc",
  70142. type: "video"
  70143. });
  70144. }
  70145. if (programMapTable.audio !== null) {
  70146. pmt.tracks.push({
  70147. timelineStartInfo: {
  70148. baseMediaDecodeTime: 0
  70149. },
  70150. id: +programMapTable.audio,
  70151. codec: "adts",
  70152. type: "audio"
  70153. });
  70154. }
  70155. self2.trigger("data", pmt);
  70156. }
  70157. segmentHadPmt = false;
  70158. this.flushStreams_();
  70159. this.trigger("done");
  70160. };
  70161. };
  70162. ElementaryStream.prototype = new Stream$4();
  70163. var m2ts$1 = {
  70164. PAT_PID: 0,
  70165. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  70166. TransportPacketStream,
  70167. TransportParseStream,
  70168. ElementaryStream,
  70169. TimestampRolloverStream,
  70170. CaptionStream: CaptionStream$1.CaptionStream,
  70171. Cea608Stream: CaptionStream$1.Cea608Stream,
  70172. Cea708Stream: CaptionStream$1.Cea708Stream,
  70173. MetadataStream: metadataStream
  70174. };
  70175. for (var type2 in StreamTypes$2) {
  70176. if (StreamTypes$2.hasOwnProperty(type2)) {
  70177. m2ts$1[type2] = StreamTypes$2[type2];
  70178. }
  70179. }
  70180. var m2ts_1 = m2ts$1;
  70181. var Stream$3 = stream;
  70182. var ONE_SECOND_IN_TS$2 = clock$2.ONE_SECOND_IN_TS;
  70183. var AdtsStream$1;
  70184. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70185. AdtsStream$1 = function(handlePartialSegments) {
  70186. var buffer, frameNum = 0;
  70187. AdtsStream$1.prototype.init.call(this);
  70188. this.skipWarn_ = function(start2, end) {
  70189. this.trigger("log", {
  70190. level: "warn",
  70191. message: `adts skiping bytes ${start2} to ${end} in frame ${frameNum} outside syncword`
  70192. });
  70193. };
  70194. this.push = function(packet) {
  70195. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  70196. if (!handlePartialSegments) {
  70197. frameNum = 0;
  70198. }
  70199. if (packet.type !== "audio") {
  70200. return;
  70201. }
  70202. if (buffer && buffer.length) {
  70203. oldBuffer = buffer;
  70204. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  70205. buffer.set(oldBuffer);
  70206. buffer.set(packet.data, oldBuffer.byteLength);
  70207. } else {
  70208. buffer = packet.data;
  70209. }
  70210. var skip;
  70211. while (i2 + 7 < buffer.length) {
  70212. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  70213. if (typeof skip !== "number") {
  70214. skip = i2;
  70215. }
  70216. i2++;
  70217. continue;
  70218. }
  70219. if (typeof skip === "number") {
  70220. this.skipWarn_(skip, i2);
  70221. skip = null;
  70222. }
  70223. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  70224. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  70225. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  70226. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  70227. if (buffer.byteLength - i2 < frameLength) {
  70228. break;
  70229. }
  70230. this.trigger("data", {
  70231. pts: packet.pts + frameNum * adtsFrameDuration,
  70232. dts: packet.dts + frameNum * adtsFrameDuration,
  70233. sampleCount,
  70234. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  70235. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  70236. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  70237. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  70238. samplesize: 16,
  70239. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  70240. });
  70241. frameNum++;
  70242. i2 += frameLength;
  70243. }
  70244. if (typeof skip === "number") {
  70245. this.skipWarn_(skip, i2);
  70246. skip = null;
  70247. }
  70248. buffer = buffer.subarray(i2);
  70249. };
  70250. this.flush = function() {
  70251. frameNum = 0;
  70252. this.trigger("done");
  70253. };
  70254. this.reset = function() {
  70255. buffer = void 0;
  70256. this.trigger("reset");
  70257. };
  70258. this.endTimeline = function() {
  70259. buffer = void 0;
  70260. this.trigger("endedtimeline");
  70261. };
  70262. };
  70263. AdtsStream$1.prototype = new Stream$3();
  70264. var adts = AdtsStream$1;
  70265. var ExpGolomb$1;
  70266. ExpGolomb$1 = function(workingData) {
  70267. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  70268. this.length = function() {
  70269. return 8 * workingBytesAvailable;
  70270. };
  70271. this.bitsAvailable = function() {
  70272. return 8 * workingBytesAvailable + workingBitsAvailable;
  70273. };
  70274. this.loadWord = function() {
  70275. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  70276. if (availableBytes === 0) {
  70277. throw new Error("no bytes available");
  70278. }
  70279. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  70280. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  70281. workingBitsAvailable = availableBytes * 8;
  70282. workingBytesAvailable -= availableBytes;
  70283. };
  70284. this.skipBits = function(count) {
  70285. var skipBytes;
  70286. if (workingBitsAvailable > count) {
  70287. workingWord <<= count;
  70288. workingBitsAvailable -= count;
  70289. } else {
  70290. count -= workingBitsAvailable;
  70291. skipBytes = Math.floor(count / 8);
  70292. count -= skipBytes * 8;
  70293. workingBytesAvailable -= skipBytes;
  70294. this.loadWord();
  70295. workingWord <<= count;
  70296. workingBitsAvailable -= count;
  70297. }
  70298. };
  70299. this.readBits = function(size) {
  70300. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  70301. workingBitsAvailable -= bits;
  70302. if (workingBitsAvailable > 0) {
  70303. workingWord <<= bits;
  70304. } else if (workingBytesAvailable > 0) {
  70305. this.loadWord();
  70306. }
  70307. bits = size - bits;
  70308. if (bits > 0) {
  70309. return valu << bits | this.readBits(bits);
  70310. }
  70311. return valu;
  70312. };
  70313. this.skipLeadingZeros = function() {
  70314. var leadingZeroCount;
  70315. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  70316. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  70317. workingWord <<= leadingZeroCount;
  70318. workingBitsAvailable -= leadingZeroCount;
  70319. return leadingZeroCount;
  70320. }
  70321. }
  70322. this.loadWord();
  70323. return leadingZeroCount + this.skipLeadingZeros();
  70324. };
  70325. this.skipUnsignedExpGolomb = function() {
  70326. this.skipBits(1 + this.skipLeadingZeros());
  70327. };
  70328. this.skipExpGolomb = function() {
  70329. this.skipBits(1 + this.skipLeadingZeros());
  70330. };
  70331. this.readUnsignedExpGolomb = function() {
  70332. var clz = this.skipLeadingZeros();
  70333. return this.readBits(clz + 1) - 1;
  70334. };
  70335. this.readExpGolomb = function() {
  70336. var valu = this.readUnsignedExpGolomb();
  70337. if (1 & valu) {
  70338. return 1 + valu >>> 1;
  70339. }
  70340. return -1 * (valu >>> 1);
  70341. };
  70342. this.readBoolean = function() {
  70343. return this.readBits(1) === 1;
  70344. };
  70345. this.readUnsignedByte = function() {
  70346. return this.readBits(8);
  70347. };
  70348. this.loadWord();
  70349. };
  70350. var expGolomb = ExpGolomb$1;
  70351. var Stream$2 = stream;
  70352. var ExpGolomb = expGolomb;
  70353. var H264Stream$1, NalByteStream;
  70354. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  70355. NalByteStream = function() {
  70356. var syncPoint = 0, i2, buffer;
  70357. NalByteStream.prototype.init.call(this);
  70358. this.push = function(data) {
  70359. var swapBuffer;
  70360. if (!buffer) {
  70361. buffer = data.data;
  70362. } else {
  70363. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  70364. swapBuffer.set(buffer);
  70365. swapBuffer.set(data.data, buffer.byteLength);
  70366. buffer = swapBuffer;
  70367. }
  70368. var len = buffer.byteLength;
  70369. for (; syncPoint < len - 3; syncPoint++) {
  70370. if (buffer[syncPoint + 2] === 1) {
  70371. i2 = syncPoint + 5;
  70372. break;
  70373. }
  70374. }
  70375. while (i2 < len) {
  70376. switch (buffer[i2]) {
  70377. case 0:
  70378. if (buffer[i2 - 1] !== 0) {
  70379. i2 += 2;
  70380. break;
  70381. } else if (buffer[i2 - 2] !== 0) {
  70382. i2++;
  70383. break;
  70384. }
  70385. if (syncPoint + 3 !== i2 - 2) {
  70386. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70387. }
  70388. do {
  70389. i2++;
  70390. } while (buffer[i2] !== 1 && i2 < len);
  70391. syncPoint = i2 - 2;
  70392. i2 += 3;
  70393. break;
  70394. case 1:
  70395. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  70396. i2 += 3;
  70397. break;
  70398. }
  70399. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70400. syncPoint = i2 - 2;
  70401. i2 += 3;
  70402. break;
  70403. default:
  70404. i2 += 3;
  70405. break;
  70406. }
  70407. }
  70408. buffer = buffer.subarray(syncPoint);
  70409. i2 -= syncPoint;
  70410. syncPoint = 0;
  70411. };
  70412. this.reset = function() {
  70413. buffer = null;
  70414. syncPoint = 0;
  70415. this.trigger("reset");
  70416. };
  70417. this.flush = function() {
  70418. if (buffer && buffer.byteLength > 3) {
  70419. this.trigger("data", buffer.subarray(syncPoint + 3));
  70420. }
  70421. buffer = null;
  70422. syncPoint = 0;
  70423. this.trigger("done");
  70424. };
  70425. this.endTimeline = function() {
  70426. this.flush();
  70427. this.trigger("endedtimeline");
  70428. };
  70429. };
  70430. NalByteStream.prototype = new Stream$2();
  70431. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  70432. 100: true,
  70433. 110: true,
  70434. 122: true,
  70435. 244: true,
  70436. 44: true,
  70437. 83: true,
  70438. 86: true,
  70439. 118: true,
  70440. 128: true,
  70441. 138: true,
  70442. 139: true,
  70443. 134: true
  70444. };
  70445. H264Stream$1 = function() {
  70446. var nalByteStream = new NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  70447. H264Stream$1.prototype.init.call(this);
  70448. self2 = this;
  70449. this.push = function(packet) {
  70450. if (packet.type !== "video") {
  70451. return;
  70452. }
  70453. trackId = packet.trackId;
  70454. currentPts = packet.pts;
  70455. currentDts = packet.dts;
  70456. nalByteStream.push(packet);
  70457. };
  70458. nalByteStream.on("data", function(data) {
  70459. var event2 = {
  70460. trackId,
  70461. pts: currentPts,
  70462. dts: currentDts,
  70463. data,
  70464. nalUnitTypeCode: data[0] & 31
  70465. };
  70466. switch (event2.nalUnitTypeCode) {
  70467. case 5:
  70468. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  70469. break;
  70470. case 6:
  70471. event2.nalUnitType = "sei_rbsp";
  70472. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70473. break;
  70474. case 7:
  70475. event2.nalUnitType = "seq_parameter_set_rbsp";
  70476. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70477. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  70478. break;
  70479. case 8:
  70480. event2.nalUnitType = "pic_parameter_set_rbsp";
  70481. break;
  70482. case 9:
  70483. event2.nalUnitType = "access_unit_delimiter_rbsp";
  70484. break;
  70485. }
  70486. self2.trigger("data", event2);
  70487. });
  70488. nalByteStream.on("done", function() {
  70489. self2.trigger("done");
  70490. });
  70491. nalByteStream.on("partialdone", function() {
  70492. self2.trigger("partialdone");
  70493. });
  70494. nalByteStream.on("reset", function() {
  70495. self2.trigger("reset");
  70496. });
  70497. nalByteStream.on("endedtimeline", function() {
  70498. self2.trigger("endedtimeline");
  70499. });
  70500. this.flush = function() {
  70501. nalByteStream.flush();
  70502. };
  70503. this.partialFlush = function() {
  70504. nalByteStream.partialFlush();
  70505. };
  70506. this.reset = function() {
  70507. nalByteStream.reset();
  70508. };
  70509. this.endTimeline = function() {
  70510. nalByteStream.endTimeline();
  70511. };
  70512. skipScalingList = function(count, expGolombDecoder) {
  70513. var lastScale = 8, nextScale = 8, j, deltaScale;
  70514. for (j = 0; j < count; j++) {
  70515. if (nextScale !== 0) {
  70516. deltaScale = expGolombDecoder.readExpGolomb();
  70517. nextScale = (lastScale + deltaScale + 256) % 256;
  70518. }
  70519. lastScale = nextScale === 0 ? lastScale : nextScale;
  70520. }
  70521. };
  70522. discardEmulationPreventionBytes5 = function(data) {
  70523. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  70524. while (i2 < length - 2) {
  70525. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  70526. emulationPreventionBytesPositions.push(i2 + 2);
  70527. i2 += 2;
  70528. } else {
  70529. i2++;
  70530. }
  70531. }
  70532. if (emulationPreventionBytesPositions.length === 0) {
  70533. return data;
  70534. }
  70535. newLength = length - emulationPreventionBytesPositions.length;
  70536. newData = new Uint8Array(newLength);
  70537. var sourceIndex = 0;
  70538. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  70539. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  70540. sourceIndex++;
  70541. emulationPreventionBytesPositions.shift();
  70542. }
  70543. newData[i2] = data[sourceIndex];
  70544. }
  70545. return newData;
  70546. };
  70547. readSequenceParameterSet = function(data) {
  70548. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  70549. expGolombDecoder = new ExpGolomb(data);
  70550. profileIdc = expGolombDecoder.readUnsignedByte();
  70551. profileCompatibility = expGolombDecoder.readUnsignedByte();
  70552. levelIdc = expGolombDecoder.readUnsignedByte();
  70553. expGolombDecoder.skipUnsignedExpGolomb();
  70554. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  70555. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  70556. if (chromaFormatIdc === 3) {
  70557. expGolombDecoder.skipBits(1);
  70558. }
  70559. expGolombDecoder.skipUnsignedExpGolomb();
  70560. expGolombDecoder.skipUnsignedExpGolomb();
  70561. expGolombDecoder.skipBits(1);
  70562. if (expGolombDecoder.readBoolean()) {
  70563. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  70564. for (i2 = 0; i2 < scalingListCount; i2++) {
  70565. if (expGolombDecoder.readBoolean()) {
  70566. if (i2 < 6) {
  70567. skipScalingList(16, expGolombDecoder);
  70568. } else {
  70569. skipScalingList(64, expGolombDecoder);
  70570. }
  70571. }
  70572. }
  70573. }
  70574. }
  70575. expGolombDecoder.skipUnsignedExpGolomb();
  70576. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  70577. if (picOrderCntType === 0) {
  70578. expGolombDecoder.readUnsignedExpGolomb();
  70579. } else if (picOrderCntType === 1) {
  70580. expGolombDecoder.skipBits(1);
  70581. expGolombDecoder.skipExpGolomb();
  70582. expGolombDecoder.skipExpGolomb();
  70583. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  70584. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  70585. expGolombDecoder.skipExpGolomb();
  70586. }
  70587. }
  70588. expGolombDecoder.skipUnsignedExpGolomb();
  70589. expGolombDecoder.skipBits(1);
  70590. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70591. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70592. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  70593. if (frameMbsOnlyFlag === 0) {
  70594. expGolombDecoder.skipBits(1);
  70595. }
  70596. expGolombDecoder.skipBits(1);
  70597. if (expGolombDecoder.readBoolean()) {
  70598. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  70599. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  70600. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  70601. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  70602. }
  70603. if (expGolombDecoder.readBoolean()) {
  70604. if (expGolombDecoder.readBoolean()) {
  70605. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  70606. switch (aspectRatioIdc) {
  70607. case 1:
  70608. sarRatio = [1, 1];
  70609. break;
  70610. case 2:
  70611. sarRatio = [12, 11];
  70612. break;
  70613. case 3:
  70614. sarRatio = [10, 11];
  70615. break;
  70616. case 4:
  70617. sarRatio = [16, 11];
  70618. break;
  70619. case 5:
  70620. sarRatio = [40, 33];
  70621. break;
  70622. case 6:
  70623. sarRatio = [24, 11];
  70624. break;
  70625. case 7:
  70626. sarRatio = [20, 11];
  70627. break;
  70628. case 8:
  70629. sarRatio = [32, 11];
  70630. break;
  70631. case 9:
  70632. sarRatio = [80, 33];
  70633. break;
  70634. case 10:
  70635. sarRatio = [18, 11];
  70636. break;
  70637. case 11:
  70638. sarRatio = [15, 11];
  70639. break;
  70640. case 12:
  70641. sarRatio = [64, 33];
  70642. break;
  70643. case 13:
  70644. sarRatio = [160, 99];
  70645. break;
  70646. case 14:
  70647. sarRatio = [4, 3];
  70648. break;
  70649. case 15:
  70650. sarRatio = [3, 2];
  70651. break;
  70652. case 16:
  70653. sarRatio = [2, 1];
  70654. break;
  70655. case 255: {
  70656. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  70657. break;
  70658. }
  70659. }
  70660. if (sarRatio) {
  70661. sarRatio[0] / sarRatio[1];
  70662. }
  70663. }
  70664. }
  70665. return {
  70666. profileIdc,
  70667. levelIdc,
  70668. profileCompatibility,
  70669. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  70670. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  70671. sarRatio
  70672. };
  70673. };
  70674. };
  70675. H264Stream$1.prototype = new Stream$2();
  70676. var h2643 = {
  70677. H264Stream: H264Stream$1,
  70678. NalByteStream
  70679. };
  70680. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70681. var parseId3TagSize = function(header, byteIndex) {
  70682. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  70683. returnSize = returnSize >= 0 ? returnSize : 0;
  70684. if (footerPresent) {
  70685. return returnSize + 20;
  70686. }
  70687. return returnSize + 10;
  70688. };
  70689. var getId3Offset4 = function(data, offset) {
  70690. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  70691. return offset;
  70692. }
  70693. offset += parseId3TagSize(data, offset);
  70694. return getId3Offset4(data, offset);
  70695. };
  70696. var isLikelyAacData$1 = function(data) {
  70697. var offset = getId3Offset4(data, 0);
  70698. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  70699. };
  70700. var parseSyncSafeInteger = function(data) {
  70701. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  70702. };
  70703. var percentEncode = function(bytes, start2, end) {
  70704. var i2, result = "";
  70705. for (i2 = start2; i2 < end; i2++) {
  70706. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  70707. }
  70708. return result;
  70709. };
  70710. var parseIso88591 = function(bytes, start2, end) {
  70711. return unescape(percentEncode(bytes, start2, end));
  70712. };
  70713. var parseAdtsSize = function(header, byteIndex) {
  70714. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  70715. return highTwo | middle | lowThree;
  70716. };
  70717. var parseType$4 = function(header, byteIndex) {
  70718. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  70719. return "timed-metadata";
  70720. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  70721. return "audio";
  70722. }
  70723. return null;
  70724. };
  70725. var parseSampleRate = function(packet) {
  70726. var i2 = 0;
  70727. while (i2 + 5 < packet.length) {
  70728. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  70729. i2++;
  70730. continue;
  70731. }
  70732. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  70733. }
  70734. return null;
  70735. };
  70736. var parseAacTimestamp = function(packet) {
  70737. var frameStart, frameSize, frame, frameHeader;
  70738. frameStart = 10;
  70739. if (packet[5] & 64) {
  70740. frameStart += 4;
  70741. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  70742. }
  70743. do {
  70744. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  70745. if (frameSize < 1) {
  70746. return null;
  70747. }
  70748. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  70749. if (frameHeader === "PRIV") {
  70750. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  70751. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  70752. if (frame[i2] === 0) {
  70753. var owner = parseIso88591(frame, 0, i2);
  70754. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  70755. var d2 = frame.subarray(i2 + 1);
  70756. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  70757. size *= 4;
  70758. size += d2[7] & 3;
  70759. return size;
  70760. }
  70761. break;
  70762. }
  70763. }
  70764. }
  70765. frameStart += 10;
  70766. frameStart += frameSize;
  70767. } while (frameStart < packet.byteLength);
  70768. return null;
  70769. };
  70770. var utils2 = {
  70771. isLikelyAacData: isLikelyAacData$1,
  70772. parseId3TagSize,
  70773. parseAdtsSize,
  70774. parseType: parseType$4,
  70775. parseSampleRate,
  70776. parseAacTimestamp
  70777. };
  70778. var Stream$12 = stream;
  70779. var aacUtils = utils2;
  70780. var AacStream$1;
  70781. AacStream$1 = function() {
  70782. var everything = new Uint8Array(), timeStamp = 0;
  70783. AacStream$1.prototype.init.call(this);
  70784. this.setTimestamp = function(timestamp) {
  70785. timeStamp = timestamp;
  70786. };
  70787. this.push = function(bytes) {
  70788. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  70789. if (everything.length) {
  70790. tempLength = everything.length;
  70791. everything = new Uint8Array(bytes.byteLength + tempLength);
  70792. everything.set(everything.subarray(0, tempLength));
  70793. everything.set(bytes, tempLength);
  70794. } else {
  70795. everything = bytes;
  70796. }
  70797. while (everything.length - byteIndex >= 3) {
  70798. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  70799. if (everything.length - byteIndex < 10) {
  70800. break;
  70801. }
  70802. frameSize = aacUtils.parseId3TagSize(everything, byteIndex);
  70803. if (byteIndex + frameSize > everything.length) {
  70804. break;
  70805. }
  70806. chunk = {
  70807. type: "timed-metadata",
  70808. data: everything.subarray(byteIndex, byteIndex + frameSize)
  70809. };
  70810. this.trigger("data", chunk);
  70811. byteIndex += frameSize;
  70812. continue;
  70813. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  70814. if (everything.length - byteIndex < 7) {
  70815. break;
  70816. }
  70817. frameSize = aacUtils.parseAdtsSize(everything, byteIndex);
  70818. if (byteIndex + frameSize > everything.length) {
  70819. break;
  70820. }
  70821. packet = {
  70822. type: "audio",
  70823. data: everything.subarray(byteIndex, byteIndex + frameSize),
  70824. pts: timeStamp,
  70825. dts: timeStamp
  70826. };
  70827. this.trigger("data", packet);
  70828. byteIndex += frameSize;
  70829. continue;
  70830. }
  70831. byteIndex++;
  70832. }
  70833. bytesLeft = everything.length - byteIndex;
  70834. if (bytesLeft > 0) {
  70835. everything = everything.subarray(byteIndex);
  70836. } else {
  70837. everything = new Uint8Array();
  70838. }
  70839. };
  70840. this.reset = function() {
  70841. everything = new Uint8Array();
  70842. this.trigger("reset");
  70843. };
  70844. this.endTimeline = function() {
  70845. everything = new Uint8Array();
  70846. this.trigger("endedtimeline");
  70847. };
  70848. };
  70849. AacStream$1.prototype = new Stream$12();
  70850. var aac3 = AacStream$1;
  70851. var AUDIO_PROPERTIES$1 = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  70852. var audioProperties = AUDIO_PROPERTIES$1;
  70853. var VIDEO_PROPERTIES$1 = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  70854. var videoProperties = VIDEO_PROPERTIES$1;
  70855. var Stream2 = stream;
  70856. var mp43 = mp4Generator;
  70857. var frameUtils = frameUtils$1;
  70858. var audioFrameUtils = audioFrameUtils$1;
  70859. var trackDecodeInfo = trackDecodeInfo$1;
  70860. var m2ts = m2ts_1;
  70861. var clock2 = clock$2;
  70862. var AdtsStream = adts;
  70863. var H264Stream = h2643.H264Stream;
  70864. var AacStream = aac3;
  70865. var isLikelyAacData = utils2.isLikelyAacData;
  70866. var ONE_SECOND_IN_TS$12 = clock$2.ONE_SECOND_IN_TS;
  70867. var AUDIO_PROPERTIES = audioProperties;
  70868. var VIDEO_PROPERTIES = videoProperties;
  70869. var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;
  70870. var retriggerForStream = function(key, event2) {
  70871. event2.stream = key;
  70872. this.trigger("log", event2);
  70873. };
  70874. var addPipelineLogRetriggers = function(transmuxer2, pipeline) {
  70875. var keys3 = Object.keys(pipeline);
  70876. for (var i2 = 0; i2 < keys3.length; i2++) {
  70877. var key = keys3[i2];
  70878. if (key === "headOfPipeline" || !pipeline[key].on) {
  70879. continue;
  70880. }
  70881. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  70882. }
  70883. };
  70884. var arrayEquals = function(a, b) {
  70885. var i2;
  70886. if (a.length !== b.length) {
  70887. return false;
  70888. }
  70889. for (i2 = 0; i2 < a.length; i2++) {
  70890. if (a[i2] !== b[i2]) {
  70891. return false;
  70892. }
  70893. }
  70894. return true;
  70895. };
  70896. var generateSegmentTimingInfo = function(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  70897. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  70898. return {
  70899. start: {
  70900. dts: baseMediaDecodeTime,
  70901. pts: baseMediaDecodeTime + ptsOffsetFromDts
  70902. },
  70903. end: {
  70904. dts: baseMediaDecodeTime + decodeDuration,
  70905. pts: baseMediaDecodeTime + presentationDuration
  70906. },
  70907. prependedContentDuration,
  70908. baseMediaDecodeTime
  70909. };
  70910. };
  70911. AudioSegmentStream = function(track, options2) {
  70912. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  70913. options2 = options2 || {};
  70914. sequenceNumber = options2.firstSequenceNumber || 0;
  70915. AudioSegmentStream.prototype.init.call(this);
  70916. this.push = function(data) {
  70917. trackDecodeInfo.collectDtsInfo(track, data);
  70918. if (track) {
  70919. AUDIO_PROPERTIES.forEach(function(prop) {
  70920. track[prop] = data[prop];
  70921. });
  70922. }
  70923. adtsFrames.push(data);
  70924. };
  70925. this.setEarliestDts = function(earliestDts) {
  70926. earliestAllowedDts = earliestDts;
  70927. };
  70928. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  70929. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  70930. };
  70931. this.setAudioAppendStart = function(timestamp) {
  70932. audioAppendStartTs = timestamp;
  70933. };
  70934. this.flush = function() {
  70935. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  70936. if (adtsFrames.length === 0) {
  70937. this.trigger("done", "AudioSegmentStream");
  70938. return;
  70939. }
  70940. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  70941. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  70942. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  70943. track.samples = audioFrameUtils.generateSampleTable(frames);
  70944. mdat2 = mp43.mdat(audioFrameUtils.concatenateFrameData(frames));
  70945. adtsFrames = [];
  70946. moof2 = mp43.moof(sequenceNumber, [track]);
  70947. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  70948. sequenceNumber++;
  70949. boxes.set(moof2);
  70950. boxes.set(mdat2, moof2.byteLength);
  70951. trackDecodeInfo.clearDtsInfo(track);
  70952. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  70953. if (frames.length) {
  70954. segmentDuration = frames.length * frameDuration;
  70955. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  70956. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  70957. frames[0].dts,
  70958. frames[0].pts,
  70959. frames[0].dts + segmentDuration,
  70960. frames[0].pts + segmentDuration,
  70961. videoClockCyclesOfSilencePrefixed || 0
  70962. ));
  70963. this.trigger("timingInfo", {
  70964. start: frames[0].pts,
  70965. end: frames[0].pts + segmentDuration
  70966. });
  70967. }
  70968. this.trigger("data", {
  70969. track,
  70970. boxes
  70971. });
  70972. this.trigger("done", "AudioSegmentStream");
  70973. };
  70974. this.reset = function() {
  70975. trackDecodeInfo.clearDtsInfo(track);
  70976. adtsFrames = [];
  70977. this.trigger("reset");
  70978. };
  70979. };
  70980. AudioSegmentStream.prototype = new Stream2();
  70981. VideoSegmentStream = function(track, options2) {
  70982. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  70983. options2 = options2 || {};
  70984. sequenceNumber = options2.firstSequenceNumber || 0;
  70985. VideoSegmentStream.prototype.init.call(this);
  70986. delete track.minPTS;
  70987. this.gopCache_ = [];
  70988. this.push = function(nalUnit) {
  70989. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  70990. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  70991. config = nalUnit.config;
  70992. track.sps = [nalUnit.data];
  70993. VIDEO_PROPERTIES.forEach(function(prop) {
  70994. track[prop] = config[prop];
  70995. }, this);
  70996. }
  70997. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  70998. pps = nalUnit.data;
  70999. track.pps = [nalUnit.data];
  71000. }
  71001. nalUnits.push(nalUnit);
  71002. };
  71003. this.flush = function() {
  71004. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  71005. while (nalUnits.length) {
  71006. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  71007. break;
  71008. }
  71009. nalUnits.shift();
  71010. }
  71011. if (nalUnits.length === 0) {
  71012. this.resetStream_();
  71013. this.trigger("done", "VideoSegmentStream");
  71014. return;
  71015. }
  71016. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  71017. gops = frameUtils.groupFramesIntoGops(frames);
  71018. if (!gops[0][0].keyFrame) {
  71019. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  71020. if (gopForFusion) {
  71021. prependedContentDuration = gopForFusion.duration;
  71022. gops.unshift(gopForFusion);
  71023. gops.byteLength += gopForFusion.byteLength;
  71024. gops.nalCount += gopForFusion.nalCount;
  71025. gops.pts = gopForFusion.pts;
  71026. gops.dts = gopForFusion.dts;
  71027. gops.duration += gopForFusion.duration;
  71028. } else {
  71029. gops = frameUtils.extendFirstKeyFrame(gops);
  71030. }
  71031. }
  71032. if (gopsToAlignWith.length) {
  71033. var alignedGops;
  71034. if (options2.alignGopsAtEnd) {
  71035. alignedGops = this.alignGopsAtEnd_(gops);
  71036. } else {
  71037. alignedGops = this.alignGopsAtStart_(gops);
  71038. }
  71039. if (!alignedGops) {
  71040. this.gopCache_.unshift({
  71041. gop: gops.pop(),
  71042. pps: track.pps,
  71043. sps: track.sps
  71044. });
  71045. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  71046. nalUnits = [];
  71047. this.resetStream_();
  71048. this.trigger("done", "VideoSegmentStream");
  71049. return;
  71050. }
  71051. trackDecodeInfo.clearDtsInfo(track);
  71052. gops = alignedGops;
  71053. }
  71054. trackDecodeInfo.collectDtsInfo(track, gops);
  71055. track.samples = frameUtils.generateSampleTable(gops);
  71056. mdat2 = mp43.mdat(frameUtils.concatenateNalData(gops));
  71057. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  71058. this.trigger("processedGopsInfo", gops.map(function(gop) {
  71059. return {
  71060. pts: gop.pts,
  71061. dts: gop.dts,
  71062. byteLength: gop.byteLength
  71063. };
  71064. }));
  71065. firstGop = gops[0];
  71066. lastGop = gops[gops.length - 1];
  71067. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  71068. this.trigger("timingInfo", {
  71069. start: gops[0].pts,
  71070. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  71071. });
  71072. this.gopCache_.unshift({
  71073. gop: gops.pop(),
  71074. pps: track.pps,
  71075. sps: track.sps
  71076. });
  71077. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  71078. nalUnits = [];
  71079. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  71080. this.trigger("timelineStartInfo", track.timelineStartInfo);
  71081. moof2 = mp43.moof(sequenceNumber, [track]);
  71082. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  71083. sequenceNumber++;
  71084. boxes.set(moof2);
  71085. boxes.set(mdat2, moof2.byteLength);
  71086. this.trigger("data", {
  71087. track,
  71088. boxes
  71089. });
  71090. this.resetStream_();
  71091. this.trigger("done", "VideoSegmentStream");
  71092. };
  71093. this.reset = function() {
  71094. this.resetStream_();
  71095. nalUnits = [];
  71096. this.gopCache_.length = 0;
  71097. gopsToAlignWith.length = 0;
  71098. this.trigger("reset");
  71099. };
  71100. this.resetStream_ = function() {
  71101. trackDecodeInfo.clearDtsInfo(track);
  71102. config = void 0;
  71103. pps = void 0;
  71104. };
  71105. this.getGopForFusion_ = function(nalUnit) {
  71106. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  71107. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  71108. currentGopObj = this.gopCache_[i2];
  71109. currentGop = currentGopObj.gop;
  71110. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  71111. continue;
  71112. }
  71113. if (currentGop.dts < track.timelineStartInfo.dts) {
  71114. continue;
  71115. }
  71116. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  71117. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  71118. if (!nearestGopObj || nearestDistance > dtsDistance) {
  71119. nearestGopObj = currentGopObj;
  71120. nearestDistance = dtsDistance;
  71121. }
  71122. }
  71123. }
  71124. if (nearestGopObj) {
  71125. return nearestGopObj.gop;
  71126. }
  71127. return null;
  71128. };
  71129. this.alignGopsAtStart_ = function(gops) {
  71130. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  71131. byteLength = gops.byteLength;
  71132. nalCount = gops.nalCount;
  71133. duration5 = gops.duration;
  71134. alignIndex = gopIndex = 0;
  71135. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  71136. align = gopsToAlignWith[alignIndex];
  71137. gop = gops[gopIndex];
  71138. if (align.pts === gop.pts) {
  71139. break;
  71140. }
  71141. if (gop.pts > align.pts) {
  71142. alignIndex++;
  71143. continue;
  71144. }
  71145. gopIndex++;
  71146. byteLength -= gop.byteLength;
  71147. nalCount -= gop.nalCount;
  71148. duration5 -= gop.duration;
  71149. }
  71150. if (gopIndex === 0) {
  71151. return gops;
  71152. }
  71153. if (gopIndex === gops.length) {
  71154. return null;
  71155. }
  71156. alignedGops = gops.slice(gopIndex);
  71157. alignedGops.byteLength = byteLength;
  71158. alignedGops.duration = duration5;
  71159. alignedGops.nalCount = nalCount;
  71160. alignedGops.pts = alignedGops[0].pts;
  71161. alignedGops.dts = alignedGops[0].dts;
  71162. return alignedGops;
  71163. };
  71164. this.alignGopsAtEnd_ = function(gops) {
  71165. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  71166. alignIndex = gopsToAlignWith.length - 1;
  71167. gopIndex = gops.length - 1;
  71168. alignEndIndex = null;
  71169. matchFound = false;
  71170. while (alignIndex >= 0 && gopIndex >= 0) {
  71171. align = gopsToAlignWith[alignIndex];
  71172. gop = gops[gopIndex];
  71173. if (align.pts === gop.pts) {
  71174. matchFound = true;
  71175. break;
  71176. }
  71177. if (align.pts > gop.pts) {
  71178. alignIndex--;
  71179. continue;
  71180. }
  71181. if (alignIndex === gopsToAlignWith.length - 1) {
  71182. alignEndIndex = gopIndex;
  71183. }
  71184. gopIndex--;
  71185. }
  71186. if (!matchFound && alignEndIndex === null) {
  71187. return null;
  71188. }
  71189. var trimIndex;
  71190. if (matchFound) {
  71191. trimIndex = gopIndex;
  71192. } else {
  71193. trimIndex = alignEndIndex;
  71194. }
  71195. if (trimIndex === 0) {
  71196. return gops;
  71197. }
  71198. var alignedGops = gops.slice(trimIndex);
  71199. var metadata = alignedGops.reduce(function(total, gop2) {
  71200. total.byteLength += gop2.byteLength;
  71201. total.duration += gop2.duration;
  71202. total.nalCount += gop2.nalCount;
  71203. return total;
  71204. }, {
  71205. byteLength: 0,
  71206. duration: 0,
  71207. nalCount: 0
  71208. });
  71209. alignedGops.byteLength = metadata.byteLength;
  71210. alignedGops.duration = metadata.duration;
  71211. alignedGops.nalCount = metadata.nalCount;
  71212. alignedGops.pts = alignedGops[0].pts;
  71213. alignedGops.dts = alignedGops[0].dts;
  71214. return alignedGops;
  71215. };
  71216. this.alignGopsWith = function(newGopsToAlignWith) {
  71217. gopsToAlignWith = newGopsToAlignWith;
  71218. };
  71219. };
  71220. VideoSegmentStream.prototype = new Stream2();
  71221. CoalesceStream = function(options2, metadataStream2) {
  71222. this.numberOfTracks = 0;
  71223. this.metadataStream = metadataStream2;
  71224. options2 = options2 || {};
  71225. if (typeof options2.remux !== "undefined") {
  71226. this.remuxTracks = !!options2.remux;
  71227. } else {
  71228. this.remuxTracks = true;
  71229. }
  71230. if (typeof options2.keepOriginalTimestamps === "boolean") {
  71231. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  71232. } else {
  71233. this.keepOriginalTimestamps = false;
  71234. }
  71235. this.pendingTracks = [];
  71236. this.videoTrack = null;
  71237. this.pendingBoxes = [];
  71238. this.pendingCaptions = [];
  71239. this.pendingMetadata = [];
  71240. this.pendingBytes = 0;
  71241. this.emittedTracks = 0;
  71242. CoalesceStream.prototype.init.call(this);
  71243. this.push = function(output) {
  71244. if (output.text) {
  71245. return this.pendingCaptions.push(output);
  71246. }
  71247. if (output.frames) {
  71248. return this.pendingMetadata.push(output);
  71249. }
  71250. this.pendingTracks.push(output.track);
  71251. this.pendingBytes += output.boxes.byteLength;
  71252. if (output.track.type === "video") {
  71253. this.videoTrack = output.track;
  71254. this.pendingBoxes.push(output.boxes);
  71255. }
  71256. if (output.track.type === "audio") {
  71257. this.audioTrack = output.track;
  71258. this.pendingBoxes.unshift(output.boxes);
  71259. }
  71260. };
  71261. };
  71262. CoalesceStream.prototype = new Stream2();
  71263. CoalesceStream.prototype.flush = function(flushSource) {
  71264. var offset = 0, event2 = {
  71265. captions: [],
  71266. captionStreams: {},
  71267. metadata: [],
  71268. info: {}
  71269. }, caption, id32, initSegment, timelineStartPts = 0, i2;
  71270. if (this.pendingTracks.length < this.numberOfTracks) {
  71271. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  71272. return;
  71273. } else if (this.remuxTracks) {
  71274. return;
  71275. } else if (this.pendingTracks.length === 0) {
  71276. this.emittedTracks++;
  71277. if (this.emittedTracks >= this.numberOfTracks) {
  71278. this.trigger("done");
  71279. this.emittedTracks = 0;
  71280. }
  71281. return;
  71282. }
  71283. }
  71284. if (this.videoTrack) {
  71285. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  71286. VIDEO_PROPERTIES.forEach(function(prop) {
  71287. event2.info[prop] = this.videoTrack[prop];
  71288. }, this);
  71289. } else if (this.audioTrack) {
  71290. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  71291. AUDIO_PROPERTIES.forEach(function(prop) {
  71292. event2.info[prop] = this.audioTrack[prop];
  71293. }, this);
  71294. }
  71295. if (this.videoTrack || this.audioTrack) {
  71296. if (this.pendingTracks.length === 1) {
  71297. event2.type = this.pendingTracks[0].type;
  71298. } else {
  71299. event2.type = "combined";
  71300. }
  71301. this.emittedTracks += this.pendingTracks.length;
  71302. initSegment = mp43.initSegment(this.pendingTracks);
  71303. event2.initSegment = new Uint8Array(initSegment.byteLength);
  71304. event2.initSegment.set(initSegment);
  71305. event2.data = new Uint8Array(this.pendingBytes);
  71306. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  71307. event2.data.set(this.pendingBoxes[i2], offset);
  71308. offset += this.pendingBoxes[i2].byteLength;
  71309. }
  71310. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  71311. caption = this.pendingCaptions[i2];
  71312. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  71313. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  71314. event2.captionStreams[caption.stream] = true;
  71315. event2.captions.push(caption);
  71316. }
  71317. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  71318. id32 = this.pendingMetadata[i2];
  71319. id32.cueTime = clock2.metadataTsToSeconds(id32.pts, timelineStartPts, this.keepOriginalTimestamps);
  71320. event2.metadata.push(id32);
  71321. }
  71322. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  71323. this.pendingTracks.length = 0;
  71324. this.videoTrack = null;
  71325. this.pendingBoxes.length = 0;
  71326. this.pendingCaptions.length = 0;
  71327. this.pendingBytes = 0;
  71328. this.pendingMetadata.length = 0;
  71329. this.trigger("data", event2);
  71330. for (i2 = 0; i2 < event2.captions.length; i2++) {
  71331. caption = event2.captions[i2];
  71332. this.trigger("caption", caption);
  71333. }
  71334. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  71335. id32 = event2.metadata[i2];
  71336. this.trigger("id3Frame", id32);
  71337. }
  71338. }
  71339. if (this.emittedTracks >= this.numberOfTracks) {
  71340. this.trigger("done");
  71341. this.emittedTracks = 0;
  71342. }
  71343. };
  71344. CoalesceStream.prototype.setRemux = function(val) {
  71345. this.remuxTracks = val;
  71346. };
  71347. Transmuxer = function(options2) {
  71348. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  71349. Transmuxer.prototype.init.call(this);
  71350. options2 = options2 || {};
  71351. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  71352. this.transmuxPipeline_ = {};
  71353. this.setupAacPipeline = function() {
  71354. var pipeline = {};
  71355. this.transmuxPipeline_ = pipeline;
  71356. pipeline.type = "aac";
  71357. pipeline.metadataStream = new m2ts.MetadataStream();
  71358. pipeline.aacStream = new AacStream();
  71359. pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream("audio");
  71360. pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream("timed-metadata");
  71361. pipeline.adtsStream = new AdtsStream();
  71362. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71363. pipeline.headOfPipeline = pipeline.aacStream;
  71364. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  71365. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71366. pipeline.metadataStream.on("timestamp", function(frame) {
  71367. pipeline.aacStream.setTimestamp(frame.timeStamp);
  71368. });
  71369. pipeline.aacStream.on("data", function(data) {
  71370. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  71371. return;
  71372. }
  71373. audioTrack = audioTrack || {
  71374. timelineStartInfo: {
  71375. baseMediaDecodeTime: self2.baseMediaDecodeTime
  71376. },
  71377. codec: "adts",
  71378. type: "audio"
  71379. };
  71380. pipeline.coalesceStream.numberOfTracks++;
  71381. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71382. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71383. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71384. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71385. self2.trigger("trackinfo", {
  71386. hasAudio: !!audioTrack,
  71387. hasVideo: !!videoTrack
  71388. });
  71389. });
  71390. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71391. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71392. addPipelineLogRetriggers(this, pipeline);
  71393. };
  71394. this.setupTsPipeline = function() {
  71395. var pipeline = {};
  71396. this.transmuxPipeline_ = pipeline;
  71397. pipeline.type = "ts";
  71398. pipeline.metadataStream = new m2ts.MetadataStream();
  71399. pipeline.packetStream = new m2ts.TransportPacketStream();
  71400. pipeline.parseStream = new m2ts.TransportParseStream();
  71401. pipeline.elementaryStream = new m2ts.ElementaryStream();
  71402. pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream();
  71403. pipeline.adtsStream = new AdtsStream();
  71404. pipeline.h264Stream = new H264Stream();
  71405. pipeline.captionStream = new m2ts.CaptionStream(options2);
  71406. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71407. pipeline.headOfPipeline = pipeline.packetStream;
  71408. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  71409. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  71410. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  71411. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71412. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  71413. pipeline.elementaryStream.on("data", function(data) {
  71414. var i2;
  71415. if (data.type === "metadata") {
  71416. i2 = data.tracks.length;
  71417. while (i2--) {
  71418. if (!videoTrack && data.tracks[i2].type === "video") {
  71419. videoTrack = data.tracks[i2];
  71420. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71421. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  71422. audioTrack = data.tracks[i2];
  71423. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71424. }
  71425. }
  71426. if (videoTrack && !pipeline.videoSegmentStream) {
  71427. pipeline.coalesceStream.numberOfTracks++;
  71428. pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options2);
  71429. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  71430. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  71431. if (audioTrack && !options2.keepOriginalTimestamps) {
  71432. audioTrack.timelineStartInfo = timelineStartInfo;
  71433. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  71434. }
  71435. });
  71436. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  71437. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  71438. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  71439. if (audioTrack) {
  71440. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  71441. }
  71442. });
  71443. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  71444. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  71445. }
  71446. if (audioTrack && !pipeline.audioSegmentStream) {
  71447. pipeline.coalesceStream.numberOfTracks++;
  71448. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71449. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71450. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71451. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  71452. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71453. }
  71454. self2.trigger("trackinfo", {
  71455. hasAudio: !!audioTrack,
  71456. hasVideo: !!videoTrack
  71457. });
  71458. }
  71459. });
  71460. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71461. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  71462. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  71463. self2.trigger("id3Frame", id3Frame);
  71464. });
  71465. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  71466. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71467. addPipelineLogRetriggers(this, pipeline);
  71468. };
  71469. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  71470. var pipeline = this.transmuxPipeline_;
  71471. if (!options2.keepOriginalTimestamps) {
  71472. this.baseMediaDecodeTime = baseMediaDecodeTime;
  71473. }
  71474. if (audioTrack) {
  71475. audioTrack.timelineStartInfo.dts = void 0;
  71476. audioTrack.timelineStartInfo.pts = void 0;
  71477. trackDecodeInfo.clearDtsInfo(audioTrack);
  71478. if (pipeline.audioTimestampRolloverStream) {
  71479. pipeline.audioTimestampRolloverStream.discontinuity();
  71480. }
  71481. }
  71482. if (videoTrack) {
  71483. if (pipeline.videoSegmentStream) {
  71484. pipeline.videoSegmentStream.gopCache_ = [];
  71485. }
  71486. videoTrack.timelineStartInfo.dts = void 0;
  71487. videoTrack.timelineStartInfo.pts = void 0;
  71488. trackDecodeInfo.clearDtsInfo(videoTrack);
  71489. pipeline.captionStream.reset();
  71490. }
  71491. if (pipeline.timestampRolloverStream) {
  71492. pipeline.timestampRolloverStream.discontinuity();
  71493. }
  71494. };
  71495. this.setAudioAppendStart = function(timestamp) {
  71496. if (audioTrack) {
  71497. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  71498. }
  71499. };
  71500. this.setRemux = function(val) {
  71501. var pipeline = this.transmuxPipeline_;
  71502. options2.remux = val;
  71503. if (pipeline && pipeline.coalesceStream) {
  71504. pipeline.coalesceStream.setRemux(val);
  71505. }
  71506. };
  71507. this.alignGopsWith = function(gopsToAlignWith) {
  71508. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  71509. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  71510. }
  71511. };
  71512. this.getLogTrigger_ = function(key) {
  71513. var self3 = this;
  71514. return function(event2) {
  71515. event2.stream = key;
  71516. self3.trigger("log", event2);
  71517. };
  71518. };
  71519. this.push = function(data) {
  71520. if (hasFlushed) {
  71521. var isAac = isLikelyAacData(data);
  71522. if (isAac && this.transmuxPipeline_.type !== "aac") {
  71523. this.setupAacPipeline();
  71524. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  71525. this.setupTsPipeline();
  71526. }
  71527. hasFlushed = false;
  71528. }
  71529. this.transmuxPipeline_.headOfPipeline.push(data);
  71530. };
  71531. this.flush = function() {
  71532. hasFlushed = true;
  71533. this.transmuxPipeline_.headOfPipeline.flush();
  71534. };
  71535. this.endTimeline = function() {
  71536. this.transmuxPipeline_.headOfPipeline.endTimeline();
  71537. };
  71538. this.reset = function() {
  71539. if (this.transmuxPipeline_.headOfPipeline) {
  71540. this.transmuxPipeline_.headOfPipeline.reset();
  71541. }
  71542. };
  71543. this.resetCaptions = function() {
  71544. if (this.transmuxPipeline_.captionStream) {
  71545. this.transmuxPipeline_.captionStream.reset();
  71546. }
  71547. };
  71548. };
  71549. Transmuxer.prototype = new Stream2();
  71550. var transmuxer = {
  71551. Transmuxer,
  71552. VideoSegmentStream,
  71553. AudioSegmentStream,
  71554. AUDIO_PROPERTIES,
  71555. VIDEO_PROPERTIES,
  71556. generateSegmentTimingInfo
  71557. };
  71558. var toUnsigned$3 = function(value) {
  71559. return value >>> 0;
  71560. };
  71561. var toHexString$1 = function(value) {
  71562. return ("00" + value.toString(16)).slice(-2);
  71563. };
  71564. var bin = {
  71565. toUnsigned: toUnsigned$3,
  71566. toHexString: toHexString$1
  71567. };
  71568. var parseType$3 = function(buffer) {
  71569. var result = "";
  71570. result += String.fromCharCode(buffer[0]);
  71571. result += String.fromCharCode(buffer[1]);
  71572. result += String.fromCharCode(buffer[2]);
  71573. result += String.fromCharCode(buffer[3]);
  71574. return result;
  71575. };
  71576. var parseType_1 = parseType$3;
  71577. var toUnsigned$2 = bin.toUnsigned;
  71578. var parseType$2 = parseType_1;
  71579. var findBox$2 = function(data, path) {
  71580. var results = [], i2, size, type3, end, subresults;
  71581. if (!path.length) {
  71582. return null;
  71583. }
  71584. for (i2 = 0; i2 < data.byteLength; ) {
  71585. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  71586. type3 = parseType$2(data.subarray(i2 + 4, i2 + 8));
  71587. end = size > 1 ? i2 + size : data.byteLength;
  71588. if (type3 === path[0]) {
  71589. if (path.length === 1) {
  71590. results.push(data.subarray(i2 + 8, end));
  71591. } else {
  71592. subresults = findBox$2(data.subarray(i2 + 8, end), path.slice(1));
  71593. if (subresults.length) {
  71594. results = results.concat(subresults);
  71595. }
  71596. }
  71597. }
  71598. i2 = end;
  71599. }
  71600. return results;
  71601. };
  71602. var findBox_1 = findBox$2;
  71603. var toUnsigned$1 = bin.toUnsigned;
  71604. var getUint64$22 = numbers2.getUint64;
  71605. var tfdt = function(data) {
  71606. var result = {
  71607. version: data[0],
  71608. flags: new Uint8Array(data.subarray(1, 4))
  71609. };
  71610. if (result.version === 1) {
  71611. result.baseMediaDecodeTime = getUint64$22(data.subarray(4));
  71612. } else {
  71613. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  71614. }
  71615. return result;
  71616. };
  71617. var parseTfdt$2 = tfdt;
  71618. var parseSampleFlags$1 = function(flags) {
  71619. return {
  71620. isLeading: (flags[0] & 12) >>> 2,
  71621. dependsOn: flags[0] & 3,
  71622. isDependedOn: (flags[1] & 192) >>> 6,
  71623. hasRedundancy: (flags[1] & 48) >>> 4,
  71624. paddingValue: (flags[1] & 14) >>> 1,
  71625. isNonSyncSample: flags[1] & 1,
  71626. degradationPriority: flags[2] << 8 | flags[3]
  71627. };
  71628. };
  71629. var parseSampleFlags_1 = parseSampleFlags$1;
  71630. var parseSampleFlags = parseSampleFlags_1;
  71631. var trun = function(data) {
  71632. var result = {
  71633. version: data[0],
  71634. flags: new Uint8Array(data.subarray(1, 4)),
  71635. samples: []
  71636. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  71637. if (dataOffsetPresent) {
  71638. result.dataOffset = view.getInt32(offset);
  71639. offset += 4;
  71640. }
  71641. if (firstSampleFlagsPresent && sampleCount) {
  71642. sample = {
  71643. flags: parseSampleFlags(data.subarray(offset, offset + 4))
  71644. };
  71645. offset += 4;
  71646. if (sampleDurationPresent) {
  71647. sample.duration = view.getUint32(offset);
  71648. offset += 4;
  71649. }
  71650. if (sampleSizePresent) {
  71651. sample.size = view.getUint32(offset);
  71652. offset += 4;
  71653. }
  71654. if (sampleCompositionTimeOffsetPresent) {
  71655. if (result.version === 1) {
  71656. sample.compositionTimeOffset = view.getInt32(offset);
  71657. } else {
  71658. sample.compositionTimeOffset = view.getUint32(offset);
  71659. }
  71660. offset += 4;
  71661. }
  71662. result.samples.push(sample);
  71663. sampleCount--;
  71664. }
  71665. while (sampleCount--) {
  71666. sample = {};
  71667. if (sampleDurationPresent) {
  71668. sample.duration = view.getUint32(offset);
  71669. offset += 4;
  71670. }
  71671. if (sampleSizePresent) {
  71672. sample.size = view.getUint32(offset);
  71673. offset += 4;
  71674. }
  71675. if (sampleFlagsPresent) {
  71676. sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));
  71677. offset += 4;
  71678. }
  71679. if (sampleCompositionTimeOffsetPresent) {
  71680. if (result.version === 1) {
  71681. sample.compositionTimeOffset = view.getInt32(offset);
  71682. } else {
  71683. sample.compositionTimeOffset = view.getUint32(offset);
  71684. }
  71685. offset += 4;
  71686. }
  71687. result.samples.push(sample);
  71688. }
  71689. return result;
  71690. };
  71691. var parseTrun$2 = trun;
  71692. var tfhd = function(data) {
  71693. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  71694. version: data[0],
  71695. flags: new Uint8Array(data.subarray(1, 4)),
  71696. trackId: view.getUint32(4)
  71697. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  71698. i2 = 8;
  71699. if (baseDataOffsetPresent) {
  71700. i2 += 4;
  71701. result.baseDataOffset = view.getUint32(12);
  71702. i2 += 4;
  71703. }
  71704. if (sampleDescriptionIndexPresent) {
  71705. result.sampleDescriptionIndex = view.getUint32(i2);
  71706. i2 += 4;
  71707. }
  71708. if (defaultSampleDurationPresent) {
  71709. result.defaultSampleDuration = view.getUint32(i2);
  71710. i2 += 4;
  71711. }
  71712. if (defaultSampleSizePresent) {
  71713. result.defaultSampleSize = view.getUint32(i2);
  71714. i2 += 4;
  71715. }
  71716. if (defaultSampleFlagsPresent) {
  71717. result.defaultSampleFlags = view.getUint32(i2);
  71718. }
  71719. if (durationIsEmpty) {
  71720. result.durationIsEmpty = true;
  71721. }
  71722. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  71723. result.baseDataOffsetIsMoof = true;
  71724. }
  71725. return result;
  71726. };
  71727. var parseTfhd$2 = tfhd;
  71728. var win2;
  71729. if (typeof window !== "undefined") {
  71730. win2 = window;
  71731. } else if (typeof commonjsGlobal2 !== "undefined") {
  71732. win2 = commonjsGlobal2;
  71733. } else if (typeof self !== "undefined") {
  71734. win2 = self;
  71735. } else {
  71736. win2 = {};
  71737. }
  71738. var window_12 = win2;
  71739. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  71740. var CaptionStream = captionStream.CaptionStream;
  71741. var findBox$12 = findBox_1;
  71742. var parseTfdt$1 = parseTfdt$2;
  71743. var parseTrun$1 = parseTrun$2;
  71744. var parseTfhd$1 = parseTfhd$2;
  71745. var window$22 = window_12;
  71746. var mapToSample = function(offset, samples) {
  71747. var approximateOffset = offset;
  71748. for (var i2 = 0; i2 < samples.length; i2++) {
  71749. var sample = samples[i2];
  71750. if (approximateOffset < sample.size) {
  71751. return sample;
  71752. }
  71753. approximateOffset -= sample.size;
  71754. }
  71755. return null;
  71756. };
  71757. var findSeiNals = function(avcStream, samples, trackId) {
  71758. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  71759. logs: [],
  71760. seiNals: []
  71761. }, seiNal, i2, length, lastMatchedSample;
  71762. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  71763. length = avcView.getUint32(i2);
  71764. i2 += 4;
  71765. if (length <= 0) {
  71766. continue;
  71767. }
  71768. switch (avcStream[i2] & 31) {
  71769. case 6:
  71770. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  71771. var matchingSample = mapToSample(i2, samples);
  71772. seiNal = {
  71773. nalUnitType: "sei_rbsp",
  71774. size: length,
  71775. data,
  71776. escapedRBSP: discardEmulationPreventionBytes4(data),
  71777. trackId
  71778. };
  71779. if (matchingSample) {
  71780. seiNal.pts = matchingSample.pts;
  71781. seiNal.dts = matchingSample.dts;
  71782. lastMatchedSample = matchingSample;
  71783. } else if (lastMatchedSample) {
  71784. seiNal.pts = lastMatchedSample.pts;
  71785. seiNal.dts = lastMatchedSample.dts;
  71786. } else {
  71787. result.logs.push({
  71788. level: "warn",
  71789. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  71790. });
  71791. break;
  71792. }
  71793. result.seiNals.push(seiNal);
  71794. break;
  71795. }
  71796. }
  71797. return result;
  71798. };
  71799. var parseSamples = function(truns, baseMediaDecodeTime, tfhd2) {
  71800. var currentDts = baseMediaDecodeTime;
  71801. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  71802. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  71803. var trackId = tfhd2.trackId;
  71804. var allSamples = [];
  71805. truns.forEach(function(trun2) {
  71806. var trackRun = parseTrun$1(trun2);
  71807. var samples = trackRun.samples;
  71808. samples.forEach(function(sample) {
  71809. if (sample.duration === void 0) {
  71810. sample.duration = defaultSampleDuration;
  71811. }
  71812. if (sample.size === void 0) {
  71813. sample.size = defaultSampleSize;
  71814. }
  71815. sample.trackId = trackId;
  71816. sample.dts = currentDts;
  71817. if (sample.compositionTimeOffset === void 0) {
  71818. sample.compositionTimeOffset = 0;
  71819. }
  71820. if (typeof currentDts === "bigint") {
  71821. sample.pts = currentDts + window$22.BigInt(sample.compositionTimeOffset);
  71822. currentDts += window$22.BigInt(sample.duration);
  71823. } else {
  71824. sample.pts = currentDts + sample.compositionTimeOffset;
  71825. currentDts += sample.duration;
  71826. }
  71827. });
  71828. allSamples = allSamples.concat(samples);
  71829. });
  71830. return allSamples;
  71831. };
  71832. var parseCaptionNals = function(segment, videoTrackId) {
  71833. var trafs = findBox$12(segment, ["moof", "traf"]);
  71834. var mdats = findBox$12(segment, ["mdat"]);
  71835. var captionNals = {};
  71836. var mdatTrafPairs = [];
  71837. mdats.forEach(function(mdat2, index2) {
  71838. var matchingTraf = trafs[index2];
  71839. mdatTrafPairs.push({
  71840. mdat: mdat2,
  71841. traf: matchingTraf
  71842. });
  71843. });
  71844. mdatTrafPairs.forEach(function(pair) {
  71845. var mdat2 = pair.mdat;
  71846. var traf2 = pair.traf;
  71847. var tfhd2 = findBox$12(traf2, ["tfhd"]);
  71848. var headerInfo = parseTfhd$1(tfhd2[0]);
  71849. var trackId = headerInfo.trackId;
  71850. var tfdt2 = findBox$12(traf2, ["tfdt"]);
  71851. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt$1(tfdt2[0]).baseMediaDecodeTime : 0;
  71852. var truns = findBox$12(traf2, ["trun"]);
  71853. var samples;
  71854. var result;
  71855. if (videoTrackId === trackId && truns.length > 0) {
  71856. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  71857. result = findSeiNals(mdat2, samples, trackId);
  71858. if (!captionNals[trackId]) {
  71859. captionNals[trackId] = {
  71860. seiNals: [],
  71861. logs: []
  71862. };
  71863. }
  71864. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  71865. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  71866. }
  71867. });
  71868. return captionNals;
  71869. };
  71870. var parseEmbeddedCaptions = function(segment, trackId, timescale3) {
  71871. var captionNals;
  71872. if (trackId === null) {
  71873. return null;
  71874. }
  71875. captionNals = parseCaptionNals(segment, trackId);
  71876. var trackNals = captionNals[trackId] || {};
  71877. return {
  71878. seiNals: trackNals.seiNals,
  71879. logs: trackNals.logs,
  71880. timescale: timescale3
  71881. };
  71882. };
  71883. var CaptionParser = function() {
  71884. var isInitialized = false;
  71885. var captionStream2;
  71886. var segmentCache;
  71887. var trackId;
  71888. var timescale3;
  71889. var parsedCaptions;
  71890. var parsingPartial;
  71891. this.isInitialized = function() {
  71892. return isInitialized;
  71893. };
  71894. this.init = function(options2) {
  71895. captionStream2 = new CaptionStream();
  71896. isInitialized = true;
  71897. parsingPartial = options2 ? options2.isPartial : false;
  71898. captionStream2.on("data", function(event2) {
  71899. event2.startTime = event2.startPts / timescale3;
  71900. event2.endTime = event2.endPts / timescale3;
  71901. parsedCaptions.captions.push(event2);
  71902. parsedCaptions.captionStreams[event2.stream] = true;
  71903. });
  71904. captionStream2.on("log", function(log2) {
  71905. parsedCaptions.logs.push(log2);
  71906. });
  71907. };
  71908. this.isNewInit = function(videoTrackIds, timescales) {
  71909. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  71910. return false;
  71911. }
  71912. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  71913. };
  71914. this.parse = function(segment, videoTrackIds, timescales) {
  71915. var parsedData;
  71916. if (!this.isInitialized()) {
  71917. return null;
  71918. } else if (!videoTrackIds || !timescales) {
  71919. return null;
  71920. } else if (this.isNewInit(videoTrackIds, timescales)) {
  71921. trackId = videoTrackIds[0];
  71922. timescale3 = timescales[trackId];
  71923. } else if (trackId === null || !timescale3) {
  71924. segmentCache.push(segment);
  71925. return null;
  71926. }
  71927. while (segmentCache.length > 0) {
  71928. var cachedSegment = segmentCache.shift();
  71929. this.parse(cachedSegment, videoTrackIds, timescales);
  71930. }
  71931. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  71932. if (parsedData && parsedData.logs) {
  71933. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  71934. }
  71935. if (parsedData === null || !parsedData.seiNals) {
  71936. if (parsedCaptions.logs.length) {
  71937. return {
  71938. logs: parsedCaptions.logs,
  71939. captions: [],
  71940. captionStreams: []
  71941. };
  71942. }
  71943. return null;
  71944. }
  71945. this.pushNals(parsedData.seiNals);
  71946. this.flushStream();
  71947. return parsedCaptions;
  71948. };
  71949. this.pushNals = function(nals) {
  71950. if (!this.isInitialized() || !nals || nals.length === 0) {
  71951. return null;
  71952. }
  71953. nals.forEach(function(nal) {
  71954. captionStream2.push(nal);
  71955. });
  71956. };
  71957. this.flushStream = function() {
  71958. if (!this.isInitialized()) {
  71959. return null;
  71960. }
  71961. if (!parsingPartial) {
  71962. captionStream2.flush();
  71963. } else {
  71964. captionStream2.partialFlush();
  71965. }
  71966. };
  71967. this.clearParsedCaptions = function() {
  71968. parsedCaptions.captions = [];
  71969. parsedCaptions.captionStreams = {};
  71970. parsedCaptions.logs = [];
  71971. };
  71972. this.resetCaptionStream = function() {
  71973. if (!this.isInitialized()) {
  71974. return null;
  71975. }
  71976. captionStream2.reset();
  71977. };
  71978. this.clearAllCaptions = function() {
  71979. this.clearParsedCaptions();
  71980. this.resetCaptionStream();
  71981. };
  71982. this.reset = function() {
  71983. segmentCache = [];
  71984. trackId = null;
  71985. timescale3 = null;
  71986. if (!parsedCaptions) {
  71987. parsedCaptions = {
  71988. captions: [],
  71989. captionStreams: {},
  71990. logs: []
  71991. };
  71992. } else {
  71993. this.clearParsedCaptions();
  71994. }
  71995. this.resetCaptionStream();
  71996. };
  71997. this.reset();
  71998. };
  71999. var captionParser = CaptionParser;
  72000. var uint8ToCString$1 = function(data) {
  72001. var index2 = 0;
  72002. var curChar = String.fromCharCode(data[index2]);
  72003. var retString = "";
  72004. while (curChar !== "\0") {
  72005. retString += curChar;
  72006. index2++;
  72007. curChar = String.fromCharCode(data[index2]);
  72008. }
  72009. retString += curChar;
  72010. return retString;
  72011. };
  72012. var string = {
  72013. uint8ToCString: uint8ToCString$1
  72014. };
  72015. var uint8ToCString = string.uint8ToCString;
  72016. var getUint64$12 = numbers2.getUint64;
  72017. var parseEmsgBox = function(boxData) {
  72018. var offset = 4;
  72019. var version2 = boxData[0];
  72020. var scheme_id_uri, value, timescale3, presentation_time, presentation_time_delta, event_duration, id, message_data;
  72021. if (version2 === 0) {
  72022. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  72023. offset += scheme_id_uri.length;
  72024. value = uint8ToCString(boxData.subarray(offset));
  72025. offset += value.length;
  72026. var dv = new DataView(boxData.buffer);
  72027. timescale3 = dv.getUint32(offset);
  72028. offset += 4;
  72029. presentation_time_delta = dv.getUint32(offset);
  72030. offset += 4;
  72031. event_duration = dv.getUint32(offset);
  72032. offset += 4;
  72033. id = dv.getUint32(offset);
  72034. offset += 4;
  72035. } else if (version2 === 1) {
  72036. var dv = new DataView(boxData.buffer);
  72037. timescale3 = dv.getUint32(offset);
  72038. offset += 4;
  72039. presentation_time = getUint64$12(boxData.subarray(offset));
  72040. offset += 8;
  72041. event_duration = dv.getUint32(offset);
  72042. offset += 4;
  72043. id = dv.getUint32(offset);
  72044. offset += 4;
  72045. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  72046. offset += scheme_id_uri.length;
  72047. value = uint8ToCString(boxData.subarray(offset));
  72048. offset += value.length;
  72049. }
  72050. message_data = new Uint8Array(boxData.subarray(offset, boxData.byteLength));
  72051. var emsgBox = {
  72052. scheme_id_uri,
  72053. value,
  72054. timescale: timescale3 ? timescale3 : 1,
  72055. presentation_time,
  72056. presentation_time_delta,
  72057. event_duration,
  72058. id,
  72059. message_data
  72060. };
  72061. return isValidEmsgBox(version2, emsgBox) ? emsgBox : void 0;
  72062. };
  72063. var scaleTime = function(presentationTime, timescale3, timeDelta, offset) {
  72064. return presentationTime || presentationTime === 0 ? presentationTime / timescale3 : offset + timeDelta / timescale3;
  72065. };
  72066. var isValidEmsgBox = function(version2, emsg2) {
  72067. var hasScheme = emsg2.scheme_id_uri !== "\0";
  72068. var isValidV0Box = version2 === 0 && isDefined(emsg2.presentation_time_delta) && hasScheme;
  72069. var isValidV1Box = version2 === 1 && isDefined(emsg2.presentation_time) && hasScheme;
  72070. return !(version2 > 1) && isValidV0Box || isValidV1Box;
  72071. };
  72072. var isDefined = function(data) {
  72073. return data !== void 0 || data !== null;
  72074. };
  72075. var emsg$1 = {
  72076. parseEmsgBox,
  72077. scaleTime
  72078. };
  72079. var toUnsigned = bin.toUnsigned;
  72080. var toHexString = bin.toHexString;
  72081. var findBox4 = findBox_1;
  72082. var parseType$1 = parseType_1;
  72083. var emsg = emsg$1;
  72084. var parseTfhd = parseTfhd$2;
  72085. var parseTrun = parseTrun$2;
  72086. var parseTfdt = parseTfdt$2;
  72087. var getUint642 = numbers2.getUint64;
  72088. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, getEmsgID3;
  72089. var window$12 = window_12;
  72090. var parseId3Frames = parseId3.parseId3Frames;
  72091. timescale2 = function(init) {
  72092. var result = {}, traks = findBox4(init, ["moov", "trak"]);
  72093. return traks.reduce(function(result2, trak2) {
  72094. var tkhd2, version2, index2, id, mdhd2;
  72095. tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72096. if (!tkhd2) {
  72097. return null;
  72098. }
  72099. version2 = tkhd2[0];
  72100. index2 = version2 === 0 ? 12 : 20;
  72101. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  72102. mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72103. if (!mdhd2) {
  72104. return null;
  72105. }
  72106. version2 = mdhd2[0];
  72107. index2 = version2 === 0 ? 12 : 20;
  72108. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72109. return result2;
  72110. }, result);
  72111. };
  72112. startTime = function(timescale3, fragment) {
  72113. var trafs;
  72114. trafs = findBox4(fragment, ["moof", "traf"]);
  72115. var lowestTime = trafs.reduce(function(acc, traf2) {
  72116. var tfhd2 = findBox4(traf2, ["tfhd"])[0];
  72117. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  72118. var scale = timescale3[id] || 9e4;
  72119. var tfdt2 = findBox4(traf2, ["tfdt"])[0];
  72120. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  72121. var baseTime;
  72122. if (tfdt2[0] === 1) {
  72123. baseTime = getUint642(tfdt2.subarray(4, 12));
  72124. } else {
  72125. baseTime = dv.getUint32(4);
  72126. }
  72127. let seconds;
  72128. if (typeof baseTime === "bigint") {
  72129. seconds = baseTime / window$12.BigInt(scale);
  72130. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  72131. seconds = baseTime / scale;
  72132. }
  72133. if (seconds < Number.MAX_SAFE_INTEGER) {
  72134. seconds = Number(seconds);
  72135. }
  72136. if (seconds < acc) {
  72137. acc = seconds;
  72138. }
  72139. return acc;
  72140. }, Infinity);
  72141. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  72142. };
  72143. compositionStartTime = function(timescales, fragment) {
  72144. var trafBoxes = findBox4(fragment, ["moof", "traf"]);
  72145. var baseMediaDecodeTime = 0;
  72146. var compositionTimeOffset = 0;
  72147. var trackId;
  72148. if (trafBoxes && trafBoxes.length) {
  72149. var tfhd2 = findBox4(trafBoxes[0], ["tfhd"])[0];
  72150. var trun2 = findBox4(trafBoxes[0], ["trun"])[0];
  72151. var tfdt2 = findBox4(trafBoxes[0], ["tfdt"])[0];
  72152. if (tfhd2) {
  72153. var parsedTfhd = parseTfhd(tfhd2);
  72154. trackId = parsedTfhd.trackId;
  72155. }
  72156. if (tfdt2) {
  72157. var parsedTfdt = parseTfdt(tfdt2);
  72158. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  72159. }
  72160. if (trun2) {
  72161. var parsedTrun = parseTrun(trun2);
  72162. if (parsedTrun.samples && parsedTrun.samples.length) {
  72163. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  72164. }
  72165. }
  72166. }
  72167. var timescale3 = timescales[trackId] || 9e4;
  72168. if (typeof baseMediaDecodeTime === "bigint") {
  72169. compositionTimeOffset = window$12.BigInt(compositionTimeOffset);
  72170. timescale3 = window$12.BigInt(timescale3);
  72171. }
  72172. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  72173. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  72174. result = Number(result);
  72175. }
  72176. return result;
  72177. };
  72178. getVideoTrackIds = function(init) {
  72179. var traks = findBox4(init, ["moov", "trak"]);
  72180. var videoTrackIds = [];
  72181. traks.forEach(function(trak2) {
  72182. var hdlrs = findBox4(trak2, ["mdia", "hdlr"]);
  72183. var tkhds = findBox4(trak2, ["tkhd"]);
  72184. hdlrs.forEach(function(hdlr2, index2) {
  72185. var handlerType = parseType$1(hdlr2.subarray(8, 12));
  72186. var tkhd2 = tkhds[index2];
  72187. var view;
  72188. var version2;
  72189. var trackId;
  72190. if (handlerType === "vide") {
  72191. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72192. version2 = view.getUint8(0);
  72193. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  72194. videoTrackIds.push(trackId);
  72195. }
  72196. });
  72197. });
  72198. return videoTrackIds;
  72199. };
  72200. getTimescaleFromMediaHeader = function(mdhd2) {
  72201. var version2 = mdhd2[0];
  72202. var index2 = version2 === 0 ? 12 : 20;
  72203. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72204. };
  72205. getTracks = function(init) {
  72206. var traks = findBox4(init, ["moov", "trak"]);
  72207. var tracks = [];
  72208. traks.forEach(function(trak2) {
  72209. var track = {};
  72210. var tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72211. var view, tkhdVersion;
  72212. if (tkhd2) {
  72213. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72214. tkhdVersion = view.getUint8(0);
  72215. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  72216. }
  72217. var hdlr2 = findBox4(trak2, ["mdia", "hdlr"])[0];
  72218. if (hdlr2) {
  72219. var type3 = parseType$1(hdlr2.subarray(8, 12));
  72220. if (type3 === "vide") {
  72221. track.type = "video";
  72222. } else if (type3 === "soun") {
  72223. track.type = "audio";
  72224. } else {
  72225. track.type = type3;
  72226. }
  72227. }
  72228. var stsd2 = findBox4(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  72229. if (stsd2) {
  72230. var sampleDescriptions = stsd2.subarray(8);
  72231. track.codec = parseType$1(sampleDescriptions.subarray(4, 8));
  72232. var codecBox = findBox4(sampleDescriptions, [track.codec])[0];
  72233. var codecConfig, codecConfigType;
  72234. if (codecBox) {
  72235. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  72236. codecConfig = codecBox.subarray(78);
  72237. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72238. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  72239. track.codec += ".";
  72240. track.codec += toHexString(codecConfig[9]);
  72241. track.codec += toHexString(codecConfig[10]);
  72242. track.codec += toHexString(codecConfig[11]);
  72243. } else {
  72244. track.codec = "avc1.4d400d";
  72245. }
  72246. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  72247. codecConfig = codecBox.subarray(28);
  72248. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72249. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  72250. track.codec += "." + toHexString(codecConfig[19]);
  72251. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  72252. } else {
  72253. track.codec = "mp4a.40.2";
  72254. }
  72255. } else {
  72256. track.codec = track.codec.toLowerCase();
  72257. }
  72258. }
  72259. }
  72260. var mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72261. if (mdhd2) {
  72262. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  72263. }
  72264. tracks.push(track);
  72265. });
  72266. return tracks;
  72267. };
  72268. getEmsgID3 = function(segmentData, offset = 0) {
  72269. var emsgBoxes = findBox4(segmentData, ["emsg"]);
  72270. return emsgBoxes.map((data) => {
  72271. var parsedBox = emsg.parseEmsgBox(new Uint8Array(data));
  72272. var parsedId3Frames = parseId3Frames(parsedBox.message_data);
  72273. return {
  72274. cueTime: emsg.scaleTime(parsedBox.presentation_time, parsedBox.timescale, parsedBox.presentation_time_delta, offset),
  72275. duration: emsg.scaleTime(parsedBox.event_duration, parsedBox.timescale),
  72276. frames: parsedId3Frames
  72277. };
  72278. });
  72279. };
  72280. var probe$2 = {
  72281. findBox: findBox4,
  72282. parseType: parseType$1,
  72283. timescale: timescale2,
  72284. startTime,
  72285. compositionStartTime,
  72286. videoTrackIds: getVideoTrackIds,
  72287. tracks: getTracks,
  72288. getTimescaleFromMediaHeader,
  72289. getEmsgID3
  72290. };
  72291. var StreamTypes$1 = streamTypes;
  72292. var parsePid = function(packet) {
  72293. var pid = packet[1] & 31;
  72294. pid <<= 8;
  72295. pid |= packet[2];
  72296. return pid;
  72297. };
  72298. var parsePayloadUnitStartIndicator = function(packet) {
  72299. return !!(packet[1] & 64);
  72300. };
  72301. var parseAdaptionField = function(packet) {
  72302. var offset = 0;
  72303. if ((packet[3] & 48) >>> 4 > 1) {
  72304. offset += packet[4] + 1;
  72305. }
  72306. return offset;
  72307. };
  72308. var parseType = function(packet, pmtPid) {
  72309. var pid = parsePid(packet);
  72310. if (pid === 0) {
  72311. return "pat";
  72312. } else if (pid === pmtPid) {
  72313. return "pmt";
  72314. } else if (pmtPid) {
  72315. return "pes";
  72316. }
  72317. return null;
  72318. };
  72319. var parsePat = function(packet) {
  72320. var pusi = parsePayloadUnitStartIndicator(packet);
  72321. var offset = 4 + parseAdaptionField(packet);
  72322. if (pusi) {
  72323. offset += packet[offset] + 1;
  72324. }
  72325. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  72326. };
  72327. var parsePmt = function(packet) {
  72328. var programMapTable = {};
  72329. var pusi = parsePayloadUnitStartIndicator(packet);
  72330. var payloadOffset = 4 + parseAdaptionField(packet);
  72331. if (pusi) {
  72332. payloadOffset += packet[payloadOffset] + 1;
  72333. }
  72334. if (!(packet[payloadOffset + 5] & 1)) {
  72335. return;
  72336. }
  72337. var sectionLength, tableEnd, programInfoLength;
  72338. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  72339. tableEnd = 3 + sectionLength - 4;
  72340. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  72341. var offset = 12 + programInfoLength;
  72342. while (offset < tableEnd) {
  72343. var i2 = payloadOffset + offset;
  72344. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  72345. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  72346. }
  72347. return programMapTable;
  72348. };
  72349. var parsePesType = function(packet, programMapTable) {
  72350. var pid = parsePid(packet);
  72351. var type3 = programMapTable[pid];
  72352. switch (type3) {
  72353. case StreamTypes$1.H264_STREAM_TYPE:
  72354. return "video";
  72355. case StreamTypes$1.ADTS_STREAM_TYPE:
  72356. return "audio";
  72357. case StreamTypes$1.METADATA_STREAM_TYPE:
  72358. return "timed-metadata";
  72359. default:
  72360. return null;
  72361. }
  72362. };
  72363. var parsePesTime = function(packet) {
  72364. var pusi = parsePayloadUnitStartIndicator(packet);
  72365. if (!pusi) {
  72366. return null;
  72367. }
  72368. var offset = 4 + parseAdaptionField(packet);
  72369. if (offset >= packet.byteLength) {
  72370. return null;
  72371. }
  72372. var pes = null;
  72373. var ptsDtsFlags;
  72374. ptsDtsFlags = packet[offset + 7];
  72375. if (ptsDtsFlags & 192) {
  72376. pes = {};
  72377. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  72378. pes.pts *= 4;
  72379. pes.pts += (packet[offset + 13] & 6) >>> 1;
  72380. pes.dts = pes.pts;
  72381. if (ptsDtsFlags & 64) {
  72382. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  72383. pes.dts *= 4;
  72384. pes.dts += (packet[offset + 18] & 6) >>> 1;
  72385. }
  72386. }
  72387. return pes;
  72388. };
  72389. var parseNalUnitType = function(type3) {
  72390. switch (type3) {
  72391. case 5:
  72392. return "slice_layer_without_partitioning_rbsp_idr";
  72393. case 6:
  72394. return "sei_rbsp";
  72395. case 7:
  72396. return "seq_parameter_set_rbsp";
  72397. case 8:
  72398. return "pic_parameter_set_rbsp";
  72399. case 9:
  72400. return "access_unit_delimiter_rbsp";
  72401. default:
  72402. return null;
  72403. }
  72404. };
  72405. var videoPacketContainsKeyFrame = function(packet) {
  72406. var offset = 4 + parseAdaptionField(packet);
  72407. var frameBuffer = packet.subarray(offset);
  72408. var frameI = 0;
  72409. var frameSyncPoint = 0;
  72410. var foundKeyFrame = false;
  72411. var nalType;
  72412. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  72413. if (frameBuffer[frameSyncPoint + 2] === 1) {
  72414. frameI = frameSyncPoint + 5;
  72415. break;
  72416. }
  72417. }
  72418. while (frameI < frameBuffer.byteLength) {
  72419. switch (frameBuffer[frameI]) {
  72420. case 0:
  72421. if (frameBuffer[frameI - 1] !== 0) {
  72422. frameI += 2;
  72423. break;
  72424. } else if (frameBuffer[frameI - 2] !== 0) {
  72425. frameI++;
  72426. break;
  72427. }
  72428. if (frameSyncPoint + 3 !== frameI - 2) {
  72429. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72430. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72431. foundKeyFrame = true;
  72432. }
  72433. }
  72434. do {
  72435. frameI++;
  72436. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  72437. frameSyncPoint = frameI - 2;
  72438. frameI += 3;
  72439. break;
  72440. case 1:
  72441. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  72442. frameI += 3;
  72443. break;
  72444. }
  72445. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72446. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72447. foundKeyFrame = true;
  72448. }
  72449. frameSyncPoint = frameI - 2;
  72450. frameI += 3;
  72451. break;
  72452. default:
  72453. frameI += 3;
  72454. break;
  72455. }
  72456. }
  72457. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  72458. frameI -= frameSyncPoint;
  72459. frameSyncPoint = 0;
  72460. if (frameBuffer && frameBuffer.byteLength > 3) {
  72461. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72462. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72463. foundKeyFrame = true;
  72464. }
  72465. }
  72466. return foundKeyFrame;
  72467. };
  72468. var probe$1 = {
  72469. parseType,
  72470. parsePat,
  72471. parsePmt,
  72472. parsePayloadUnitStartIndicator,
  72473. parsePesType,
  72474. parsePesTime,
  72475. videoPacketContainsKeyFrame
  72476. };
  72477. var StreamTypes = streamTypes;
  72478. var handleRollover = timestampRolloverStream.handleRollover;
  72479. var probe = {};
  72480. probe.ts = probe$1;
  72481. probe.aac = utils2;
  72482. var ONE_SECOND_IN_TS2 = clock$2.ONE_SECOND_IN_TS;
  72483. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  72484. var parsePsi_ = function(bytes, pmt) {
  72485. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  72486. while (endIndex < bytes.byteLength) {
  72487. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72488. packet = bytes.subarray(startIndex, endIndex);
  72489. type3 = probe.ts.parseType(packet, pmt.pid);
  72490. switch (type3) {
  72491. case "pat":
  72492. pmt.pid = probe.ts.parsePat(packet);
  72493. break;
  72494. case "pmt":
  72495. var table = probe.ts.parsePmt(packet);
  72496. pmt.table = pmt.table || {};
  72497. Object.keys(table).forEach(function(key) {
  72498. pmt.table[key] = table[key];
  72499. });
  72500. break;
  72501. }
  72502. startIndex += MP2T_PACKET_LENGTH;
  72503. endIndex += MP2T_PACKET_LENGTH;
  72504. continue;
  72505. }
  72506. startIndex++;
  72507. endIndex++;
  72508. }
  72509. };
  72510. var parseAudioPes_ = function(bytes, pmt, result) {
  72511. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  72512. var endLoop = false;
  72513. while (endIndex <= bytes.byteLength) {
  72514. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72515. packet = bytes.subarray(startIndex, endIndex);
  72516. type3 = probe.ts.parseType(packet, pmt.pid);
  72517. switch (type3) {
  72518. case "pes":
  72519. pesType = probe.ts.parsePesType(packet, pmt.table);
  72520. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72521. if (pesType === "audio" && pusi) {
  72522. parsed = probe.ts.parsePesTime(packet);
  72523. if (parsed) {
  72524. parsed.type = "audio";
  72525. result.audio.push(parsed);
  72526. endLoop = true;
  72527. }
  72528. }
  72529. break;
  72530. }
  72531. if (endLoop) {
  72532. break;
  72533. }
  72534. startIndex += MP2T_PACKET_LENGTH;
  72535. endIndex += MP2T_PACKET_LENGTH;
  72536. continue;
  72537. }
  72538. startIndex++;
  72539. endIndex++;
  72540. }
  72541. endIndex = bytes.byteLength;
  72542. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72543. endLoop = false;
  72544. while (startIndex >= 0) {
  72545. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72546. packet = bytes.subarray(startIndex, endIndex);
  72547. type3 = probe.ts.parseType(packet, pmt.pid);
  72548. switch (type3) {
  72549. case "pes":
  72550. pesType = probe.ts.parsePesType(packet, pmt.table);
  72551. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72552. if (pesType === "audio" && pusi) {
  72553. parsed = probe.ts.parsePesTime(packet);
  72554. if (parsed) {
  72555. parsed.type = "audio";
  72556. result.audio.push(parsed);
  72557. endLoop = true;
  72558. }
  72559. }
  72560. break;
  72561. }
  72562. if (endLoop) {
  72563. break;
  72564. }
  72565. startIndex -= MP2T_PACKET_LENGTH;
  72566. endIndex -= MP2T_PACKET_LENGTH;
  72567. continue;
  72568. }
  72569. startIndex--;
  72570. endIndex--;
  72571. }
  72572. };
  72573. var parseVideoPes_ = function(bytes, pmt, result) {
  72574. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  72575. var endLoop = false;
  72576. var currentFrame = {
  72577. data: [],
  72578. size: 0
  72579. };
  72580. while (endIndex < bytes.byteLength) {
  72581. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72582. packet = bytes.subarray(startIndex, endIndex);
  72583. type3 = probe.ts.parseType(packet, pmt.pid);
  72584. switch (type3) {
  72585. case "pes":
  72586. pesType = probe.ts.parsePesType(packet, pmt.table);
  72587. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72588. if (pesType === "video") {
  72589. if (pusi && !endLoop) {
  72590. parsed = probe.ts.parsePesTime(packet);
  72591. if (parsed) {
  72592. parsed.type = "video";
  72593. result.video.push(parsed);
  72594. endLoop = true;
  72595. }
  72596. }
  72597. if (!result.firstKeyFrame) {
  72598. if (pusi) {
  72599. if (currentFrame.size !== 0) {
  72600. frame = new Uint8Array(currentFrame.size);
  72601. i2 = 0;
  72602. while (currentFrame.data.length) {
  72603. pes = currentFrame.data.shift();
  72604. frame.set(pes, i2);
  72605. i2 += pes.byteLength;
  72606. }
  72607. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  72608. var firstKeyFrame = probe.ts.parsePesTime(frame);
  72609. if (firstKeyFrame) {
  72610. result.firstKeyFrame = firstKeyFrame;
  72611. result.firstKeyFrame.type = "video";
  72612. } else {
  72613. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  72614. }
  72615. }
  72616. currentFrame.size = 0;
  72617. }
  72618. }
  72619. currentFrame.data.push(packet);
  72620. currentFrame.size += packet.byteLength;
  72621. }
  72622. }
  72623. break;
  72624. }
  72625. if (endLoop && result.firstKeyFrame) {
  72626. break;
  72627. }
  72628. startIndex += MP2T_PACKET_LENGTH;
  72629. endIndex += MP2T_PACKET_LENGTH;
  72630. continue;
  72631. }
  72632. startIndex++;
  72633. endIndex++;
  72634. }
  72635. endIndex = bytes.byteLength;
  72636. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72637. endLoop = false;
  72638. while (startIndex >= 0) {
  72639. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72640. packet = bytes.subarray(startIndex, endIndex);
  72641. type3 = probe.ts.parseType(packet, pmt.pid);
  72642. switch (type3) {
  72643. case "pes":
  72644. pesType = probe.ts.parsePesType(packet, pmt.table);
  72645. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72646. if (pesType === "video" && pusi) {
  72647. parsed = probe.ts.parsePesTime(packet);
  72648. if (parsed) {
  72649. parsed.type = "video";
  72650. result.video.push(parsed);
  72651. endLoop = true;
  72652. }
  72653. }
  72654. break;
  72655. }
  72656. if (endLoop) {
  72657. break;
  72658. }
  72659. startIndex -= MP2T_PACKET_LENGTH;
  72660. endIndex -= MP2T_PACKET_LENGTH;
  72661. continue;
  72662. }
  72663. startIndex--;
  72664. endIndex--;
  72665. }
  72666. };
  72667. var adjustTimestamp_ = function(segmentInfo, baseTimestamp) {
  72668. if (segmentInfo.audio && segmentInfo.audio.length) {
  72669. var audioBaseTimestamp = baseTimestamp;
  72670. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  72671. audioBaseTimestamp = segmentInfo.audio[0].dts;
  72672. }
  72673. segmentInfo.audio.forEach(function(info) {
  72674. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  72675. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  72676. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72677. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72678. });
  72679. }
  72680. if (segmentInfo.video && segmentInfo.video.length) {
  72681. var videoBaseTimestamp = baseTimestamp;
  72682. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  72683. videoBaseTimestamp = segmentInfo.video[0].dts;
  72684. }
  72685. segmentInfo.video.forEach(function(info) {
  72686. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  72687. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  72688. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72689. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72690. });
  72691. if (segmentInfo.firstKeyFrame) {
  72692. var frame = segmentInfo.firstKeyFrame;
  72693. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  72694. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  72695. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  72696. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  72697. }
  72698. }
  72699. };
  72700. var inspectAac_ = function(bytes) {
  72701. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  72702. while (bytes.length - byteIndex >= 3) {
  72703. var type3 = probe.aac.parseType(bytes, byteIndex);
  72704. switch (type3) {
  72705. case "timed-metadata":
  72706. if (bytes.length - byteIndex < 10) {
  72707. endLoop = true;
  72708. break;
  72709. }
  72710. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  72711. if (frameSize > bytes.length) {
  72712. endLoop = true;
  72713. break;
  72714. }
  72715. if (timestamp === null) {
  72716. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72717. timestamp = probe.aac.parseAacTimestamp(packet);
  72718. }
  72719. byteIndex += frameSize;
  72720. break;
  72721. case "audio":
  72722. if (bytes.length - byteIndex < 7) {
  72723. endLoop = true;
  72724. break;
  72725. }
  72726. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  72727. if (frameSize > bytes.length) {
  72728. endLoop = true;
  72729. break;
  72730. }
  72731. if (sampleRate === null) {
  72732. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72733. sampleRate = probe.aac.parseSampleRate(packet);
  72734. }
  72735. audioCount++;
  72736. byteIndex += frameSize;
  72737. break;
  72738. default:
  72739. byteIndex++;
  72740. break;
  72741. }
  72742. if (endLoop) {
  72743. return null;
  72744. }
  72745. }
  72746. if (sampleRate === null || timestamp === null) {
  72747. return null;
  72748. }
  72749. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  72750. var result = {
  72751. audio: [{
  72752. type: "audio",
  72753. dts: timestamp,
  72754. pts: timestamp
  72755. }, {
  72756. type: "audio",
  72757. dts: timestamp + audioCount * 1024 * audioTimescale,
  72758. pts: timestamp + audioCount * 1024 * audioTimescale
  72759. }]
  72760. };
  72761. return result;
  72762. };
  72763. var inspectTs_ = function(bytes) {
  72764. var pmt = {
  72765. pid: null,
  72766. table: null
  72767. };
  72768. var result = {};
  72769. parsePsi_(bytes, pmt);
  72770. for (var pid in pmt.table) {
  72771. if (pmt.table.hasOwnProperty(pid)) {
  72772. var type3 = pmt.table[pid];
  72773. switch (type3) {
  72774. case StreamTypes.H264_STREAM_TYPE:
  72775. result.video = [];
  72776. parseVideoPes_(bytes, pmt, result);
  72777. if (result.video.length === 0) {
  72778. delete result.video;
  72779. }
  72780. break;
  72781. case StreamTypes.ADTS_STREAM_TYPE:
  72782. result.audio = [];
  72783. parseAudioPes_(bytes, pmt, result);
  72784. if (result.audio.length === 0) {
  72785. delete result.audio;
  72786. }
  72787. break;
  72788. }
  72789. }
  72790. }
  72791. return result;
  72792. };
  72793. var inspect = function(bytes, baseTimestamp) {
  72794. var isAacData = probe.aac.isLikelyAacData(bytes);
  72795. var result;
  72796. if (isAacData) {
  72797. result = inspectAac_(bytes);
  72798. } else {
  72799. result = inspectTs_(bytes);
  72800. }
  72801. if (!result || !result.audio && !result.video) {
  72802. return null;
  72803. }
  72804. adjustTimestamp_(result, baseTimestamp);
  72805. return result;
  72806. };
  72807. var tsInspector = {
  72808. inspect,
  72809. parseAudioPes_
  72810. };
  72811. const wireTransmuxerEvents = function(self2, transmuxer2) {
  72812. transmuxer2.on("data", function(segment) {
  72813. const initArray = segment.initSegment;
  72814. segment.initSegment = {
  72815. data: initArray.buffer,
  72816. byteOffset: initArray.byteOffset,
  72817. byteLength: initArray.byteLength
  72818. };
  72819. const typedArray2 = segment.data;
  72820. segment.data = typedArray2.buffer;
  72821. self2.postMessage({
  72822. action: "data",
  72823. segment,
  72824. byteOffset: typedArray2.byteOffset,
  72825. byteLength: typedArray2.byteLength
  72826. }, [segment.data]);
  72827. });
  72828. transmuxer2.on("done", function(data) {
  72829. self2.postMessage({
  72830. action: "done"
  72831. });
  72832. });
  72833. transmuxer2.on("gopInfo", function(gopInfo) {
  72834. self2.postMessage({
  72835. action: "gopInfo",
  72836. gopInfo
  72837. });
  72838. });
  72839. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  72840. const videoSegmentTimingInfo = {
  72841. start: {
  72842. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72843. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72844. },
  72845. end: {
  72846. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72847. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72848. },
  72849. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72850. };
  72851. if (timingInfo.prependedContentDuration) {
  72852. videoSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72853. }
  72854. self2.postMessage({
  72855. action: "videoSegmentTimingInfo",
  72856. videoSegmentTimingInfo
  72857. });
  72858. });
  72859. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  72860. const audioSegmentTimingInfo = {
  72861. start: {
  72862. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72863. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72864. },
  72865. end: {
  72866. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72867. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72868. },
  72869. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72870. };
  72871. if (timingInfo.prependedContentDuration) {
  72872. audioSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72873. }
  72874. self2.postMessage({
  72875. action: "audioSegmentTimingInfo",
  72876. audioSegmentTimingInfo
  72877. });
  72878. });
  72879. transmuxer2.on("id3Frame", function(id3Frame) {
  72880. self2.postMessage({
  72881. action: "id3Frame",
  72882. id3Frame
  72883. });
  72884. });
  72885. transmuxer2.on("caption", function(caption) {
  72886. self2.postMessage({
  72887. action: "caption",
  72888. caption
  72889. });
  72890. });
  72891. transmuxer2.on("trackinfo", function(trackInfo) {
  72892. self2.postMessage({
  72893. action: "trackinfo",
  72894. trackInfo
  72895. });
  72896. });
  72897. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  72898. self2.postMessage({
  72899. action: "audioTimingInfo",
  72900. audioTimingInfo: {
  72901. start: clock$2.videoTsToSeconds(audioTimingInfo.start),
  72902. end: clock$2.videoTsToSeconds(audioTimingInfo.end)
  72903. }
  72904. });
  72905. });
  72906. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  72907. self2.postMessage({
  72908. action: "videoTimingInfo",
  72909. videoTimingInfo: {
  72910. start: clock$2.videoTsToSeconds(videoTimingInfo.start),
  72911. end: clock$2.videoTsToSeconds(videoTimingInfo.end)
  72912. }
  72913. });
  72914. });
  72915. transmuxer2.on("log", function(log2) {
  72916. self2.postMessage({
  72917. action: "log",
  72918. log: log2
  72919. });
  72920. });
  72921. };
  72922. class MessageHandlers {
  72923. constructor(self2, options2) {
  72924. this.options = options2 || {};
  72925. this.self = self2;
  72926. this.init();
  72927. }
  72928. init() {
  72929. if (this.transmuxer) {
  72930. this.transmuxer.dispose();
  72931. }
  72932. this.transmuxer = new transmuxer.Transmuxer(this.options);
  72933. wireTransmuxerEvents(this.self, this.transmuxer);
  72934. }
  72935. pushMp4Captions(data) {
  72936. if (!this.captionParser) {
  72937. this.captionParser = new captionParser();
  72938. this.captionParser.init();
  72939. }
  72940. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  72941. const parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  72942. this.self.postMessage({
  72943. action: "mp4Captions",
  72944. captions: parsed && parsed.captions || [],
  72945. logs: parsed && parsed.logs || [],
  72946. data: segment.buffer
  72947. }, [segment.buffer]);
  72948. }
  72949. probeMp4StartTime({
  72950. timescales,
  72951. data
  72952. }) {
  72953. const startTime2 = probe$2.startTime(timescales, data);
  72954. this.self.postMessage({
  72955. action: "probeMp4StartTime",
  72956. startTime: startTime2,
  72957. data
  72958. }, [data.buffer]);
  72959. }
  72960. probeMp4Tracks({
  72961. data
  72962. }) {
  72963. const tracks = probe$2.tracks(data);
  72964. this.self.postMessage({
  72965. action: "probeMp4Tracks",
  72966. tracks,
  72967. data
  72968. }, [data.buffer]);
  72969. }
  72970. probeTs({
  72971. data,
  72972. baseStartTime
  72973. }) {
  72974. const tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock$2.ONE_SECOND_IN_TS : void 0;
  72975. const timeInfo = tsInspector.inspect(data, tsStartTime);
  72976. let result = null;
  72977. if (timeInfo) {
  72978. result = {
  72979. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  72980. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  72981. };
  72982. if (result.hasVideo) {
  72983. result.videoStart = timeInfo.video[0].ptsTime;
  72984. }
  72985. if (result.hasAudio) {
  72986. result.audioStart = timeInfo.audio[0].ptsTime;
  72987. }
  72988. }
  72989. this.self.postMessage({
  72990. action: "probeTs",
  72991. result,
  72992. data
  72993. }, [data.buffer]);
  72994. }
  72995. clearAllMp4Captions() {
  72996. if (this.captionParser) {
  72997. this.captionParser.clearAllCaptions();
  72998. }
  72999. }
  73000. clearParsedMp4Captions() {
  73001. if (this.captionParser) {
  73002. this.captionParser.clearParsedCaptions();
  73003. }
  73004. }
  73005. push(data) {
  73006. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  73007. this.transmuxer.push(segment);
  73008. }
  73009. reset() {
  73010. this.transmuxer.reset();
  73011. }
  73012. setTimestampOffset(data) {
  73013. const timestampOffset2 = data.timestampOffset || 0;
  73014. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock$2.secondsToVideoTs(timestampOffset2)));
  73015. }
  73016. setAudioAppendStart(data) {
  73017. this.transmuxer.setAudioAppendStart(Math.ceil(clock$2.secondsToVideoTs(data.appendStart)));
  73018. }
  73019. setRemux(data) {
  73020. this.transmuxer.setRemux(data.remux);
  73021. }
  73022. flush(data) {
  73023. this.transmuxer.flush();
  73024. self.postMessage({
  73025. action: "done",
  73026. type: "transmuxed"
  73027. });
  73028. }
  73029. endTimeline() {
  73030. this.transmuxer.endTimeline();
  73031. self.postMessage({
  73032. action: "endedtimeline",
  73033. type: "transmuxed"
  73034. });
  73035. }
  73036. alignGopsWith(data) {
  73037. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  73038. }
  73039. }
  73040. self.onmessage = function(event2) {
  73041. if (event2.data.action === "init" && event2.data.options) {
  73042. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  73043. return;
  73044. }
  73045. if (!this.messageHandlers) {
  73046. this.messageHandlers = new MessageHandlers(self);
  73047. }
  73048. if (event2.data && event2.data.action && event2.data.action !== "init") {
  73049. if (this.messageHandlers[event2.data.action]) {
  73050. this.messageHandlers[event2.data.action](event2.data);
  73051. }
  73052. }
  73053. };
  73054. }));
  73055. var TransmuxWorker$1 = factory$1(workerCode$1$1);
  73056. const handleData_$1 = (event2, transmuxedData, callback2) => {
  73057. const {
  73058. type: type2,
  73059. initSegment,
  73060. captions,
  73061. captionStreams,
  73062. metadata,
  73063. videoFrameDtsTime,
  73064. videoFramePtsTime
  73065. } = event2.data.segment;
  73066. transmuxedData.buffer.push({
  73067. captions,
  73068. captionStreams,
  73069. metadata
  73070. });
  73071. const boxes = event2.data.segment.boxes || {
  73072. data: event2.data.segment.data
  73073. };
  73074. const result = {
  73075. type: type2,
  73076. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  73077. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  73078. };
  73079. if (typeof videoFrameDtsTime !== "undefined") {
  73080. result.videoFrameDtsTime = videoFrameDtsTime;
  73081. }
  73082. if (typeof videoFramePtsTime !== "undefined") {
  73083. result.videoFramePtsTime = videoFramePtsTime;
  73084. }
  73085. callback2(result);
  73086. };
  73087. const handleDone_$1 = ({
  73088. transmuxedData,
  73089. callback: callback2
  73090. }) => {
  73091. transmuxedData.buffer = [];
  73092. callback2(transmuxedData);
  73093. };
  73094. const handleGopInfo_$1 = (event2, transmuxedData) => {
  73095. transmuxedData.gopInfo = event2.data.gopInfo;
  73096. };
  73097. const processTransmux$1 = (options2) => {
  73098. const {
  73099. transmuxer,
  73100. bytes,
  73101. audioAppendStart,
  73102. gopsToAlignWith,
  73103. remux,
  73104. onData,
  73105. onTrackInfo,
  73106. onAudioTimingInfo,
  73107. onVideoTimingInfo,
  73108. onVideoSegmentTimingInfo,
  73109. onAudioSegmentTimingInfo,
  73110. onId3,
  73111. onCaptions,
  73112. onDone,
  73113. onEndedTimeline,
  73114. onTransmuxerLog,
  73115. isEndOfTimeline
  73116. } = options2;
  73117. const transmuxedData = {
  73118. buffer: []
  73119. };
  73120. let waitForEndedTimelineEvent = isEndOfTimeline;
  73121. const handleMessage = (event2) => {
  73122. if (transmuxer.currentTransmux !== options2) {
  73123. return;
  73124. }
  73125. if (event2.data.action === "data") {
  73126. handleData_$1(event2, transmuxedData, onData);
  73127. }
  73128. if (event2.data.action === "trackinfo") {
  73129. onTrackInfo(event2.data.trackInfo);
  73130. }
  73131. if (event2.data.action === "gopInfo") {
  73132. handleGopInfo_$1(event2, transmuxedData);
  73133. }
  73134. if (event2.data.action === "audioTimingInfo") {
  73135. onAudioTimingInfo(event2.data.audioTimingInfo);
  73136. }
  73137. if (event2.data.action === "videoTimingInfo") {
  73138. onVideoTimingInfo(event2.data.videoTimingInfo);
  73139. }
  73140. if (event2.data.action === "videoSegmentTimingInfo") {
  73141. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  73142. }
  73143. if (event2.data.action === "audioSegmentTimingInfo") {
  73144. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  73145. }
  73146. if (event2.data.action === "id3Frame") {
  73147. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  73148. }
  73149. if (event2.data.action === "caption") {
  73150. onCaptions(event2.data.caption);
  73151. }
  73152. if (event2.data.action === "endedtimeline") {
  73153. waitForEndedTimelineEvent = false;
  73154. onEndedTimeline();
  73155. }
  73156. if (event2.data.action === "log") {
  73157. onTransmuxerLog(event2.data.log);
  73158. }
  73159. if (event2.data.type !== "transmuxed") {
  73160. return;
  73161. }
  73162. if (waitForEndedTimelineEvent) {
  73163. return;
  73164. }
  73165. transmuxer.onmessage = null;
  73166. handleDone_$1({
  73167. transmuxedData,
  73168. callback: onDone
  73169. });
  73170. dequeue$1(transmuxer);
  73171. };
  73172. transmuxer.onmessage = handleMessage;
  73173. if (audioAppendStart) {
  73174. transmuxer.postMessage({
  73175. action: "setAudioAppendStart",
  73176. appendStart: audioAppendStart
  73177. });
  73178. }
  73179. if (Array.isArray(gopsToAlignWith)) {
  73180. transmuxer.postMessage({
  73181. action: "alignGopsWith",
  73182. gopsToAlignWith
  73183. });
  73184. }
  73185. if (typeof remux !== "undefined") {
  73186. transmuxer.postMessage({
  73187. action: "setRemux",
  73188. remux
  73189. });
  73190. }
  73191. if (bytes.byteLength) {
  73192. const buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  73193. const byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  73194. transmuxer.postMessage({
  73195. action: "push",
  73196. data: buffer,
  73197. byteOffset,
  73198. byteLength: bytes.byteLength
  73199. }, [buffer]);
  73200. }
  73201. if (isEndOfTimeline) {
  73202. transmuxer.postMessage({
  73203. action: "endTimeline"
  73204. });
  73205. }
  73206. transmuxer.postMessage({
  73207. action: "flush"
  73208. });
  73209. };
  73210. const dequeue$1 = (transmuxer) => {
  73211. transmuxer.currentTransmux = null;
  73212. if (transmuxer.transmuxQueue.length) {
  73213. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  73214. if (typeof transmuxer.currentTransmux === "function") {
  73215. transmuxer.currentTransmux();
  73216. } else {
  73217. processTransmux$1(transmuxer.currentTransmux);
  73218. }
  73219. }
  73220. };
  73221. const processAction$1 = (transmuxer, action) => {
  73222. transmuxer.postMessage({
  73223. action
  73224. });
  73225. dequeue$1(transmuxer);
  73226. };
  73227. const enqueueAction$1 = (action, transmuxer) => {
  73228. if (!transmuxer.currentTransmux) {
  73229. transmuxer.currentTransmux = action;
  73230. processAction$1(transmuxer, action);
  73231. return;
  73232. }
  73233. transmuxer.transmuxQueue.push(processAction$1.bind(null, transmuxer, action));
  73234. };
  73235. const reset$1 = (transmuxer) => {
  73236. enqueueAction$1("reset", transmuxer);
  73237. };
  73238. const endTimeline$1 = (transmuxer) => {
  73239. enqueueAction$1("endTimeline", transmuxer);
  73240. };
  73241. const transmux$1 = (options2) => {
  73242. if (!options2.transmuxer.currentTransmux) {
  73243. options2.transmuxer.currentTransmux = options2;
  73244. processTransmux$1(options2);
  73245. return;
  73246. }
  73247. options2.transmuxer.transmuxQueue.push(options2);
  73248. };
  73249. const createTransmuxer$1 = (options2) => {
  73250. const transmuxer = new TransmuxWorker$1();
  73251. transmuxer.currentTransmux = null;
  73252. transmuxer.transmuxQueue = [];
  73253. const term = transmuxer.terminate;
  73254. transmuxer.terminate = () => {
  73255. transmuxer.currentTransmux = null;
  73256. transmuxer.transmuxQueue.length = 0;
  73257. return term.call(transmuxer);
  73258. };
  73259. transmuxer.postMessage({
  73260. action: "init",
  73261. options: options2
  73262. });
  73263. return transmuxer;
  73264. };
  73265. var segmentTransmuxer$1 = {
  73266. reset: reset$1,
  73267. endTimeline: endTimeline$1,
  73268. transmux: transmux$1,
  73269. createTransmuxer: createTransmuxer$1
  73270. };
  73271. const workerCallback$1 = function(options2) {
  73272. const transmuxer = options2.transmuxer;
  73273. const endAction = options2.endAction || options2.action;
  73274. const callback2 = options2.callback;
  73275. const message = _extends$2({}, options2, {
  73276. endAction: null,
  73277. transmuxer: null,
  73278. callback: null
  73279. });
  73280. const listenForEndEvent = (event2) => {
  73281. if (event2.data.action !== endAction) {
  73282. return;
  73283. }
  73284. transmuxer.removeEventListener("message", listenForEndEvent);
  73285. if (event2.data.data) {
  73286. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  73287. if (options2.data) {
  73288. options2.data = event2.data.data;
  73289. }
  73290. }
  73291. callback2(event2.data);
  73292. };
  73293. transmuxer.addEventListener("message", listenForEndEvent);
  73294. if (options2.data) {
  73295. const isArrayBuffer = options2.data instanceof ArrayBuffer;
  73296. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  73297. message.byteLength = options2.data.byteLength;
  73298. const transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  73299. transmuxer.postMessage(message, transfers);
  73300. } else {
  73301. transmuxer.postMessage(message);
  73302. }
  73303. };
  73304. const REQUEST_ERRORS$1 = {
  73305. FAILURE: 2,
  73306. TIMEOUT: -101,
  73307. ABORTED: -102
  73308. };
  73309. const abortAll$1 = (activeXhrs) => {
  73310. activeXhrs.forEach((xhr) => {
  73311. xhr.abort();
  73312. });
  73313. };
  73314. const getRequestStats$1 = (request) => {
  73315. return {
  73316. bandwidth: request.bandwidth,
  73317. bytesReceived: request.bytesReceived || 0,
  73318. roundTripTime: request.roundTripTime || 0
  73319. };
  73320. };
  73321. const getProgressStats$1 = (progressEvent) => {
  73322. const request = progressEvent.target;
  73323. const roundTripTime = Date.now() - request.requestTime;
  73324. const stats = {
  73325. bandwidth: Infinity,
  73326. bytesReceived: 0,
  73327. roundTripTime: roundTripTime || 0
  73328. };
  73329. stats.bytesReceived = progressEvent.loaded;
  73330. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  73331. return stats;
  73332. };
  73333. const handleErrors$1 = (error, request) => {
  73334. if (request.timedout) {
  73335. return {
  73336. status: request.status,
  73337. message: "HLS request timed-out at URL: " + request.uri,
  73338. code: REQUEST_ERRORS$1.TIMEOUT,
  73339. xhr: request
  73340. };
  73341. }
  73342. if (request.aborted) {
  73343. return {
  73344. status: request.status,
  73345. message: "HLS request aborted at URL: " + request.uri,
  73346. code: REQUEST_ERRORS$1.ABORTED,
  73347. xhr: request
  73348. };
  73349. }
  73350. if (error) {
  73351. return {
  73352. status: request.status,
  73353. message: "HLS request errored at URL: " + request.uri,
  73354. code: REQUEST_ERRORS$1.FAILURE,
  73355. xhr: request
  73356. };
  73357. }
  73358. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  73359. return {
  73360. status: request.status,
  73361. message: "Empty HLS response at URL: " + request.uri,
  73362. code: REQUEST_ERRORS$1.FAILURE,
  73363. xhr: request
  73364. };
  73365. }
  73366. return null;
  73367. };
  73368. const handleKeyResponse$1 = (segment, objects, finishProcessingFn) => (error, request) => {
  73369. const response = request.response;
  73370. const errorObj = handleErrors$1(error, request);
  73371. if (errorObj) {
  73372. return finishProcessingFn(errorObj, segment);
  73373. }
  73374. if (response.byteLength !== 16) {
  73375. return finishProcessingFn({
  73376. status: request.status,
  73377. message: "Invalid HLS key at URL: " + request.uri,
  73378. code: REQUEST_ERRORS$1.FAILURE,
  73379. xhr: request
  73380. }, segment);
  73381. }
  73382. const view = new DataView(response);
  73383. const bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  73384. for (let i2 = 0; i2 < objects.length; i2++) {
  73385. objects[i2].bytes = bytes;
  73386. }
  73387. return finishProcessingFn(null, segment);
  73388. };
  73389. const parseInitSegment$1 = (segment, callback2) => {
  73390. const type2 = detectContainerForBytes$1(segment.map.bytes);
  73391. if (type2 !== "mp4") {
  73392. const uri = segment.map.resolvedUri || segment.map.uri;
  73393. return callback2({
  73394. internal: true,
  73395. message: `Found unsupported ${type2 || "unknown"} container for initialization segment at URL: ${uri}`,
  73396. code: REQUEST_ERRORS$1.FAILURE
  73397. });
  73398. }
  73399. workerCallback$1({
  73400. action: "probeMp4Tracks",
  73401. data: segment.map.bytes,
  73402. transmuxer: segment.transmuxer,
  73403. callback: ({
  73404. tracks,
  73405. data
  73406. }) => {
  73407. segment.map.bytes = data;
  73408. tracks.forEach(function(track) {
  73409. segment.map.tracks = segment.map.tracks || {};
  73410. if (segment.map.tracks[track.type]) {
  73411. return;
  73412. }
  73413. segment.map.tracks[track.type] = track;
  73414. if (typeof track.id === "number" && track.timescale) {
  73415. segment.map.timescales = segment.map.timescales || {};
  73416. segment.map.timescales[track.id] = track.timescale;
  73417. }
  73418. });
  73419. return callback2(null);
  73420. }
  73421. });
  73422. };
  73423. const handleInitSegmentResponse$1 = ({
  73424. segment,
  73425. finishProcessingFn
  73426. }) => (error, request) => {
  73427. const errorObj = handleErrors$1(error, request);
  73428. if (errorObj) {
  73429. return finishProcessingFn(errorObj, segment);
  73430. }
  73431. const bytes = new Uint8Array(request.response);
  73432. if (segment.map.key) {
  73433. segment.map.encryptedBytes = bytes;
  73434. return finishProcessingFn(null, segment);
  73435. }
  73436. segment.map.bytes = bytes;
  73437. parseInitSegment$1(segment, function(parseError) {
  73438. if (parseError) {
  73439. parseError.xhr = request;
  73440. parseError.status = request.status;
  73441. return finishProcessingFn(parseError, segment);
  73442. }
  73443. finishProcessingFn(null, segment);
  73444. });
  73445. };
  73446. const handleSegmentResponse$1 = ({
  73447. segment,
  73448. finishProcessingFn,
  73449. responseType
  73450. }) => (error, request) => {
  73451. const errorObj = handleErrors$1(error, request);
  73452. if (errorObj) {
  73453. return finishProcessingFn(errorObj, segment);
  73454. }
  73455. const newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer$1(request.responseText.substring(segment.lastReachedChar || 0));
  73456. segment.stats = getRequestStats$1(request);
  73457. if (segment.key) {
  73458. segment.encryptedBytes = new Uint8Array(newBytes);
  73459. } else {
  73460. segment.bytes = new Uint8Array(newBytes);
  73461. }
  73462. return finishProcessingFn(null, segment);
  73463. };
  73464. const transmuxAndNotify$1 = ({
  73465. segment,
  73466. bytes,
  73467. trackInfoFn,
  73468. timingInfoFn,
  73469. videoSegmentTimingInfoFn,
  73470. audioSegmentTimingInfoFn,
  73471. id3Fn,
  73472. captionsFn,
  73473. isEndOfTimeline,
  73474. endedTimelineFn,
  73475. dataFn,
  73476. doneFn,
  73477. onTransmuxerLog
  73478. }) => {
  73479. const fmp4Tracks = segment.map && segment.map.tracks || {};
  73480. const isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  73481. let audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  73482. const audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  73483. let videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  73484. const videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  73485. const finish = () => transmux$1({
  73486. bytes,
  73487. transmuxer: segment.transmuxer,
  73488. audioAppendStart: segment.audioAppendStart,
  73489. gopsToAlignWith: segment.gopsToAlignWith,
  73490. remux: isMuxed3,
  73491. onData: (result) => {
  73492. result.type = result.type === "combined" ? "video" : result.type;
  73493. dataFn(segment, result);
  73494. },
  73495. onTrackInfo: (trackInfo) => {
  73496. if (trackInfoFn) {
  73497. if (isMuxed3) {
  73498. trackInfo.isMuxed = true;
  73499. }
  73500. trackInfoFn(segment, trackInfo);
  73501. }
  73502. },
  73503. onAudioTimingInfo: (audioTimingInfo) => {
  73504. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  73505. audioStartFn(audioTimingInfo.start);
  73506. audioStartFn = null;
  73507. }
  73508. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  73509. audioEndFn(audioTimingInfo.end);
  73510. }
  73511. },
  73512. onVideoTimingInfo: (videoTimingInfo) => {
  73513. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  73514. videoStartFn(videoTimingInfo.start);
  73515. videoStartFn = null;
  73516. }
  73517. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  73518. videoEndFn(videoTimingInfo.end);
  73519. }
  73520. },
  73521. onVideoSegmentTimingInfo: (videoSegmentTimingInfo) => {
  73522. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  73523. },
  73524. onAudioSegmentTimingInfo: (audioSegmentTimingInfo) => {
  73525. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  73526. },
  73527. onId3: (id3Frames, dispatchType) => {
  73528. id3Fn(segment, id3Frames, dispatchType);
  73529. },
  73530. onCaptions: (captions) => {
  73531. captionsFn(segment, [captions]);
  73532. },
  73533. isEndOfTimeline,
  73534. onEndedTimeline: () => {
  73535. endedTimelineFn();
  73536. },
  73537. onTransmuxerLog,
  73538. onDone: (result) => {
  73539. if (!doneFn) {
  73540. return;
  73541. }
  73542. result.type = result.type === "combined" ? "video" : result.type;
  73543. doneFn(null, segment, result);
  73544. }
  73545. });
  73546. workerCallback$1({
  73547. action: "probeTs",
  73548. transmuxer: segment.transmuxer,
  73549. data: bytes,
  73550. baseStartTime: segment.baseStartTime,
  73551. callback: (data) => {
  73552. segment.bytes = bytes = data.data;
  73553. const probeResult = data.result;
  73554. if (probeResult) {
  73555. trackInfoFn(segment, {
  73556. hasAudio: probeResult.hasAudio,
  73557. hasVideo: probeResult.hasVideo,
  73558. isMuxed: isMuxed3
  73559. });
  73560. trackInfoFn = null;
  73561. if (probeResult.hasAudio && !isMuxed3) {
  73562. audioStartFn(probeResult.audioStart);
  73563. }
  73564. if (probeResult.hasVideo) {
  73565. videoStartFn(probeResult.videoStart);
  73566. }
  73567. audioStartFn = null;
  73568. videoStartFn = null;
  73569. }
  73570. finish();
  73571. }
  73572. });
  73573. };
  73574. const handleSegmentBytes$1 = ({
  73575. segment,
  73576. bytes,
  73577. trackInfoFn,
  73578. timingInfoFn,
  73579. videoSegmentTimingInfoFn,
  73580. audioSegmentTimingInfoFn,
  73581. id3Fn,
  73582. captionsFn,
  73583. isEndOfTimeline,
  73584. endedTimelineFn,
  73585. dataFn,
  73586. doneFn,
  73587. onTransmuxerLog
  73588. }) => {
  73589. let bytesAsUint8Array = new Uint8Array(bytes);
  73590. if (isLikelyFmp4MediaSegment$1(bytesAsUint8Array)) {
  73591. segment.isFmp4 = true;
  73592. const {
  73593. tracks
  73594. } = segment.map;
  73595. const trackInfo = {
  73596. isFmp4: true,
  73597. hasVideo: !!tracks.video,
  73598. hasAudio: !!tracks.audio
  73599. };
  73600. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  73601. trackInfo.audioCodec = tracks.audio.codec;
  73602. }
  73603. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  73604. trackInfo.videoCodec = tracks.video.codec;
  73605. }
  73606. if (tracks.video && tracks.audio) {
  73607. trackInfo.isMuxed = true;
  73608. }
  73609. trackInfoFn(segment, trackInfo);
  73610. const finishLoading = (captions) => {
  73611. dataFn(segment, {
  73612. data: bytesAsUint8Array,
  73613. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  73614. });
  73615. if (captions && captions.length) {
  73616. captionsFn(segment, captions);
  73617. }
  73618. doneFn(null, segment, {});
  73619. };
  73620. workerCallback$1({
  73621. action: "probeMp4StartTime",
  73622. timescales: segment.map.timescales,
  73623. data: bytesAsUint8Array,
  73624. transmuxer: segment.transmuxer,
  73625. callback: ({
  73626. data,
  73627. startTime
  73628. }) => {
  73629. bytes = data.buffer;
  73630. segment.bytes = bytesAsUint8Array = data;
  73631. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  73632. timingInfoFn(segment, "audio", "start", startTime);
  73633. }
  73634. if (trackInfo.hasVideo) {
  73635. timingInfoFn(segment, "video", "start", startTime);
  73636. }
  73637. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  73638. finishLoading();
  73639. return;
  73640. }
  73641. workerCallback$1({
  73642. action: "pushMp4Captions",
  73643. endAction: "mp4Captions",
  73644. transmuxer: segment.transmuxer,
  73645. data: bytesAsUint8Array,
  73646. timescales: segment.map.timescales,
  73647. trackIds: [tracks.video.id],
  73648. callback: (message) => {
  73649. bytes = message.data.buffer;
  73650. segment.bytes = bytesAsUint8Array = message.data;
  73651. message.logs.forEach(function(log2) {
  73652. onTransmuxerLog(merge$2(log2, {
  73653. stream: "mp4CaptionParser"
  73654. }));
  73655. });
  73656. finishLoading(message.captions);
  73657. }
  73658. });
  73659. }
  73660. });
  73661. return;
  73662. }
  73663. if (!segment.transmuxer) {
  73664. doneFn(null, segment, {});
  73665. return;
  73666. }
  73667. if (typeof segment.container === "undefined") {
  73668. segment.container = detectContainerForBytes$1(bytesAsUint8Array);
  73669. }
  73670. if (segment.container !== "ts" && segment.container !== "aac") {
  73671. trackInfoFn(segment, {
  73672. hasAudio: false,
  73673. hasVideo: false
  73674. });
  73675. doneFn(null, segment, {});
  73676. return;
  73677. }
  73678. transmuxAndNotify$1({
  73679. segment,
  73680. bytes,
  73681. trackInfoFn,
  73682. timingInfoFn,
  73683. videoSegmentTimingInfoFn,
  73684. audioSegmentTimingInfoFn,
  73685. id3Fn,
  73686. captionsFn,
  73687. isEndOfTimeline,
  73688. endedTimelineFn,
  73689. dataFn,
  73690. doneFn,
  73691. onTransmuxerLog
  73692. });
  73693. };
  73694. const decrypt$1 = function({
  73695. id,
  73696. key,
  73697. encryptedBytes,
  73698. decryptionWorker
  73699. }, callback2) {
  73700. const decryptionHandler = (event2) => {
  73701. if (event2.data.source === id) {
  73702. decryptionWorker.removeEventListener("message", decryptionHandler);
  73703. const decrypted = event2.data.decrypted;
  73704. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  73705. }
  73706. };
  73707. decryptionWorker.addEventListener("message", decryptionHandler);
  73708. let keyBytes;
  73709. if (key.bytes.slice) {
  73710. keyBytes = key.bytes.slice();
  73711. } else {
  73712. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  73713. }
  73714. decryptionWorker.postMessage(createTransferableMessage$1({
  73715. source: id,
  73716. encrypted: encryptedBytes,
  73717. key: keyBytes,
  73718. iv: key.iv
  73719. }), [encryptedBytes.buffer, keyBytes.buffer]);
  73720. };
  73721. const decryptSegment$1 = ({
  73722. decryptionWorker,
  73723. segment,
  73724. trackInfoFn,
  73725. timingInfoFn,
  73726. videoSegmentTimingInfoFn,
  73727. audioSegmentTimingInfoFn,
  73728. id3Fn,
  73729. captionsFn,
  73730. isEndOfTimeline,
  73731. endedTimelineFn,
  73732. dataFn,
  73733. doneFn,
  73734. onTransmuxerLog
  73735. }) => {
  73736. decrypt$1({
  73737. id: segment.requestId,
  73738. key: segment.key,
  73739. encryptedBytes: segment.encryptedBytes,
  73740. decryptionWorker
  73741. }, (decryptedBytes) => {
  73742. segment.bytes = decryptedBytes;
  73743. handleSegmentBytes$1({
  73744. segment,
  73745. bytes: segment.bytes,
  73746. trackInfoFn,
  73747. timingInfoFn,
  73748. videoSegmentTimingInfoFn,
  73749. audioSegmentTimingInfoFn,
  73750. id3Fn,
  73751. captionsFn,
  73752. isEndOfTimeline,
  73753. endedTimelineFn,
  73754. dataFn,
  73755. doneFn,
  73756. onTransmuxerLog
  73757. });
  73758. });
  73759. };
  73760. const waitForCompletion$1 = ({
  73761. activeXhrs,
  73762. decryptionWorker,
  73763. trackInfoFn,
  73764. timingInfoFn,
  73765. videoSegmentTimingInfoFn,
  73766. audioSegmentTimingInfoFn,
  73767. id3Fn,
  73768. captionsFn,
  73769. isEndOfTimeline,
  73770. endedTimelineFn,
  73771. dataFn,
  73772. doneFn,
  73773. onTransmuxerLog
  73774. }) => {
  73775. let count = 0;
  73776. let didError = false;
  73777. return (error, segment) => {
  73778. if (didError) {
  73779. return;
  73780. }
  73781. if (error) {
  73782. didError = true;
  73783. abortAll$1(activeXhrs);
  73784. return doneFn(error, segment);
  73785. }
  73786. count += 1;
  73787. if (count === activeXhrs.length) {
  73788. const segmentFinish = function() {
  73789. if (segment.encryptedBytes) {
  73790. return decryptSegment$1({
  73791. decryptionWorker,
  73792. segment,
  73793. trackInfoFn,
  73794. timingInfoFn,
  73795. videoSegmentTimingInfoFn,
  73796. audioSegmentTimingInfoFn,
  73797. id3Fn,
  73798. captionsFn,
  73799. isEndOfTimeline,
  73800. endedTimelineFn,
  73801. dataFn,
  73802. doneFn,
  73803. onTransmuxerLog
  73804. });
  73805. }
  73806. handleSegmentBytes$1({
  73807. segment,
  73808. bytes: segment.bytes,
  73809. trackInfoFn,
  73810. timingInfoFn,
  73811. videoSegmentTimingInfoFn,
  73812. audioSegmentTimingInfoFn,
  73813. id3Fn,
  73814. captionsFn,
  73815. isEndOfTimeline,
  73816. endedTimelineFn,
  73817. dataFn,
  73818. doneFn,
  73819. onTransmuxerLog
  73820. });
  73821. };
  73822. segment.endOfAllRequests = Date.now();
  73823. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  73824. return decrypt$1({
  73825. decryptionWorker,
  73826. id: segment.requestId + "-init",
  73827. encryptedBytes: segment.map.encryptedBytes,
  73828. key: segment.map.key
  73829. }, (decryptedBytes) => {
  73830. segment.map.bytes = decryptedBytes;
  73831. parseInitSegment$1(segment, (parseError) => {
  73832. if (parseError) {
  73833. abortAll$1(activeXhrs);
  73834. return doneFn(parseError, segment);
  73835. }
  73836. segmentFinish();
  73837. });
  73838. });
  73839. }
  73840. segmentFinish();
  73841. }
  73842. };
  73843. };
  73844. const handleLoadEnd$1 = ({
  73845. loadendState,
  73846. abortFn
  73847. }) => (event2) => {
  73848. const request = event2.target;
  73849. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  73850. abortFn();
  73851. loadendState.calledAbortFn = true;
  73852. }
  73853. };
  73854. const handleProgress$1 = ({
  73855. segment,
  73856. progressFn,
  73857. trackInfoFn,
  73858. timingInfoFn,
  73859. videoSegmentTimingInfoFn,
  73860. audioSegmentTimingInfoFn,
  73861. id3Fn,
  73862. captionsFn,
  73863. isEndOfTimeline,
  73864. endedTimelineFn,
  73865. dataFn
  73866. }) => (event2) => {
  73867. const request = event2.target;
  73868. if (request.aborted) {
  73869. return;
  73870. }
  73871. segment.stats = merge$2(segment.stats, getProgressStats$1(event2));
  73872. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  73873. segment.stats.firstBytesReceivedAt = Date.now();
  73874. }
  73875. return progressFn(event2, segment);
  73876. };
  73877. const mediaSegmentRequest$1 = ({
  73878. xhr,
  73879. xhrOptions,
  73880. decryptionWorker,
  73881. segment,
  73882. abortFn,
  73883. progressFn,
  73884. trackInfoFn,
  73885. timingInfoFn,
  73886. videoSegmentTimingInfoFn,
  73887. audioSegmentTimingInfoFn,
  73888. id3Fn,
  73889. captionsFn,
  73890. isEndOfTimeline,
  73891. endedTimelineFn,
  73892. dataFn,
  73893. doneFn,
  73894. onTransmuxerLog
  73895. }) => {
  73896. const activeXhrs = [];
  73897. const finishProcessingFn = waitForCompletion$1({
  73898. activeXhrs,
  73899. decryptionWorker,
  73900. trackInfoFn,
  73901. timingInfoFn,
  73902. videoSegmentTimingInfoFn,
  73903. audioSegmentTimingInfoFn,
  73904. id3Fn,
  73905. captionsFn,
  73906. isEndOfTimeline,
  73907. endedTimelineFn,
  73908. dataFn,
  73909. doneFn,
  73910. onTransmuxerLog
  73911. });
  73912. if (segment.key && !segment.key.bytes) {
  73913. const objects = [segment.key];
  73914. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  73915. objects.push(segment.map.key);
  73916. }
  73917. const keyRequestOptions = merge$2(xhrOptions, {
  73918. uri: segment.key.resolvedUri,
  73919. responseType: "arraybuffer"
  73920. });
  73921. const keyRequestCallback = handleKeyResponse$1(segment, objects, finishProcessingFn);
  73922. const keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  73923. activeXhrs.push(keyXhr);
  73924. }
  73925. if (segment.map && !segment.map.bytes) {
  73926. const differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  73927. if (differentMapKey) {
  73928. const mapKeyRequestOptions = merge$2(xhrOptions, {
  73929. uri: segment.map.key.resolvedUri,
  73930. responseType: "arraybuffer"
  73931. });
  73932. const mapKeyRequestCallback = handleKeyResponse$1(segment, [segment.map.key], finishProcessingFn);
  73933. const mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  73934. activeXhrs.push(mapKeyXhr);
  73935. }
  73936. const initSegmentOptions = merge$2(xhrOptions, {
  73937. uri: segment.map.resolvedUri,
  73938. responseType: "arraybuffer",
  73939. headers: segmentXhrHeaders$1(segment.map)
  73940. });
  73941. const initSegmentRequestCallback = handleInitSegmentResponse$1({
  73942. segment,
  73943. finishProcessingFn
  73944. });
  73945. const initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  73946. activeXhrs.push(initSegmentXhr);
  73947. }
  73948. const segmentRequestOptions = merge$2(xhrOptions, {
  73949. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  73950. responseType: "arraybuffer",
  73951. headers: segmentXhrHeaders$1(segment)
  73952. });
  73953. const segmentRequestCallback = handleSegmentResponse$1({
  73954. segment,
  73955. finishProcessingFn,
  73956. responseType: segmentRequestOptions.responseType
  73957. });
  73958. const segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  73959. segmentXhr.addEventListener("progress", handleProgress$1({
  73960. segment,
  73961. progressFn,
  73962. trackInfoFn,
  73963. timingInfoFn,
  73964. videoSegmentTimingInfoFn,
  73965. audioSegmentTimingInfoFn,
  73966. id3Fn,
  73967. captionsFn,
  73968. isEndOfTimeline,
  73969. endedTimelineFn,
  73970. dataFn
  73971. }));
  73972. activeXhrs.push(segmentXhr);
  73973. const loadendState = {};
  73974. activeXhrs.forEach((activeXhr) => {
  73975. activeXhr.addEventListener("loadend", handleLoadEnd$1({
  73976. loadendState,
  73977. abortFn
  73978. }));
  73979. });
  73980. return () => abortAll$1(activeXhrs);
  73981. };
  73982. const logFn$1$1 = logger$1("CodecUtils");
  73983. const getCodecs$1 = function(media) {
  73984. const mediaAttributes = media.attributes || {};
  73985. if (mediaAttributes.CODECS) {
  73986. return parseCodecs$1(mediaAttributes.CODECS);
  73987. }
  73988. };
  73989. const isMaat$1 = (main, media) => {
  73990. const mediaAttributes = media.attributes || {};
  73991. return main && main.mediaGroups && main.mediaGroups.AUDIO && mediaAttributes.AUDIO && main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73992. };
  73993. const isMuxed$1 = (main, media) => {
  73994. if (!isMaat$1(main, media)) {
  73995. return true;
  73996. }
  73997. const mediaAttributes = media.attributes || {};
  73998. const audioGroup = main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73999. for (const groupId in audioGroup) {
  74000. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  74001. return true;
  74002. }
  74003. }
  74004. return false;
  74005. };
  74006. const unwrapCodecList$1 = function(codecList) {
  74007. const codecs = {};
  74008. codecList.forEach(({
  74009. mediaType,
  74010. type: type2,
  74011. details
  74012. }) => {
  74013. codecs[mediaType] = codecs[mediaType] || [];
  74014. codecs[mediaType].push(translateLegacyCodec$1(`${type2}${details}`));
  74015. });
  74016. Object.keys(codecs).forEach(function(mediaType) {
  74017. if (codecs[mediaType].length > 1) {
  74018. logFn$1$1(`multiple ${mediaType} codecs found as attributes: ${codecs[mediaType].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);
  74019. codecs[mediaType] = null;
  74020. return;
  74021. }
  74022. codecs[mediaType] = codecs[mediaType][0];
  74023. });
  74024. return codecs;
  74025. };
  74026. const codecCount$1 = function(codecObj) {
  74027. let count = 0;
  74028. if (codecObj.audio) {
  74029. count++;
  74030. }
  74031. if (codecObj.video) {
  74032. count++;
  74033. }
  74034. return count;
  74035. };
  74036. const codecsForPlaylist$1 = function(main, media) {
  74037. const mediaAttributes = media.attributes || {};
  74038. const codecInfo = unwrapCodecList$1(getCodecs$1(media) || []);
  74039. if (isMaat$1(main, media) && !codecInfo.audio) {
  74040. if (!isMuxed$1(main, media)) {
  74041. const defaultCodecs = unwrapCodecList$1(codecsFromDefault$1(main, mediaAttributes.AUDIO) || []);
  74042. if (defaultCodecs.audio) {
  74043. codecInfo.audio = defaultCodecs.audio;
  74044. }
  74045. }
  74046. }
  74047. return codecInfo;
  74048. };
  74049. const logFn$2 = logger$1("PlaylistSelector");
  74050. const representationToString$1 = function(representation) {
  74051. if (!representation || !representation.playlist) {
  74052. return;
  74053. }
  74054. const playlist = representation.playlist;
  74055. return JSON.stringify({
  74056. id: playlist.id,
  74057. bandwidth: representation.bandwidth,
  74058. width: representation.width,
  74059. height: representation.height,
  74060. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  74061. });
  74062. };
  74063. const safeGetComputedStyle$1 = function(el, property) {
  74064. if (!el) {
  74065. return "";
  74066. }
  74067. const result = window_1.getComputedStyle(el);
  74068. if (!result) {
  74069. return "";
  74070. }
  74071. return result[property];
  74072. };
  74073. const stableSort$1 = function(array, sortFn) {
  74074. const newArray = array.slice();
  74075. array.sort(function(left, right) {
  74076. const cmp = sortFn(left, right);
  74077. if (cmp === 0) {
  74078. return newArray.indexOf(left) - newArray.indexOf(right);
  74079. }
  74080. return cmp;
  74081. });
  74082. };
  74083. const comparePlaylistBandwidth$1 = function(left, right) {
  74084. let leftBandwidth;
  74085. let rightBandwidth;
  74086. if (left.attributes.BANDWIDTH) {
  74087. leftBandwidth = left.attributes.BANDWIDTH;
  74088. }
  74089. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  74090. if (right.attributes.BANDWIDTH) {
  74091. rightBandwidth = right.attributes.BANDWIDTH;
  74092. }
  74093. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  74094. return leftBandwidth - rightBandwidth;
  74095. };
  74096. const comparePlaylistResolution$1 = function(left, right) {
  74097. let leftWidth;
  74098. let rightWidth;
  74099. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  74100. leftWidth = left.attributes.RESOLUTION.width;
  74101. }
  74102. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  74103. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  74104. rightWidth = right.attributes.RESOLUTION.width;
  74105. }
  74106. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  74107. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  74108. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  74109. }
  74110. return leftWidth - rightWidth;
  74111. };
  74112. let simpleSelector$1 = function(main, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, playlistController) {
  74113. if (!main) {
  74114. return;
  74115. }
  74116. const options2 = {
  74117. bandwidth: playerBandwidth,
  74118. width: playerWidth,
  74119. height: playerHeight,
  74120. limitRenditionByPlayerDimensions
  74121. };
  74122. let playlists = main.playlists;
  74123. if (Playlist$1.isAudioOnly(main)) {
  74124. playlists = playlistController.getAudioTrackPlaylists_();
  74125. options2.audioOnly = true;
  74126. }
  74127. let sortedPlaylistReps = playlists.map((playlist) => {
  74128. let bandwidth2;
  74129. const width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  74130. const height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  74131. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  74132. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  74133. return {
  74134. bandwidth: bandwidth2,
  74135. width: width2,
  74136. height: height2,
  74137. playlist
  74138. };
  74139. });
  74140. stableSort$1(sortedPlaylistReps, (left, right) => left.bandwidth - right.bandwidth);
  74141. sortedPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isIncompatible(rep2.playlist));
  74142. let enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => Playlist$1.isEnabled(rep2.playlist));
  74143. if (!enabledPlaylistReps.length) {
  74144. enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isDisabled(rep2.playlist));
  74145. }
  74146. const bandwidthPlaylistReps = enabledPlaylistReps.filter((rep2) => rep2.bandwidth * Config$1.BANDWIDTH_VARIANCE < playerBandwidth);
  74147. let highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  74148. const bandwidthBestRep = bandwidthPlaylistReps.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74149. if (limitRenditionByPlayerDimensions === false) {
  74150. const chosenRep2 = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74151. if (chosenRep2 && chosenRep2.playlist) {
  74152. let type2 = "sortedPlaylistReps";
  74153. if (bandwidthBestRep) {
  74154. type2 = "bandwidthBestRep";
  74155. }
  74156. if (enabledPlaylistReps[0]) {
  74157. type2 = "enabledPlaylistReps";
  74158. }
  74159. logFn$2(`choosing ${representationToString$1(chosenRep2)} using ${type2} with options`, options2);
  74160. return chosenRep2.playlist;
  74161. }
  74162. logFn$2("could not choose a playlist with options", options2);
  74163. return null;
  74164. }
  74165. const haveResolution = bandwidthPlaylistReps.filter((rep2) => rep2.width && rep2.height);
  74166. stableSort$1(haveResolution, (left, right) => left.width - right.width);
  74167. const resolutionBestRepList = haveResolution.filter((rep2) => rep2.width === playerWidth && rep2.height === playerHeight);
  74168. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  74169. const resolutionBestRep = resolutionBestRepList.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74170. let resolutionPlusOneList;
  74171. let resolutionPlusOneSmallest;
  74172. let resolutionPlusOneRep;
  74173. if (!resolutionBestRep) {
  74174. resolutionPlusOneList = haveResolution.filter((rep2) => rep2.width > playerWidth || rep2.height > playerHeight);
  74175. resolutionPlusOneSmallest = resolutionPlusOneList.filter((rep2) => rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height);
  74176. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  74177. resolutionPlusOneRep = resolutionPlusOneSmallest.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74178. }
  74179. let leastPixelDiffRep;
  74180. if (playlistController.leastPixelDiffSelector) {
  74181. const leastPixelDiffList = haveResolution.map((rep2) => {
  74182. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  74183. return rep2;
  74184. });
  74185. stableSort$1(leastPixelDiffList, (left, right) => {
  74186. if (left.pixelDiff === right.pixelDiff) {
  74187. return right.bandwidth - left.bandwidth;
  74188. }
  74189. return left.pixelDiff - right.pixelDiff;
  74190. });
  74191. leastPixelDiffRep = leastPixelDiffList[0];
  74192. }
  74193. const chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74194. if (chosenRep && chosenRep.playlist) {
  74195. let type2 = "sortedPlaylistReps";
  74196. if (leastPixelDiffRep) {
  74197. type2 = "leastPixelDiffRep";
  74198. } else if (resolutionPlusOneRep) {
  74199. type2 = "resolutionPlusOneRep";
  74200. } else if (resolutionBestRep) {
  74201. type2 = "resolutionBestRep";
  74202. } else if (bandwidthBestRep) {
  74203. type2 = "bandwidthBestRep";
  74204. } else if (enabledPlaylistReps[0]) {
  74205. type2 = "enabledPlaylistReps";
  74206. }
  74207. logFn$2(`choosing ${representationToString$1(chosenRep)} using ${type2} with options`, options2);
  74208. return chosenRep.playlist;
  74209. }
  74210. logFn$2("could not choose a playlist with options", options2);
  74211. return null;
  74212. };
  74213. const lastBandwidthSelector$1 = function() {
  74214. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74215. return simpleSelector$1(this.playlists.main, this.systemBandwidth, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74216. };
  74217. const movingAverageBandwidthSelector$1 = function(decay) {
  74218. let average = -1;
  74219. let lastSystemBandwidth = -1;
  74220. if (decay < 0 || decay > 1) {
  74221. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  74222. }
  74223. return function() {
  74224. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74225. if (average < 0) {
  74226. average = this.systemBandwidth;
  74227. lastSystemBandwidth = this.systemBandwidth;
  74228. }
  74229. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  74230. average = decay * this.systemBandwidth + (1 - decay) * average;
  74231. lastSystemBandwidth = this.systemBandwidth;
  74232. }
  74233. return simpleSelector$1(this.playlists.main, average, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74234. };
  74235. };
  74236. const minRebufferMaxBandwidthSelector$1 = function(settings) {
  74237. const {
  74238. main,
  74239. currentTime,
  74240. bandwidth: bandwidth2,
  74241. duration: duration5,
  74242. segmentDuration,
  74243. timeUntilRebuffer: timeUntilRebuffer3,
  74244. currentTimeline,
  74245. syncController
  74246. } = settings;
  74247. const compatiblePlaylists = main.playlists.filter((playlist) => !Playlist$1.isIncompatible(playlist));
  74248. let enabledPlaylists = compatiblePlaylists.filter(Playlist$1.isEnabled);
  74249. if (!enabledPlaylists.length) {
  74250. enabledPlaylists = compatiblePlaylists.filter((playlist) => !Playlist$1.isDisabled(playlist));
  74251. }
  74252. const bandwidthPlaylists = enabledPlaylists.filter(Playlist$1.hasAttribute.bind(null, "BANDWIDTH"));
  74253. const rebufferingEstimates = bandwidthPlaylists.map((playlist) => {
  74254. const syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  74255. const numRequests = syncPoint ? 1 : 2;
  74256. const requestTimeEstimate = Playlist$1.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  74257. const rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  74258. return {
  74259. playlist,
  74260. rebufferingImpact
  74261. };
  74262. });
  74263. const noRebufferingPlaylists = rebufferingEstimates.filter((estimate) => estimate.rebufferingImpact <= 0);
  74264. stableSort$1(noRebufferingPlaylists, (a, b) => comparePlaylistBandwidth$1(b.playlist, a.playlist));
  74265. if (noRebufferingPlaylists.length) {
  74266. return noRebufferingPlaylists[0];
  74267. }
  74268. stableSort$1(rebufferingEstimates, (a, b) => a.rebufferingImpact - b.rebufferingImpact);
  74269. return rebufferingEstimates[0] || null;
  74270. };
  74271. const lowestBitrateCompatibleVariantSelector$1 = function() {
  74272. const playlists = this.playlists.main.playlists.filter(Playlist$1.isEnabled);
  74273. stableSort$1(playlists, (a, b) => comparePlaylistBandwidth$1(a, b));
  74274. const playlistsWithVideo = playlists.filter((playlist) => !!codecsForPlaylist$1(this.playlists.main, playlist).video);
  74275. return playlistsWithVideo[0] || null;
  74276. };
  74277. const concatSegments$1 = (segmentObj) => {
  74278. let offset = 0;
  74279. let tempBuffer;
  74280. if (segmentObj.bytes) {
  74281. tempBuffer = new Uint8Array(segmentObj.bytes);
  74282. segmentObj.segments.forEach((segment) => {
  74283. tempBuffer.set(segment, offset);
  74284. offset += segment.byteLength;
  74285. });
  74286. }
  74287. return tempBuffer;
  74288. };
  74289. const createCaptionsTrackIfNotExists$1 = function(inbandTextTracks, tech, captionStream) {
  74290. if (!inbandTextTracks[captionStream]) {
  74291. tech.trigger({
  74292. type: "usage",
  74293. name: "vhs-608"
  74294. });
  74295. let instreamId = captionStream;
  74296. if (/^cc708_/.test(captionStream)) {
  74297. instreamId = "SERVICE" + captionStream.split("_")[1];
  74298. }
  74299. const track = tech.textTracks().getTrackById(instreamId);
  74300. if (track) {
  74301. inbandTextTracks[captionStream] = track;
  74302. } else {
  74303. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  74304. let label2 = captionStream;
  74305. let language = captionStream;
  74306. let def = false;
  74307. const captionService = captionServices[instreamId];
  74308. if (captionService) {
  74309. label2 = captionService.label;
  74310. language = captionService.language;
  74311. def = captionService.default;
  74312. }
  74313. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  74314. kind: "captions",
  74315. id: instreamId,
  74316. default: def,
  74317. label: label2,
  74318. language
  74319. }, false).track;
  74320. }
  74321. }
  74322. };
  74323. const addCaptionData$1 = function({
  74324. inbandTextTracks,
  74325. captionArray,
  74326. timestampOffset: timestampOffset2
  74327. }) {
  74328. if (!captionArray) {
  74329. return;
  74330. }
  74331. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74332. captionArray.forEach((caption) => {
  74333. const track = caption.stream;
  74334. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  74335. });
  74336. };
  74337. const deprecateOldCue$1 = function(cue) {
  74338. Object.defineProperties(cue.frame, {
  74339. id: {
  74340. get() {
  74341. videojs$2.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  74342. return cue.value.key;
  74343. }
  74344. },
  74345. value: {
  74346. get() {
  74347. videojs$2.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  74348. return cue.value.data;
  74349. }
  74350. },
  74351. privateData: {
  74352. get() {
  74353. videojs$2.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  74354. return cue.value.data;
  74355. }
  74356. }
  74357. });
  74358. };
  74359. const addMetadata$1 = ({
  74360. inbandTextTracks,
  74361. metadataArray,
  74362. timestampOffset: timestampOffset2,
  74363. videoDuration
  74364. }) => {
  74365. if (!metadataArray) {
  74366. return;
  74367. }
  74368. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74369. const metadataTrack = inbandTextTracks.metadataTrack_;
  74370. if (!metadataTrack) {
  74371. return;
  74372. }
  74373. metadataArray.forEach((metadata) => {
  74374. const time = metadata.cueTime + timestampOffset2;
  74375. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  74376. return;
  74377. }
  74378. metadata.frames.forEach((frame) => {
  74379. const cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  74380. cue.frame = frame;
  74381. cue.value = frame;
  74382. deprecateOldCue$1(cue);
  74383. metadataTrack.addCue(cue);
  74384. });
  74385. });
  74386. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  74387. return;
  74388. }
  74389. const cues = metadataTrack.cues;
  74390. const cuesArray = [];
  74391. for (let i2 = 0; i2 < cues.length; i2++) {
  74392. if (cues[i2]) {
  74393. cuesArray.push(cues[i2]);
  74394. }
  74395. }
  74396. const cuesGroupedByStartTime = cuesArray.reduce((obj, cue) => {
  74397. const timeSlot = obj[cue.startTime] || [];
  74398. timeSlot.push(cue);
  74399. obj[cue.startTime] = timeSlot;
  74400. return obj;
  74401. }, {});
  74402. const sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort((a, b) => Number(a) - Number(b));
  74403. sortedStartTimes.forEach((startTime, idx) => {
  74404. const cueGroup = cuesGroupedByStartTime[startTime];
  74405. const nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  74406. cueGroup.forEach((cue) => {
  74407. cue.endTime = nextTime;
  74408. });
  74409. });
  74410. };
  74411. const createMetadataTrackIfNotExists$1 = (inbandTextTracks, dispatchType, tech) => {
  74412. if (inbandTextTracks.metadataTrack_) {
  74413. return;
  74414. }
  74415. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  74416. kind: "metadata",
  74417. label: "Timed Metadata"
  74418. }, false).track;
  74419. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  74420. };
  74421. const removeCuesFromTrack$1 = function(start2, end, track) {
  74422. let i2;
  74423. let cue;
  74424. if (!track) {
  74425. return;
  74426. }
  74427. if (!track.cues) {
  74428. return;
  74429. }
  74430. i2 = track.cues.length;
  74431. while (i2--) {
  74432. cue = track.cues[i2];
  74433. if (cue.startTime >= start2 && cue.endTime <= end) {
  74434. track.removeCue(cue);
  74435. }
  74436. }
  74437. };
  74438. const removeDuplicateCuesFromTrack$1 = function(track) {
  74439. const cues = track.cues;
  74440. if (!cues) {
  74441. return;
  74442. }
  74443. for (let i2 = 0; i2 < cues.length; i2++) {
  74444. const duplicates = [];
  74445. let occurrences = 0;
  74446. for (let j = 0; j < cues.length; j++) {
  74447. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  74448. occurrences++;
  74449. if (occurrences > 1) {
  74450. duplicates.push(cues[j]);
  74451. }
  74452. }
  74453. }
  74454. if (duplicates.length) {
  74455. duplicates.forEach((dupe) => track.removeCue(dupe));
  74456. }
  74457. }
  74458. };
  74459. const gopsSafeToAlignWith$1 = (buffer, currentTime, mapping) => {
  74460. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  74461. return [];
  74462. }
  74463. const currentTimePts = Math.ceil((currentTime - mapping + 3) * clock$1.ONE_SECOND_IN_TS);
  74464. let i2;
  74465. for (i2 = 0; i2 < buffer.length; i2++) {
  74466. if (buffer[i2].pts > currentTimePts) {
  74467. break;
  74468. }
  74469. }
  74470. return buffer.slice(i2);
  74471. };
  74472. const updateGopBuffer$1 = (buffer, gops, replace) => {
  74473. if (!gops.length) {
  74474. return buffer;
  74475. }
  74476. if (replace) {
  74477. return gops.slice();
  74478. }
  74479. const start2 = gops[0].pts;
  74480. let i2 = 0;
  74481. for (i2; i2 < buffer.length; i2++) {
  74482. if (buffer[i2].pts >= start2) {
  74483. break;
  74484. }
  74485. }
  74486. return buffer.slice(0, i2).concat(gops);
  74487. };
  74488. const removeGopBuffer$1 = (buffer, start2, end, mapping) => {
  74489. const startPts = Math.ceil((start2 - mapping) * clock$1.ONE_SECOND_IN_TS);
  74490. const endPts = Math.ceil((end - mapping) * clock$1.ONE_SECOND_IN_TS);
  74491. const updatedBuffer = buffer.slice();
  74492. let i2 = buffer.length;
  74493. while (i2--) {
  74494. if (buffer[i2].pts <= endPts) {
  74495. break;
  74496. }
  74497. }
  74498. if (i2 === -1) {
  74499. return updatedBuffer;
  74500. }
  74501. let j = i2 + 1;
  74502. while (j--) {
  74503. if (buffer[j].pts <= startPts) {
  74504. break;
  74505. }
  74506. }
  74507. j = Math.max(j, 0);
  74508. updatedBuffer.splice(j, i2 - j + 1);
  74509. return updatedBuffer;
  74510. };
  74511. const shallowEqual$1 = function(a, b) {
  74512. if (!a && !b || !a && b || a && !b) {
  74513. return false;
  74514. }
  74515. if (a === b) {
  74516. return true;
  74517. }
  74518. const akeys = Object.keys(a).sort();
  74519. const bkeys = Object.keys(b).sort();
  74520. if (akeys.length !== bkeys.length) {
  74521. return false;
  74522. }
  74523. for (let i2 = 0; i2 < akeys.length; i2++) {
  74524. const key = akeys[i2];
  74525. if (key !== bkeys[i2]) {
  74526. return false;
  74527. }
  74528. if (a[key] !== b[key]) {
  74529. return false;
  74530. }
  74531. }
  74532. return true;
  74533. };
  74534. const QUOTA_EXCEEDED_ERR$1 = 22;
  74535. const getSyncSegmentCandidate$1 = function(currentTimeline, segments, targetTime) {
  74536. segments = segments || [];
  74537. const timelineSegments = [];
  74538. let time = 0;
  74539. for (let i2 = 0; i2 < segments.length; i2++) {
  74540. const segment = segments[i2];
  74541. if (currentTimeline === segment.timeline) {
  74542. timelineSegments.push(i2);
  74543. time += segment.duration;
  74544. if (time > targetTime) {
  74545. return i2;
  74546. }
  74547. }
  74548. }
  74549. if (timelineSegments.length === 0) {
  74550. return 0;
  74551. }
  74552. return timelineSegments[timelineSegments.length - 1];
  74553. };
  74554. const MIN_BACK_BUFFER$1 = 1;
  74555. const CHECK_BUFFER_DELAY$1 = 500;
  74556. const finite$1 = (num) => typeof num === "number" && isFinite(num);
  74557. const MIN_SEGMENT_DURATION_TO_SAVE_STATS$1 = 1 / 60;
  74558. const illegalMediaSwitch$1 = (loaderType, startingMedia, trackInfo) => {
  74559. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  74560. return null;
  74561. }
  74562. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  74563. return "Neither audio nor video found in segment.";
  74564. }
  74565. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  74566. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  74567. }
  74568. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  74569. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  74570. }
  74571. return null;
  74572. };
  74573. const safeBackBufferTrimTime$1 = (seekable3, currentTime, targetDuration) => {
  74574. let trimTime = currentTime - Config$1.BACK_BUFFER_LENGTH;
  74575. if (seekable3.length) {
  74576. trimTime = Math.max(trimTime, seekable3.start(0));
  74577. }
  74578. const maxTrimTime = currentTime - targetDuration;
  74579. return Math.min(maxTrimTime, trimTime);
  74580. };
  74581. const segmentInfoString$1 = (segmentInfo) => {
  74582. const {
  74583. startOfSegment,
  74584. duration: duration5,
  74585. segment,
  74586. part,
  74587. playlist: {
  74588. mediaSequence: seq,
  74589. id,
  74590. segments = []
  74591. },
  74592. mediaIndex: index2,
  74593. partIndex,
  74594. timeline
  74595. } = segmentInfo;
  74596. const segmentLen = segments.length - 1;
  74597. let selection = "mediaIndex/partIndex increment";
  74598. if (segmentInfo.getMediaInfoForTime) {
  74599. selection = `getMediaInfoForTime (${segmentInfo.getMediaInfoForTime})`;
  74600. } else if (segmentInfo.isSyncRequest) {
  74601. selection = "getSyncSegmentCandidate (isSyncRequest)";
  74602. }
  74603. if (segmentInfo.independent) {
  74604. selection += ` with independent ${segmentInfo.independent}`;
  74605. }
  74606. const hasPartIndex = typeof partIndex === "number";
  74607. const name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  74608. const zeroBasedPartCount = hasPartIndex ? getKnownPartCount$1({
  74609. preloadSegment: segment
  74610. }) - 1 : 0;
  74611. return `${name} [${seq + index2}/${seq + segmentLen}]` + (hasPartIndex ? ` part [${partIndex}/${zeroBasedPartCount}]` : "") + ` segment start/end [${segment.start} => ${segment.end}]` + (hasPartIndex ? ` part start/end [${part.start} => ${part.end}]` : "") + ` startOfSegment [${startOfSegment}] duration [${duration5}] timeline [${timeline}] selected by [${selection}] playlist [${id}]`;
  74612. };
  74613. const timingInfoPropertyForMedia$1 = (mediaType) => `${mediaType}TimingInfo`;
  74614. const timestampOffsetForSegment$1 = ({
  74615. segmentTimeline,
  74616. currentTimeline,
  74617. startOfSegment,
  74618. buffered,
  74619. overrideCheck
  74620. }) => {
  74621. if (!overrideCheck && segmentTimeline === currentTimeline) {
  74622. return null;
  74623. }
  74624. if (segmentTimeline < currentTimeline) {
  74625. return startOfSegment;
  74626. }
  74627. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  74628. };
  74629. const shouldWaitForTimelineChange$1 = ({
  74630. timelineChangeController,
  74631. currentTimeline,
  74632. segmentTimeline,
  74633. loaderType,
  74634. audioDisabled
  74635. }) => {
  74636. if (currentTimeline === segmentTimeline) {
  74637. return false;
  74638. }
  74639. if (loaderType === "audio") {
  74640. const lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  74641. type: "main"
  74642. });
  74643. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  74644. }
  74645. if (loaderType === "main" && audioDisabled) {
  74646. const pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  74647. type: "audio"
  74648. });
  74649. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  74650. return false;
  74651. }
  74652. return true;
  74653. }
  74654. return false;
  74655. };
  74656. const mediaDuration$1 = (timingInfos) => {
  74657. let maxDuration = 0;
  74658. ["video", "audio"].forEach(function(type2) {
  74659. const typeTimingInfo = timingInfos[`${type2}TimingInfo`];
  74660. if (!typeTimingInfo) {
  74661. return;
  74662. }
  74663. const {
  74664. start: start2,
  74665. end
  74666. } = typeTimingInfo;
  74667. let duration5;
  74668. if (typeof start2 === "bigint" || typeof end === "bigint") {
  74669. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  74670. } else if (typeof start2 === "number" && typeof end === "number") {
  74671. duration5 = end - start2;
  74672. }
  74673. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  74674. maxDuration = duration5;
  74675. }
  74676. });
  74677. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  74678. maxDuration = Number(maxDuration);
  74679. }
  74680. return maxDuration;
  74681. };
  74682. const segmentTooLong$1 = ({
  74683. segmentDuration,
  74684. maxDuration
  74685. }) => {
  74686. if (!segmentDuration) {
  74687. return false;
  74688. }
  74689. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR$1;
  74690. };
  74691. const getTroublesomeSegmentDurationMessage$1 = (segmentInfo, sourceType) => {
  74692. if (sourceType !== "hls") {
  74693. return null;
  74694. }
  74695. const segmentDuration = mediaDuration$1({
  74696. audioTimingInfo: segmentInfo.audioTimingInfo,
  74697. videoTimingInfo: segmentInfo.videoTimingInfo
  74698. });
  74699. if (!segmentDuration) {
  74700. return null;
  74701. }
  74702. const targetDuration = segmentInfo.playlist.targetDuration;
  74703. const isSegmentWayTooLong = segmentTooLong$1({
  74704. segmentDuration,
  74705. maxDuration: targetDuration * 2
  74706. });
  74707. const isSegmentSlightlyTooLong = segmentTooLong$1({
  74708. segmentDuration,
  74709. maxDuration: targetDuration
  74710. });
  74711. const segmentTooLongMessage = `Segment with index ${segmentInfo.mediaIndex} from playlist ${segmentInfo.playlist.id} has a duration of ${segmentDuration} when the reported duration is ${segmentInfo.duration} and the target duration is ${targetDuration}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;
  74712. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  74713. return {
  74714. severity: isSegmentWayTooLong ? "warn" : "info",
  74715. message: segmentTooLongMessage
  74716. };
  74717. }
  74718. return null;
  74719. };
  74720. class SegmentLoader$1 extends videojs$2.EventTarget {
  74721. constructor(settings, options2 = {}) {
  74722. super();
  74723. if (!settings) {
  74724. throw new TypeError("Initialization settings are required");
  74725. }
  74726. if (typeof settings.currentTime !== "function") {
  74727. throw new TypeError("No currentTime getter specified");
  74728. }
  74729. if (!settings.mediaSource) {
  74730. throw new TypeError("No MediaSource specified");
  74731. }
  74732. this.bandwidth = settings.bandwidth;
  74733. this.throughput = {
  74734. rate: 0,
  74735. count: 0
  74736. };
  74737. this.roundTrip = NaN;
  74738. this.resetStats_();
  74739. this.mediaIndex = null;
  74740. this.partIndex = null;
  74741. this.hasPlayed_ = settings.hasPlayed;
  74742. this.currentTime_ = settings.currentTime;
  74743. this.seekable_ = settings.seekable;
  74744. this.seeking_ = settings.seeking;
  74745. this.duration_ = settings.duration;
  74746. this.mediaSource_ = settings.mediaSource;
  74747. this.vhs_ = settings.vhs;
  74748. this.loaderType_ = settings.loaderType;
  74749. this.currentMediaInfo_ = void 0;
  74750. this.startingMediaInfo_ = void 0;
  74751. this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  74752. this.goalBufferLength_ = settings.goalBufferLength;
  74753. this.sourceType_ = settings.sourceType;
  74754. this.sourceUpdater_ = settings.sourceUpdater;
  74755. this.inbandTextTracks_ = settings.inbandTextTracks;
  74756. this.state_ = "INIT";
  74757. this.timelineChangeController_ = settings.timelineChangeController;
  74758. this.shouldSaveSegmentTimingInfo_ = true;
  74759. this.parse708captions_ = settings.parse708captions;
  74760. this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  74761. this.captionServices_ = settings.captionServices;
  74762. this.exactManifestTimings = settings.exactManifestTimings;
  74763. this.checkBufferTimeout_ = null;
  74764. this.error_ = void 0;
  74765. this.currentTimeline_ = -1;
  74766. this.pendingSegment_ = null;
  74767. this.xhrOptions_ = null;
  74768. this.pendingSegments_ = [];
  74769. this.audioDisabled_ = false;
  74770. this.isPendingTimestampOffset_ = false;
  74771. this.gopBuffer_ = [];
  74772. this.timeMapping_ = 0;
  74773. this.safeAppend_ = videojs$2.browser.IE_VERSION >= 11;
  74774. this.appendInitSegment_ = {
  74775. audio: true,
  74776. video: true
  74777. };
  74778. this.playlistOfLastInitSegment_ = {
  74779. audio: null,
  74780. video: null
  74781. };
  74782. this.callQueue_ = [];
  74783. this.loadQueue_ = [];
  74784. this.metadataQueue_ = {
  74785. id3: [],
  74786. caption: []
  74787. };
  74788. this.waitingOnRemove_ = false;
  74789. this.quotaExceededErrorRetryTimeout_ = null;
  74790. this.activeInitSegmentId_ = null;
  74791. this.initSegments_ = {};
  74792. this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  74793. this.keyCache_ = {};
  74794. this.decrypter_ = settings.decrypter;
  74795. this.syncController_ = settings.syncController;
  74796. this.syncPoint_ = {
  74797. segmentIndex: 0,
  74798. time: 0
  74799. };
  74800. this.transmuxer_ = this.createTransmuxer_();
  74801. this.triggerSyncInfoUpdate_ = () => this.trigger("syncinfoupdate");
  74802. this.syncController_.on("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74803. this.mediaSource_.addEventListener("sourceopen", () => {
  74804. if (!this.isEndOfStream_()) {
  74805. this.ended_ = false;
  74806. }
  74807. });
  74808. this.fetchAtBuffer_ = false;
  74809. this.logger_ = logger$1(`SegmentLoader[${this.loaderType_}]`);
  74810. Object.defineProperty(this, "state", {
  74811. get() {
  74812. return this.state_;
  74813. },
  74814. set(newState) {
  74815. if (newState !== this.state_) {
  74816. this.logger_(`${this.state_} -> ${newState}`);
  74817. this.state_ = newState;
  74818. this.trigger("statechange");
  74819. }
  74820. }
  74821. });
  74822. this.sourceUpdater_.on("ready", () => {
  74823. if (this.hasEnoughInfoToAppend_()) {
  74824. this.processCallQueue_();
  74825. }
  74826. });
  74827. if (this.loaderType_ === "main") {
  74828. this.timelineChangeController_.on("pendingtimelinechange", () => {
  74829. if (this.hasEnoughInfoToAppend_()) {
  74830. this.processCallQueue_();
  74831. }
  74832. });
  74833. }
  74834. if (this.loaderType_ === "audio") {
  74835. this.timelineChangeController_.on("timelinechange", () => {
  74836. if (this.hasEnoughInfoToLoad_()) {
  74837. this.processLoadQueue_();
  74838. }
  74839. if (this.hasEnoughInfoToAppend_()) {
  74840. this.processCallQueue_();
  74841. }
  74842. });
  74843. }
  74844. }
  74845. createTransmuxer_() {
  74846. return segmentTransmuxer$1.createTransmuxer({
  74847. remux: false,
  74848. alignGopsAtEnd: this.safeAppend_,
  74849. keepOriginalTimestamps: true,
  74850. parse708captions: this.parse708captions_,
  74851. captionServices: this.captionServices_
  74852. });
  74853. }
  74854. resetStats_() {
  74855. this.mediaBytesTransferred = 0;
  74856. this.mediaRequests = 0;
  74857. this.mediaRequestsAborted = 0;
  74858. this.mediaRequestsTimedout = 0;
  74859. this.mediaRequestsErrored = 0;
  74860. this.mediaTransferDuration = 0;
  74861. this.mediaSecondsLoaded = 0;
  74862. this.mediaAppends = 0;
  74863. }
  74864. dispose() {
  74865. this.trigger("dispose");
  74866. this.state = "DISPOSED";
  74867. this.pause();
  74868. this.abort_();
  74869. if (this.transmuxer_) {
  74870. this.transmuxer_.terminate();
  74871. }
  74872. this.resetStats_();
  74873. if (this.checkBufferTimeout_) {
  74874. window_1.clearTimeout(this.checkBufferTimeout_);
  74875. }
  74876. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  74877. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74878. }
  74879. this.off();
  74880. }
  74881. setAudio(enable) {
  74882. this.audioDisabled_ = !enable;
  74883. if (enable) {
  74884. this.appendInitSegment_.audio = true;
  74885. } else {
  74886. this.sourceUpdater_.removeAudio(0, this.duration_());
  74887. }
  74888. }
  74889. abort() {
  74890. if (this.state !== "WAITING") {
  74891. if (this.pendingSegment_) {
  74892. this.pendingSegment_ = null;
  74893. }
  74894. return;
  74895. }
  74896. this.abort_();
  74897. this.state = "READY";
  74898. if (!this.paused()) {
  74899. this.monitorBuffer_();
  74900. }
  74901. }
  74902. abort_() {
  74903. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  74904. this.pendingSegment_.abortRequests();
  74905. }
  74906. this.pendingSegment_ = null;
  74907. this.callQueue_ = [];
  74908. this.loadQueue_ = [];
  74909. this.metadataQueue_.id3 = [];
  74910. this.metadataQueue_.caption = [];
  74911. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  74912. this.waitingOnRemove_ = false;
  74913. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  74914. this.quotaExceededErrorRetryTimeout_ = null;
  74915. }
  74916. checkForAbort_(requestId) {
  74917. if (this.state === "APPENDING" && !this.pendingSegment_) {
  74918. this.state = "READY";
  74919. return true;
  74920. }
  74921. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  74922. return true;
  74923. }
  74924. return false;
  74925. }
  74926. error(error) {
  74927. if (typeof error !== "undefined") {
  74928. this.logger_("error occurred:", error);
  74929. this.error_ = error;
  74930. }
  74931. this.pendingSegment_ = null;
  74932. return this.error_;
  74933. }
  74934. endOfStream() {
  74935. this.ended_ = true;
  74936. if (this.transmuxer_) {
  74937. segmentTransmuxer$1.reset(this.transmuxer_);
  74938. }
  74939. this.gopBuffer_.length = 0;
  74940. this.pause();
  74941. this.trigger("ended");
  74942. }
  74943. buffered_() {
  74944. const trackInfo = this.getMediaInfo_();
  74945. if (!this.sourceUpdater_ || !trackInfo) {
  74946. return createTimeRanges$2();
  74947. }
  74948. if (this.loaderType_ === "main") {
  74949. const {
  74950. hasAudio,
  74951. hasVideo,
  74952. isMuxed: isMuxed3
  74953. } = trackInfo;
  74954. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  74955. return this.sourceUpdater_.buffered();
  74956. }
  74957. if (hasVideo) {
  74958. return this.sourceUpdater_.videoBuffered();
  74959. }
  74960. }
  74961. return this.sourceUpdater_.audioBuffered();
  74962. }
  74963. initSegmentForMap(map, set4 = false) {
  74964. if (!map) {
  74965. return null;
  74966. }
  74967. const id = initSegmentId$1(map);
  74968. let storedMap = this.initSegments_[id];
  74969. if (set4 && !storedMap && map.bytes) {
  74970. this.initSegments_[id] = storedMap = {
  74971. resolvedUri: map.resolvedUri,
  74972. byterange: map.byterange,
  74973. bytes: map.bytes,
  74974. tracks: map.tracks,
  74975. timescales: map.timescales
  74976. };
  74977. }
  74978. return storedMap || map;
  74979. }
  74980. segmentKey(key, set4 = false) {
  74981. if (!key) {
  74982. return null;
  74983. }
  74984. const id = segmentKeyId$1(key);
  74985. let storedKey = this.keyCache_[id];
  74986. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  74987. this.keyCache_[id] = storedKey = {
  74988. resolvedUri: key.resolvedUri,
  74989. bytes: key.bytes
  74990. };
  74991. }
  74992. const result = {
  74993. resolvedUri: (storedKey || key).resolvedUri
  74994. };
  74995. if (storedKey) {
  74996. result.bytes = storedKey.bytes;
  74997. }
  74998. return result;
  74999. }
  75000. couldBeginLoading_() {
  75001. return this.playlist_ && !this.paused();
  75002. }
  75003. load() {
  75004. this.monitorBuffer_();
  75005. if (!this.playlist_) {
  75006. return;
  75007. }
  75008. if (this.state === "INIT" && this.couldBeginLoading_()) {
  75009. return this.init_();
  75010. }
  75011. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  75012. return;
  75013. }
  75014. this.state = "READY";
  75015. }
  75016. init_() {
  75017. this.state = "READY";
  75018. this.resetEverything();
  75019. return this.monitorBuffer_();
  75020. }
  75021. playlist(newPlaylist, options2 = {}) {
  75022. if (!newPlaylist) {
  75023. return;
  75024. }
  75025. const oldPlaylist = this.playlist_;
  75026. const segmentInfo = this.pendingSegment_;
  75027. this.playlist_ = newPlaylist;
  75028. this.xhrOptions_ = options2;
  75029. if (this.state === "INIT") {
  75030. newPlaylist.syncInfo = {
  75031. mediaSequence: newPlaylist.mediaSequence,
  75032. time: 0
  75033. };
  75034. if (this.loaderType_ === "main") {
  75035. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  75036. }
  75037. }
  75038. let oldId = null;
  75039. if (oldPlaylist) {
  75040. if (oldPlaylist.id) {
  75041. oldId = oldPlaylist.id;
  75042. } else if (oldPlaylist.uri) {
  75043. oldId = oldPlaylist.uri;
  75044. }
  75045. }
  75046. this.logger_(`playlist update [${oldId} => ${newPlaylist.id || newPlaylist.uri}]`);
  75047. this.trigger("syncinfoupdate");
  75048. if (this.state === "INIT" && this.couldBeginLoading_()) {
  75049. return this.init_();
  75050. }
  75051. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  75052. if (this.mediaIndex !== null) {
  75053. if (!newPlaylist.endList) {
  75054. this.resetLoader();
  75055. } else {
  75056. this.resyncLoader();
  75057. }
  75058. }
  75059. this.currentMediaInfo_ = void 0;
  75060. this.trigger("playlistupdate");
  75061. return;
  75062. }
  75063. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  75064. this.logger_(`live window shift [${mediaSequenceDiff}]`);
  75065. if (this.mediaIndex !== null) {
  75066. this.mediaIndex -= mediaSequenceDiff;
  75067. if (this.mediaIndex < 0) {
  75068. this.mediaIndex = null;
  75069. this.partIndex = null;
  75070. } else {
  75071. const segment = this.playlist_.segments[this.mediaIndex];
  75072. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  75073. const mediaIndex = this.mediaIndex;
  75074. this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);
  75075. this.resetLoader();
  75076. this.mediaIndex = mediaIndex;
  75077. }
  75078. }
  75079. }
  75080. if (segmentInfo) {
  75081. segmentInfo.mediaIndex -= mediaSequenceDiff;
  75082. if (segmentInfo.mediaIndex < 0) {
  75083. segmentInfo.mediaIndex = null;
  75084. segmentInfo.partIndex = null;
  75085. } else {
  75086. if (segmentInfo.mediaIndex >= 0) {
  75087. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  75088. }
  75089. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  75090. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  75091. }
  75092. }
  75093. }
  75094. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  75095. }
  75096. pause() {
  75097. if (this.checkBufferTimeout_) {
  75098. window_1.clearTimeout(this.checkBufferTimeout_);
  75099. this.checkBufferTimeout_ = null;
  75100. }
  75101. }
  75102. paused() {
  75103. return this.checkBufferTimeout_ === null;
  75104. }
  75105. resetEverything(done) {
  75106. this.ended_ = false;
  75107. this.activeInitSegmentId_ = null;
  75108. this.appendInitSegment_ = {
  75109. audio: true,
  75110. video: true
  75111. };
  75112. this.resetLoader();
  75113. this.remove(0, Infinity, done);
  75114. if (this.transmuxer_) {
  75115. this.transmuxer_.postMessage({
  75116. action: "clearAllMp4Captions"
  75117. });
  75118. this.transmuxer_.postMessage({
  75119. action: "reset"
  75120. });
  75121. }
  75122. }
  75123. resetLoader() {
  75124. this.fetchAtBuffer_ = false;
  75125. this.resyncLoader();
  75126. }
  75127. resyncLoader() {
  75128. if (this.transmuxer_) {
  75129. segmentTransmuxer$1.reset(this.transmuxer_);
  75130. }
  75131. this.mediaIndex = null;
  75132. this.partIndex = null;
  75133. this.syncPoint_ = null;
  75134. this.isPendingTimestampOffset_ = false;
  75135. this.callQueue_ = [];
  75136. this.loadQueue_ = [];
  75137. this.metadataQueue_.id3 = [];
  75138. this.metadataQueue_.caption = [];
  75139. this.abort();
  75140. if (this.transmuxer_) {
  75141. this.transmuxer_.postMessage({
  75142. action: "clearParsedMp4Captions"
  75143. });
  75144. }
  75145. }
  75146. remove(start2, end, done = () => {
  75147. }, force = false) {
  75148. if (end === Infinity) {
  75149. end = this.duration_();
  75150. }
  75151. if (end <= start2) {
  75152. this.logger_("skipping remove because end ${end} is <= start ${start}");
  75153. return;
  75154. }
  75155. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  75156. this.logger_("skipping remove because no source updater or starting media info");
  75157. return;
  75158. }
  75159. let removesRemaining = 1;
  75160. const removeFinished = () => {
  75161. removesRemaining--;
  75162. if (removesRemaining === 0) {
  75163. done();
  75164. }
  75165. };
  75166. if (force || !this.audioDisabled_) {
  75167. removesRemaining++;
  75168. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  75169. }
  75170. if (force || this.loaderType_ === "main") {
  75171. this.gopBuffer_ = removeGopBuffer$1(this.gopBuffer_, start2, end, this.timeMapping_);
  75172. removesRemaining++;
  75173. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  75174. }
  75175. for (const track in this.inbandTextTracks_) {
  75176. removeCuesFromTrack$1(start2, end, this.inbandTextTracks_[track]);
  75177. }
  75178. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  75179. removeFinished();
  75180. }
  75181. monitorBuffer_() {
  75182. if (this.checkBufferTimeout_) {
  75183. window_1.clearTimeout(this.checkBufferTimeout_);
  75184. }
  75185. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  75186. }
  75187. monitorBufferTick_() {
  75188. if (this.state === "READY") {
  75189. this.fillBuffer_();
  75190. }
  75191. if (this.checkBufferTimeout_) {
  75192. window_1.clearTimeout(this.checkBufferTimeout_);
  75193. }
  75194. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY$1);
  75195. }
  75196. fillBuffer_() {
  75197. if (this.sourceUpdater_.updating()) {
  75198. return;
  75199. }
  75200. const segmentInfo = this.chooseNextRequest_();
  75201. if (!segmentInfo) {
  75202. return;
  75203. }
  75204. if (typeof segmentInfo.timestampOffset === "number") {
  75205. this.isPendingTimestampOffset_ = false;
  75206. this.timelineChangeController_.pendingTimelineChange({
  75207. type: this.loaderType_,
  75208. from: this.currentTimeline_,
  75209. to: segmentInfo.timeline
  75210. });
  75211. }
  75212. this.loadSegment_(segmentInfo);
  75213. }
  75214. isEndOfStream_(mediaIndex = this.mediaIndex, playlist = this.playlist_, partIndex = this.partIndex) {
  75215. if (!playlist || !this.mediaSource_) {
  75216. return false;
  75217. }
  75218. const segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  75219. const appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  75220. const appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  75221. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  75222. }
  75223. chooseNextRequest_() {
  75224. const buffered = this.buffered_();
  75225. const bufferedEnd = lastBufferedEnd$1(buffered) || 0;
  75226. const bufferedTime = timeAheadOf$1(buffered, this.currentTime_());
  75227. const preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  75228. const haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  75229. const segments = this.playlist_.segments;
  75230. if (!segments.length || preloaded || haveEnoughBuffer) {
  75231. return null;
  75232. }
  75233. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  75234. const next = {
  75235. partIndex: null,
  75236. mediaIndex: null,
  75237. startOfSegment: null,
  75238. playlist: this.playlist_,
  75239. isSyncRequest: Boolean(!this.syncPoint_)
  75240. };
  75241. if (next.isSyncRequest) {
  75242. next.mediaIndex = getSyncSegmentCandidate$1(this.currentTimeline_, segments, bufferedEnd);
  75243. } else if (this.mediaIndex !== null) {
  75244. const segment = segments[this.mediaIndex];
  75245. const partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  75246. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  75247. if (segment.parts && segment.parts[partIndex + 1]) {
  75248. next.mediaIndex = this.mediaIndex;
  75249. next.partIndex = partIndex + 1;
  75250. } else {
  75251. next.mediaIndex = this.mediaIndex + 1;
  75252. }
  75253. } else {
  75254. const {
  75255. segmentIndex,
  75256. startTime,
  75257. partIndex
  75258. } = Playlist$1.getMediaInfoForTime({
  75259. exactManifestTimings: this.exactManifestTimings,
  75260. playlist: this.playlist_,
  75261. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  75262. startingPartIndex: this.syncPoint_.partIndex,
  75263. startingSegmentIndex: this.syncPoint_.segmentIndex,
  75264. startTime: this.syncPoint_.time
  75265. });
  75266. next.getMediaInfoForTime = this.fetchAtBuffer_ ? `bufferedEnd ${bufferedEnd}` : `currentTime ${this.currentTime_()}`;
  75267. next.mediaIndex = segmentIndex;
  75268. next.startOfSegment = startTime;
  75269. next.partIndex = partIndex;
  75270. }
  75271. const nextSegment = segments[next.mediaIndex];
  75272. let nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  75273. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  75274. return null;
  75275. }
  75276. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  75277. next.partIndex = 0;
  75278. nextPart = nextSegment.parts[0];
  75279. }
  75280. if (!bufferedTime && nextPart && !nextPart.independent) {
  75281. if (next.partIndex === 0) {
  75282. const lastSegment = segments[next.mediaIndex - 1];
  75283. const lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  75284. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  75285. next.mediaIndex -= 1;
  75286. next.partIndex = lastSegment.parts.length - 1;
  75287. next.independent = "previous segment";
  75288. }
  75289. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  75290. next.partIndex -= 1;
  75291. next.independent = "previous part";
  75292. }
  75293. }
  75294. const ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  75295. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  75296. return null;
  75297. }
  75298. return this.generateSegmentInfo_(next);
  75299. }
  75300. generateSegmentInfo_(options2) {
  75301. const {
  75302. independent,
  75303. playlist,
  75304. mediaIndex,
  75305. startOfSegment,
  75306. isSyncRequest,
  75307. partIndex,
  75308. forceTimestampOffset,
  75309. getMediaInfoForTime: getMediaInfoForTime3
  75310. } = options2;
  75311. const segment = playlist.segments[mediaIndex];
  75312. const part = typeof partIndex === "number" && segment.parts[partIndex];
  75313. const segmentInfo = {
  75314. requestId: "segment-loader-" + Math.random(),
  75315. uri: part && part.resolvedUri || segment.resolvedUri,
  75316. mediaIndex,
  75317. partIndex: part ? partIndex : null,
  75318. isSyncRequest,
  75319. startOfSegment,
  75320. playlist,
  75321. bytes: null,
  75322. encryptedBytes: null,
  75323. timestampOffset: null,
  75324. timeline: segment.timeline,
  75325. duration: part && part.duration || segment.duration,
  75326. segment,
  75327. part,
  75328. byteLength: 0,
  75329. transmuxer: this.transmuxer_,
  75330. getMediaInfoForTime: getMediaInfoForTime3,
  75331. independent
  75332. };
  75333. const overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  75334. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  75335. segmentTimeline: segment.timeline,
  75336. currentTimeline: this.currentTimeline_,
  75337. startOfSegment,
  75338. buffered: this.buffered_(),
  75339. overrideCheck
  75340. });
  75341. const audioBufferedEnd = lastBufferedEnd$1(this.sourceUpdater_.audioBuffered());
  75342. if (typeof audioBufferedEnd === "number") {
  75343. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  75344. }
  75345. if (this.sourceUpdater_.videoBuffered().length) {
  75346. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith$1(
  75347. this.gopBuffer_,
  75348. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  75349. this.timeMapping_
  75350. );
  75351. }
  75352. return segmentInfo;
  75353. }
  75354. timestampOffsetForSegment_(options2) {
  75355. return timestampOffsetForSegment$1(options2);
  75356. }
  75357. earlyAbortWhenNeeded_(stats) {
  75358. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  75359. return;
  75360. }
  75361. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  75362. return;
  75363. }
  75364. const currentTime = this.currentTime_();
  75365. const measuredBandwidth = stats.bandwidth;
  75366. const segmentDuration = this.pendingSegment_.duration;
  75367. const requestTimeRemaining = Playlist$1.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  75368. const timeUntilRebuffer$1$1 = timeUntilRebuffer$1(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  75369. if (requestTimeRemaining <= timeUntilRebuffer$1$1) {
  75370. return;
  75371. }
  75372. const switchCandidate = minRebufferMaxBandwidthSelector$1({
  75373. main: this.vhs_.playlists.main,
  75374. currentTime,
  75375. bandwidth: measuredBandwidth,
  75376. duration: this.duration_(),
  75377. segmentDuration,
  75378. timeUntilRebuffer: timeUntilRebuffer$1$1,
  75379. currentTimeline: this.currentTimeline_,
  75380. syncController: this.syncController_
  75381. });
  75382. if (!switchCandidate) {
  75383. return;
  75384. }
  75385. const rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1$1;
  75386. const timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  75387. let minimumTimeSaving = 0.5;
  75388. if (timeUntilRebuffer$1$1 <= TIME_FUDGE_FACTOR$1) {
  75389. minimumTimeSaving = 1;
  75390. }
  75391. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  75392. return;
  75393. }
  75394. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config$1.BANDWIDTH_VARIANCE + 1;
  75395. this.trigger("earlyabort");
  75396. }
  75397. handleAbort_(segmentInfo) {
  75398. this.logger_(`Aborting ${segmentInfoString$1(segmentInfo)}`);
  75399. this.mediaRequestsAborted += 1;
  75400. }
  75401. handleProgress_(event2, simpleSegment) {
  75402. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75403. if (this.checkForAbort_(simpleSegment.requestId)) {
  75404. return;
  75405. }
  75406. this.trigger("progress");
  75407. }
  75408. handleTrackInfo_(simpleSegment, trackInfo) {
  75409. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75410. if (this.checkForAbort_(simpleSegment.requestId)) {
  75411. return;
  75412. }
  75413. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  75414. return;
  75415. }
  75416. trackInfo = trackInfo || {};
  75417. if (!shallowEqual$1(this.currentMediaInfo_, trackInfo)) {
  75418. this.appendInitSegment_ = {
  75419. audio: true,
  75420. video: true
  75421. };
  75422. this.startingMediaInfo_ = trackInfo;
  75423. this.currentMediaInfo_ = trackInfo;
  75424. this.logger_("trackinfo update", trackInfo);
  75425. this.trigger("trackinfo");
  75426. }
  75427. if (this.checkForAbort_(simpleSegment.requestId)) {
  75428. return;
  75429. }
  75430. this.pendingSegment_.trackInfo = trackInfo;
  75431. if (this.hasEnoughInfoToAppend_()) {
  75432. this.processCallQueue_();
  75433. }
  75434. }
  75435. handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  75436. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75437. if (this.checkForAbort_(simpleSegment.requestId)) {
  75438. return;
  75439. }
  75440. const segmentInfo = this.pendingSegment_;
  75441. const timingInfoProperty = timingInfoPropertyForMedia$1(mediaType);
  75442. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  75443. segmentInfo[timingInfoProperty][timeType] = time;
  75444. this.logger_(`timinginfo: ${mediaType} - ${timeType} - ${time}`);
  75445. if (this.hasEnoughInfoToAppend_()) {
  75446. this.processCallQueue_();
  75447. }
  75448. }
  75449. handleCaptions_(simpleSegment, captionData) {
  75450. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75451. if (this.checkForAbort_(simpleSegment.requestId)) {
  75452. return;
  75453. }
  75454. if (captionData.length === 0) {
  75455. this.logger_("SegmentLoader received no captions from a caption event");
  75456. return;
  75457. }
  75458. const segmentInfo = this.pendingSegment_;
  75459. if (!segmentInfo.hasAppendedData_) {
  75460. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  75461. return;
  75462. }
  75463. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75464. const captionTracks = {};
  75465. captionData.forEach((caption) => {
  75466. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  75467. startTime: Infinity,
  75468. captions: [],
  75469. endTime: 0
  75470. };
  75471. const captionTrack = captionTracks[caption.stream];
  75472. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  75473. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  75474. captionTrack.captions.push(caption);
  75475. });
  75476. Object.keys(captionTracks).forEach((trackName) => {
  75477. const {
  75478. startTime,
  75479. endTime,
  75480. captions
  75481. } = captionTracks[trackName];
  75482. const inbandTextTracks = this.inbandTextTracks_;
  75483. this.logger_(`adding cues from ${startTime} -> ${endTime} for ${trackName}`);
  75484. createCaptionsTrackIfNotExists$1(inbandTextTracks, this.vhs_.tech_, trackName);
  75485. removeCuesFromTrack$1(startTime, endTime, inbandTextTracks[trackName]);
  75486. addCaptionData$1({
  75487. captionArray: captions,
  75488. inbandTextTracks,
  75489. timestampOffset: timestampOffset2
  75490. });
  75491. });
  75492. if (this.transmuxer_) {
  75493. this.transmuxer_.postMessage({
  75494. action: "clearParsedMp4Captions"
  75495. });
  75496. }
  75497. }
  75498. handleId3_(simpleSegment, id3Frames, dispatchType) {
  75499. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75500. if (this.checkForAbort_(simpleSegment.requestId)) {
  75501. return;
  75502. }
  75503. const segmentInfo = this.pendingSegment_;
  75504. if (!segmentInfo.hasAppendedData_) {
  75505. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  75506. return;
  75507. }
  75508. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75509. createMetadataTrackIfNotExists$1(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  75510. addMetadata$1({
  75511. inbandTextTracks: this.inbandTextTracks_,
  75512. metadataArray: id3Frames,
  75513. timestampOffset: timestampOffset2,
  75514. videoDuration: this.duration_()
  75515. });
  75516. }
  75517. processMetadataQueue_() {
  75518. this.metadataQueue_.id3.forEach((fn2) => fn2());
  75519. this.metadataQueue_.caption.forEach((fn2) => fn2());
  75520. this.metadataQueue_.id3 = [];
  75521. this.metadataQueue_.caption = [];
  75522. }
  75523. processCallQueue_() {
  75524. const callQueue = this.callQueue_;
  75525. this.callQueue_ = [];
  75526. callQueue.forEach((fun) => fun());
  75527. }
  75528. processLoadQueue_() {
  75529. const loadQueue = this.loadQueue_;
  75530. this.loadQueue_ = [];
  75531. loadQueue.forEach((fun) => fun());
  75532. }
  75533. hasEnoughInfoToLoad_() {
  75534. if (this.loaderType_ !== "audio") {
  75535. return true;
  75536. }
  75537. const segmentInfo = this.pendingSegment_;
  75538. if (!segmentInfo) {
  75539. return false;
  75540. }
  75541. if (!this.getCurrentMediaInfo_()) {
  75542. return true;
  75543. }
  75544. if (shouldWaitForTimelineChange$1({
  75545. timelineChangeController: this.timelineChangeController_,
  75546. currentTimeline: this.currentTimeline_,
  75547. segmentTimeline: segmentInfo.timeline,
  75548. loaderType: this.loaderType_,
  75549. audioDisabled: this.audioDisabled_
  75550. })) {
  75551. return false;
  75552. }
  75553. return true;
  75554. }
  75555. getCurrentMediaInfo_(segmentInfo = this.pendingSegment_) {
  75556. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  75557. }
  75558. getMediaInfo_(segmentInfo = this.pendingSegment_) {
  75559. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  75560. }
  75561. getPendingSegmentPlaylist() {
  75562. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  75563. }
  75564. hasEnoughInfoToAppend_() {
  75565. if (!this.sourceUpdater_.ready()) {
  75566. return false;
  75567. }
  75568. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  75569. return false;
  75570. }
  75571. const segmentInfo = this.pendingSegment_;
  75572. const trackInfo = this.getCurrentMediaInfo_();
  75573. if (!segmentInfo || !trackInfo) {
  75574. return false;
  75575. }
  75576. const {
  75577. hasAudio,
  75578. hasVideo,
  75579. isMuxed: isMuxed3
  75580. } = trackInfo;
  75581. if (hasVideo && !segmentInfo.videoTimingInfo) {
  75582. return false;
  75583. }
  75584. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  75585. return false;
  75586. }
  75587. if (shouldWaitForTimelineChange$1({
  75588. timelineChangeController: this.timelineChangeController_,
  75589. currentTimeline: this.currentTimeline_,
  75590. segmentTimeline: segmentInfo.timeline,
  75591. loaderType: this.loaderType_,
  75592. audioDisabled: this.audioDisabled_
  75593. })) {
  75594. return false;
  75595. }
  75596. return true;
  75597. }
  75598. handleData_(simpleSegment, result) {
  75599. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75600. if (this.checkForAbort_(simpleSegment.requestId)) {
  75601. return;
  75602. }
  75603. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  75604. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  75605. return;
  75606. }
  75607. const segmentInfo = this.pendingSegment_;
  75608. this.setTimeMapping_(segmentInfo.timeline);
  75609. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  75610. if (this.mediaSource_.readyState === "closed") {
  75611. return;
  75612. }
  75613. if (simpleSegment.map) {
  75614. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  75615. segmentInfo.segment.map = simpleSegment.map;
  75616. }
  75617. if (simpleSegment.key) {
  75618. this.segmentKey(simpleSegment.key, true);
  75619. }
  75620. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  75621. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  75622. if (segmentInfo.isFmp4) {
  75623. this.trigger("fmp4");
  75624. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia$1(result.type)].start;
  75625. } else {
  75626. const trackInfo = this.getCurrentMediaInfo_();
  75627. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  75628. let firstVideoFrameTimeForData;
  75629. if (useVideoTimingInfo) {
  75630. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  75631. }
  75632. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  75633. currentStart: segmentInfo.timingInfo.start,
  75634. playlist: segmentInfo.playlist,
  75635. mediaIndex: segmentInfo.mediaIndex,
  75636. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  75637. useVideoTimingInfo,
  75638. firstVideoFrameTimeForData,
  75639. videoTimingInfo: segmentInfo.videoTimingInfo,
  75640. audioTimingInfo: segmentInfo.audioTimingInfo
  75641. });
  75642. }
  75643. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  75644. this.updateSourceBufferTimestampOffset_(segmentInfo);
  75645. if (segmentInfo.isSyncRequest) {
  75646. this.updateTimingInfoEnd_(segmentInfo);
  75647. this.syncController_.saveSegmentTimingInfo({
  75648. segmentInfo,
  75649. shouldSaveTimelineMapping: this.loaderType_ === "main"
  75650. });
  75651. const next = this.chooseNextRequest_();
  75652. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  75653. this.logger_("sync segment was incorrect, not appending");
  75654. return;
  75655. }
  75656. this.logger_("sync segment was correct, appending");
  75657. }
  75658. segmentInfo.hasAppendedData_ = true;
  75659. this.processMetadataQueue_();
  75660. this.appendData_(segmentInfo, result);
  75661. }
  75662. updateAppendInitSegmentStatus(segmentInfo, type2) {
  75663. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  75664. this.appendInitSegment_ = {
  75665. audio: true,
  75666. video: true
  75667. };
  75668. }
  75669. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  75670. this.appendInitSegment_[type2] = true;
  75671. }
  75672. }
  75673. getInitSegmentAndUpdateState_({
  75674. type: type2,
  75675. initSegment,
  75676. map,
  75677. playlist
  75678. }) {
  75679. if (map) {
  75680. const id = initSegmentId$1(map);
  75681. if (this.activeInitSegmentId_ === id) {
  75682. return null;
  75683. }
  75684. initSegment = this.initSegmentForMap(map, true).bytes;
  75685. this.activeInitSegmentId_ = id;
  75686. }
  75687. if (initSegment && this.appendInitSegment_[type2]) {
  75688. this.playlistOfLastInitSegment_[type2] = playlist;
  75689. this.appendInitSegment_[type2] = false;
  75690. this.activeInitSegmentId_ = null;
  75691. return initSegment;
  75692. }
  75693. return null;
  75694. }
  75695. handleQuotaExceededError_({
  75696. segmentInfo,
  75697. type: type2,
  75698. bytes
  75699. }, error) {
  75700. const audioBuffered = this.sourceUpdater_.audioBuffered();
  75701. const videoBuffered = this.sourceUpdater_.videoBuffered();
  75702. if (audioBuffered.length > 1) {
  75703. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray$1(audioBuffered).join(", "));
  75704. }
  75705. if (videoBuffered.length > 1) {
  75706. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray$1(videoBuffered).join(", "));
  75707. }
  75708. const audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  75709. const audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  75710. const videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  75711. const videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  75712. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER$1 && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER$1) {
  75713. this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${bytes.byteLength}, audio buffer: ${timeRangesToArray$1(audioBuffered).join(", ")}, video buffer: ${timeRangesToArray$1(videoBuffered).join(", ")}, `);
  75714. this.error({
  75715. message: "Quota exceeded error with append of a single segment of content",
  75716. excludeUntil: Infinity
  75717. });
  75718. this.trigger("error");
  75719. return;
  75720. }
  75721. this.waitingOnRemove_ = true;
  75722. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  75723. segmentInfo,
  75724. type: type2,
  75725. bytes
  75726. }));
  75727. const currentTime = this.currentTime_();
  75728. const timeToRemoveUntil = currentTime - MIN_BACK_BUFFER$1;
  75729. this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${timeToRemoveUntil}`);
  75730. this.remove(0, timeToRemoveUntil, () => {
  75731. this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${MIN_BACK_BUFFER$1}s`);
  75732. this.waitingOnRemove_ = false;
  75733. this.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(() => {
  75734. this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  75735. this.quotaExceededErrorRetryTimeout_ = null;
  75736. this.processCallQueue_();
  75737. }, MIN_BACK_BUFFER$1 * 1e3);
  75738. }, true);
  75739. }
  75740. handleAppendError_({
  75741. segmentInfo,
  75742. type: type2,
  75743. bytes
  75744. }, error) {
  75745. if (!error) {
  75746. return;
  75747. }
  75748. if (error.code === QUOTA_EXCEEDED_ERR$1) {
  75749. this.handleQuotaExceededError_({
  75750. segmentInfo,
  75751. type: type2,
  75752. bytes
  75753. });
  75754. return;
  75755. }
  75756. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  75757. this.error(`${type2} append of ${bytes.length}b failed for segment #${segmentInfo.mediaIndex} in playlist ${segmentInfo.playlist.id}`);
  75758. this.trigger("appenderror");
  75759. }
  75760. appendToSourceBuffer_({
  75761. segmentInfo,
  75762. type: type2,
  75763. initSegment,
  75764. data,
  75765. bytes
  75766. }) {
  75767. if (!bytes) {
  75768. const segments = [data];
  75769. let byteLength = data.byteLength;
  75770. if (initSegment) {
  75771. segments.unshift(initSegment);
  75772. byteLength += initSegment.byteLength;
  75773. }
  75774. bytes = concatSegments$1({
  75775. bytes: byteLength,
  75776. segments
  75777. });
  75778. }
  75779. this.sourceUpdater_.appendBuffer({
  75780. segmentInfo,
  75781. type: type2,
  75782. bytes
  75783. }, this.handleAppendError_.bind(this, {
  75784. segmentInfo,
  75785. type: type2,
  75786. bytes
  75787. }));
  75788. }
  75789. handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  75790. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  75791. return;
  75792. }
  75793. const segment = this.pendingSegment_.segment;
  75794. const timingInfoProperty = `${type2}TimingInfo`;
  75795. if (!segment[timingInfoProperty]) {
  75796. segment[timingInfoProperty] = {};
  75797. }
  75798. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  75799. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  75800. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  75801. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  75802. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  75803. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  75804. }
  75805. appendData_(segmentInfo, result) {
  75806. const {
  75807. type: type2,
  75808. data
  75809. } = result;
  75810. if (!data || !data.byteLength) {
  75811. return;
  75812. }
  75813. if (type2 === "audio" && this.audioDisabled_) {
  75814. return;
  75815. }
  75816. const initSegment = this.getInitSegmentAndUpdateState_({
  75817. type: type2,
  75818. initSegment: result.initSegment,
  75819. playlist: segmentInfo.playlist,
  75820. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  75821. });
  75822. this.appendToSourceBuffer_({
  75823. segmentInfo,
  75824. type: type2,
  75825. initSegment,
  75826. data
  75827. });
  75828. }
  75829. loadSegment_(segmentInfo) {
  75830. this.state = "WAITING";
  75831. this.pendingSegment_ = segmentInfo;
  75832. this.trimBackBuffer_(segmentInfo);
  75833. if (typeof segmentInfo.timestampOffset === "number") {
  75834. if (this.transmuxer_) {
  75835. this.transmuxer_.postMessage({
  75836. action: "clearAllMp4Captions"
  75837. });
  75838. }
  75839. }
  75840. if (!this.hasEnoughInfoToLoad_()) {
  75841. this.loadQueue_.push(() => {
  75842. const options2 = _extends$2({}, segmentInfo, {
  75843. forceTimestampOffset: true
  75844. });
  75845. _extends$2(segmentInfo, this.generateSegmentInfo_(options2));
  75846. this.isPendingTimestampOffset_ = false;
  75847. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75848. });
  75849. return;
  75850. }
  75851. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75852. }
  75853. updateTransmuxerAndRequestSegment_(segmentInfo) {
  75854. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  75855. this.gopBuffer_.length = 0;
  75856. segmentInfo.gopsToAlignWith = [];
  75857. this.timeMapping_ = 0;
  75858. this.transmuxer_.postMessage({
  75859. action: "reset"
  75860. });
  75861. this.transmuxer_.postMessage({
  75862. action: "setTimestampOffset",
  75863. timestampOffset: segmentInfo.timestampOffset
  75864. });
  75865. }
  75866. const simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  75867. const isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  75868. const isWalkingForward = this.mediaIndex !== null;
  75869. const isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  75870. const isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  75871. this.logger_(`Requesting ${segmentInfoString$1(segmentInfo)}`);
  75872. if (simpleSegment.map && !simpleSegment.map.bytes) {
  75873. this.logger_("going to request init segment.");
  75874. this.appendInitSegment_ = {
  75875. video: true,
  75876. audio: true
  75877. };
  75878. }
  75879. segmentInfo.abortRequests = mediaSegmentRequest$1({
  75880. xhr: this.vhs_.xhr,
  75881. xhrOptions: this.xhrOptions_,
  75882. decryptionWorker: this.decrypter_,
  75883. segment: simpleSegment,
  75884. abortFn: this.handleAbort_.bind(this, segmentInfo),
  75885. progressFn: this.handleProgress_.bind(this),
  75886. trackInfoFn: this.handleTrackInfo_.bind(this),
  75887. timingInfoFn: this.handleTimingInfo_.bind(this),
  75888. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  75889. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  75890. captionsFn: this.handleCaptions_.bind(this),
  75891. isEndOfTimeline,
  75892. endedTimelineFn: () => {
  75893. this.logger_("received endedtimeline callback");
  75894. },
  75895. id3Fn: this.handleId3_.bind(this),
  75896. dataFn: this.handleData_.bind(this),
  75897. doneFn: this.segmentRequestFinished_.bind(this),
  75898. onTransmuxerLog: ({
  75899. message,
  75900. level,
  75901. stream
  75902. }) => {
  75903. this.logger_(`${segmentInfoString$1(segmentInfo)} logged from transmuxer stream ${stream} as a ${level}: ${message}`);
  75904. }
  75905. });
  75906. }
  75907. trimBackBuffer_(segmentInfo) {
  75908. const removeToTime = safeBackBufferTrimTime$1(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  75909. if (removeToTime > 0) {
  75910. this.remove(0, removeToTime);
  75911. }
  75912. }
  75913. createSimplifiedSegmentObj_(segmentInfo) {
  75914. const segment = segmentInfo.segment;
  75915. const part = segmentInfo.part;
  75916. const simpleSegment = {
  75917. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  75918. byterange: part ? part.byterange : segment.byterange,
  75919. requestId: segmentInfo.requestId,
  75920. transmuxer: segmentInfo.transmuxer,
  75921. audioAppendStart: segmentInfo.audioAppendStart,
  75922. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  75923. part: segmentInfo.part
  75924. };
  75925. const previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  75926. if (previousSegment && previousSegment.timeline === segment.timeline) {
  75927. if (previousSegment.videoTimingInfo) {
  75928. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  75929. } else if (previousSegment.audioTimingInfo) {
  75930. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  75931. }
  75932. }
  75933. if (segment.key) {
  75934. const iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  75935. simpleSegment.key = this.segmentKey(segment.key);
  75936. simpleSegment.key.iv = iv;
  75937. }
  75938. if (segment.map) {
  75939. simpleSegment.map = this.initSegmentForMap(segment.map);
  75940. }
  75941. return simpleSegment;
  75942. }
  75943. saveTransferStats_(stats) {
  75944. this.mediaRequests += 1;
  75945. if (stats) {
  75946. this.mediaBytesTransferred += stats.bytesReceived;
  75947. this.mediaTransferDuration += stats.roundTripTime;
  75948. }
  75949. }
  75950. saveBandwidthRelatedStats_(duration5, stats) {
  75951. this.pendingSegment_.byteLength = stats.bytesReceived;
  75952. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  75953. this.logger_(`Ignoring segment's bandwidth because its duration of ${duration5} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  75954. return;
  75955. }
  75956. this.bandwidth = stats.bandwidth;
  75957. this.roundTrip = stats.roundTripTime;
  75958. }
  75959. handleTimeout_() {
  75960. this.mediaRequestsTimedout += 1;
  75961. this.bandwidth = 1;
  75962. this.roundTrip = NaN;
  75963. this.trigger("bandwidthupdate");
  75964. this.trigger("timeout");
  75965. }
  75966. segmentRequestFinished_(error, simpleSegment, result) {
  75967. if (this.callQueue_.length) {
  75968. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  75969. return;
  75970. }
  75971. this.saveTransferStats_(simpleSegment.stats);
  75972. if (!this.pendingSegment_) {
  75973. return;
  75974. }
  75975. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  75976. return;
  75977. }
  75978. if (error) {
  75979. this.pendingSegment_ = null;
  75980. this.state = "READY";
  75981. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  75982. return;
  75983. }
  75984. this.pause();
  75985. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  75986. this.handleTimeout_();
  75987. return;
  75988. }
  75989. this.mediaRequestsErrored += 1;
  75990. this.error(error);
  75991. this.trigger("error");
  75992. return;
  75993. }
  75994. const segmentInfo = this.pendingSegment_;
  75995. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  75996. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  75997. if (result.gopInfo) {
  75998. this.gopBuffer_ = updateGopBuffer$1(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  75999. }
  76000. this.state = "APPENDING";
  76001. this.trigger("appending");
  76002. this.waitForAppendsToComplete_(segmentInfo);
  76003. }
  76004. setTimeMapping_(timeline) {
  76005. const timelineMapping = this.syncController_.mappingForTimeline(timeline);
  76006. if (timelineMapping !== null) {
  76007. this.timeMapping_ = timelineMapping;
  76008. }
  76009. }
  76010. updateMediaSecondsLoaded_(segment) {
  76011. if (typeof segment.start === "number" && typeof segment.end === "number") {
  76012. this.mediaSecondsLoaded += segment.end - segment.start;
  76013. } else {
  76014. this.mediaSecondsLoaded += segment.duration;
  76015. }
  76016. }
  76017. shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  76018. if (timestampOffset2 === null) {
  76019. return false;
  76020. }
  76021. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  76022. return true;
  76023. }
  76024. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  76025. return true;
  76026. }
  76027. return false;
  76028. }
  76029. trueSegmentStart_({
  76030. currentStart,
  76031. playlist,
  76032. mediaIndex,
  76033. firstVideoFrameTimeForData,
  76034. currentVideoTimestampOffset,
  76035. useVideoTimingInfo,
  76036. videoTimingInfo,
  76037. audioTimingInfo
  76038. }) {
  76039. if (typeof currentStart !== "undefined") {
  76040. return currentStart;
  76041. }
  76042. if (!useVideoTimingInfo) {
  76043. return audioTimingInfo.start;
  76044. }
  76045. const previousSegment = playlist.segments[mediaIndex - 1];
  76046. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  76047. return firstVideoFrameTimeForData;
  76048. }
  76049. return videoTimingInfo.start;
  76050. }
  76051. waitForAppendsToComplete_(segmentInfo) {
  76052. const trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  76053. if (!trackInfo) {
  76054. this.error({
  76055. message: "No starting media returned, likely due to an unsupported media format.",
  76056. playlistExclusionDuration: Infinity
  76057. });
  76058. this.trigger("error");
  76059. return;
  76060. }
  76061. const {
  76062. hasAudio,
  76063. hasVideo,
  76064. isMuxed: isMuxed3
  76065. } = trackInfo;
  76066. const waitForVideo = this.loaderType_ === "main" && hasVideo;
  76067. const waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  76068. segmentInfo.waitingOnAppends = 0;
  76069. if (!segmentInfo.hasAppendedData_) {
  76070. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  76071. this.isPendingTimestampOffset_ = true;
  76072. }
  76073. segmentInfo.timingInfo = {
  76074. start: 0
  76075. };
  76076. segmentInfo.waitingOnAppends++;
  76077. if (!this.isPendingTimestampOffset_) {
  76078. this.updateSourceBufferTimestampOffset_(segmentInfo);
  76079. this.processMetadataQueue_();
  76080. }
  76081. this.checkAppendsDone_(segmentInfo);
  76082. return;
  76083. }
  76084. if (waitForVideo) {
  76085. segmentInfo.waitingOnAppends++;
  76086. }
  76087. if (waitForAudio) {
  76088. segmentInfo.waitingOnAppends++;
  76089. }
  76090. if (waitForVideo) {
  76091. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76092. }
  76093. if (waitForAudio) {
  76094. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76095. }
  76096. }
  76097. checkAppendsDone_(segmentInfo) {
  76098. if (this.checkForAbort_(segmentInfo.requestId)) {
  76099. return;
  76100. }
  76101. segmentInfo.waitingOnAppends--;
  76102. if (segmentInfo.waitingOnAppends === 0) {
  76103. this.handleAppendsDone_();
  76104. }
  76105. }
  76106. checkForIllegalMediaSwitch(trackInfo) {
  76107. const illegalMediaSwitchError = illegalMediaSwitch$1(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  76108. if (illegalMediaSwitchError) {
  76109. this.error({
  76110. message: illegalMediaSwitchError,
  76111. playlistExclusionDuration: Infinity
  76112. });
  76113. this.trigger("error");
  76114. return true;
  76115. }
  76116. return false;
  76117. }
  76118. updateSourceBufferTimestampOffset_(segmentInfo) {
  76119. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  76120. return;
  76121. }
  76122. let didChange = false;
  76123. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  76124. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  76125. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  76126. timingInfo: segmentInfo.timingInfo
  76127. });
  76128. segmentInfo.changedTimestampOffset = true;
  76129. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  76130. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  76131. didChange = true;
  76132. }
  76133. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  76134. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  76135. didChange = true;
  76136. }
  76137. if (didChange) {
  76138. this.trigger("timestampoffset");
  76139. }
  76140. }
  76141. getSegmentStartTimeForTimestampOffsetCalculation_({
  76142. videoTimingInfo,
  76143. audioTimingInfo,
  76144. timingInfo
  76145. }) {
  76146. if (!this.useDtsForTimestampOffset_) {
  76147. return timingInfo.start;
  76148. }
  76149. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  76150. return videoTimingInfo.transmuxedDecodeStart;
  76151. }
  76152. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  76153. return audioTimingInfo.transmuxedDecodeStart;
  76154. }
  76155. return timingInfo.start;
  76156. }
  76157. updateTimingInfoEnd_(segmentInfo) {
  76158. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  76159. const trackInfo = this.getMediaInfo_();
  76160. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  76161. const prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  76162. if (!prioritizedTimingInfo) {
  76163. return;
  76164. }
  76165. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  76166. }
  76167. handleAppendsDone_() {
  76168. if (this.pendingSegment_) {
  76169. this.trigger("appendsdone");
  76170. }
  76171. if (!this.pendingSegment_) {
  76172. this.state = "READY";
  76173. if (!this.paused()) {
  76174. this.monitorBuffer_();
  76175. }
  76176. return;
  76177. }
  76178. const segmentInfo = this.pendingSegment_;
  76179. this.updateTimingInfoEnd_(segmentInfo);
  76180. if (this.shouldSaveSegmentTimingInfo_) {
  76181. this.syncController_.saveSegmentTimingInfo({
  76182. segmentInfo,
  76183. shouldSaveTimelineMapping: this.loaderType_ === "main"
  76184. });
  76185. }
  76186. const segmentDurationMessage = getTroublesomeSegmentDurationMessage$1(segmentInfo, this.sourceType_);
  76187. if (segmentDurationMessage) {
  76188. if (segmentDurationMessage.severity === "warn") {
  76189. videojs$2.log.warn(segmentDurationMessage.message);
  76190. } else {
  76191. this.logger_(segmentDurationMessage.message);
  76192. }
  76193. }
  76194. this.recordThroughput_(segmentInfo);
  76195. this.pendingSegment_ = null;
  76196. this.state = "READY";
  76197. if (segmentInfo.isSyncRequest) {
  76198. this.trigger("syncinfoupdate");
  76199. if (!segmentInfo.hasAppendedData_) {
  76200. this.logger_(`Throwing away un-appended sync request ${segmentInfoString$1(segmentInfo)}`);
  76201. return;
  76202. }
  76203. }
  76204. this.logger_(`Appended ${segmentInfoString$1(segmentInfo)}`);
  76205. this.addSegmentMetadataCue_(segmentInfo);
  76206. this.fetchAtBuffer_ = true;
  76207. if (this.currentTimeline_ !== segmentInfo.timeline) {
  76208. this.timelineChangeController_.lastTimelineChange({
  76209. type: this.loaderType_,
  76210. from: this.currentTimeline_,
  76211. to: segmentInfo.timeline
  76212. });
  76213. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  76214. this.timelineChangeController_.lastTimelineChange({
  76215. type: "audio",
  76216. from: this.currentTimeline_,
  76217. to: segmentInfo.timeline
  76218. });
  76219. }
  76220. }
  76221. this.currentTimeline_ = segmentInfo.timeline;
  76222. this.trigger("syncinfoupdate");
  76223. const segment = segmentInfo.segment;
  76224. const part = segmentInfo.part;
  76225. const badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  76226. const badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  76227. if (badSegmentGuess || badPartGuess) {
  76228. this.logger_(`bad ${badSegmentGuess ? "segment" : "part"} ${segmentInfoString$1(segmentInfo)}`);
  76229. this.resetEverything();
  76230. return;
  76231. }
  76232. const isWalkingForward = this.mediaIndex !== null;
  76233. if (isWalkingForward) {
  76234. this.trigger("bandwidthupdate");
  76235. }
  76236. this.trigger("progress");
  76237. this.mediaIndex = segmentInfo.mediaIndex;
  76238. this.partIndex = segmentInfo.partIndex;
  76239. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  76240. this.endOfStream();
  76241. }
  76242. this.trigger("appended");
  76243. if (segmentInfo.hasAppendedData_) {
  76244. this.mediaAppends++;
  76245. }
  76246. if (!this.paused()) {
  76247. this.monitorBuffer_();
  76248. }
  76249. }
  76250. recordThroughput_(segmentInfo) {
  76251. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  76252. this.logger_(`Ignoring segment's throughput because its duration of ${segmentInfo.duration} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  76253. return;
  76254. }
  76255. const rate = this.throughput.rate;
  76256. const segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  76257. const segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  76258. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  76259. }
  76260. addSegmentMetadataCue_(segmentInfo) {
  76261. if (!this.segmentMetadataTrack_) {
  76262. return;
  76263. }
  76264. const segment = segmentInfo.segment;
  76265. const start2 = segment.start;
  76266. const end = segment.end;
  76267. if (!finite$1(start2) || !finite$1(end)) {
  76268. return;
  76269. }
  76270. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  76271. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  76272. const value = {
  76273. custom: segment.custom,
  76274. dateTimeObject: segment.dateTimeObject,
  76275. dateTimeString: segment.dateTimeString,
  76276. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  76277. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  76278. codecs: segmentInfo.playlist.attributes.CODECS,
  76279. byteLength: segmentInfo.byteLength,
  76280. uri: segmentInfo.uri,
  76281. timeline: segmentInfo.timeline,
  76282. playlist: segmentInfo.playlist.id,
  76283. start: start2,
  76284. end
  76285. };
  76286. const data = JSON.stringify(value);
  76287. const cue = new Cue(start2, end, data);
  76288. cue.value = value;
  76289. this.segmentMetadataTrack_.addCue(cue);
  76290. }
  76291. }
  76292. function noop$1() {
  76293. }
  76294. const toTitleCase$2 = function(string) {
  76295. if (typeof string !== "string") {
  76296. return string;
  76297. }
  76298. return string.replace(/./, (w) => w.toUpperCase());
  76299. };
  76300. const bufferTypes$1 = ["video", "audio"];
  76301. const updating = (type2, sourceUpdater) => {
  76302. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76303. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  76304. };
  76305. const nextQueueIndexOfType$1 = (type2, queue) => {
  76306. for (let i2 = 0; i2 < queue.length; i2++) {
  76307. const queueEntry = queue[i2];
  76308. if (queueEntry.type === "mediaSource") {
  76309. return null;
  76310. }
  76311. if (queueEntry.type === type2) {
  76312. return i2;
  76313. }
  76314. }
  76315. return null;
  76316. };
  76317. const shiftQueue$1 = (type2, sourceUpdater) => {
  76318. if (sourceUpdater.queue.length === 0) {
  76319. return;
  76320. }
  76321. let queueIndex = 0;
  76322. let queueEntry = sourceUpdater.queue[queueIndex];
  76323. if (queueEntry.type === "mediaSource") {
  76324. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  76325. sourceUpdater.queue.shift();
  76326. queueEntry.action(sourceUpdater);
  76327. if (queueEntry.doneFn) {
  76328. queueEntry.doneFn();
  76329. }
  76330. shiftQueue$1("audio", sourceUpdater);
  76331. shiftQueue$1("video", sourceUpdater);
  76332. }
  76333. return;
  76334. }
  76335. if (type2 === "mediaSource") {
  76336. return;
  76337. }
  76338. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || updating(type2, sourceUpdater)) {
  76339. return;
  76340. }
  76341. if (queueEntry.type !== type2) {
  76342. queueIndex = nextQueueIndexOfType$1(type2, sourceUpdater.queue);
  76343. if (queueIndex === null) {
  76344. return;
  76345. }
  76346. queueEntry = sourceUpdater.queue[queueIndex];
  76347. }
  76348. sourceUpdater.queue.splice(queueIndex, 1);
  76349. sourceUpdater.queuePending[type2] = queueEntry;
  76350. queueEntry.action(type2, sourceUpdater);
  76351. if (!queueEntry.doneFn) {
  76352. sourceUpdater.queuePending[type2] = null;
  76353. shiftQueue$1(type2, sourceUpdater);
  76354. return;
  76355. }
  76356. };
  76357. const cleanupBuffer$1 = (type2, sourceUpdater) => {
  76358. const buffer = sourceUpdater[`${type2}Buffer`];
  76359. const titleType = toTitleCase$2(type2);
  76360. if (!buffer) {
  76361. return;
  76362. }
  76363. buffer.removeEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76364. buffer.removeEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76365. sourceUpdater.codecs[type2] = null;
  76366. sourceUpdater[`${type2}Buffer`] = null;
  76367. };
  76368. const inSourceBuffers$1 = (mediaSource, sourceBuffer) => mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  76369. const actions$1 = {
  76370. appendBuffer: (bytes, segmentInfo, onError2) => (type2, sourceUpdater) => {
  76371. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76372. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76373. return;
  76374. }
  76375. sourceUpdater.logger_(`Appending segment ${segmentInfo.mediaIndex}'s ${bytes.length} bytes to ${type2}Buffer`);
  76376. try {
  76377. sourceBuffer.appendBuffer(bytes);
  76378. } catch (e) {
  76379. sourceUpdater.logger_(`Error with code ${e.code} ` + (e.code === QUOTA_EXCEEDED_ERR$1 ? "(QUOTA_EXCEEDED_ERR) " : "") + `when appending segment ${segmentInfo.mediaIndex} to ${type2}Buffer`);
  76380. sourceUpdater.queuePending[type2] = null;
  76381. onError2(e);
  76382. }
  76383. },
  76384. remove: (start2, end) => (type2, sourceUpdater) => {
  76385. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76386. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76387. return;
  76388. }
  76389. sourceUpdater.logger_(`Removing ${start2} to ${end} from ${type2}Buffer`);
  76390. try {
  76391. sourceBuffer.remove(start2, end);
  76392. } catch (e) {
  76393. sourceUpdater.logger_(`Remove ${start2} to ${end} from ${type2}Buffer failed`);
  76394. }
  76395. },
  76396. timestampOffset: (offset) => (type2, sourceUpdater) => {
  76397. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76398. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76399. return;
  76400. }
  76401. sourceUpdater.logger_(`Setting ${type2}timestampOffset to ${offset}`);
  76402. sourceBuffer.timestampOffset = offset;
  76403. },
  76404. callback: (callback2) => (type2, sourceUpdater) => {
  76405. callback2();
  76406. },
  76407. endOfStream: (error) => (sourceUpdater) => {
  76408. if (sourceUpdater.mediaSource.readyState !== "open") {
  76409. return;
  76410. }
  76411. sourceUpdater.logger_(`Calling mediaSource endOfStream(${error || ""})`);
  76412. try {
  76413. sourceUpdater.mediaSource.endOfStream(error);
  76414. } catch (e) {
  76415. videojs$2.log.warn("Failed to call media source endOfStream", e);
  76416. }
  76417. },
  76418. duration: (duration5) => (sourceUpdater) => {
  76419. sourceUpdater.logger_(`Setting mediaSource duration to ${duration5}`);
  76420. try {
  76421. sourceUpdater.mediaSource.duration = duration5;
  76422. } catch (e) {
  76423. videojs$2.log.warn("Failed to set media source duration", e);
  76424. }
  76425. },
  76426. abort: () => (type2, sourceUpdater) => {
  76427. if (sourceUpdater.mediaSource.readyState !== "open") {
  76428. return;
  76429. }
  76430. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76431. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76432. return;
  76433. }
  76434. sourceUpdater.logger_(`calling abort on ${type2}Buffer`);
  76435. try {
  76436. sourceBuffer.abort();
  76437. } catch (e) {
  76438. videojs$2.log.warn(`Failed to abort on ${type2}Buffer`, e);
  76439. }
  76440. },
  76441. addSourceBuffer: (type2, codec) => (sourceUpdater) => {
  76442. const titleType = toTitleCase$2(type2);
  76443. const mime = getMimeForCodec$1(codec);
  76444. sourceUpdater.logger_(`Adding ${type2}Buffer with codec ${codec} to mediaSource`);
  76445. const sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  76446. sourceBuffer.addEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76447. sourceBuffer.addEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76448. sourceUpdater.codecs[type2] = codec;
  76449. sourceUpdater[`${type2}Buffer`] = sourceBuffer;
  76450. },
  76451. removeSourceBuffer: (type2) => (sourceUpdater) => {
  76452. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76453. cleanupBuffer$1(type2, sourceUpdater);
  76454. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76455. return;
  76456. }
  76457. sourceUpdater.logger_(`Removing ${type2}Buffer with codec ${sourceUpdater.codecs[type2]} from mediaSource`);
  76458. try {
  76459. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  76460. } catch (e) {
  76461. videojs$2.log.warn(`Failed to removeSourceBuffer ${type2}Buffer`, e);
  76462. }
  76463. },
  76464. changeType: (codec) => (type2, sourceUpdater) => {
  76465. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76466. const mime = getMimeForCodec$1(codec);
  76467. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76468. return;
  76469. }
  76470. if (sourceUpdater.codecs[type2] === codec) {
  76471. return;
  76472. }
  76473. sourceUpdater.logger_(`changing ${type2}Buffer codec from ${sourceUpdater.codecs[type2]} to ${codec}`);
  76474. sourceBuffer.changeType(mime);
  76475. sourceUpdater.codecs[type2] = codec;
  76476. }
  76477. };
  76478. const pushQueue$1 = ({
  76479. type: type2,
  76480. sourceUpdater,
  76481. action,
  76482. doneFn,
  76483. name
  76484. }) => {
  76485. sourceUpdater.queue.push({
  76486. type: type2,
  76487. action,
  76488. doneFn,
  76489. name
  76490. });
  76491. shiftQueue$1(type2, sourceUpdater);
  76492. };
  76493. const onUpdateend$1 = (type2, sourceUpdater) => (e) => {
  76494. if (sourceUpdater.queuePending[type2]) {
  76495. const doneFn = sourceUpdater.queuePending[type2].doneFn;
  76496. sourceUpdater.queuePending[type2] = null;
  76497. if (doneFn) {
  76498. doneFn(sourceUpdater[`${type2}Error_`]);
  76499. }
  76500. }
  76501. shiftQueue$1(type2, sourceUpdater);
  76502. };
  76503. class SourceUpdater$1 extends videojs$2.EventTarget {
  76504. constructor(mediaSource) {
  76505. super();
  76506. this.mediaSource = mediaSource;
  76507. this.sourceopenListener_ = () => shiftQueue$1("mediaSource", this);
  76508. this.mediaSource.addEventListener("sourceopen", this.sourceopenListener_);
  76509. this.logger_ = logger$1("SourceUpdater");
  76510. this.audioTimestampOffset_ = 0;
  76511. this.videoTimestampOffset_ = 0;
  76512. this.queue = [];
  76513. this.queuePending = {
  76514. audio: null,
  76515. video: null
  76516. };
  76517. this.delayedAudioAppendQueue_ = [];
  76518. this.videoAppendQueued_ = false;
  76519. this.codecs = {};
  76520. this.onVideoUpdateEnd_ = onUpdateend$1("video", this);
  76521. this.onAudioUpdateEnd_ = onUpdateend$1("audio", this);
  76522. this.onVideoError_ = (e) => {
  76523. this.videoError_ = e;
  76524. };
  76525. this.onAudioError_ = (e) => {
  76526. this.audioError_ = e;
  76527. };
  76528. this.createdSourceBuffers_ = false;
  76529. this.initializedEme_ = false;
  76530. this.triggeredReady_ = false;
  76531. }
  76532. initializedEme() {
  76533. this.initializedEme_ = true;
  76534. this.triggerReady();
  76535. }
  76536. hasCreatedSourceBuffers() {
  76537. return this.createdSourceBuffers_;
  76538. }
  76539. hasInitializedAnyEme() {
  76540. return this.initializedEme_;
  76541. }
  76542. ready() {
  76543. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  76544. }
  76545. createSourceBuffers(codecs) {
  76546. if (this.hasCreatedSourceBuffers()) {
  76547. return;
  76548. }
  76549. this.addOrChangeSourceBuffers(codecs);
  76550. this.createdSourceBuffers_ = true;
  76551. this.trigger("createdsourcebuffers");
  76552. this.triggerReady();
  76553. }
  76554. triggerReady() {
  76555. if (this.ready() && !this.triggeredReady_) {
  76556. this.triggeredReady_ = true;
  76557. this.trigger("ready");
  76558. }
  76559. }
  76560. addSourceBuffer(type2, codec) {
  76561. pushQueue$1({
  76562. type: "mediaSource",
  76563. sourceUpdater: this,
  76564. action: actions$1.addSourceBuffer(type2, codec),
  76565. name: "addSourceBuffer"
  76566. });
  76567. }
  76568. abort(type2) {
  76569. pushQueue$1({
  76570. type: type2,
  76571. sourceUpdater: this,
  76572. action: actions$1.abort(type2),
  76573. name: "abort"
  76574. });
  76575. }
  76576. removeSourceBuffer(type2) {
  76577. if (!this.canRemoveSourceBuffer()) {
  76578. videojs$2.log.error("removeSourceBuffer is not supported!");
  76579. return;
  76580. }
  76581. pushQueue$1({
  76582. type: "mediaSource",
  76583. sourceUpdater: this,
  76584. action: actions$1.removeSourceBuffer(type2),
  76585. name: "removeSourceBuffer"
  76586. });
  76587. }
  76588. canRemoveSourceBuffer() {
  76589. return !videojs$2.browser.IE_VERSION && !videojs$2.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  76590. }
  76591. static canChangeType() {
  76592. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  76593. }
  76594. canChangeType() {
  76595. return this.constructor.canChangeType();
  76596. }
  76597. changeType(type2, codec) {
  76598. if (!this.canChangeType()) {
  76599. videojs$2.log.error("changeType is not supported!");
  76600. return;
  76601. }
  76602. pushQueue$1({
  76603. type: type2,
  76604. sourceUpdater: this,
  76605. action: actions$1.changeType(codec),
  76606. name: "changeType"
  76607. });
  76608. }
  76609. addOrChangeSourceBuffers(codecs) {
  76610. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  76611. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  76612. }
  76613. Object.keys(codecs).forEach((type2) => {
  76614. const codec = codecs[type2];
  76615. if (!this.hasCreatedSourceBuffers()) {
  76616. return this.addSourceBuffer(type2, codec);
  76617. }
  76618. if (this.canChangeType()) {
  76619. this.changeType(type2, codec);
  76620. }
  76621. });
  76622. }
  76623. appendBuffer(options2, doneFn) {
  76624. const {
  76625. segmentInfo,
  76626. type: type2,
  76627. bytes
  76628. } = options2;
  76629. this.processedAppend_ = true;
  76630. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  76631. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  76632. this.logger_(`delayed audio append of ${bytes.length} until video append`);
  76633. return;
  76634. }
  76635. const onError2 = doneFn;
  76636. pushQueue$1({
  76637. type: type2,
  76638. sourceUpdater: this,
  76639. action: actions$1.appendBuffer(bytes, segmentInfo || {
  76640. mediaIndex: -1
  76641. }, onError2),
  76642. doneFn,
  76643. name: "appendBuffer"
  76644. });
  76645. if (type2 === "video") {
  76646. this.videoAppendQueued_ = true;
  76647. if (!this.delayedAudioAppendQueue_.length) {
  76648. return;
  76649. }
  76650. const queue = this.delayedAudioAppendQueue_.slice();
  76651. this.logger_(`queuing delayed audio ${queue.length} appendBuffers`);
  76652. this.delayedAudioAppendQueue_.length = 0;
  76653. queue.forEach((que) => {
  76654. this.appendBuffer.apply(this, que);
  76655. });
  76656. }
  76657. }
  76658. audioBuffered() {
  76659. if (!inSourceBuffers$1(this.mediaSource, this.audioBuffer)) {
  76660. return createTimeRanges$2();
  76661. }
  76662. return this.audioBuffer.buffered ? this.audioBuffer.buffered : createTimeRanges$2();
  76663. }
  76664. videoBuffered() {
  76665. if (!inSourceBuffers$1(this.mediaSource, this.videoBuffer)) {
  76666. return createTimeRanges$2();
  76667. }
  76668. return this.videoBuffer.buffered ? this.videoBuffer.buffered : createTimeRanges$2();
  76669. }
  76670. buffered() {
  76671. const video = inSourceBuffers$1(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  76672. const audio = inSourceBuffers$1(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  76673. if (audio && !video) {
  76674. return this.audioBuffered();
  76675. }
  76676. if (video && !audio) {
  76677. return this.videoBuffered();
  76678. }
  76679. return bufferIntersection$1(this.audioBuffered(), this.videoBuffered());
  76680. }
  76681. setDuration(duration5, doneFn = noop$1) {
  76682. pushQueue$1({
  76683. type: "mediaSource",
  76684. sourceUpdater: this,
  76685. action: actions$1.duration(duration5),
  76686. name: "duration",
  76687. doneFn
  76688. });
  76689. }
  76690. endOfStream(error = null, doneFn = noop$1) {
  76691. if (typeof error !== "string") {
  76692. error = void 0;
  76693. }
  76694. pushQueue$1({
  76695. type: "mediaSource",
  76696. sourceUpdater: this,
  76697. action: actions$1.endOfStream(error),
  76698. name: "endOfStream",
  76699. doneFn
  76700. });
  76701. }
  76702. removeAudio(start2, end, done = noop$1) {
  76703. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  76704. done();
  76705. return;
  76706. }
  76707. pushQueue$1({
  76708. type: "audio",
  76709. sourceUpdater: this,
  76710. action: actions$1.remove(start2, end),
  76711. doneFn: done,
  76712. name: "remove"
  76713. });
  76714. }
  76715. removeVideo(start2, end, done = noop$1) {
  76716. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  76717. done();
  76718. return;
  76719. }
  76720. pushQueue$1({
  76721. type: "video",
  76722. sourceUpdater: this,
  76723. action: actions$1.remove(start2, end),
  76724. doneFn: done,
  76725. name: "remove"
  76726. });
  76727. }
  76728. updating() {
  76729. if (updating("audio", this) || updating("video", this)) {
  76730. return true;
  76731. }
  76732. return false;
  76733. }
  76734. audioTimestampOffset(offset) {
  76735. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  76736. pushQueue$1({
  76737. type: "audio",
  76738. sourceUpdater: this,
  76739. action: actions$1.timestampOffset(offset),
  76740. name: "timestampOffset"
  76741. });
  76742. this.audioTimestampOffset_ = offset;
  76743. }
  76744. return this.audioTimestampOffset_;
  76745. }
  76746. videoTimestampOffset(offset) {
  76747. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  76748. pushQueue$1({
  76749. type: "video",
  76750. sourceUpdater: this,
  76751. action: actions$1.timestampOffset(offset),
  76752. name: "timestampOffset"
  76753. });
  76754. this.videoTimestampOffset_ = offset;
  76755. }
  76756. return this.videoTimestampOffset_;
  76757. }
  76758. audioQueueCallback(callback2) {
  76759. if (!this.audioBuffer) {
  76760. return;
  76761. }
  76762. pushQueue$1({
  76763. type: "audio",
  76764. sourceUpdater: this,
  76765. action: actions$1.callback(callback2),
  76766. name: "callback"
  76767. });
  76768. }
  76769. videoQueueCallback(callback2) {
  76770. if (!this.videoBuffer) {
  76771. return;
  76772. }
  76773. pushQueue$1({
  76774. type: "video",
  76775. sourceUpdater: this,
  76776. action: actions$1.callback(callback2),
  76777. name: "callback"
  76778. });
  76779. }
  76780. dispose() {
  76781. this.trigger("dispose");
  76782. bufferTypes$1.forEach((type2) => {
  76783. this.abort(type2);
  76784. if (this.canRemoveSourceBuffer()) {
  76785. this.removeSourceBuffer(type2);
  76786. } else {
  76787. this[`${type2}QueueCallback`](() => cleanupBuffer$1(type2, this));
  76788. }
  76789. });
  76790. this.videoAppendQueued_ = false;
  76791. this.delayedAudioAppendQueue_.length = 0;
  76792. if (this.sourceopenListener_) {
  76793. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  76794. }
  76795. this.off();
  76796. }
  76797. }
  76798. const uint8ToUtf8$1 = (uintArray) => decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  76799. const VTT_LINE_TERMINATORS$1 = new Uint8Array("\n\n".split("").map((char) => char.charCodeAt(0)));
  76800. class NoVttJsError$1 extends Error {
  76801. constructor() {
  76802. super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.");
  76803. }
  76804. }
  76805. class VTTSegmentLoader$1 extends SegmentLoader$1 {
  76806. constructor(settings, options2 = {}) {
  76807. super(settings, options2);
  76808. this.mediaSource_ = null;
  76809. this.subtitlesTrack_ = null;
  76810. this.loaderType_ = "subtitle";
  76811. this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  76812. this.loadVttJs = settings.loadVttJs;
  76813. this.shouldSaveSegmentTimingInfo_ = false;
  76814. }
  76815. createTransmuxer_() {
  76816. return null;
  76817. }
  76818. buffered_() {
  76819. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  76820. return createTimeRanges$2();
  76821. }
  76822. const cues = this.subtitlesTrack_.cues;
  76823. const start2 = cues[0].startTime;
  76824. const end = cues[cues.length - 1].startTime;
  76825. return createTimeRanges$2([[start2, end]]);
  76826. }
  76827. initSegmentForMap(map, set4 = false) {
  76828. if (!map) {
  76829. return null;
  76830. }
  76831. const id = initSegmentId$1(map);
  76832. let storedMap = this.initSegments_[id];
  76833. if (set4 && !storedMap && map.bytes) {
  76834. const combinedByteLength = VTT_LINE_TERMINATORS$1.byteLength + map.bytes.byteLength;
  76835. const combinedSegment = new Uint8Array(combinedByteLength);
  76836. combinedSegment.set(map.bytes);
  76837. combinedSegment.set(VTT_LINE_TERMINATORS$1, map.bytes.byteLength);
  76838. this.initSegments_[id] = storedMap = {
  76839. resolvedUri: map.resolvedUri,
  76840. byterange: map.byterange,
  76841. bytes: combinedSegment
  76842. };
  76843. }
  76844. return storedMap || map;
  76845. }
  76846. couldBeginLoading_() {
  76847. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  76848. }
  76849. init_() {
  76850. this.state = "READY";
  76851. this.resetEverything();
  76852. return this.monitorBuffer_();
  76853. }
  76854. track(track) {
  76855. if (typeof track === "undefined") {
  76856. return this.subtitlesTrack_;
  76857. }
  76858. this.subtitlesTrack_ = track;
  76859. if (this.state === "INIT" && this.couldBeginLoading_()) {
  76860. this.init_();
  76861. }
  76862. return this.subtitlesTrack_;
  76863. }
  76864. remove(start2, end) {
  76865. removeCuesFromTrack$1(start2, end, this.subtitlesTrack_);
  76866. }
  76867. fillBuffer_() {
  76868. const segmentInfo = this.chooseNextRequest_();
  76869. if (!segmentInfo) {
  76870. return;
  76871. }
  76872. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  76873. const checkTimestampOffset = () => {
  76874. this.state = "READY";
  76875. if (!this.paused()) {
  76876. this.monitorBuffer_();
  76877. }
  76878. };
  76879. this.syncController_.one("timestampoffset", checkTimestampOffset);
  76880. this.state = "WAITING_ON_TIMELINE";
  76881. return;
  76882. }
  76883. this.loadSegment_(segmentInfo);
  76884. }
  76885. timestampOffsetForSegment_() {
  76886. return null;
  76887. }
  76888. chooseNextRequest_() {
  76889. return this.skipEmptySegments_(super.chooseNextRequest_());
  76890. }
  76891. skipEmptySegments_(segmentInfo) {
  76892. while (segmentInfo && segmentInfo.segment.empty) {
  76893. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  76894. segmentInfo = null;
  76895. break;
  76896. }
  76897. segmentInfo = this.generateSegmentInfo_({
  76898. playlist: segmentInfo.playlist,
  76899. mediaIndex: segmentInfo.mediaIndex + 1,
  76900. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  76901. isSyncRequest: segmentInfo.isSyncRequest
  76902. });
  76903. }
  76904. return segmentInfo;
  76905. }
  76906. stopForError(error) {
  76907. this.error(error);
  76908. this.state = "READY";
  76909. this.pause();
  76910. this.trigger("error");
  76911. }
  76912. segmentRequestFinished_(error, simpleSegment, result) {
  76913. if (!this.subtitlesTrack_) {
  76914. this.state = "READY";
  76915. return;
  76916. }
  76917. this.saveTransferStats_(simpleSegment.stats);
  76918. if (!this.pendingSegment_) {
  76919. this.state = "READY";
  76920. this.mediaRequestsAborted += 1;
  76921. return;
  76922. }
  76923. if (error) {
  76924. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  76925. this.handleTimeout_();
  76926. }
  76927. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  76928. this.mediaRequestsAborted += 1;
  76929. } else {
  76930. this.mediaRequestsErrored += 1;
  76931. }
  76932. this.stopForError(error);
  76933. return;
  76934. }
  76935. const segmentInfo = this.pendingSegment_;
  76936. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  76937. if (simpleSegment.key) {
  76938. this.segmentKey(simpleSegment.key, true);
  76939. }
  76940. this.state = "APPENDING";
  76941. this.trigger("appending");
  76942. const segment = segmentInfo.segment;
  76943. if (segment.map) {
  76944. segment.map.bytes = simpleSegment.map.bytes;
  76945. }
  76946. segmentInfo.bytes = simpleSegment.bytes;
  76947. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  76948. this.state = "WAITING_ON_VTTJS";
  76949. this.loadVttJs().then(() => this.segmentRequestFinished_(error, simpleSegment, result), () => this.stopForError({
  76950. message: "Error loading vtt.js"
  76951. }));
  76952. return;
  76953. }
  76954. segment.requested = true;
  76955. try {
  76956. this.parseVTTCues_(segmentInfo);
  76957. } catch (e) {
  76958. this.stopForError({
  76959. message: e.message
  76960. });
  76961. return;
  76962. }
  76963. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  76964. if (segmentInfo.cues.length) {
  76965. segmentInfo.timingInfo = {
  76966. start: segmentInfo.cues[0].startTime,
  76967. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  76968. };
  76969. } else {
  76970. segmentInfo.timingInfo = {
  76971. start: segmentInfo.startOfSegment,
  76972. end: segmentInfo.startOfSegment + segmentInfo.duration
  76973. };
  76974. }
  76975. if (segmentInfo.isSyncRequest) {
  76976. this.trigger("syncinfoupdate");
  76977. this.pendingSegment_ = null;
  76978. this.state = "READY";
  76979. return;
  76980. }
  76981. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  76982. this.mediaSecondsLoaded += segment.duration;
  76983. segmentInfo.cues.forEach((cue) => {
  76984. this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  76985. });
  76986. removeDuplicateCuesFromTrack$1(this.subtitlesTrack_);
  76987. this.handleAppendsDone_();
  76988. }
  76989. handleData_() {
  76990. }
  76991. updateTimingInfoEnd_() {
  76992. }
  76993. parseVTTCues_(segmentInfo) {
  76994. let decoder;
  76995. let decodeBytesToString = false;
  76996. if (typeof window_1.WebVTT !== "function") {
  76997. throw new NoVttJsError$1();
  76998. }
  76999. if (typeof window_1.TextDecoder === "function") {
  77000. decoder = new window_1.TextDecoder("utf8");
  77001. } else {
  77002. decoder = window_1.WebVTT.StringDecoder();
  77003. decodeBytesToString = true;
  77004. }
  77005. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  77006. segmentInfo.cues = [];
  77007. segmentInfo.timestampmap = {
  77008. MPEGTS: 0,
  77009. LOCAL: 0
  77010. };
  77011. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  77012. parser2.ontimestampmap = (map) => {
  77013. segmentInfo.timestampmap = map;
  77014. };
  77015. parser2.onparsingerror = (error) => {
  77016. videojs$2.log.warn("Error encountered when parsing cues: " + error.message);
  77017. };
  77018. if (segmentInfo.segment.map) {
  77019. let mapData = segmentInfo.segment.map.bytes;
  77020. if (decodeBytesToString) {
  77021. mapData = uint8ToUtf8$1(mapData);
  77022. }
  77023. parser2.parse(mapData);
  77024. }
  77025. let segmentData = segmentInfo.bytes;
  77026. if (decodeBytesToString) {
  77027. segmentData = uint8ToUtf8$1(segmentData);
  77028. }
  77029. parser2.parse(segmentData);
  77030. parser2.flush();
  77031. }
  77032. updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  77033. const segment = segmentInfo.segment;
  77034. if (!mappingObj) {
  77035. return;
  77036. }
  77037. if (!segmentInfo.cues.length) {
  77038. segment.empty = true;
  77039. return;
  77040. }
  77041. const timestampmap = segmentInfo.timestampmap;
  77042. const diff = timestampmap.MPEGTS / clock$1.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  77043. segmentInfo.cues.forEach((cue) => {
  77044. cue.startTime += diff;
  77045. cue.endTime += diff;
  77046. });
  77047. if (!playlist.syncInfo) {
  77048. const firstStart = segmentInfo.cues[0].startTime;
  77049. const lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  77050. playlist.syncInfo = {
  77051. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  77052. time: Math.min(firstStart, lastStart - segment.duration)
  77053. };
  77054. }
  77055. }
  77056. }
  77057. const findAdCue$1 = function(track, mediaTime) {
  77058. const cues = track.cues;
  77059. for (let i2 = 0; i2 < cues.length; i2++) {
  77060. const cue = cues[i2];
  77061. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  77062. return cue;
  77063. }
  77064. }
  77065. return null;
  77066. };
  77067. const updateAdCues$1 = function(media, track, offset = 0) {
  77068. if (!media.segments) {
  77069. return;
  77070. }
  77071. let mediaTime = offset;
  77072. let cue;
  77073. for (let i2 = 0; i2 < media.segments.length; i2++) {
  77074. const segment = media.segments[i2];
  77075. if (!cue) {
  77076. cue = findAdCue$1(track, mediaTime + segment.duration / 2);
  77077. }
  77078. if (cue) {
  77079. if ("cueIn" in segment) {
  77080. cue.endTime = mediaTime;
  77081. cue.adEndTime = mediaTime;
  77082. mediaTime += segment.duration;
  77083. cue = null;
  77084. continue;
  77085. }
  77086. if (mediaTime < cue.endTime) {
  77087. mediaTime += segment.duration;
  77088. continue;
  77089. }
  77090. cue.endTime += segment.duration;
  77091. } else {
  77092. if ("cueOut" in segment) {
  77093. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  77094. cue.adStartTime = mediaTime;
  77095. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  77096. track.addCue(cue);
  77097. }
  77098. if ("cueOutCont" in segment) {
  77099. const [adOffset, adTotal] = segment.cueOutCont.split("/").map(parseFloat);
  77100. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  77101. cue.adStartTime = mediaTime - adOffset;
  77102. cue.adEndTime = cue.adStartTime + adTotal;
  77103. track.addCue(cue);
  77104. }
  77105. }
  77106. mediaTime += segment.duration;
  77107. }
  77108. };
  77109. const MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1 = 86400;
  77110. const syncPointStrategies$1 = [
  77111. {
  77112. name: "VOD",
  77113. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77114. if (duration5 !== Infinity) {
  77115. const syncPoint = {
  77116. time: 0,
  77117. segmentIndex: 0,
  77118. partIndex: null
  77119. };
  77120. return syncPoint;
  77121. }
  77122. return null;
  77123. }
  77124. },
  77125. {
  77126. name: "ProgramDateTime",
  77127. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77128. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  77129. return null;
  77130. }
  77131. let syncPoint = null;
  77132. let lastDistance = null;
  77133. const partsAndSegments = getPartsAndSegments$1(playlist);
  77134. currentTime = currentTime || 0;
  77135. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77136. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77137. const partAndSegment = partsAndSegments[index2];
  77138. const segment = partAndSegment.segment;
  77139. const datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  77140. if (!datetimeMapping || !segment.dateTimeObject) {
  77141. continue;
  77142. }
  77143. const segmentTime = segment.dateTimeObject.getTime() / 1e3;
  77144. let start2 = segmentTime + datetimeMapping;
  77145. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  77146. for (let z = 0; z < partAndSegment.partIndex; z++) {
  77147. start2 += segment.parts[z].duration;
  77148. }
  77149. }
  77150. const distance2 = Math.abs(currentTime - start2);
  77151. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  77152. break;
  77153. }
  77154. lastDistance = distance2;
  77155. syncPoint = {
  77156. time: start2,
  77157. segmentIndex: partAndSegment.segmentIndex,
  77158. partIndex: partAndSegment.partIndex
  77159. };
  77160. }
  77161. return syncPoint;
  77162. }
  77163. },
  77164. {
  77165. name: "Segment",
  77166. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77167. let syncPoint = null;
  77168. let lastDistance = null;
  77169. currentTime = currentTime || 0;
  77170. const partsAndSegments = getPartsAndSegments$1(playlist);
  77171. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77172. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77173. const partAndSegment = partsAndSegments[index2];
  77174. const segment = partAndSegment.segment;
  77175. const start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  77176. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  77177. const distance2 = Math.abs(currentTime - start2);
  77178. if (lastDistance !== null && lastDistance < distance2) {
  77179. break;
  77180. }
  77181. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77182. lastDistance = distance2;
  77183. syncPoint = {
  77184. time: start2,
  77185. segmentIndex: partAndSegment.segmentIndex,
  77186. partIndex: partAndSegment.partIndex
  77187. };
  77188. }
  77189. }
  77190. }
  77191. return syncPoint;
  77192. }
  77193. },
  77194. {
  77195. name: "Discontinuity",
  77196. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77197. let syncPoint = null;
  77198. currentTime = currentTime || 0;
  77199. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77200. let lastDistance = null;
  77201. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77202. const segmentIndex = playlist.discontinuityStarts[i2];
  77203. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77204. const discontinuitySync = syncController.discontinuities[discontinuity];
  77205. if (discontinuitySync) {
  77206. const distance2 = Math.abs(currentTime - discontinuitySync.time);
  77207. if (lastDistance !== null && lastDistance < distance2) {
  77208. break;
  77209. }
  77210. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77211. lastDistance = distance2;
  77212. syncPoint = {
  77213. time: discontinuitySync.time,
  77214. segmentIndex,
  77215. partIndex: null
  77216. };
  77217. }
  77218. }
  77219. }
  77220. }
  77221. return syncPoint;
  77222. }
  77223. },
  77224. {
  77225. name: "Playlist",
  77226. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77227. if (playlist.syncInfo) {
  77228. const syncPoint = {
  77229. time: playlist.syncInfo.time,
  77230. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  77231. partIndex: null
  77232. };
  77233. return syncPoint;
  77234. }
  77235. return null;
  77236. }
  77237. }
  77238. ];
  77239. class SyncController$1 extends videojs$2.EventTarget {
  77240. constructor(options2 = {}) {
  77241. super();
  77242. this.timelines = [];
  77243. this.discontinuities = [];
  77244. this.timelineToDatetimeMappings = {};
  77245. this.logger_ = logger$1("SyncController");
  77246. }
  77247. getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  77248. const syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  77249. if (!syncPoints.length) {
  77250. return null;
  77251. }
  77252. return this.selectSyncPoint_(syncPoints, {
  77253. key: "time",
  77254. value: currentTime
  77255. });
  77256. }
  77257. getExpiredTime(playlist, duration5) {
  77258. if (!playlist || !playlist.segments) {
  77259. return null;
  77260. }
  77261. const syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  77262. if (!syncPoints.length) {
  77263. return null;
  77264. }
  77265. const syncPoint = this.selectSyncPoint_(syncPoints, {
  77266. key: "segmentIndex",
  77267. value: 0
  77268. });
  77269. if (syncPoint.segmentIndex > 0) {
  77270. syncPoint.time *= -1;
  77271. }
  77272. return Math.abs(syncPoint.time + sumDurations$1({
  77273. defaultDuration: playlist.targetDuration,
  77274. durationList: playlist.segments,
  77275. startIndex: syncPoint.segmentIndex,
  77276. endIndex: 0
  77277. }));
  77278. }
  77279. runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  77280. const syncPoints = [];
  77281. for (let i2 = 0; i2 < syncPointStrategies$1.length; i2++) {
  77282. const strategy = syncPointStrategies$1[i2];
  77283. const syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  77284. if (syncPoint) {
  77285. syncPoint.strategy = strategy.name;
  77286. syncPoints.push({
  77287. strategy: strategy.name,
  77288. syncPoint
  77289. });
  77290. }
  77291. }
  77292. return syncPoints;
  77293. }
  77294. selectSyncPoint_(syncPoints, target) {
  77295. let bestSyncPoint = syncPoints[0].syncPoint;
  77296. let bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  77297. let bestStrategy = syncPoints[0].strategy;
  77298. for (let i2 = 1; i2 < syncPoints.length; i2++) {
  77299. const newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  77300. if (newDistance < bestDistance) {
  77301. bestDistance = newDistance;
  77302. bestSyncPoint = syncPoints[i2].syncPoint;
  77303. bestStrategy = syncPoints[i2].strategy;
  77304. }
  77305. }
  77306. this.logger_(`syncPoint for [${target.key}: ${target.value}] chosen with strategy [${bestStrategy}]: [time:${bestSyncPoint.time}, segmentIndex:${bestSyncPoint.segmentIndex}` + (typeof bestSyncPoint.partIndex === "number" ? `,partIndex:${bestSyncPoint.partIndex}` : "") + "]");
  77307. return bestSyncPoint;
  77308. }
  77309. saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  77310. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  77311. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1) {
  77312. videojs$2.log.warn(`Not saving expired segment info. Media sequence gap ${mediaSequenceDiff} is too large.`);
  77313. return;
  77314. }
  77315. for (let i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  77316. const lastRemovedSegment = oldPlaylist.segments[i2];
  77317. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  77318. newPlaylist.syncInfo = {
  77319. mediaSequence: oldPlaylist.mediaSequence + i2,
  77320. time: lastRemovedSegment.start
  77321. };
  77322. this.logger_(`playlist refresh sync: [time:${newPlaylist.syncInfo.time}, mediaSequence: ${newPlaylist.syncInfo.mediaSequence}]`);
  77323. this.trigger("syncinfoupdate");
  77324. break;
  77325. }
  77326. }
  77327. }
  77328. setDateTimeMappingForStart(playlist) {
  77329. this.timelineToDatetimeMappings = {};
  77330. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  77331. const firstSegment = playlist.segments[0];
  77332. const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  77333. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  77334. }
  77335. }
  77336. saveSegmentTimingInfo({
  77337. segmentInfo,
  77338. shouldSaveTimelineMapping
  77339. }) {
  77340. const didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  77341. const segment = segmentInfo.segment;
  77342. if (didCalculateSegmentTimeMapping) {
  77343. this.saveDiscontinuitySyncInfo_(segmentInfo);
  77344. if (!segmentInfo.playlist.syncInfo) {
  77345. segmentInfo.playlist.syncInfo = {
  77346. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  77347. time: segment.start
  77348. };
  77349. }
  77350. }
  77351. const dateTime = segment.dateTimeObject;
  77352. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  77353. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  77354. }
  77355. }
  77356. timestampOffsetForTimeline(timeline) {
  77357. if (typeof this.timelines[timeline] === "undefined") {
  77358. return null;
  77359. }
  77360. return this.timelines[timeline].time;
  77361. }
  77362. mappingForTimeline(timeline) {
  77363. if (typeof this.timelines[timeline] === "undefined") {
  77364. return null;
  77365. }
  77366. return this.timelines[timeline].mapping;
  77367. }
  77368. calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  77369. const segment = segmentInfo.segment;
  77370. const part = segmentInfo.part;
  77371. let mappingObj = this.timelines[segmentInfo.timeline];
  77372. let start2;
  77373. let end;
  77374. if (typeof segmentInfo.timestampOffset === "number") {
  77375. mappingObj = {
  77376. time: segmentInfo.startOfSegment,
  77377. mapping: segmentInfo.startOfSegment - timingInfo.start
  77378. };
  77379. if (shouldSaveTimelineMapping) {
  77380. this.timelines[segmentInfo.timeline] = mappingObj;
  77381. this.trigger("timestampoffset");
  77382. this.logger_(`time mapping for timeline ${segmentInfo.timeline}: [time: ${mappingObj.time}] [mapping: ${mappingObj.mapping}]`);
  77383. }
  77384. start2 = segmentInfo.startOfSegment;
  77385. end = timingInfo.end + mappingObj.mapping;
  77386. } else if (mappingObj) {
  77387. start2 = timingInfo.start + mappingObj.mapping;
  77388. end = timingInfo.end + mappingObj.mapping;
  77389. } else {
  77390. return false;
  77391. }
  77392. if (part) {
  77393. part.start = start2;
  77394. part.end = end;
  77395. }
  77396. if (!segment.start || start2 < segment.start) {
  77397. segment.start = start2;
  77398. }
  77399. segment.end = end;
  77400. return true;
  77401. }
  77402. saveDiscontinuitySyncInfo_(segmentInfo) {
  77403. const playlist = segmentInfo.playlist;
  77404. const segment = segmentInfo.segment;
  77405. if (segment.discontinuity) {
  77406. this.discontinuities[segment.timeline] = {
  77407. time: segment.start,
  77408. accuracy: 0
  77409. };
  77410. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77411. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77412. const segmentIndex = playlist.discontinuityStarts[i2];
  77413. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77414. const mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  77415. const accuracy = Math.abs(mediaIndexDiff);
  77416. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  77417. let time;
  77418. if (mediaIndexDiff < 0) {
  77419. time = segment.start - sumDurations$1({
  77420. defaultDuration: playlist.targetDuration,
  77421. durationList: playlist.segments,
  77422. startIndex: segmentInfo.mediaIndex,
  77423. endIndex: segmentIndex
  77424. });
  77425. } else {
  77426. time = segment.end + sumDurations$1({
  77427. defaultDuration: playlist.targetDuration,
  77428. durationList: playlist.segments,
  77429. startIndex: segmentInfo.mediaIndex + 1,
  77430. endIndex: segmentIndex
  77431. });
  77432. }
  77433. this.discontinuities[discontinuity] = {
  77434. time,
  77435. accuracy
  77436. };
  77437. }
  77438. }
  77439. }
  77440. }
  77441. dispose() {
  77442. this.trigger("dispose");
  77443. this.off();
  77444. }
  77445. }
  77446. class TimelineChangeController$1 extends videojs$2.EventTarget {
  77447. constructor() {
  77448. super();
  77449. this.pendingTimelineChanges_ = {};
  77450. this.lastTimelineChanges_ = {};
  77451. }
  77452. clearPendingTimelineChange(type2) {
  77453. this.pendingTimelineChanges_[type2] = null;
  77454. this.trigger("pendingtimelinechange");
  77455. }
  77456. pendingTimelineChange({
  77457. type: type2,
  77458. from: from3,
  77459. to
  77460. }) {
  77461. if (typeof from3 === "number" && typeof to === "number") {
  77462. this.pendingTimelineChanges_[type2] = {
  77463. type: type2,
  77464. from: from3,
  77465. to
  77466. };
  77467. this.trigger("pendingtimelinechange");
  77468. }
  77469. return this.pendingTimelineChanges_[type2];
  77470. }
  77471. lastTimelineChange({
  77472. type: type2,
  77473. from: from3,
  77474. to
  77475. }) {
  77476. if (typeof from3 === "number" && typeof to === "number") {
  77477. this.lastTimelineChanges_[type2] = {
  77478. type: type2,
  77479. from: from3,
  77480. to
  77481. };
  77482. delete this.pendingTimelineChanges_[type2];
  77483. this.trigger("timelinechange");
  77484. }
  77485. return this.lastTimelineChanges_[type2];
  77486. }
  77487. dispose() {
  77488. this.trigger("dispose");
  77489. this.pendingTimelineChanges_ = {};
  77490. this.lastTimelineChanges_ = {};
  77491. this.off();
  77492. }
  77493. }
  77494. const workerCode$2 = transform$1(getWorkerString$1(function() {
  77495. var Stream2 = /* @__PURE__ */ function() {
  77496. function Stream3() {
  77497. this.listeners = {};
  77498. }
  77499. var _proto = Stream3.prototype;
  77500. _proto.on = function on3(type2, listener) {
  77501. if (!this.listeners[type2]) {
  77502. this.listeners[type2] = [];
  77503. }
  77504. this.listeners[type2].push(listener);
  77505. };
  77506. _proto.off = function off2(type2, listener) {
  77507. if (!this.listeners[type2]) {
  77508. return false;
  77509. }
  77510. var index2 = this.listeners[type2].indexOf(listener);
  77511. this.listeners[type2] = this.listeners[type2].slice(0);
  77512. this.listeners[type2].splice(index2, 1);
  77513. return index2 > -1;
  77514. };
  77515. _proto.trigger = function trigger2(type2) {
  77516. var callbacks = this.listeners[type2];
  77517. if (!callbacks) {
  77518. return;
  77519. }
  77520. if (arguments.length === 2) {
  77521. var length = callbacks.length;
  77522. for (var i2 = 0; i2 < length; ++i2) {
  77523. callbacks[i2].call(this, arguments[1]);
  77524. }
  77525. } else {
  77526. var args = Array.prototype.slice.call(arguments, 1);
  77527. var _length = callbacks.length;
  77528. for (var _i = 0; _i < _length; ++_i) {
  77529. callbacks[_i].apply(this, args);
  77530. }
  77531. }
  77532. };
  77533. _proto.dispose = function dispose() {
  77534. this.listeners = {};
  77535. };
  77536. _proto.pipe = function pipe(destination2) {
  77537. this.on("data", function(data) {
  77538. destination2.push(data);
  77539. });
  77540. };
  77541. return Stream3;
  77542. }();
  77543. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  77544. function unpad(padded) {
  77545. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  77546. }
  77547. /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */
  77548. const precompute = function() {
  77549. const tables = [[[], [], [], [], []], [[], [], [], [], []]];
  77550. const encTable = tables[0];
  77551. const decTable = tables[1];
  77552. const sbox = encTable[4];
  77553. const sboxInv = decTable[4];
  77554. let i2;
  77555. let x;
  77556. let xInv;
  77557. const d2 = [];
  77558. const th = [];
  77559. let x2;
  77560. let x4;
  77561. let x8;
  77562. let s;
  77563. let tEnc;
  77564. let tDec;
  77565. for (i2 = 0; i2 < 256; i2++) {
  77566. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  77567. }
  77568. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  77569. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  77570. s = s >> 8 ^ s & 255 ^ 99;
  77571. sbox[x] = s;
  77572. sboxInv[s] = x;
  77573. x8 = d2[x4 = d2[x2 = d2[x]]];
  77574. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  77575. tEnc = d2[s] * 257 ^ s * 16843008;
  77576. for (i2 = 0; i2 < 4; i2++) {
  77577. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  77578. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  77579. }
  77580. }
  77581. for (i2 = 0; i2 < 5; i2++) {
  77582. encTable[i2] = encTable[i2].slice(0);
  77583. decTable[i2] = decTable[i2].slice(0);
  77584. }
  77585. return tables;
  77586. };
  77587. let aesTables = null;
  77588. class AES {
  77589. constructor(key) {
  77590. if (!aesTables) {
  77591. aesTables = precompute();
  77592. }
  77593. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  77594. let i2;
  77595. let j;
  77596. let tmp;
  77597. const sbox = this._tables[0][4];
  77598. const decTable = this._tables[1];
  77599. const keyLen = key.length;
  77600. let rcon = 1;
  77601. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  77602. throw new Error("Invalid aes key size");
  77603. }
  77604. const encKey = key.slice(0);
  77605. const decKey = [];
  77606. this._key = [encKey, decKey];
  77607. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  77608. tmp = encKey[i2 - 1];
  77609. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  77610. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  77611. if (i2 % keyLen === 0) {
  77612. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  77613. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  77614. }
  77615. }
  77616. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  77617. }
  77618. for (j = 0; i2; j++, i2--) {
  77619. tmp = encKey[j & 3 ? i2 : i2 - 4];
  77620. if (i2 <= 4 || j < 4) {
  77621. decKey[j] = tmp;
  77622. } else {
  77623. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  77624. }
  77625. }
  77626. }
  77627. decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  77628. const key = this._key[1];
  77629. let a = encrypted0 ^ key[0];
  77630. let b = encrypted3 ^ key[1];
  77631. let c = encrypted2 ^ key[2];
  77632. let d2 = encrypted1 ^ key[3];
  77633. let a2;
  77634. let b2;
  77635. let c2;
  77636. const nInnerRounds = key.length / 4 - 2;
  77637. let i2;
  77638. let kIndex = 4;
  77639. const table = this._tables[1];
  77640. const table0 = table[0];
  77641. const table1 = table[1];
  77642. const table2 = table[2];
  77643. const table3 = table[3];
  77644. const sbox = table[4];
  77645. for (i2 = 0; i2 < nInnerRounds; i2++) {
  77646. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  77647. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  77648. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  77649. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  77650. kIndex += 4;
  77651. a = a2;
  77652. b = b2;
  77653. c = c2;
  77654. }
  77655. for (i2 = 0; i2 < 4; i2++) {
  77656. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  77657. a2 = a;
  77658. a = b;
  77659. b = c;
  77660. c = d2;
  77661. d2 = a2;
  77662. }
  77663. }
  77664. }
  77665. class AsyncStream extends Stream2 {
  77666. constructor() {
  77667. super(Stream2);
  77668. this.jobs = [];
  77669. this.delay = 1;
  77670. this.timeout_ = null;
  77671. }
  77672. processJob_() {
  77673. this.jobs.shift()();
  77674. if (this.jobs.length) {
  77675. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77676. } else {
  77677. this.timeout_ = null;
  77678. }
  77679. }
  77680. push(job) {
  77681. this.jobs.push(job);
  77682. if (!this.timeout_) {
  77683. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77684. }
  77685. }
  77686. }
  77687. const ntoh = function(word) {
  77688. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  77689. };
  77690. const decrypt3 = function(encrypted, key, initVector) {
  77691. const encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  77692. const decipher = new AES(Array.prototype.slice.call(key));
  77693. const decrypted = new Uint8Array(encrypted.byteLength);
  77694. const decrypted32 = new Int32Array(decrypted.buffer);
  77695. let init0;
  77696. let init1;
  77697. let init2;
  77698. let init3;
  77699. let encrypted0;
  77700. let encrypted1;
  77701. let encrypted2;
  77702. let encrypted3;
  77703. let wordIx;
  77704. init0 = initVector[0];
  77705. init1 = initVector[1];
  77706. init2 = initVector[2];
  77707. init3 = initVector[3];
  77708. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  77709. encrypted0 = ntoh(encrypted32[wordIx]);
  77710. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  77711. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  77712. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  77713. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  77714. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  77715. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  77716. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  77717. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  77718. init0 = encrypted0;
  77719. init1 = encrypted1;
  77720. init2 = encrypted2;
  77721. init3 = encrypted3;
  77722. }
  77723. return decrypted;
  77724. };
  77725. class Decrypter2 {
  77726. constructor(encrypted, key, initVector, done) {
  77727. const step = Decrypter2.STEP;
  77728. const encrypted32 = new Int32Array(encrypted.buffer);
  77729. const decrypted = new Uint8Array(encrypted.byteLength);
  77730. let i2 = 0;
  77731. this.asyncStream_ = new AsyncStream();
  77732. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77733. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  77734. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  77735. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77736. }
  77737. this.asyncStream_.push(function() {
  77738. done(null, unpad(decrypted));
  77739. });
  77740. }
  77741. static get STEP() {
  77742. return 32e3;
  77743. }
  77744. decryptChunk_(encrypted, key, initVector, decrypted) {
  77745. return function() {
  77746. const bytes = decrypt3(encrypted, key, initVector);
  77747. decrypted.set(bytes, encrypted.byteOffset);
  77748. };
  77749. }
  77750. }
  77751. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  77752. var win2;
  77753. if (typeof window !== "undefined") {
  77754. win2 = window;
  77755. } else if (typeof commonjsGlobal2 !== "undefined") {
  77756. win2 = commonjsGlobal2;
  77757. } else if (typeof self !== "undefined") {
  77758. win2 = self;
  77759. } else {
  77760. win2 = {};
  77761. }
  77762. var window_12 = win2;
  77763. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  77764. if (ArrayBuffer.isView === "function") {
  77765. return ArrayBuffer.isView(obj);
  77766. }
  77767. return obj && obj.buffer instanceof ArrayBuffer;
  77768. };
  77769. var BigInt2 = window_12.BigInt || Number;
  77770. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  77771. (function() {
  77772. var a = new Uint16Array([65484]);
  77773. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  77774. if (b[0] === 255) {
  77775. return "big";
  77776. }
  77777. if (b[0] === 204) {
  77778. return "little";
  77779. }
  77780. return "unknown";
  77781. })();
  77782. const createTransferableMessage3 = function(message) {
  77783. const transferable = {};
  77784. Object.keys(message).forEach((key) => {
  77785. const value = message[key];
  77786. if (isArrayBufferView4(value)) {
  77787. transferable[key] = {
  77788. bytes: value.buffer,
  77789. byteOffset: value.byteOffset,
  77790. byteLength: value.byteLength
  77791. };
  77792. } else {
  77793. transferable[key] = value;
  77794. }
  77795. });
  77796. return transferable;
  77797. };
  77798. self.onmessage = function(event2) {
  77799. const data = event2.data;
  77800. const encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  77801. const key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  77802. const iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  77803. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  77804. self.postMessage(createTransferableMessage3({
  77805. source: data.source,
  77806. decrypted: bytes
  77807. }), [bytes.buffer]);
  77808. });
  77809. };
  77810. }));
  77811. var Decrypter$1 = factory$1(workerCode$2);
  77812. const audioTrackKind_$1 = (properties) => {
  77813. let kind = properties.default ? "main" : "alternative";
  77814. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  77815. kind = "main-desc";
  77816. }
  77817. return kind;
  77818. };
  77819. const stopLoaders$1 = (segmentLoader, mediaType) => {
  77820. segmentLoader.abort();
  77821. segmentLoader.pause();
  77822. if (mediaType && mediaType.activePlaylistLoader) {
  77823. mediaType.activePlaylistLoader.pause();
  77824. mediaType.activePlaylistLoader = null;
  77825. }
  77826. };
  77827. const startLoaders$1 = (playlistLoader, mediaType) => {
  77828. mediaType.activePlaylistLoader = playlistLoader;
  77829. playlistLoader.load();
  77830. };
  77831. const onGroupChanged$1 = (type2, settings) => () => {
  77832. const {
  77833. segmentLoaders: {
  77834. [type2]: segmentLoader,
  77835. main: mainSegmentLoader
  77836. },
  77837. mediaTypes: {
  77838. [type2]: mediaType
  77839. }
  77840. } = settings;
  77841. const activeTrack2 = mediaType.activeTrack();
  77842. const activeGroup3 = mediaType.getActiveGroup();
  77843. const previousActiveLoader = mediaType.activePlaylistLoader;
  77844. const lastGroup = mediaType.lastGroup_;
  77845. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  77846. return;
  77847. }
  77848. mediaType.lastGroup_ = activeGroup3;
  77849. mediaType.lastTrack_ = activeTrack2;
  77850. stopLoaders$1(segmentLoader, mediaType);
  77851. if (!activeGroup3 || activeGroup3.isMainPlaylist) {
  77852. return;
  77853. }
  77854. if (!activeGroup3.playlistLoader) {
  77855. if (previousActiveLoader) {
  77856. mainSegmentLoader.resetEverything();
  77857. }
  77858. return;
  77859. }
  77860. segmentLoader.resyncLoader();
  77861. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77862. };
  77863. const onGroupChanging$1 = (type2, settings) => () => {
  77864. const {
  77865. segmentLoaders: {
  77866. [type2]: segmentLoader
  77867. },
  77868. mediaTypes: {
  77869. [type2]: mediaType
  77870. }
  77871. } = settings;
  77872. mediaType.lastGroup_ = null;
  77873. segmentLoader.abort();
  77874. segmentLoader.pause();
  77875. };
  77876. const onTrackChanged$1 = (type2, settings) => () => {
  77877. const {
  77878. mainPlaylistLoader,
  77879. segmentLoaders: {
  77880. [type2]: segmentLoader,
  77881. main: mainSegmentLoader
  77882. },
  77883. mediaTypes: {
  77884. [type2]: mediaType
  77885. }
  77886. } = settings;
  77887. const activeTrack2 = mediaType.activeTrack();
  77888. const activeGroup3 = mediaType.getActiveGroup();
  77889. const previousActiveLoader = mediaType.activePlaylistLoader;
  77890. const lastTrack = mediaType.lastTrack_;
  77891. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  77892. return;
  77893. }
  77894. mediaType.lastGroup_ = activeGroup3;
  77895. mediaType.lastTrack_ = activeTrack2;
  77896. stopLoaders$1(segmentLoader, mediaType);
  77897. if (!activeGroup3) {
  77898. return;
  77899. }
  77900. if (activeGroup3.isMainPlaylist) {
  77901. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  77902. return;
  77903. }
  77904. const pc = settings.vhs.playlistController_;
  77905. const newPlaylist = pc.selectPlaylist();
  77906. if (pc.media() === newPlaylist) {
  77907. return;
  77908. }
  77909. mediaType.logger_(`track change. Switching main audio from ${lastTrack.id} to ${activeTrack2.id}`);
  77910. mainPlaylistLoader.pause();
  77911. mainSegmentLoader.resetEverything();
  77912. pc.fastQualityChange_(newPlaylist);
  77913. return;
  77914. }
  77915. if (type2 === "AUDIO") {
  77916. if (!activeGroup3.playlistLoader) {
  77917. mainSegmentLoader.setAudio(true);
  77918. mainSegmentLoader.resetEverything();
  77919. return;
  77920. }
  77921. segmentLoader.setAudio(true);
  77922. mainSegmentLoader.setAudio(false);
  77923. }
  77924. if (previousActiveLoader === activeGroup3.playlistLoader) {
  77925. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77926. return;
  77927. }
  77928. if (segmentLoader.track) {
  77929. segmentLoader.track(activeTrack2);
  77930. }
  77931. segmentLoader.resetEverything();
  77932. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77933. };
  77934. const onError$1 = {
  77935. AUDIO: (type2, settings) => () => {
  77936. const {
  77937. segmentLoaders: {
  77938. [type2]: segmentLoader
  77939. },
  77940. mediaTypes: {
  77941. [type2]: mediaType
  77942. },
  77943. excludePlaylist
  77944. } = settings;
  77945. stopLoaders$1(segmentLoader, mediaType);
  77946. const activeTrack2 = mediaType.activeTrack();
  77947. const activeGroup3 = mediaType.activeGroup();
  77948. const id = (activeGroup3.filter((group) => group.default)[0] || activeGroup3[0]).id;
  77949. const defaultTrack = mediaType.tracks[id];
  77950. if (activeTrack2 === defaultTrack) {
  77951. excludePlaylist({
  77952. error: {
  77953. message: "Problem encountered loading the default audio track."
  77954. }
  77955. });
  77956. return;
  77957. }
  77958. videojs$2.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  77959. for (const trackId in mediaType.tracks) {
  77960. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  77961. }
  77962. mediaType.onTrackChanged();
  77963. },
  77964. SUBTITLES: (type2, settings) => () => {
  77965. const {
  77966. segmentLoaders: {
  77967. [type2]: segmentLoader
  77968. },
  77969. mediaTypes: {
  77970. [type2]: mediaType
  77971. }
  77972. } = settings;
  77973. videojs$2.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  77974. stopLoaders$1(segmentLoader, mediaType);
  77975. const track = mediaType.activeTrack();
  77976. if (track) {
  77977. track.mode = "disabled";
  77978. }
  77979. mediaType.onTrackChanged();
  77980. }
  77981. };
  77982. const setupListeners$1 = {
  77983. AUDIO: (type2, playlistLoader, settings) => {
  77984. if (!playlistLoader) {
  77985. return;
  77986. }
  77987. const {
  77988. tech,
  77989. requestOptions,
  77990. segmentLoaders: {
  77991. [type2]: segmentLoader
  77992. }
  77993. } = settings;
  77994. playlistLoader.on("loadedmetadata", () => {
  77995. const media = playlistLoader.media();
  77996. segmentLoader.playlist(media, requestOptions);
  77997. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  77998. segmentLoader.load();
  77999. }
  78000. });
  78001. playlistLoader.on("loadedplaylist", () => {
  78002. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  78003. if (!tech.paused()) {
  78004. segmentLoader.load();
  78005. }
  78006. });
  78007. playlistLoader.on("error", onError$1[type2](type2, settings));
  78008. },
  78009. SUBTITLES: (type2, playlistLoader, settings) => {
  78010. const {
  78011. tech,
  78012. requestOptions,
  78013. segmentLoaders: {
  78014. [type2]: segmentLoader
  78015. },
  78016. mediaTypes: {
  78017. [type2]: mediaType
  78018. }
  78019. } = settings;
  78020. playlistLoader.on("loadedmetadata", () => {
  78021. const media = playlistLoader.media();
  78022. segmentLoader.playlist(media, requestOptions);
  78023. segmentLoader.track(mediaType.activeTrack());
  78024. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  78025. segmentLoader.load();
  78026. }
  78027. });
  78028. playlistLoader.on("loadedplaylist", () => {
  78029. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  78030. if (!tech.paused()) {
  78031. segmentLoader.load();
  78032. }
  78033. });
  78034. playlistLoader.on("error", onError$1[type2](type2, settings));
  78035. }
  78036. };
  78037. const initialize$1 = {
  78038. "AUDIO": (type2, settings) => {
  78039. const {
  78040. vhs,
  78041. sourceType,
  78042. segmentLoaders: {
  78043. [type2]: segmentLoader
  78044. },
  78045. requestOptions,
  78046. main: {
  78047. mediaGroups
  78048. },
  78049. mediaTypes: {
  78050. [type2]: {
  78051. groups,
  78052. tracks,
  78053. logger_
  78054. }
  78055. },
  78056. mainPlaylistLoader
  78057. } = settings;
  78058. const audioOnlyMain = isAudioOnly$1(mainPlaylistLoader.main);
  78059. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  78060. mediaGroups[type2] = {
  78061. main: {
  78062. default: {
  78063. default: true
  78064. }
  78065. }
  78066. };
  78067. if (audioOnlyMain) {
  78068. mediaGroups[type2].main.default.playlists = mainPlaylistLoader.main.playlists;
  78069. }
  78070. }
  78071. for (const groupId in mediaGroups[type2]) {
  78072. if (!groups[groupId]) {
  78073. groups[groupId] = [];
  78074. }
  78075. for (const variantLabel in mediaGroups[type2][groupId]) {
  78076. let properties = mediaGroups[type2][groupId][variantLabel];
  78077. let playlistLoader;
  78078. if (audioOnlyMain) {
  78079. logger_(`AUDIO group '${groupId}' label '${variantLabel}' is a main playlist`);
  78080. properties.isMainPlaylist = true;
  78081. playlistLoader = null;
  78082. } else if (sourceType === "vhs-json" && properties.playlists) {
  78083. playlistLoader = new PlaylistLoader$1(properties.playlists[0], vhs, requestOptions);
  78084. } else if (properties.resolvedUri) {
  78085. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78086. } else if (properties.playlists && sourceType === "dash") {
  78087. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78088. } else {
  78089. playlistLoader = null;
  78090. }
  78091. properties = merge$2({
  78092. id: variantLabel,
  78093. playlistLoader
  78094. }, properties);
  78095. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78096. groups[groupId].push(properties);
  78097. if (typeof tracks[variantLabel] === "undefined") {
  78098. const track = new videojs$2.AudioTrack({
  78099. id: variantLabel,
  78100. kind: audioTrackKind_$1(properties),
  78101. enabled: false,
  78102. language: properties.language,
  78103. default: properties.default,
  78104. label: variantLabel
  78105. });
  78106. tracks[variantLabel] = track;
  78107. }
  78108. }
  78109. }
  78110. segmentLoader.on("error", onError$1[type2](type2, settings));
  78111. },
  78112. "SUBTITLES": (type2, settings) => {
  78113. const {
  78114. tech,
  78115. vhs,
  78116. sourceType,
  78117. segmentLoaders: {
  78118. [type2]: segmentLoader
  78119. },
  78120. requestOptions,
  78121. main: {
  78122. mediaGroups
  78123. },
  78124. mediaTypes: {
  78125. [type2]: {
  78126. groups,
  78127. tracks
  78128. }
  78129. },
  78130. mainPlaylistLoader
  78131. } = settings;
  78132. for (const groupId in mediaGroups[type2]) {
  78133. if (!groups[groupId]) {
  78134. groups[groupId] = [];
  78135. }
  78136. for (const variantLabel in mediaGroups[type2][groupId]) {
  78137. if (mediaGroups[type2][groupId][variantLabel].forced) {
  78138. continue;
  78139. }
  78140. let properties = mediaGroups[type2][groupId][variantLabel];
  78141. let playlistLoader;
  78142. if (sourceType === "hls") {
  78143. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78144. } else if (sourceType === "dash") {
  78145. const playlists = properties.playlists.filter((p) => p.excludeUntil !== Infinity);
  78146. if (!playlists.length) {
  78147. return;
  78148. }
  78149. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78150. } else if (sourceType === "vhs-json") {
  78151. playlistLoader = new PlaylistLoader$1(
  78152. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  78153. vhs,
  78154. requestOptions
  78155. );
  78156. }
  78157. properties = merge$2({
  78158. id: variantLabel,
  78159. playlistLoader
  78160. }, properties);
  78161. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78162. groups[groupId].push(properties);
  78163. if (typeof tracks[variantLabel] === "undefined") {
  78164. const track = tech.addRemoteTextTrack({
  78165. id: variantLabel,
  78166. kind: "subtitles",
  78167. default: properties.default && properties.autoselect,
  78168. language: properties.language,
  78169. label: variantLabel
  78170. }, false).track;
  78171. tracks[variantLabel] = track;
  78172. }
  78173. }
  78174. }
  78175. segmentLoader.on("error", onError$1[type2](type2, settings));
  78176. },
  78177. "CLOSED-CAPTIONS": (type2, settings) => {
  78178. const {
  78179. tech,
  78180. main: {
  78181. mediaGroups
  78182. },
  78183. mediaTypes: {
  78184. [type2]: {
  78185. groups,
  78186. tracks
  78187. }
  78188. }
  78189. } = settings;
  78190. for (const groupId in mediaGroups[type2]) {
  78191. if (!groups[groupId]) {
  78192. groups[groupId] = [];
  78193. }
  78194. for (const variantLabel in mediaGroups[type2][groupId]) {
  78195. const properties = mediaGroups[type2][groupId][variantLabel];
  78196. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  78197. continue;
  78198. }
  78199. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  78200. let newProps = {
  78201. label: variantLabel,
  78202. language: properties.language,
  78203. instreamId: properties.instreamId,
  78204. default: properties.default && properties.autoselect
  78205. };
  78206. if (captionServices[newProps.instreamId]) {
  78207. newProps = merge$2(newProps, captionServices[newProps.instreamId]);
  78208. }
  78209. if (newProps.default === void 0) {
  78210. delete newProps.default;
  78211. }
  78212. groups[groupId].push(merge$2({
  78213. id: variantLabel
  78214. }, properties));
  78215. if (typeof tracks[variantLabel] === "undefined") {
  78216. const track = tech.addRemoteTextTrack({
  78217. id: newProps.instreamId,
  78218. kind: "captions",
  78219. default: newProps.default,
  78220. language: newProps.language,
  78221. label: newProps.label
  78222. }, false).track;
  78223. tracks[variantLabel] = track;
  78224. }
  78225. }
  78226. }
  78227. }
  78228. };
  78229. const groupMatch$1 = (list, media) => {
  78230. for (let i2 = 0; i2 < list.length; i2++) {
  78231. if (playlistMatch$1(media, list[i2])) {
  78232. return true;
  78233. }
  78234. if (list[i2].playlists && groupMatch$1(list[i2].playlists, media)) {
  78235. return true;
  78236. }
  78237. }
  78238. return false;
  78239. };
  78240. const activeGroup$1 = (type2, settings) => (track) => {
  78241. const {
  78242. mainPlaylistLoader,
  78243. mediaTypes: {
  78244. [type2]: {
  78245. groups
  78246. }
  78247. }
  78248. } = settings;
  78249. const media = mainPlaylistLoader.media();
  78250. if (!media) {
  78251. return null;
  78252. }
  78253. let variants = null;
  78254. if (media.attributes[type2]) {
  78255. variants = groups[media.attributes[type2]];
  78256. }
  78257. const groupKeys = Object.keys(groups);
  78258. if (!variants) {
  78259. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly$1(settings.main)) {
  78260. for (let i2 = 0; i2 < groupKeys.length; i2++) {
  78261. const groupPropertyList = groups[groupKeys[i2]];
  78262. if (groupMatch$1(groupPropertyList, media)) {
  78263. variants = groupPropertyList;
  78264. break;
  78265. }
  78266. }
  78267. } else if (groups.main) {
  78268. variants = groups.main;
  78269. } else if (groupKeys.length === 1) {
  78270. variants = groups[groupKeys[0]];
  78271. }
  78272. }
  78273. if (typeof track === "undefined") {
  78274. return variants;
  78275. }
  78276. if (track === null || !variants) {
  78277. return null;
  78278. }
  78279. return variants.filter((props) => props.id === track.id)[0] || null;
  78280. };
  78281. const activeTrack$1 = {
  78282. AUDIO: (type2, settings) => () => {
  78283. const {
  78284. mediaTypes: {
  78285. [type2]: {
  78286. tracks
  78287. }
  78288. }
  78289. } = settings;
  78290. for (const id in tracks) {
  78291. if (tracks[id].enabled) {
  78292. return tracks[id];
  78293. }
  78294. }
  78295. return null;
  78296. },
  78297. SUBTITLES: (type2, settings) => () => {
  78298. const {
  78299. mediaTypes: {
  78300. [type2]: {
  78301. tracks
  78302. }
  78303. }
  78304. } = settings;
  78305. for (const id in tracks) {
  78306. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  78307. return tracks[id];
  78308. }
  78309. }
  78310. return null;
  78311. }
  78312. };
  78313. const getActiveGroup$1 = (type2, {
  78314. mediaTypes: mediaTypes2
  78315. }) => () => {
  78316. const activeTrack_ = mediaTypes2[type2].activeTrack();
  78317. if (!activeTrack_) {
  78318. return null;
  78319. }
  78320. return mediaTypes2[type2].activeGroup(activeTrack_);
  78321. };
  78322. const setupMediaGroups$1 = (settings) => {
  78323. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78324. initialize$1[type2](type2, settings);
  78325. });
  78326. const {
  78327. mediaTypes: mediaTypes2,
  78328. mainPlaylistLoader,
  78329. tech,
  78330. vhs,
  78331. segmentLoaders: {
  78332. ["AUDIO"]: audioSegmentLoader,
  78333. main: mainSegmentLoader
  78334. }
  78335. } = settings;
  78336. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  78337. mediaTypes2[type2].activeGroup = activeGroup$1(type2, settings);
  78338. mediaTypes2[type2].activeTrack = activeTrack$1[type2](type2, settings);
  78339. mediaTypes2[type2].onGroupChanged = onGroupChanged$1(type2, settings);
  78340. mediaTypes2[type2].onGroupChanging = onGroupChanging$1(type2, settings);
  78341. mediaTypes2[type2].onTrackChanged = onTrackChanged$1(type2, settings);
  78342. mediaTypes2[type2].getActiveGroup = getActiveGroup$1(type2, settings);
  78343. });
  78344. const audioGroup = mediaTypes2.AUDIO.activeGroup();
  78345. if (audioGroup) {
  78346. const groupId = (audioGroup.filter((group) => group.default)[0] || audioGroup[0]).id;
  78347. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  78348. mediaTypes2.AUDIO.onGroupChanged();
  78349. mediaTypes2.AUDIO.onTrackChanged();
  78350. const activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  78351. if (!activeAudioGroup.playlistLoader) {
  78352. mainSegmentLoader.setAudio(true);
  78353. } else {
  78354. mainSegmentLoader.setAudio(false);
  78355. audioSegmentLoader.setAudio(true);
  78356. }
  78357. }
  78358. mainPlaylistLoader.on("mediachange", () => {
  78359. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanged());
  78360. });
  78361. mainPlaylistLoader.on("mediachanging", () => {
  78362. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanging());
  78363. });
  78364. const onAudioTrackChanged = () => {
  78365. mediaTypes2.AUDIO.onTrackChanged();
  78366. tech.trigger({
  78367. type: "usage",
  78368. name: "vhs-audio-change"
  78369. });
  78370. };
  78371. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  78372. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78373. vhs.on("dispose", () => {
  78374. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  78375. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78376. });
  78377. tech.clearTracks("audio");
  78378. for (const id in mediaTypes2.AUDIO.tracks) {
  78379. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  78380. }
  78381. };
  78382. const createMediaTypes$1 = () => {
  78383. const mediaTypes2 = {};
  78384. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78385. mediaTypes2[type2] = {
  78386. groups: {},
  78387. tracks: {},
  78388. activePlaylistLoader: null,
  78389. activeGroup: noop$1,
  78390. activeTrack: noop$1,
  78391. getActiveGroup: noop$1,
  78392. onGroupChanged: noop$1,
  78393. onTrackChanged: noop$1,
  78394. lastTrack_: null,
  78395. logger_: logger$1(`MediaGroups[${type2}]`)
  78396. };
  78397. });
  78398. return mediaTypes2;
  78399. };
  78400. const ABORT_EARLY_EXCLUSION_SECONDS = 60 * 2;
  78401. let Vhs$1$1;
  78402. const loaderStats$1 = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  78403. const sumLoaderStat$1 = function(stat) {
  78404. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  78405. };
  78406. const shouldSwitchToMedia$1 = function({
  78407. currentPlaylist,
  78408. buffered,
  78409. currentTime,
  78410. nextPlaylist,
  78411. bufferLowWaterLine,
  78412. bufferHighWaterLine,
  78413. duration: duration5,
  78414. bufferBasedABR,
  78415. log: log2
  78416. }) {
  78417. if (!nextPlaylist) {
  78418. videojs$2.log.warn("We received no playlist to switch to. Please check your stream.");
  78419. return false;
  78420. }
  78421. const sharedLogLine = `allowing switch ${currentPlaylist && currentPlaylist.id || "null"} -> ${nextPlaylist.id}`;
  78422. if (!currentPlaylist) {
  78423. log2(`${sharedLogLine} as current playlist is not set`);
  78424. return true;
  78425. }
  78426. if (nextPlaylist.id === currentPlaylist.id) {
  78427. return false;
  78428. }
  78429. const isBuffered = Boolean(findRange$1(buffered, currentTime).length);
  78430. if (!currentPlaylist.endList) {
  78431. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  78432. log2(`not ${sharedLogLine} as current playlist is live llhls, but currentTime isn't in buffered.`);
  78433. return false;
  78434. }
  78435. log2(`${sharedLogLine} as current playlist is live`);
  78436. return true;
  78437. }
  78438. const forwardBuffer = timeAheadOf$1(buffered, currentTime);
  78439. const maxBufferLowWaterLine = bufferBasedABR ? Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config$1.MAX_BUFFER_LOW_WATER_LINE;
  78440. if (duration5 < maxBufferLowWaterLine) {
  78441. log2(`${sharedLogLine} as duration < max low water line (${duration5} < ${maxBufferLowWaterLine})`);
  78442. return true;
  78443. }
  78444. const nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  78445. const currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  78446. if (nextBandwidth < currBandwidth && (!bufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  78447. let logLine = `${sharedLogLine} as next bandwidth < current bandwidth (${nextBandwidth} < ${currBandwidth})`;
  78448. if (bufferBasedABR) {
  78449. logLine += ` and forwardBuffer < bufferHighWaterLine (${forwardBuffer} < ${bufferHighWaterLine})`;
  78450. }
  78451. log2(logLine);
  78452. return true;
  78453. }
  78454. if ((!bufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  78455. let logLine = `${sharedLogLine} as forwardBuffer >= bufferLowWaterLine (${forwardBuffer} >= ${bufferLowWaterLine})`;
  78456. if (bufferBasedABR) {
  78457. logLine += ` and next bandwidth > current bandwidth (${nextBandwidth} > ${currBandwidth})`;
  78458. }
  78459. log2(logLine);
  78460. return true;
  78461. }
  78462. log2(`not ${sharedLogLine} as no switching criteria met`);
  78463. return false;
  78464. };
  78465. class PlaylistController extends videojs$2.EventTarget {
  78466. constructor(options2) {
  78467. super();
  78468. const {
  78469. src,
  78470. withCredentials,
  78471. tech,
  78472. bandwidth: bandwidth2,
  78473. externVhs,
  78474. useCueTags,
  78475. playlistExclusionDuration,
  78476. enableLowInitialPlaylist,
  78477. sourceType,
  78478. cacheEncryptionKeys,
  78479. bufferBasedABR,
  78480. leastPixelDiffSelector,
  78481. captionServices
  78482. } = options2;
  78483. if (!src) {
  78484. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  78485. }
  78486. let {
  78487. maxPlaylistRetries
  78488. } = options2;
  78489. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  78490. maxPlaylistRetries = Infinity;
  78491. }
  78492. Vhs$1$1 = externVhs;
  78493. this.bufferBasedABR = Boolean(bufferBasedABR);
  78494. this.leastPixelDiffSelector = Boolean(leastPixelDiffSelector);
  78495. this.withCredentials = withCredentials;
  78496. this.tech_ = tech;
  78497. this.vhs_ = tech.vhs;
  78498. this.sourceType_ = sourceType;
  78499. this.useCueTags_ = useCueTags;
  78500. this.playlistExclusionDuration = playlistExclusionDuration;
  78501. this.maxPlaylistRetries = maxPlaylistRetries;
  78502. this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  78503. if (this.useCueTags_) {
  78504. this.cueTagsTrack_ = this.tech_.addTextTrack("metadata", "ad-cues");
  78505. this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  78506. }
  78507. this.requestOptions_ = {
  78508. withCredentials,
  78509. maxPlaylistRetries,
  78510. timeout: null
  78511. };
  78512. this.on("error", this.pauseLoading);
  78513. this.mediaTypes_ = createMediaTypes$1();
  78514. this.mediaSource = new window_1.MediaSource();
  78515. this.handleDurationChange_ = this.handleDurationChange_.bind(this);
  78516. this.handleSourceOpen_ = this.handleSourceOpen_.bind(this);
  78517. this.handleSourceEnded_ = this.handleSourceEnded_.bind(this);
  78518. this.mediaSource.addEventListener("durationchange", this.handleDurationChange_);
  78519. this.mediaSource.addEventListener("sourceopen", this.handleSourceOpen_);
  78520. this.mediaSource.addEventListener("sourceended", this.handleSourceEnded_);
  78521. this.seekable_ = createTimeRanges$2();
  78522. this.hasPlayed_ = false;
  78523. this.syncController_ = new SyncController$1(options2);
  78524. this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  78525. kind: "metadata",
  78526. label: "segment-metadata"
  78527. }, false).track;
  78528. this.decrypter_ = new Decrypter$1();
  78529. this.sourceUpdater_ = new SourceUpdater$1(this.mediaSource);
  78530. this.inbandTextTracks_ = {};
  78531. this.timelineChangeController_ = new TimelineChangeController$1();
  78532. const segmentLoaderSettings = {
  78533. vhs: this.vhs_,
  78534. parse708captions: options2.parse708captions,
  78535. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  78536. captionServices,
  78537. mediaSource: this.mediaSource,
  78538. currentTime: this.tech_.currentTime.bind(this.tech_),
  78539. seekable: () => this.seekable(),
  78540. seeking: () => this.tech_.seeking(),
  78541. duration: () => this.duration(),
  78542. hasPlayed: () => this.hasPlayed_,
  78543. goalBufferLength: () => this.goalBufferLength(),
  78544. bandwidth: bandwidth2,
  78545. syncController: this.syncController_,
  78546. decrypter: this.decrypter_,
  78547. sourceType: this.sourceType_,
  78548. inbandTextTracks: this.inbandTextTracks_,
  78549. cacheEncryptionKeys,
  78550. sourceUpdater: this.sourceUpdater_,
  78551. timelineChangeController: this.timelineChangeController_,
  78552. exactManifestTimings: options2.exactManifestTimings
  78553. };
  78554. this.mainPlaylistLoader_ = this.sourceType_ === "dash" ? new DashPlaylistLoader$1(src, this.vhs_, this.requestOptions_) : new PlaylistLoader$1(src, this.vhs_, this.requestOptions_);
  78555. this.setupMainPlaylistLoaderListeners_();
  78556. this.mainSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78557. segmentMetadataTrack: this.segmentMetadataTrack_,
  78558. loaderType: "main"
  78559. }), options2);
  78560. this.audioSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78561. loaderType: "audio"
  78562. }), options2);
  78563. this.subtitleSegmentLoader_ = new VTTSegmentLoader$1(merge$2(segmentLoaderSettings, {
  78564. loaderType: "vtt",
  78565. featuresNativeTextTracks: this.tech_.featuresNativeTextTracks,
  78566. loadVttJs: () => new Promise((resolve2, reject2) => {
  78567. function onLoad() {
  78568. tech.off("vttjserror", onError2);
  78569. resolve2();
  78570. }
  78571. function onError2() {
  78572. tech.off("vttjsloaded", onLoad);
  78573. reject2();
  78574. }
  78575. tech.one("vttjsloaded", onLoad);
  78576. tech.one("vttjserror", onError2);
  78577. tech.addWebVttScript_();
  78578. })
  78579. }), options2);
  78580. this.setupSegmentLoaderListeners_();
  78581. if (this.bufferBasedABR) {
  78582. this.mainPlaylistLoader_.one("loadedplaylist", () => this.startABRTimer_());
  78583. this.tech_.on("pause", () => this.stopABRTimer_());
  78584. this.tech_.on("play", () => this.startABRTimer_());
  78585. }
  78586. loaderStats$1.forEach((stat) => {
  78587. this[stat + "_"] = sumLoaderStat$1.bind(this, stat);
  78588. });
  78589. this.logger_ = logger$1("pc");
  78590. this.triggeredFmp4Usage = false;
  78591. if (this.tech_.preload() === "none") {
  78592. this.loadOnPlay_ = () => {
  78593. this.loadOnPlay_ = null;
  78594. this.mainPlaylistLoader_.load();
  78595. };
  78596. this.tech_.one("play", this.loadOnPlay_);
  78597. } else {
  78598. this.mainPlaylistLoader_.load();
  78599. }
  78600. this.timeToLoadedData__ = -1;
  78601. this.mainAppendsToLoadedData__ = -1;
  78602. this.audioAppendsToLoadedData__ = -1;
  78603. const event2 = this.tech_.preload() === "none" ? "play" : "loadstart";
  78604. this.tech_.one(event2, () => {
  78605. const timeToLoadedDataStart = Date.now();
  78606. this.tech_.one("loadeddata", () => {
  78607. this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  78608. this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends;
  78609. this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends;
  78610. });
  78611. });
  78612. }
  78613. mainAppendsToLoadedData_() {
  78614. return this.mainAppendsToLoadedData__;
  78615. }
  78616. audioAppendsToLoadedData_() {
  78617. return this.audioAppendsToLoadedData__;
  78618. }
  78619. appendsToLoadedData_() {
  78620. const main = this.mainAppendsToLoadedData_();
  78621. const audio = this.audioAppendsToLoadedData_();
  78622. if (main === -1 || audio === -1) {
  78623. return -1;
  78624. }
  78625. return main + audio;
  78626. }
  78627. timeToLoadedData_() {
  78628. return this.timeToLoadedData__;
  78629. }
  78630. checkABR_(reason = "abr") {
  78631. const nextPlaylist = this.selectPlaylist();
  78632. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  78633. this.switchMedia_(nextPlaylist, reason);
  78634. }
  78635. }
  78636. switchMedia_(playlist, cause, delay) {
  78637. const oldMedia = this.media();
  78638. const oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  78639. const newId = playlist.id || playlist.uri;
  78640. if (oldId && oldId !== newId) {
  78641. this.logger_(`switch media ${oldId} -> ${newId} from ${cause}`);
  78642. this.tech_.trigger({
  78643. type: "usage",
  78644. name: `vhs-rendition-change-${cause}`
  78645. });
  78646. }
  78647. this.mainPlaylistLoader_.media(playlist, delay);
  78648. }
  78649. startABRTimer_() {
  78650. this.stopABRTimer_();
  78651. this.abrTimer_ = window_1.setInterval(() => this.checkABR_(), 250);
  78652. }
  78653. stopABRTimer_() {
  78654. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  78655. return;
  78656. }
  78657. window_1.clearInterval(this.abrTimer_);
  78658. this.abrTimer_ = null;
  78659. }
  78660. getAudioTrackPlaylists_() {
  78661. const main = this.main();
  78662. const defaultPlaylists = main && main.playlists || [];
  78663. if (!main || !main.mediaGroups || !main.mediaGroups.AUDIO) {
  78664. return defaultPlaylists;
  78665. }
  78666. const AUDIO5 = main.mediaGroups.AUDIO;
  78667. const groupKeys = Object.keys(AUDIO5);
  78668. let track;
  78669. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  78670. track = this.mediaTypes_.AUDIO.activeTrack();
  78671. } else {
  78672. const defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  78673. for (const label2 in defaultGroup) {
  78674. if (defaultGroup[label2].default) {
  78675. track = {
  78676. label: label2
  78677. };
  78678. break;
  78679. }
  78680. }
  78681. }
  78682. if (!track) {
  78683. return defaultPlaylists;
  78684. }
  78685. const playlists = [];
  78686. for (const group in AUDIO5) {
  78687. if (AUDIO5[group][track.label]) {
  78688. const properties = AUDIO5[group][track.label];
  78689. if (properties.playlists && properties.playlists.length) {
  78690. playlists.push.apply(playlists, properties.playlists);
  78691. } else if (properties.uri) {
  78692. playlists.push(properties);
  78693. } else if (main.playlists.length) {
  78694. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  78695. const playlist = main.playlists[i2];
  78696. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  78697. playlists.push(playlist);
  78698. }
  78699. }
  78700. }
  78701. }
  78702. }
  78703. if (!playlists.length) {
  78704. return defaultPlaylists;
  78705. }
  78706. return playlists;
  78707. }
  78708. setupMainPlaylistLoaderListeners_() {
  78709. this.mainPlaylistLoader_.on("loadedmetadata", () => {
  78710. const media = this.mainPlaylistLoader_.media();
  78711. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78712. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78713. this.requestOptions_.timeout = 0;
  78714. } else {
  78715. this.requestOptions_.timeout = requestTimeout;
  78716. }
  78717. if (media.endList && this.tech_.preload() !== "none") {
  78718. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78719. this.mainSegmentLoader_.load();
  78720. }
  78721. setupMediaGroups$1({
  78722. sourceType: this.sourceType_,
  78723. segmentLoaders: {
  78724. AUDIO: this.audioSegmentLoader_,
  78725. SUBTITLES: this.subtitleSegmentLoader_,
  78726. main: this.mainSegmentLoader_
  78727. },
  78728. tech: this.tech_,
  78729. requestOptions: this.requestOptions_,
  78730. mainPlaylistLoader: this.mainPlaylistLoader_,
  78731. vhs: this.vhs_,
  78732. main: this.main(),
  78733. mediaTypes: this.mediaTypes_,
  78734. excludePlaylist: this.excludePlaylist.bind(this)
  78735. });
  78736. this.triggerPresenceUsage_(this.main(), media);
  78737. this.setupFirstPlay();
  78738. if (!this.mediaTypes_.AUDIO.activePlaylistLoader || this.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  78739. this.trigger("selectedinitialmedia");
  78740. } else {
  78741. this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", () => {
  78742. this.trigger("selectedinitialmedia");
  78743. });
  78744. }
  78745. });
  78746. this.mainPlaylistLoader_.on("loadedplaylist", () => {
  78747. if (this.loadOnPlay_) {
  78748. this.tech_.off("play", this.loadOnPlay_);
  78749. }
  78750. let updatedPlaylist = this.mainPlaylistLoader_.media();
  78751. if (!updatedPlaylist) {
  78752. this.excludeUnsupportedVariants_();
  78753. let selectedMedia;
  78754. if (this.enableLowInitialPlaylist) {
  78755. selectedMedia = this.selectInitialPlaylist();
  78756. }
  78757. if (!selectedMedia) {
  78758. selectedMedia = this.selectPlaylist();
  78759. }
  78760. if (!selectedMedia || !this.shouldSwitchToMedia_(selectedMedia)) {
  78761. return;
  78762. }
  78763. this.initialMedia_ = selectedMedia;
  78764. this.switchMedia_(this.initialMedia_, "initial");
  78765. const haveJsonSource = this.sourceType_ === "vhs-json" && this.initialMedia_.segments;
  78766. if (!haveJsonSource) {
  78767. return;
  78768. }
  78769. updatedPlaylist = this.initialMedia_;
  78770. }
  78771. this.handleUpdatedMediaPlaylist(updatedPlaylist);
  78772. });
  78773. this.mainPlaylistLoader_.on("error", () => {
  78774. const error = this.mainPlaylistLoader_.error;
  78775. this.excludePlaylist({
  78776. playlistToExclude: error.playlist,
  78777. error
  78778. });
  78779. });
  78780. this.mainPlaylistLoader_.on("mediachanging", () => {
  78781. this.mainSegmentLoader_.abort();
  78782. this.mainSegmentLoader_.pause();
  78783. });
  78784. this.mainPlaylistLoader_.on("mediachange", () => {
  78785. const media = this.mainPlaylistLoader_.media();
  78786. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78787. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78788. this.requestOptions_.timeout = 0;
  78789. } else {
  78790. this.requestOptions_.timeout = requestTimeout;
  78791. }
  78792. this.mainPlaylistLoader_.load();
  78793. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78794. this.mainSegmentLoader_.load();
  78795. this.tech_.trigger({
  78796. type: "mediachange",
  78797. bubbles: true
  78798. });
  78799. });
  78800. this.mainPlaylistLoader_.on("playlistunchanged", () => {
  78801. const updatedPlaylist = this.mainPlaylistLoader_.media();
  78802. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  78803. return;
  78804. }
  78805. const playlistOutdated = this.stuckAtPlaylistEnd_(updatedPlaylist);
  78806. if (playlistOutdated) {
  78807. this.excludePlaylist({
  78808. error: {
  78809. message: "Playlist no longer updating.",
  78810. reason: "playlist-unchanged"
  78811. }
  78812. });
  78813. this.tech_.trigger("playliststuck");
  78814. }
  78815. });
  78816. this.mainPlaylistLoader_.on("renditiondisabled", () => {
  78817. this.tech_.trigger({
  78818. type: "usage",
  78819. name: "vhs-rendition-disabled"
  78820. });
  78821. });
  78822. this.mainPlaylistLoader_.on("renditionenabled", () => {
  78823. this.tech_.trigger({
  78824. type: "usage",
  78825. name: "vhs-rendition-enabled"
  78826. });
  78827. });
  78828. }
  78829. handleUpdatedMediaPlaylist(updatedPlaylist) {
  78830. if (this.useCueTags_) {
  78831. this.updateAdCues_(updatedPlaylist);
  78832. }
  78833. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  78834. this.updateDuration(!updatedPlaylist.endList);
  78835. if (!this.tech_.paused()) {
  78836. this.mainSegmentLoader_.load();
  78837. if (this.audioSegmentLoader_) {
  78838. this.audioSegmentLoader_.load();
  78839. }
  78840. }
  78841. }
  78842. triggerPresenceUsage_(main, media) {
  78843. const mediaGroups = main.mediaGroups || {};
  78844. let defaultDemuxed = true;
  78845. const audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  78846. for (const mediaGroup in mediaGroups.AUDIO) {
  78847. for (const label2 in mediaGroups.AUDIO[mediaGroup]) {
  78848. const properties = mediaGroups.AUDIO[mediaGroup][label2];
  78849. if (!properties.uri) {
  78850. defaultDemuxed = false;
  78851. }
  78852. }
  78853. }
  78854. if (defaultDemuxed) {
  78855. this.tech_.trigger({
  78856. type: "usage",
  78857. name: "vhs-demuxed"
  78858. });
  78859. }
  78860. if (Object.keys(mediaGroups.SUBTITLES).length) {
  78861. this.tech_.trigger({
  78862. type: "usage",
  78863. name: "vhs-webvtt"
  78864. });
  78865. }
  78866. if (Vhs$1$1.Playlist.isAes(media)) {
  78867. this.tech_.trigger({
  78868. type: "usage",
  78869. name: "vhs-aes"
  78870. });
  78871. }
  78872. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  78873. this.tech_.trigger({
  78874. type: "usage",
  78875. name: "vhs-alternate-audio"
  78876. });
  78877. }
  78878. if (this.useCueTags_) {
  78879. this.tech_.trigger({
  78880. type: "usage",
  78881. name: "vhs-playlist-cue-tags"
  78882. });
  78883. }
  78884. }
  78885. shouldSwitchToMedia_(nextPlaylist) {
  78886. const currentPlaylist = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pendingMedia_;
  78887. const currentTime = this.tech_.currentTime();
  78888. const bufferLowWaterLine = this.bufferLowWaterLine();
  78889. const bufferHighWaterLine = this.bufferHighWaterLine();
  78890. const buffered = this.tech_.buffered();
  78891. return shouldSwitchToMedia$1({
  78892. buffered,
  78893. currentTime,
  78894. currentPlaylist,
  78895. nextPlaylist,
  78896. bufferLowWaterLine,
  78897. bufferHighWaterLine,
  78898. duration: this.duration(),
  78899. bufferBasedABR: this.bufferBasedABR,
  78900. log: this.logger_
  78901. });
  78902. }
  78903. setupSegmentLoaderListeners_() {
  78904. this.mainSegmentLoader_.on("bandwidthupdate", () => {
  78905. this.checkABR_("bandwidthupdate");
  78906. this.tech_.trigger("bandwidthupdate");
  78907. });
  78908. this.mainSegmentLoader_.on("timeout", () => {
  78909. if (this.bufferBasedABR) {
  78910. this.mainSegmentLoader_.load();
  78911. }
  78912. });
  78913. if (!this.bufferBasedABR) {
  78914. this.mainSegmentLoader_.on("progress", () => {
  78915. this.trigger("progress");
  78916. });
  78917. }
  78918. this.mainSegmentLoader_.on("error", () => {
  78919. const error = this.mainSegmentLoader_.error();
  78920. this.excludePlaylist({
  78921. playlistToExclude: error.playlist,
  78922. error
  78923. });
  78924. });
  78925. this.mainSegmentLoader_.on("appenderror", () => {
  78926. this.error = this.mainSegmentLoader_.error_;
  78927. this.trigger("error");
  78928. });
  78929. this.mainSegmentLoader_.on("syncinfoupdate", () => {
  78930. this.onSyncInfoUpdate_();
  78931. });
  78932. this.mainSegmentLoader_.on("timestampoffset", () => {
  78933. this.tech_.trigger({
  78934. type: "usage",
  78935. name: "vhs-timestamp-offset"
  78936. });
  78937. });
  78938. this.audioSegmentLoader_.on("syncinfoupdate", () => {
  78939. this.onSyncInfoUpdate_();
  78940. });
  78941. this.audioSegmentLoader_.on("appenderror", () => {
  78942. this.error = this.audioSegmentLoader_.error_;
  78943. this.trigger("error");
  78944. });
  78945. this.mainSegmentLoader_.on("ended", () => {
  78946. this.logger_("main segment loader ended");
  78947. this.onEndOfStream();
  78948. });
  78949. this.mainSegmentLoader_.on("earlyabort", (event2) => {
  78950. if (this.bufferBasedABR) {
  78951. return;
  78952. }
  78953. this.delegateLoaders_("all", ["abort"]);
  78954. this.excludePlaylist({
  78955. error: {
  78956. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  78957. },
  78958. playlistExclusionDuration: ABORT_EARLY_EXCLUSION_SECONDS
  78959. });
  78960. });
  78961. const updateCodecs = () => {
  78962. if (!this.sourceUpdater_.hasCreatedSourceBuffers()) {
  78963. return this.tryToCreateSourceBuffers_();
  78964. }
  78965. const codecs = this.getCodecsOrExclude_();
  78966. if (!codecs) {
  78967. return;
  78968. }
  78969. this.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  78970. };
  78971. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  78972. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  78973. this.mainSegmentLoader_.on("fmp4", () => {
  78974. if (!this.triggeredFmp4Usage) {
  78975. this.tech_.trigger({
  78976. type: "usage",
  78977. name: "vhs-fmp4"
  78978. });
  78979. this.triggeredFmp4Usage = true;
  78980. }
  78981. });
  78982. this.audioSegmentLoader_.on("fmp4", () => {
  78983. if (!this.triggeredFmp4Usage) {
  78984. this.tech_.trigger({
  78985. type: "usage",
  78986. name: "vhs-fmp4"
  78987. });
  78988. this.triggeredFmp4Usage = true;
  78989. }
  78990. });
  78991. this.audioSegmentLoader_.on("ended", () => {
  78992. this.logger_("audioSegmentLoader ended");
  78993. this.onEndOfStream();
  78994. });
  78995. }
  78996. mediaSecondsLoaded_() {
  78997. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  78998. }
  78999. load() {
  79000. this.mainSegmentLoader_.load();
  79001. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79002. this.audioSegmentLoader_.load();
  79003. }
  79004. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  79005. this.subtitleSegmentLoader_.load();
  79006. }
  79007. }
  79008. fastQualityChange_(media = this.selectPlaylist()) {
  79009. if (media === this.mainPlaylistLoader_.media()) {
  79010. this.logger_("skipping fastQualityChange because new media is same as old");
  79011. return;
  79012. }
  79013. this.switchMedia_(media, "fast-quality");
  79014. this.mainSegmentLoader_.resetEverything(() => {
  79015. if (videojs$2.browser.IE_VERSION || videojs$2.browser.IS_EDGE) {
  79016. this.tech_.setCurrentTime(this.tech_.currentTime() + 0.04);
  79017. } else {
  79018. this.tech_.setCurrentTime(this.tech_.currentTime());
  79019. }
  79020. });
  79021. }
  79022. play() {
  79023. if (this.setupFirstPlay()) {
  79024. return;
  79025. }
  79026. if (this.tech_.ended()) {
  79027. this.tech_.setCurrentTime(0);
  79028. }
  79029. if (this.hasPlayed_) {
  79030. this.load();
  79031. }
  79032. const seekable3 = this.tech_.seekable();
  79033. if (this.tech_.duration() === Infinity) {
  79034. if (this.tech_.currentTime() < seekable3.start(0)) {
  79035. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  79036. }
  79037. }
  79038. }
  79039. setupFirstPlay() {
  79040. const media = this.mainPlaylistLoader_.media();
  79041. if (!media || this.tech_.paused() || this.hasPlayed_) {
  79042. return false;
  79043. }
  79044. if (!media.endList) {
  79045. const seekable3 = this.seekable();
  79046. if (!seekable3.length) {
  79047. return false;
  79048. }
  79049. if (videojs$2.browser.IE_VERSION && this.tech_.readyState() === 0) {
  79050. this.tech_.one("loadedmetadata", () => {
  79051. this.trigger("firstplay");
  79052. this.tech_.setCurrentTime(seekable3.end(0));
  79053. this.hasPlayed_ = true;
  79054. });
  79055. return false;
  79056. }
  79057. this.trigger("firstplay");
  79058. this.tech_.setCurrentTime(seekable3.end(0));
  79059. }
  79060. this.hasPlayed_ = true;
  79061. this.load();
  79062. return true;
  79063. }
  79064. handleSourceOpen_() {
  79065. this.tryToCreateSourceBuffers_();
  79066. if (this.tech_.autoplay()) {
  79067. const playPromise = this.tech_.play();
  79068. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  79069. playPromise.then(null, (e) => {
  79070. });
  79071. }
  79072. }
  79073. this.trigger("sourceopen");
  79074. }
  79075. handleSourceEnded_() {
  79076. if (!this.inbandTextTracks_.metadataTrack_) {
  79077. return;
  79078. }
  79079. const cues = this.inbandTextTracks_.metadataTrack_.cues;
  79080. if (!cues || !cues.length) {
  79081. return;
  79082. }
  79083. const duration5 = this.duration();
  79084. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  79085. }
  79086. handleDurationChange_() {
  79087. this.tech_.trigger("durationchange");
  79088. }
  79089. onEndOfStream() {
  79090. let isEndOfStream = this.mainSegmentLoader_.ended_;
  79091. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79092. const mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  79093. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  79094. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  79095. } else {
  79096. isEndOfStream = this.audioSegmentLoader_.ended_;
  79097. }
  79098. }
  79099. if (!isEndOfStream) {
  79100. return;
  79101. }
  79102. this.stopABRTimer_();
  79103. this.sourceUpdater_.endOfStream();
  79104. }
  79105. stuckAtPlaylistEnd_(playlist) {
  79106. const seekable3 = this.seekable();
  79107. if (!seekable3.length) {
  79108. return false;
  79109. }
  79110. const expired = this.syncController_.getExpiredTime(playlist, this.duration());
  79111. if (expired === null) {
  79112. return false;
  79113. }
  79114. const absolutePlaylistEnd = Vhs$1$1.Playlist.playlistEnd(playlist, expired);
  79115. const currentTime = this.tech_.currentTime();
  79116. const buffered = this.tech_.buffered();
  79117. if (!buffered.length) {
  79118. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA$1;
  79119. }
  79120. const bufferedEnd = buffered.end(buffered.length - 1);
  79121. return bufferedEnd - currentTime <= SAFE_TIME_DELTA$1 && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA$1;
  79122. }
  79123. excludePlaylist({
  79124. playlistToExclude = this.mainPlaylistLoader_.media(),
  79125. error = {},
  79126. playlistExclusionDuration
  79127. }) {
  79128. playlistToExclude = playlistToExclude || this.mainPlaylistLoader_.media();
  79129. playlistExclusionDuration = playlistExclusionDuration || error.playlistExclusionDuration || this.playlistExclusionDuration;
  79130. if (!playlistToExclude) {
  79131. this.error = error;
  79132. if (this.mediaSource.readyState !== "open") {
  79133. this.trigger("error");
  79134. } else {
  79135. this.sourceUpdater_.endOfStream("network");
  79136. }
  79137. return;
  79138. }
  79139. playlistToExclude.playlistErrors_++;
  79140. const playlists = this.mainPlaylistLoader_.main.playlists;
  79141. const enabledPlaylists = playlists.filter(isEnabled$1);
  79142. const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude;
  79143. if (playlists.length === 1 && playlistExclusionDuration !== Infinity) {
  79144. videojs$2.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. Trying again since it is the only playlist.`);
  79145. this.tech_.trigger("retryplaylist");
  79146. return this.mainPlaylistLoader_.load(isFinalRendition);
  79147. }
  79148. if (isFinalRendition) {
  79149. let reincluded = false;
  79150. playlists.forEach((playlist) => {
  79151. if (playlist === playlistToExclude) {
  79152. return;
  79153. }
  79154. const excludeUntil2 = playlist.excludeUntil;
  79155. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  79156. reincluded = true;
  79157. delete playlist.excludeUntil;
  79158. }
  79159. });
  79160. if (reincluded) {
  79161. videojs$2.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  79162. this.tech_.trigger("retryplaylist");
  79163. }
  79164. }
  79165. let excludeUntil;
  79166. if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) {
  79167. excludeUntil = Infinity;
  79168. } else {
  79169. excludeUntil = Date.now() + playlistExclusionDuration * 1e3;
  79170. }
  79171. playlistToExclude.excludeUntil = excludeUntil;
  79172. if (error.reason) {
  79173. playlistToExclude.lastExcludeReason_ = error.reason;
  79174. }
  79175. this.tech_.trigger("excludeplaylist");
  79176. this.tech_.trigger({
  79177. type: "usage",
  79178. name: "vhs-rendition-excluded"
  79179. });
  79180. const nextPlaylist = this.selectPlaylist();
  79181. if (!nextPlaylist) {
  79182. this.error = "Playback cannot continue. No available working or supported playlists.";
  79183. this.trigger("error");
  79184. return;
  79185. }
  79186. const logFn2 = error.internal ? this.logger_ : videojs$2.log.warn;
  79187. const errorMessage = error.message ? " " + error.message : "";
  79188. logFn2(`${error.internal ? "Internal problem" : "Problem"} encountered with playlist ${playlistToExclude.id}.${errorMessage} Switching to playlist ${nextPlaylist.id}.`);
  79189. if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) {
  79190. this.delegateLoaders_("audio", ["abort", "pause"]);
  79191. }
  79192. if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) {
  79193. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  79194. }
  79195. this.delegateLoaders_("main", ["abort", "pause"]);
  79196. const delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  79197. const shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  79198. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  79199. }
  79200. pauseLoading() {
  79201. this.delegateLoaders_("all", ["abort", "pause"]);
  79202. this.stopABRTimer_();
  79203. }
  79204. delegateLoaders_(filter, fnNames) {
  79205. const loaders = [];
  79206. const dontFilterPlaylist = filter === "all";
  79207. if (dontFilterPlaylist || filter === "main") {
  79208. loaders.push(this.mainPlaylistLoader_);
  79209. }
  79210. const mediaTypes2 = [];
  79211. if (dontFilterPlaylist || filter === "audio") {
  79212. mediaTypes2.push("AUDIO");
  79213. }
  79214. if (dontFilterPlaylist || filter === "subtitle") {
  79215. mediaTypes2.push("CLOSED-CAPTIONS");
  79216. mediaTypes2.push("SUBTITLES");
  79217. }
  79218. mediaTypes2.forEach((mediaType) => {
  79219. const loader = this.mediaTypes_[mediaType] && this.mediaTypes_[mediaType].activePlaylistLoader;
  79220. if (loader) {
  79221. loaders.push(loader);
  79222. }
  79223. });
  79224. ["main", "audio", "subtitle"].forEach((name) => {
  79225. const loader = this[`${name}SegmentLoader_`];
  79226. if (loader && (filter === name || filter === "all")) {
  79227. loaders.push(loader);
  79228. }
  79229. });
  79230. loaders.forEach((loader) => fnNames.forEach((fnName) => {
  79231. if (typeof loader[fnName] === "function") {
  79232. loader[fnName]();
  79233. }
  79234. }));
  79235. }
  79236. setCurrentTime(currentTime) {
  79237. const buffered = findRange$1(this.tech_.buffered(), currentTime);
  79238. if (!(this.mainPlaylistLoader_ && this.mainPlaylistLoader_.media())) {
  79239. return 0;
  79240. }
  79241. if (!this.mainPlaylistLoader_.media().segments) {
  79242. return 0;
  79243. }
  79244. if (buffered && buffered.length) {
  79245. return currentTime;
  79246. }
  79247. this.mainSegmentLoader_.resetEverything();
  79248. this.mainSegmentLoader_.abort();
  79249. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79250. this.audioSegmentLoader_.resetEverything();
  79251. this.audioSegmentLoader_.abort();
  79252. }
  79253. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  79254. this.subtitleSegmentLoader_.resetEverything();
  79255. this.subtitleSegmentLoader_.abort();
  79256. }
  79257. this.load();
  79258. }
  79259. duration() {
  79260. if (!this.mainPlaylistLoader_) {
  79261. return 0;
  79262. }
  79263. const media = this.mainPlaylistLoader_.media();
  79264. if (!media) {
  79265. return 0;
  79266. }
  79267. if (!media.endList) {
  79268. return Infinity;
  79269. }
  79270. if (this.mediaSource) {
  79271. return this.mediaSource.duration;
  79272. }
  79273. return Vhs$1$1.Playlist.duration(media);
  79274. }
  79275. seekable() {
  79276. return this.seekable_;
  79277. }
  79278. onSyncInfoUpdate_() {
  79279. let audioSeekable;
  79280. if (!this.mainPlaylistLoader_) {
  79281. return;
  79282. }
  79283. let media = this.mainPlaylistLoader_.media();
  79284. if (!media) {
  79285. return;
  79286. }
  79287. let expired = this.syncController_.getExpiredTime(media, this.duration());
  79288. if (expired === null) {
  79289. return;
  79290. }
  79291. const main = this.mainPlaylistLoader_.main;
  79292. const mainSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79293. if (mainSeekable.length === 0) {
  79294. return;
  79295. }
  79296. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79297. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  79298. expired = this.syncController_.getExpiredTime(media, this.duration());
  79299. if (expired === null) {
  79300. return;
  79301. }
  79302. audioSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79303. if (audioSeekable.length === 0) {
  79304. return;
  79305. }
  79306. }
  79307. let oldEnd;
  79308. let oldStart;
  79309. if (this.seekable_ && this.seekable_.length) {
  79310. oldEnd = this.seekable_.end(0);
  79311. oldStart = this.seekable_.start(0);
  79312. }
  79313. if (!audioSeekable) {
  79314. this.seekable_ = mainSeekable;
  79315. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  79316. this.seekable_ = mainSeekable;
  79317. } else {
  79318. this.seekable_ = createTimeRanges$2([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  79319. }
  79320. if (this.seekable_ && this.seekable_.length) {
  79321. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  79322. return;
  79323. }
  79324. }
  79325. this.logger_(`seekable updated [${printableRange$1(this.seekable_)}]`);
  79326. this.tech_.trigger("seekablechanged");
  79327. }
  79328. updateDuration(isLive) {
  79329. if (this.updateDuration_) {
  79330. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79331. this.updateDuration_ = null;
  79332. }
  79333. if (this.mediaSource.readyState !== "open") {
  79334. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  79335. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  79336. return;
  79337. }
  79338. if (isLive) {
  79339. const seekable3 = this.seekable();
  79340. if (!seekable3.length) {
  79341. return;
  79342. }
  79343. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  79344. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  79345. }
  79346. return;
  79347. }
  79348. const buffered = this.tech_.buffered();
  79349. let duration5 = Vhs$1$1.Playlist.duration(this.mainPlaylistLoader_.media());
  79350. if (buffered.length > 0) {
  79351. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  79352. }
  79353. if (this.mediaSource.duration !== duration5) {
  79354. this.sourceUpdater_.setDuration(duration5);
  79355. }
  79356. }
  79357. dispose() {
  79358. this.trigger("dispose");
  79359. this.decrypter_.terminate();
  79360. this.mainPlaylistLoader_.dispose();
  79361. this.mainSegmentLoader_.dispose();
  79362. if (this.loadOnPlay_) {
  79363. this.tech_.off("play", this.loadOnPlay_);
  79364. }
  79365. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  79366. const groups = this.mediaTypes_[type2].groups;
  79367. for (const id in groups) {
  79368. groups[id].forEach((group) => {
  79369. if (group.playlistLoader) {
  79370. group.playlistLoader.dispose();
  79371. }
  79372. });
  79373. }
  79374. });
  79375. this.audioSegmentLoader_.dispose();
  79376. this.subtitleSegmentLoader_.dispose();
  79377. this.sourceUpdater_.dispose();
  79378. this.timelineChangeController_.dispose();
  79379. this.stopABRTimer_();
  79380. if (this.updateDuration_) {
  79381. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79382. }
  79383. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  79384. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  79385. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  79386. this.off();
  79387. }
  79388. main() {
  79389. return this.mainPlaylistLoader_.main;
  79390. }
  79391. media() {
  79392. return this.mainPlaylistLoader_.media() || this.initialMedia_;
  79393. }
  79394. areMediaTypesKnown_() {
  79395. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79396. const hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  79397. const hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  79398. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  79399. return false;
  79400. }
  79401. return true;
  79402. }
  79403. getCodecsOrExclude_() {
  79404. const media = {
  79405. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  79406. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  79407. };
  79408. const playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  79409. media.video = media.main;
  79410. const playlistCodecs = codecsForPlaylist$1(this.main(), playlist);
  79411. const codecs = {};
  79412. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79413. if (media.main.hasVideo) {
  79414. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC$1;
  79415. }
  79416. if (media.main.isMuxed) {
  79417. codecs.video += `,${playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC$1}`;
  79418. }
  79419. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  79420. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC$1;
  79421. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  79422. }
  79423. if (!codecs.audio && !codecs.video) {
  79424. this.excludePlaylist({
  79425. playlistToExclude: playlist,
  79426. error: {
  79427. message: "Could not determine codecs for playlist."
  79428. },
  79429. playlistExclusionDuration: Infinity
  79430. });
  79431. return;
  79432. }
  79433. const supportFunction = (isFmp4, codec) => isFmp4 ? browserSupportsCodec$1(codec) : muxerSupportsCodec$1(codec);
  79434. const unsupportedCodecs = {};
  79435. let unsupportedAudio;
  79436. ["video", "audio"].forEach(function(type2) {
  79437. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  79438. const supporter = media[type2].isFmp4 ? "browser" : "muxer";
  79439. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  79440. unsupportedCodecs[supporter].push(codecs[type2]);
  79441. if (type2 === "audio") {
  79442. unsupportedAudio = supporter;
  79443. }
  79444. }
  79445. });
  79446. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  79447. const audioGroup = playlist.attributes.AUDIO;
  79448. this.main().playlists.forEach((variant) => {
  79449. const variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  79450. if (variantAudioGroup === audioGroup && variant !== playlist) {
  79451. variant.excludeUntil = Infinity;
  79452. }
  79453. });
  79454. this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): "${codecs.audio}"`);
  79455. }
  79456. if (Object.keys(unsupportedCodecs).length) {
  79457. const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => {
  79458. if (acc) {
  79459. acc += ", ";
  79460. }
  79461. acc += `${supporter} does not support codec(s): "${unsupportedCodecs[supporter].join(",")}"`;
  79462. return acc;
  79463. }, "") + ".";
  79464. this.excludePlaylist({
  79465. playlistToExclude: playlist,
  79466. error: {
  79467. internal: true,
  79468. message
  79469. },
  79470. playlistExclusionDuration: Infinity
  79471. });
  79472. return;
  79473. }
  79474. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  79475. const switchMessages = [];
  79476. ["video", "audio"].forEach((type2) => {
  79477. const newCodec = (parseCodecs$1(this.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  79478. const oldCodec = (parseCodecs$1(codecs[type2] || "")[0] || {}).type;
  79479. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  79480. switchMessages.push(`"${this.sourceUpdater_.codecs[type2]}" -> "${codecs[type2]}"`);
  79481. }
  79482. });
  79483. if (switchMessages.length) {
  79484. this.excludePlaylist({
  79485. playlistToExclude: playlist,
  79486. error: {
  79487. message: `Codec switching not supported: ${switchMessages.join(", ")}.`,
  79488. internal: true
  79489. },
  79490. playlistExclusionDuration: Infinity
  79491. });
  79492. return;
  79493. }
  79494. }
  79495. return codecs;
  79496. }
  79497. tryToCreateSourceBuffers_() {
  79498. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  79499. return;
  79500. }
  79501. if (!this.areMediaTypesKnown_()) {
  79502. return;
  79503. }
  79504. const codecs = this.getCodecsOrExclude_();
  79505. if (!codecs) {
  79506. return;
  79507. }
  79508. this.sourceUpdater_.createSourceBuffers(codecs);
  79509. const codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  79510. this.excludeIncompatibleVariants_(codecString);
  79511. }
  79512. excludeUnsupportedVariants_() {
  79513. const playlists = this.main().playlists;
  79514. const ids = [];
  79515. Object.keys(playlists).forEach((key) => {
  79516. const variant = playlists[key];
  79517. if (ids.indexOf(variant.id) !== -1) {
  79518. return;
  79519. }
  79520. ids.push(variant.id);
  79521. const codecs = codecsForPlaylist$1(this.main, variant);
  79522. const unsupported = [];
  79523. if (codecs.audio && !muxerSupportsCodec$1(codecs.audio) && !browserSupportsCodec$1(codecs.audio)) {
  79524. unsupported.push(`audio codec ${codecs.audio}`);
  79525. }
  79526. if (codecs.video && !muxerSupportsCodec$1(codecs.video) && !browserSupportsCodec$1(codecs.video)) {
  79527. unsupported.push(`video codec ${codecs.video}`);
  79528. }
  79529. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  79530. unsupported.push(`text codec ${codecs.text}`);
  79531. }
  79532. if (unsupported.length) {
  79533. variant.excludeUntil = Infinity;
  79534. this.logger_(`excluding ${variant.id} for unsupported: ${unsupported.join(", ")}`);
  79535. }
  79536. });
  79537. }
  79538. excludeIncompatibleVariants_(codecString) {
  79539. const ids = [];
  79540. const playlists = this.main().playlists;
  79541. const codecs = unwrapCodecList$1(parseCodecs$1(codecString));
  79542. const codecCount_ = codecCount$1(codecs);
  79543. const videoDetails = codecs.video && parseCodecs$1(codecs.video)[0] || null;
  79544. const audioDetails = codecs.audio && parseCodecs$1(codecs.audio)[0] || null;
  79545. Object.keys(playlists).forEach((key) => {
  79546. const variant = playlists[key];
  79547. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  79548. return;
  79549. }
  79550. ids.push(variant.id);
  79551. const exclusionReasons = [];
  79552. const variantCodecs = codecsForPlaylist$1(this.mainPlaylistLoader_.main, variant);
  79553. const variantCodecCount = codecCount$1(variantCodecs);
  79554. if (!variantCodecs.audio && !variantCodecs.video) {
  79555. return;
  79556. }
  79557. if (variantCodecCount !== codecCount_) {
  79558. exclusionReasons.push(`codec count "${variantCodecCount}" !== "${codecCount_}"`);
  79559. }
  79560. if (!this.sourceUpdater_.canChangeType()) {
  79561. const variantVideoDetails = variantCodecs.video && parseCodecs$1(variantCodecs.video)[0] || null;
  79562. const variantAudioDetails = variantCodecs.audio && parseCodecs$1(variantCodecs.audio)[0] || null;
  79563. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  79564. exclusionReasons.push(`video codec "${variantVideoDetails.type}" !== "${videoDetails.type}"`);
  79565. }
  79566. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  79567. exclusionReasons.push(`audio codec "${variantAudioDetails.type}" !== "${audioDetails.type}"`);
  79568. }
  79569. }
  79570. if (exclusionReasons.length) {
  79571. variant.excludeUntil = Infinity;
  79572. this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(" && ")}`);
  79573. }
  79574. });
  79575. }
  79576. updateAdCues_(media) {
  79577. let offset = 0;
  79578. const seekable3 = this.seekable();
  79579. if (seekable3.length) {
  79580. offset = seekable3.start(0);
  79581. }
  79582. updateAdCues$1(media, this.cueTagsTrack_, offset);
  79583. }
  79584. goalBufferLength() {
  79585. const currentTime = this.tech_.currentTime();
  79586. const initial = Config$1.GOAL_BUFFER_LENGTH;
  79587. const rate = Config$1.GOAL_BUFFER_LENGTH_RATE;
  79588. const max2 = Math.max(initial, Config$1.MAX_GOAL_BUFFER_LENGTH);
  79589. return Math.min(initial + currentTime * rate, max2);
  79590. }
  79591. bufferLowWaterLine() {
  79592. const currentTime = this.tech_.currentTime();
  79593. const initial = Config$1.BUFFER_LOW_WATER_LINE;
  79594. const rate = Config$1.BUFFER_LOW_WATER_LINE_RATE;
  79595. const max2 = Math.max(initial, Config$1.MAX_BUFFER_LOW_WATER_LINE);
  79596. const newMax = Math.max(initial, Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  79597. return Math.min(initial + currentTime * rate, this.bufferBasedABR ? newMax : max2);
  79598. }
  79599. bufferHighWaterLine() {
  79600. return Config$1.BUFFER_HIGH_WATER_LINE;
  79601. }
  79602. }
  79603. const enableFunction$1 = (loader, playlistID, changePlaylistFn) => (enable) => {
  79604. const playlist = loader.main.playlists[playlistID];
  79605. const incompatible = isIncompatible$1(playlist);
  79606. const currentlyEnabled = isEnabled$1(playlist);
  79607. if (typeof enable === "undefined") {
  79608. return currentlyEnabled;
  79609. }
  79610. if (enable) {
  79611. delete playlist.disabled;
  79612. } else {
  79613. playlist.disabled = true;
  79614. }
  79615. if (enable !== currentlyEnabled && !incompatible) {
  79616. changePlaylistFn();
  79617. if (enable) {
  79618. loader.trigger("renditionenabled");
  79619. } else {
  79620. loader.trigger("renditiondisabled");
  79621. }
  79622. }
  79623. return enable;
  79624. };
  79625. class Representation$1 {
  79626. constructor(vhsHandler, playlist, id) {
  79627. const {
  79628. playlistController_: pc
  79629. } = vhsHandler;
  79630. const qualityChangeFunction = pc.fastQualityChange_.bind(pc);
  79631. if (playlist.attributes) {
  79632. const resolution = playlist.attributes.RESOLUTION;
  79633. this.width = resolution && resolution.width;
  79634. this.height = resolution && resolution.height;
  79635. this.bandwidth = playlist.attributes.BANDWIDTH;
  79636. this.frameRate = playlist.attributes["FRAME-RATE"];
  79637. }
  79638. this.codecs = codecsForPlaylist$1(pc.main(), playlist);
  79639. this.playlist = playlist;
  79640. this.id = id;
  79641. this.enabled = enableFunction$1(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  79642. }
  79643. }
  79644. const renditionSelectionMixin$1 = function(vhsHandler) {
  79645. vhsHandler.representations = () => {
  79646. const main = vhsHandler.playlistController_.main();
  79647. const playlists = isAudioOnly$1(main) ? vhsHandler.playlistController_.getAudioTrackPlaylists_() : main.playlists;
  79648. if (!playlists) {
  79649. return [];
  79650. }
  79651. return playlists.filter((media) => !isIncompatible$1(media)).map((e, i2) => new Representation$1(vhsHandler, e, e.id));
  79652. };
  79653. };
  79654. const timerCancelEvents$1 = ["seeking", "seeked", "pause", "playing", "error"];
  79655. class PlaybackWatcher$1 {
  79656. constructor(options2) {
  79657. this.playlistController_ = options2.playlistController;
  79658. this.tech_ = options2.tech;
  79659. this.seekable = options2.seekable;
  79660. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  79661. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  79662. this.media = options2.media;
  79663. this.consecutiveUpdates = 0;
  79664. this.lastRecordedTime = null;
  79665. this.checkCurrentTimeTimeout_ = null;
  79666. this.logger_ = logger$1("PlaybackWatcher");
  79667. this.logger_("initialize");
  79668. const playHandler = () => this.monitorCurrentTime_();
  79669. const canPlayHandler = () => this.monitorCurrentTime_();
  79670. const waitingHandler = () => this.techWaiting_();
  79671. const cancelTimerHandler = () => this.resetTimeUpdate_();
  79672. const pc = this.playlistController_;
  79673. const loaderTypes = ["main", "subtitle", "audio"];
  79674. const loaderChecks = {};
  79675. loaderTypes.forEach((type2) => {
  79676. loaderChecks[type2] = {
  79677. reset: () => this.resetSegmentDownloads_(type2),
  79678. updateend: () => this.checkSegmentDownloads_(type2)
  79679. };
  79680. pc[`${type2}SegmentLoader_`].on("appendsdone", loaderChecks[type2].updateend);
  79681. pc[`${type2}SegmentLoader_`].on("playlistupdate", loaderChecks[type2].reset);
  79682. this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  79683. });
  79684. const setSeekingHandlers = (fn2) => {
  79685. ["main", "audio"].forEach((type2) => {
  79686. pc[`${type2}SegmentLoader_`][fn2]("appended", this.seekingAppendCheck_);
  79687. });
  79688. };
  79689. this.seekingAppendCheck_ = () => {
  79690. if (this.fixesBadSeeks_()) {
  79691. this.consecutiveUpdates = 0;
  79692. this.lastRecordedTime = this.tech_.currentTime();
  79693. setSeekingHandlers("off");
  79694. }
  79695. };
  79696. this.clearSeekingAppendCheck_ = () => setSeekingHandlers("off");
  79697. this.watchForBadSeeking_ = () => {
  79698. this.clearSeekingAppendCheck_();
  79699. setSeekingHandlers("on");
  79700. };
  79701. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  79702. this.tech_.on("seeking", this.watchForBadSeeking_);
  79703. this.tech_.on("waiting", waitingHandler);
  79704. this.tech_.on(timerCancelEvents$1, cancelTimerHandler);
  79705. this.tech_.on("canplay", canPlayHandler);
  79706. this.tech_.one("play", playHandler);
  79707. this.dispose = () => {
  79708. this.clearSeekingAppendCheck_();
  79709. this.logger_("dispose");
  79710. this.tech_.off("waiting", waitingHandler);
  79711. this.tech_.off(timerCancelEvents$1, cancelTimerHandler);
  79712. this.tech_.off("canplay", canPlayHandler);
  79713. this.tech_.off("play", playHandler);
  79714. this.tech_.off("seeking", this.watchForBadSeeking_);
  79715. this.tech_.off("seeked", this.clearSeekingAppendCheck_);
  79716. loaderTypes.forEach((type2) => {
  79717. pc[`${type2}SegmentLoader_`].off("appendsdone", loaderChecks[type2].updateend);
  79718. pc[`${type2}SegmentLoader_`].off("playlistupdate", loaderChecks[type2].reset);
  79719. this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  79720. });
  79721. if (this.checkCurrentTimeTimeout_) {
  79722. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79723. }
  79724. this.resetTimeUpdate_();
  79725. };
  79726. }
  79727. monitorCurrentTime_() {
  79728. this.checkCurrentTime_();
  79729. if (this.checkCurrentTimeTimeout_) {
  79730. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79731. }
  79732. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  79733. }
  79734. resetSegmentDownloads_(type2) {
  79735. const loader = this.playlistController_[`${type2}SegmentLoader_`];
  79736. if (this[`${type2}StalledDownloads_`] > 0) {
  79737. this.logger_(`resetting possible stalled download count for ${type2} loader`);
  79738. }
  79739. this[`${type2}StalledDownloads_`] = 0;
  79740. this[`${type2}Buffered_`] = loader.buffered_();
  79741. }
  79742. checkSegmentDownloads_(type2) {
  79743. const pc = this.playlistController_;
  79744. const loader = pc[`${type2}SegmentLoader_`];
  79745. const buffered = loader.buffered_();
  79746. const isBufferedDifferent = isRangeDifferent$1(this[`${type2}Buffered_`], buffered);
  79747. this[`${type2}Buffered_`] = buffered;
  79748. if (isBufferedDifferent) {
  79749. this.resetSegmentDownloads_(type2);
  79750. return;
  79751. }
  79752. this[`${type2}StalledDownloads_`]++;
  79753. this.logger_(`found #${this[`${type2}StalledDownloads_`]} ${type2} appends that did not increase buffer (possible stalled download)`, {
  79754. playlistId: loader.playlist_ && loader.playlist_.id,
  79755. buffered: timeRangesToArray$1(buffered)
  79756. });
  79757. if (this[`${type2}StalledDownloads_`] < 10) {
  79758. return;
  79759. }
  79760. this.logger_(`${type2} loader stalled download exclusion`);
  79761. this.resetSegmentDownloads_(type2);
  79762. this.tech_.trigger({
  79763. type: "usage",
  79764. name: `vhs-${type2}-download-exclusion`
  79765. });
  79766. if (type2 === "subtitle") {
  79767. return;
  79768. }
  79769. pc.excludePlaylist({
  79770. error: {
  79771. message: `Excessive ${type2} segment downloading detected.`
  79772. },
  79773. playlistExclusionDuration: Infinity
  79774. });
  79775. }
  79776. checkCurrentTime_() {
  79777. if (this.tech_.paused() || this.tech_.seeking()) {
  79778. return;
  79779. }
  79780. const currentTime = this.tech_.currentTime();
  79781. const buffered = this.tech_.buffered();
  79782. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA$1 >= buffered.end(buffered.length - 1))) {
  79783. return this.techWaiting_();
  79784. }
  79785. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  79786. this.consecutiveUpdates++;
  79787. this.waiting_();
  79788. } else if (currentTime === this.lastRecordedTime) {
  79789. this.consecutiveUpdates++;
  79790. } else {
  79791. this.consecutiveUpdates = 0;
  79792. this.lastRecordedTime = currentTime;
  79793. }
  79794. }
  79795. resetTimeUpdate_() {
  79796. this.consecutiveUpdates = 0;
  79797. }
  79798. fixesBadSeeks_() {
  79799. const seeking = this.tech_.seeking();
  79800. if (!seeking) {
  79801. return false;
  79802. }
  79803. const seekable3 = this.seekable();
  79804. const currentTime = this.tech_.currentTime();
  79805. const isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  79806. let seekTo;
  79807. if (isAfterSeekableRange) {
  79808. const seekableEnd = seekable3.end(seekable3.length - 1);
  79809. seekTo = seekableEnd;
  79810. }
  79811. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79812. const seekableStart = seekable3.start(0);
  79813. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA$1);
  79814. }
  79815. if (typeof seekTo !== "undefined") {
  79816. this.logger_(`Trying to seek outside of seekable at time ${currentTime} with seekable range ${printableRange$1(seekable3)}. Seeking to ${seekTo}.`);
  79817. this.tech_.setCurrentTime(seekTo);
  79818. return true;
  79819. }
  79820. const sourceUpdater = this.playlistController_.sourceUpdater_;
  79821. const buffered = this.tech_.buffered();
  79822. const audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  79823. const videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  79824. const media = this.media();
  79825. const minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR$1) * 2;
  79826. const bufferedToCheck = [audioBuffered, videoBuffered];
  79827. for (let i2 = 0; i2 < bufferedToCheck.length; i2++) {
  79828. if (!bufferedToCheck[i2]) {
  79829. continue;
  79830. }
  79831. const timeAhead = timeAheadOf$1(bufferedToCheck[i2], currentTime);
  79832. if (timeAhead < minAppendedDuration) {
  79833. return false;
  79834. }
  79835. }
  79836. const nextRange = findNextRange$1(buffered, currentTime);
  79837. if (nextRange.length === 0) {
  79838. return false;
  79839. }
  79840. seekTo = nextRange.start(0) + SAFE_TIME_DELTA$1;
  79841. this.logger_(`Buffered region starts (${nextRange.start(0)}) just beyond seek point (${currentTime}). Seeking to ${seekTo}.`);
  79842. this.tech_.setCurrentTime(seekTo);
  79843. return true;
  79844. }
  79845. waiting_() {
  79846. if (this.techWaiting_()) {
  79847. return;
  79848. }
  79849. const currentTime = this.tech_.currentTime();
  79850. const buffered = this.tech_.buffered();
  79851. const currentRange = findRange$1(buffered, currentTime);
  79852. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  79853. this.resetTimeUpdate_();
  79854. this.tech_.setCurrentTime(currentTime);
  79855. this.logger_(`Stopped at ${currentTime} while inside a buffered region [${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume playback by seeking to the current time.`);
  79856. this.tech_.trigger({
  79857. type: "usage",
  79858. name: "vhs-unknown-waiting"
  79859. });
  79860. return;
  79861. }
  79862. }
  79863. techWaiting_() {
  79864. const seekable3 = this.seekable();
  79865. const currentTime = this.tech_.currentTime();
  79866. if (this.tech_.seeking()) {
  79867. return true;
  79868. }
  79869. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79870. const livePoint = seekable3.end(seekable3.length - 1);
  79871. this.logger_(`Fell out of live window at time ${currentTime}. Seeking to live point (seekable end) ${livePoint}`);
  79872. this.resetTimeUpdate_();
  79873. this.tech_.setCurrentTime(livePoint);
  79874. this.tech_.trigger({
  79875. type: "usage",
  79876. name: "vhs-live-resync"
  79877. });
  79878. return true;
  79879. }
  79880. const sourceUpdater = this.tech_.vhs.playlistController_.sourceUpdater_;
  79881. const buffered = this.tech_.buffered();
  79882. const videoUnderflow = this.videoUnderflow_({
  79883. audioBuffered: sourceUpdater.audioBuffered(),
  79884. videoBuffered: sourceUpdater.videoBuffered(),
  79885. currentTime
  79886. });
  79887. if (videoUnderflow) {
  79888. this.resetTimeUpdate_();
  79889. this.tech_.setCurrentTime(currentTime);
  79890. this.tech_.trigger({
  79891. type: "usage",
  79892. name: "vhs-video-underflow"
  79893. });
  79894. return true;
  79895. }
  79896. const nextRange = findNextRange$1(buffered, currentTime);
  79897. if (nextRange.length > 0) {
  79898. this.logger_(`Stopped at ${currentTime} and seeking to ${nextRange.start(0)}`);
  79899. this.resetTimeUpdate_();
  79900. this.skipTheGap_(currentTime);
  79901. return true;
  79902. }
  79903. return false;
  79904. }
  79905. afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow = false) {
  79906. if (!seekable3.length) {
  79907. return false;
  79908. }
  79909. let allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA$1;
  79910. const isLive = !playlist.endList;
  79911. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  79912. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  79913. }
  79914. if (currentTime > allowedEnd) {
  79915. return true;
  79916. }
  79917. return false;
  79918. }
  79919. beforeSeekableWindow_(seekable3, currentTime) {
  79920. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  79921. return true;
  79922. }
  79923. return false;
  79924. }
  79925. videoUnderflow_({
  79926. videoBuffered,
  79927. audioBuffered,
  79928. currentTime
  79929. }) {
  79930. if (!videoBuffered) {
  79931. return;
  79932. }
  79933. let gap;
  79934. if (videoBuffered.length && audioBuffered.length) {
  79935. const lastVideoRange = findRange$1(videoBuffered, currentTime - 3);
  79936. const videoRange = findRange$1(videoBuffered, currentTime);
  79937. const audioRange = findRange$1(audioBuffered, currentTime);
  79938. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  79939. gap = {
  79940. start: lastVideoRange.end(0),
  79941. end: audioRange.end(0)
  79942. };
  79943. }
  79944. } else {
  79945. const nextRange = findNextRange$1(videoBuffered, currentTime);
  79946. if (!nextRange.length) {
  79947. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  79948. }
  79949. }
  79950. if (gap) {
  79951. this.logger_(`Encountered a gap in video from ${gap.start} to ${gap.end}. Seeking to current time ${currentTime}`);
  79952. return true;
  79953. }
  79954. return false;
  79955. }
  79956. skipTheGap_(scheduledCurrentTime) {
  79957. const buffered = this.tech_.buffered();
  79958. const currentTime = this.tech_.currentTime();
  79959. const nextRange = findNextRange$1(buffered, currentTime);
  79960. this.resetTimeUpdate_();
  79961. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  79962. return;
  79963. }
  79964. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  79965. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR$1);
  79966. this.tech_.trigger({
  79967. type: "usage",
  79968. name: "vhs-gap-skip"
  79969. });
  79970. }
  79971. gapFromVideoUnderflow_(buffered, currentTime) {
  79972. const gaps = findGaps$1(buffered);
  79973. for (let i2 = 0; i2 < gaps.length; i2++) {
  79974. const start2 = gaps.start(i2);
  79975. const end = gaps.end(i2);
  79976. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  79977. return {
  79978. start: start2,
  79979. end
  79980. };
  79981. }
  79982. }
  79983. return null;
  79984. }
  79985. }
  79986. const defaultOptions$1 = {
  79987. errorInterval: 30,
  79988. getSource(next) {
  79989. const tech = this.tech({
  79990. IWillNotUseThisInPlugins: true
  79991. });
  79992. const sourceObj = tech.currentSource_ || this.currentSource();
  79993. return next(sourceObj);
  79994. }
  79995. };
  79996. const initPlugin$2 = function(player, options2) {
  79997. let lastCalled = 0;
  79998. let seekTo = 0;
  79999. const localOptions = merge$2(defaultOptions$1, options2);
  80000. player.ready(() => {
  80001. player.trigger({
  80002. type: "usage",
  80003. name: "vhs-error-reload-initialized"
  80004. });
  80005. });
  80006. const loadedMetadataHandler = function() {
  80007. if (seekTo) {
  80008. player.currentTime(seekTo);
  80009. }
  80010. };
  80011. const setSource2 = function(sourceObj) {
  80012. if (sourceObj === null || sourceObj === void 0) {
  80013. return;
  80014. }
  80015. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  80016. player.one("loadedmetadata", loadedMetadataHandler);
  80017. player.src(sourceObj);
  80018. player.trigger({
  80019. type: "usage",
  80020. name: "vhs-error-reload"
  80021. });
  80022. player.play();
  80023. };
  80024. const errorHandler = function() {
  80025. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  80026. player.trigger({
  80027. type: "usage",
  80028. name: "vhs-error-reload-canceled"
  80029. });
  80030. return;
  80031. }
  80032. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  80033. videojs$2.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  80034. return;
  80035. }
  80036. lastCalled = Date.now();
  80037. return localOptions.getSource.call(player, setSource2);
  80038. };
  80039. const cleanupEvents = function() {
  80040. player.off("loadedmetadata", loadedMetadataHandler);
  80041. player.off("error", errorHandler);
  80042. player.off("dispose", cleanupEvents);
  80043. };
  80044. const reinitPlugin = function(newOptions) {
  80045. cleanupEvents();
  80046. initPlugin$2(player, newOptions);
  80047. };
  80048. player.on("error", errorHandler);
  80049. player.on("dispose", cleanupEvents);
  80050. player.reloadSourceOnError = reinitPlugin;
  80051. };
  80052. const reloadSourceOnError$1 = function(options2) {
  80053. initPlugin$2(this, options2);
  80054. };
  80055. var version$4$1 = "3.0.2";
  80056. var version$3$1 = "6.3.0";
  80057. var version$2$1 = "1.0.1";
  80058. var version$1$2 = "6.0.0";
  80059. var version$7 = "4.0.1";
  80060. const Vhs$2 = {
  80061. PlaylistLoader: PlaylistLoader$1,
  80062. Playlist: Playlist$1,
  80063. utils: utils$1,
  80064. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector$1,
  80065. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector$1,
  80066. lastBandwidthSelector: lastBandwidthSelector$1,
  80067. movingAverageBandwidthSelector: movingAverageBandwidthSelector$1,
  80068. comparePlaylistBandwidth: comparePlaylistBandwidth$1,
  80069. comparePlaylistResolution: comparePlaylistResolution$1,
  80070. xhr: xhrFactory$1()
  80071. };
  80072. Object.keys(Config$1).forEach((prop) => {
  80073. Object.defineProperty(Vhs$2, prop, {
  80074. get() {
  80075. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80076. return Config$1[prop];
  80077. },
  80078. set(value) {
  80079. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80080. if (typeof value !== "number" || value < 0) {
  80081. videojs$2.log.warn(`value of Vhs.${prop} must be greater than or equal to 0`);
  80082. return;
  80083. }
  80084. Config$1[prop] = value;
  80085. }
  80086. });
  80087. });
  80088. const LOCAL_STORAGE_KEY$2 = "videojs-vhs";
  80089. const handleVhsMediaChange$1 = function(qualityLevels2, playlistLoader) {
  80090. const newPlaylist = playlistLoader.media();
  80091. let selectedIndex = -1;
  80092. for (let i2 = 0; i2 < qualityLevels2.length; i2++) {
  80093. if (qualityLevels2[i2].id === newPlaylist.id) {
  80094. selectedIndex = i2;
  80095. break;
  80096. }
  80097. }
  80098. qualityLevels2.selectedIndex_ = selectedIndex;
  80099. qualityLevels2.trigger({
  80100. selectedIndex,
  80101. type: "change"
  80102. });
  80103. };
  80104. const handleVhsLoadedMetadata$1 = function(qualityLevels2, vhs) {
  80105. vhs.representations().forEach((rep2) => {
  80106. qualityLevels2.addQualityLevel(rep2);
  80107. });
  80108. handleVhsMediaChange$1(qualityLevels2, vhs.playlists);
  80109. };
  80110. Vhs$2.canPlaySource = function() {
  80111. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80112. };
  80113. const emeKeySystems$1 = (keySystemOptions, mainPlaylist, audioPlaylist) => {
  80114. if (!keySystemOptions) {
  80115. return keySystemOptions;
  80116. }
  80117. let codecs = {};
  80118. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  80119. codecs = unwrapCodecList$1(parseCodecs$1(mainPlaylist.attributes.CODECS));
  80120. }
  80121. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  80122. codecs.audio = audioPlaylist.attributes.CODECS;
  80123. }
  80124. const videoContentType = getMimeForCodec$1(codecs.video);
  80125. const audioContentType = getMimeForCodec$1(codecs.audio);
  80126. const keySystemContentTypes = {};
  80127. for (const keySystem in keySystemOptions) {
  80128. keySystemContentTypes[keySystem] = {};
  80129. if (audioContentType) {
  80130. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  80131. }
  80132. if (videoContentType) {
  80133. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  80134. }
  80135. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  80136. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  80137. }
  80138. if (typeof keySystemOptions[keySystem] === "string") {
  80139. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  80140. }
  80141. }
  80142. return merge$2(keySystemOptions, keySystemContentTypes);
  80143. };
  80144. const getAllPsshKeySystemsOptions$1 = (playlists, keySystems) => {
  80145. return playlists.reduce((keySystemsArr, playlist) => {
  80146. if (!playlist.contentProtection) {
  80147. return keySystemsArr;
  80148. }
  80149. const keySystemsOptions = keySystems.reduce((keySystemsObj, keySystem) => {
  80150. const keySystemOptions = playlist.contentProtection[keySystem];
  80151. if (keySystemOptions && keySystemOptions.pssh) {
  80152. keySystemsObj[keySystem] = {
  80153. pssh: keySystemOptions.pssh
  80154. };
  80155. }
  80156. return keySystemsObj;
  80157. }, {});
  80158. if (Object.keys(keySystemsOptions).length) {
  80159. keySystemsArr.push(keySystemsOptions);
  80160. }
  80161. return keySystemsArr;
  80162. }, []);
  80163. };
  80164. const waitForKeySessionCreation$1 = ({
  80165. player,
  80166. sourceKeySystems,
  80167. audioMedia,
  80168. mainPlaylists
  80169. }) => {
  80170. if (!player.eme.initializeMediaKeys) {
  80171. return Promise.resolve();
  80172. }
  80173. const playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  80174. const keySystemsOptionsArr = getAllPsshKeySystemsOptions$1(playlists, Object.keys(sourceKeySystems));
  80175. const initializationFinishedPromises = [];
  80176. const keySessionCreatedPromises = [];
  80177. keySystemsOptionsArr.forEach((keySystemsOptions) => {
  80178. keySessionCreatedPromises.push(new Promise((resolve2, reject2) => {
  80179. player.tech_.one("keysessioncreated", resolve2);
  80180. }));
  80181. initializationFinishedPromises.push(new Promise((resolve2, reject2) => {
  80182. player.eme.initializeMediaKeys({
  80183. keySystems: keySystemsOptions
  80184. }, (err) => {
  80185. if (err) {
  80186. reject2(err);
  80187. return;
  80188. }
  80189. resolve2();
  80190. });
  80191. }));
  80192. });
  80193. return Promise.race([
  80194. Promise.all(initializationFinishedPromises),
  80195. Promise.race(keySessionCreatedPromises)
  80196. ]);
  80197. };
  80198. const setupEmeOptions$1 = ({
  80199. player,
  80200. sourceKeySystems,
  80201. media,
  80202. audioMedia
  80203. }) => {
  80204. const sourceOptions = emeKeySystems$1(sourceKeySystems, media, audioMedia);
  80205. if (!sourceOptions) {
  80206. return false;
  80207. }
  80208. player.currentSource().keySystems = sourceOptions;
  80209. if (sourceOptions && !player.eme) {
  80210. videojs$2.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  80211. return false;
  80212. }
  80213. return true;
  80214. };
  80215. const getVhsLocalStorage$1 = () => {
  80216. if (!window_1.localStorage) {
  80217. return null;
  80218. }
  80219. const storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY$2);
  80220. if (!storedObject) {
  80221. return null;
  80222. }
  80223. try {
  80224. return JSON.parse(storedObject);
  80225. } catch (e) {
  80226. return null;
  80227. }
  80228. };
  80229. const updateVhsLocalStorage$1 = (options2) => {
  80230. if (!window_1.localStorage) {
  80231. return false;
  80232. }
  80233. let objectToStore = getVhsLocalStorage$1();
  80234. objectToStore = objectToStore ? merge$2(objectToStore, options2) : options2;
  80235. try {
  80236. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$2, JSON.stringify(objectToStore));
  80237. } catch (e) {
  80238. return false;
  80239. }
  80240. return objectToStore;
  80241. };
  80242. const expandDataUri$1 = (dataUri) => {
  80243. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  80244. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  80245. }
  80246. return dataUri;
  80247. };
  80248. Vhs$2.supportsNativeHls = function() {
  80249. if (!document_1 || !document_1.createElement) {
  80250. return false;
  80251. }
  80252. const video = document_1.createElement("video");
  80253. if (!videojs$2.getTech("Html5").isSupported()) {
  80254. return false;
  80255. }
  80256. const canPlay = [
  80257. "application/vnd.apple.mpegurl",
  80258. "audio/mpegurl",
  80259. "audio/x-mpegurl",
  80260. "application/x-mpegurl",
  80261. "video/x-mpegurl",
  80262. "video/mpegurl",
  80263. "application/mpegurl"
  80264. ];
  80265. return canPlay.some(function(canItPlay) {
  80266. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  80267. });
  80268. }();
  80269. Vhs$2.supportsNativeDash = function() {
  80270. if (!document_1 || !document_1.createElement || !videojs$2.getTech("Html5").isSupported()) {
  80271. return false;
  80272. }
  80273. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  80274. }();
  80275. Vhs$2.supportsTypeNatively = (type2) => {
  80276. if (type2 === "hls") {
  80277. return Vhs$2.supportsNativeHls;
  80278. }
  80279. if (type2 === "dash") {
  80280. return Vhs$2.supportsNativeDash;
  80281. }
  80282. return false;
  80283. };
  80284. Vhs$2.isSupported = function() {
  80285. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80286. };
  80287. const Component$2 = videojs$2.getComponent("Component");
  80288. class VhsHandler$1 extends Component$2 {
  80289. constructor(source, tech, options2) {
  80290. super(tech, options2.vhs);
  80291. if (typeof options2.initialBandwidth === "number") {
  80292. this.options_.bandwidth = options2.initialBandwidth;
  80293. }
  80294. this.logger_ = logger$1("VhsHandler");
  80295. if (tech.options_ && tech.options_.playerId) {
  80296. const _player = videojs$2.getPlayer(tech.options_.playerId);
  80297. this.player_ = _player;
  80298. }
  80299. this.tech_ = tech;
  80300. this.source_ = source;
  80301. this.stats = {};
  80302. this.ignoreNextSeekingEvent_ = false;
  80303. this.setOptions_();
  80304. if (this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  80305. tech.overrideNativeAudioTracks(true);
  80306. tech.overrideNativeVideoTracks(true);
  80307. } else if (this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  80308. throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");
  80309. }
  80310. this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], (event2) => {
  80311. const fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  80312. if (fullscreenElement && fullscreenElement.contains(this.tech_.el())) {
  80313. this.playlistController_.fastQualityChange_();
  80314. } else {
  80315. this.playlistController_.checkABR_();
  80316. }
  80317. });
  80318. this.on(this.tech_, "seeking", function() {
  80319. if (this.ignoreNextSeekingEvent_) {
  80320. this.ignoreNextSeekingEvent_ = false;
  80321. return;
  80322. }
  80323. this.setCurrentTime(this.tech_.currentTime());
  80324. });
  80325. this.on(this.tech_, "error", function() {
  80326. if (this.tech_.error() && this.playlistController_) {
  80327. this.playlistController_.pauseLoading();
  80328. }
  80329. });
  80330. this.on(this.tech_, "play", this.play);
  80331. }
  80332. setOptions_() {
  80333. this.options_.withCredentials = this.options_.withCredentials || false;
  80334. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  80335. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  80336. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  80337. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  80338. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  80339. this.options_.customTagParsers = this.options_.customTagParsers || [];
  80340. this.options_.customTagMappers = this.options_.customTagMappers || [];
  80341. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  80342. this.options_.llhls = this.options_.llhls === false ? false : true;
  80343. this.options_.bufferBasedABR = this.options_.bufferBasedABR || false;
  80344. if (typeof this.options_.playlistExclusionDuration !== "number") {
  80345. this.options_.playlistExclusionDuration = 5 * 60;
  80346. }
  80347. if (typeof this.options_.bandwidth !== "number") {
  80348. if (this.options_.useBandwidthFromLocalStorage) {
  80349. const storedObject = getVhsLocalStorage$1();
  80350. if (storedObject && storedObject.bandwidth) {
  80351. this.options_.bandwidth = storedObject.bandwidth;
  80352. this.tech_.trigger({
  80353. type: "usage",
  80354. name: "vhs-bandwidth-from-local-storage"
  80355. });
  80356. }
  80357. if (storedObject && storedObject.throughput) {
  80358. this.options_.throughput = storedObject.throughput;
  80359. this.tech_.trigger({
  80360. type: "usage",
  80361. name: "vhs-throughput-from-local-storage"
  80362. });
  80363. }
  80364. }
  80365. }
  80366. if (typeof this.options_.bandwidth !== "number") {
  80367. this.options_.bandwidth = Config$1.INITIAL_BANDWIDTH;
  80368. }
  80369. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config$1.INITIAL_BANDWIDTH;
  80370. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "customTagParsers", "customTagMappers", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "bufferBasedABR", "liveRangeSafeTimeDelta", "llhls", "useNetworkInformationApi", "useDtsForTimestampOffset", "exactManifestTimings", "leastPixelDiffSelector"].forEach((option) => {
  80371. if (typeof this.source_[option] !== "undefined") {
  80372. this.options_[option] = this.source_[option];
  80373. }
  80374. });
  80375. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  80376. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  80377. }
  80378. src(src, type2) {
  80379. if (!src) {
  80380. return;
  80381. }
  80382. this.setOptions_();
  80383. this.options_.src = expandDataUri$1(this.source_.src);
  80384. this.options_.tech = this.tech_;
  80385. this.options_.externVhs = Vhs$2;
  80386. this.options_.sourceType = simpleTypeFromSourceType$1(type2);
  80387. this.options_.seekTo = (time) => {
  80388. this.tech_.setCurrentTime(time);
  80389. };
  80390. this.playlistController_ = new PlaylistController(this.options_);
  80391. const playbackWatcherOptions = merge$2({
  80392. liveRangeSafeTimeDelta: SAFE_TIME_DELTA$1
  80393. }, this.options_, {
  80394. seekable: () => this.seekable(),
  80395. media: () => this.playlistController_.media(),
  80396. playlistController: this.playlistController_
  80397. });
  80398. this.playbackWatcher_ = new PlaybackWatcher$1(playbackWatcherOptions);
  80399. this.playlistController_.on("error", () => {
  80400. const player = videojs$2.players[this.tech_.options_.playerId];
  80401. let error = this.playlistController_.error;
  80402. if (typeof error === "object" && !error.code) {
  80403. error.code = 3;
  80404. } else if (typeof error === "string") {
  80405. error = {
  80406. message: error,
  80407. code: 3
  80408. };
  80409. }
  80410. player.error(error);
  80411. });
  80412. const defaultSelector = this.options_.bufferBasedABR ? Vhs$2.movingAverageBandwidthSelector(0.55) : Vhs$2.STANDARD_PLAYLIST_SELECTOR;
  80413. this.playlistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  80414. this.playlistController_.selectInitialPlaylist = Vhs$2.INITIAL_PLAYLIST_SELECTOR.bind(this);
  80415. this.playlists = this.playlistController_.mainPlaylistLoader_;
  80416. this.mediaSource = this.playlistController_.mediaSource;
  80417. Object.defineProperties(this, {
  80418. selectPlaylist: {
  80419. get() {
  80420. return this.playlistController_.selectPlaylist;
  80421. },
  80422. set(selectPlaylist) {
  80423. this.playlistController_.selectPlaylist = selectPlaylist.bind(this);
  80424. }
  80425. },
  80426. throughput: {
  80427. get() {
  80428. return this.playlistController_.mainSegmentLoader_.throughput.rate;
  80429. },
  80430. set(throughput) {
  80431. this.playlistController_.mainSegmentLoader_.throughput.rate = throughput;
  80432. this.playlistController_.mainSegmentLoader_.throughput.count = 1;
  80433. }
  80434. },
  80435. bandwidth: {
  80436. get() {
  80437. let playerBandwidthEst = this.playlistController_.mainSegmentLoader_.bandwidth;
  80438. const networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  80439. const tenMbpsAsBitsPerSecond = 1e7;
  80440. if (this.options_.useNetworkInformationApi && networkInformation) {
  80441. const networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  80442. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  80443. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  80444. } else {
  80445. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  80446. }
  80447. }
  80448. return playerBandwidthEst;
  80449. },
  80450. set(bandwidth2) {
  80451. this.playlistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  80452. this.playlistController_.mainSegmentLoader_.throughput = {
  80453. rate: 0,
  80454. count: 0
  80455. };
  80456. }
  80457. },
  80458. systemBandwidth: {
  80459. get() {
  80460. const invBandwidth = 1 / (this.bandwidth || 1);
  80461. let invThroughput;
  80462. if (this.throughput > 0) {
  80463. invThroughput = 1 / this.throughput;
  80464. } else {
  80465. invThroughput = 0;
  80466. }
  80467. const systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  80468. return systemBitrate;
  80469. },
  80470. set() {
  80471. videojs$2.log.error('The "systemBandwidth" property is read-only');
  80472. }
  80473. }
  80474. });
  80475. if (this.options_.bandwidth) {
  80476. this.bandwidth = this.options_.bandwidth;
  80477. }
  80478. if (this.options_.throughput) {
  80479. this.throughput = this.options_.throughput;
  80480. }
  80481. Object.defineProperties(this.stats, {
  80482. bandwidth: {
  80483. get: () => this.bandwidth || 0,
  80484. enumerable: true
  80485. },
  80486. mediaRequests: {
  80487. get: () => this.playlistController_.mediaRequests_() || 0,
  80488. enumerable: true
  80489. },
  80490. mediaRequestsAborted: {
  80491. get: () => this.playlistController_.mediaRequestsAborted_() || 0,
  80492. enumerable: true
  80493. },
  80494. mediaRequestsTimedout: {
  80495. get: () => this.playlistController_.mediaRequestsTimedout_() || 0,
  80496. enumerable: true
  80497. },
  80498. mediaRequestsErrored: {
  80499. get: () => this.playlistController_.mediaRequestsErrored_() || 0,
  80500. enumerable: true
  80501. },
  80502. mediaTransferDuration: {
  80503. get: () => this.playlistController_.mediaTransferDuration_() || 0,
  80504. enumerable: true
  80505. },
  80506. mediaBytesTransferred: {
  80507. get: () => this.playlistController_.mediaBytesTransferred_() || 0,
  80508. enumerable: true
  80509. },
  80510. mediaSecondsLoaded: {
  80511. get: () => this.playlistController_.mediaSecondsLoaded_() || 0,
  80512. enumerable: true
  80513. },
  80514. mediaAppends: {
  80515. get: () => this.playlistController_.mediaAppends_() || 0,
  80516. enumerable: true
  80517. },
  80518. mainAppendsToLoadedData: {
  80519. get: () => this.playlistController_.mainAppendsToLoadedData_() || 0,
  80520. enumerable: true
  80521. },
  80522. audioAppendsToLoadedData: {
  80523. get: () => this.playlistController_.audioAppendsToLoadedData_() || 0,
  80524. enumerable: true
  80525. },
  80526. appendsToLoadedData: {
  80527. get: () => this.playlistController_.appendsToLoadedData_() || 0,
  80528. enumerable: true
  80529. },
  80530. timeToLoadedData: {
  80531. get: () => this.playlistController_.timeToLoadedData_() || 0,
  80532. enumerable: true
  80533. },
  80534. buffered: {
  80535. get: () => timeRangesToArray$1(this.tech_.buffered()),
  80536. enumerable: true
  80537. },
  80538. currentTime: {
  80539. get: () => this.tech_.currentTime(),
  80540. enumerable: true
  80541. },
  80542. currentSource: {
  80543. get: () => this.tech_.currentSource_,
  80544. enumerable: true
  80545. },
  80546. currentTech: {
  80547. get: () => this.tech_.name_,
  80548. enumerable: true
  80549. },
  80550. duration: {
  80551. get: () => this.tech_.duration(),
  80552. enumerable: true
  80553. },
  80554. main: {
  80555. get: () => this.playlists.main,
  80556. enumerable: true
  80557. },
  80558. playerDimensions: {
  80559. get: () => this.tech_.currentDimensions(),
  80560. enumerable: true
  80561. },
  80562. seekable: {
  80563. get: () => timeRangesToArray$1(this.tech_.seekable()),
  80564. enumerable: true
  80565. },
  80566. timestamp: {
  80567. get: () => Date.now(),
  80568. enumerable: true
  80569. },
  80570. videoPlaybackQuality: {
  80571. get: () => this.tech_.getVideoPlaybackQuality(),
  80572. enumerable: true
  80573. }
  80574. });
  80575. this.tech_.one("canplay", this.playlistController_.setupFirstPlay.bind(this.playlistController_));
  80576. this.tech_.on("bandwidthupdate", () => {
  80577. if (this.options_.useBandwidthFromLocalStorage) {
  80578. updateVhsLocalStorage$1({
  80579. bandwidth: this.bandwidth,
  80580. throughput: Math.round(this.throughput)
  80581. });
  80582. }
  80583. });
  80584. this.playlistController_.on("selectedinitialmedia", () => {
  80585. renditionSelectionMixin$1(this);
  80586. });
  80587. this.playlistController_.sourceUpdater_.on("createdsourcebuffers", () => {
  80588. this.setupEme_();
  80589. });
  80590. this.on(this.playlistController_, "progress", function() {
  80591. this.tech_.trigger("progress");
  80592. });
  80593. this.on(this.playlistController_, "firstplay", function() {
  80594. this.ignoreNextSeekingEvent_ = true;
  80595. });
  80596. this.setupQualityLevels_();
  80597. if (!this.tech_.el()) {
  80598. return;
  80599. }
  80600. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.playlistController_.mediaSource);
  80601. this.tech_.src(this.mediaSourceUrl_);
  80602. }
  80603. createKeySessions_() {
  80604. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80605. this.logger_("waiting for EME key session creation");
  80606. waitForKeySessionCreation$1({
  80607. player: this.player_,
  80608. sourceKeySystems: this.source_.keySystems,
  80609. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  80610. mainPlaylists: this.playlists.main.playlists
  80611. }).then(() => {
  80612. this.logger_("created EME key session");
  80613. this.playlistController_.sourceUpdater_.initializedEme();
  80614. }).catch((err) => {
  80615. this.logger_("error while creating EME key session", err);
  80616. this.player_.error({
  80617. message: "Failed to initialize media keys for EME",
  80618. code: 3
  80619. });
  80620. });
  80621. }
  80622. handleWaitingForKey_() {
  80623. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  80624. this.createKeySessions_();
  80625. }
  80626. setupEme_() {
  80627. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80628. const didSetupEmeOptions = setupEmeOptions$1({
  80629. player: this.player_,
  80630. sourceKeySystems: this.source_.keySystems,
  80631. media: this.playlists.media(),
  80632. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  80633. });
  80634. this.player_.tech_.on("keystatuschange", (e) => {
  80635. if (e.status !== "output-restricted") {
  80636. return;
  80637. }
  80638. const mainPlaylist = this.playlistController_.main();
  80639. if (!mainPlaylist || !mainPlaylist.playlists) {
  80640. return;
  80641. }
  80642. const excludedHDPlaylists = [];
  80643. mainPlaylist.playlists.forEach((playlist) => {
  80644. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  80645. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  80646. playlist.excludeUntil = Infinity;
  80647. excludedHDPlaylists.push(playlist);
  80648. }
  80649. }
  80650. });
  80651. if (excludedHDPlaylists.length) {
  80652. videojs$2.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.', ...excludedHDPlaylists);
  80653. this.playlistController_.fastQualityChange_();
  80654. }
  80655. });
  80656. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  80657. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  80658. if (videojs$2.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  80659. this.playlistController_.sourceUpdater_.initializedEme();
  80660. return;
  80661. }
  80662. this.createKeySessions_();
  80663. }
  80664. setupQualityLevels_() {
  80665. const player = videojs$2.players[this.tech_.options_.playerId];
  80666. if (!player || !player.qualityLevels || this.qualityLevels_) {
  80667. return;
  80668. }
  80669. this.qualityLevels_ = player.qualityLevels();
  80670. this.playlistController_.on("selectedinitialmedia", () => {
  80671. handleVhsLoadedMetadata$1(this.qualityLevels_, this);
  80672. });
  80673. this.playlists.on("mediachange", () => {
  80674. handleVhsMediaChange$1(this.qualityLevels_, this.playlists);
  80675. });
  80676. }
  80677. static version() {
  80678. return {
  80679. "@videojs/http-streaming": version$4$1,
  80680. "mux.js": version$3$1,
  80681. "mpd-parser": version$2$1,
  80682. "m3u8-parser": version$1$2,
  80683. "aes-decrypter": version$7
  80684. };
  80685. }
  80686. version() {
  80687. return this.constructor.version();
  80688. }
  80689. canChangeType() {
  80690. return SourceUpdater$1.canChangeType();
  80691. }
  80692. play() {
  80693. this.playlistController_.play();
  80694. }
  80695. setCurrentTime(currentTime) {
  80696. this.playlistController_.setCurrentTime(currentTime);
  80697. }
  80698. duration() {
  80699. return this.playlistController_.duration();
  80700. }
  80701. seekable() {
  80702. return this.playlistController_.seekable();
  80703. }
  80704. dispose() {
  80705. if (this.playbackWatcher_) {
  80706. this.playbackWatcher_.dispose();
  80707. }
  80708. if (this.playlistController_) {
  80709. this.playlistController_.dispose();
  80710. }
  80711. if (this.qualityLevels_) {
  80712. this.qualityLevels_.dispose();
  80713. }
  80714. if (this.tech_ && this.tech_.vhs) {
  80715. delete this.tech_.vhs;
  80716. }
  80717. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  80718. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  80719. this.mediaSourceUrl_ = null;
  80720. }
  80721. if (this.tech_) {
  80722. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  80723. }
  80724. super.dispose();
  80725. }
  80726. convertToProgramTime(time, callback2) {
  80727. return getProgramTime$1({
  80728. playlist: this.playlistController_.media(),
  80729. time,
  80730. callback: callback2
  80731. });
  80732. }
  80733. seekToProgramTime(programTime, callback2, pauseAfterSeek = true, retryCount = 2) {
  80734. return seekToProgramTime$1({
  80735. programTime,
  80736. playlist: this.playlistController_.media(),
  80737. retryCount,
  80738. pauseAfterSeek,
  80739. seekTo: this.options_.seekTo,
  80740. tech: this.options_.tech,
  80741. callback: callback2
  80742. });
  80743. }
  80744. }
  80745. const VhsSourceHandler$1 = {
  80746. name: "videojs-http-streaming",
  80747. VERSION: version$4$1,
  80748. canHandleSource(srcObj, options2 = {}) {
  80749. const localOptions = merge$2(videojs$2.options, options2);
  80750. return VhsSourceHandler$1.canPlayType(srcObj.type, localOptions);
  80751. },
  80752. handleSource(source, tech, options2 = {}) {
  80753. const localOptions = merge$2(videojs$2.options, options2);
  80754. tech.vhs = new VhsHandler$1(source, tech, localOptions);
  80755. tech.vhs.xhr = xhrFactory$1();
  80756. tech.vhs.src(source.src, source.type);
  80757. return tech.vhs;
  80758. },
  80759. canPlayType(type2, options2) {
  80760. const simpleType = simpleTypeFromSourceType$1(type2);
  80761. if (!simpleType) {
  80762. return "";
  80763. }
  80764. const overrideNative = VhsSourceHandler$1.getOverrideNative(options2);
  80765. const supportsTypeNatively = Vhs$2.supportsTypeNatively(simpleType);
  80766. const canUseMsePlayback = !supportsTypeNatively || overrideNative;
  80767. return canUseMsePlayback ? "maybe" : "";
  80768. },
  80769. getOverrideNative(options2 = {}) {
  80770. const {
  80771. vhs = {}
  80772. } = options2;
  80773. const defaultOverrideNative = !(videojs$2.browser.IS_ANY_SAFARI || videojs$2.browser.IS_IOS);
  80774. const {
  80775. overrideNative = defaultOverrideNative
  80776. } = vhs;
  80777. return overrideNative;
  80778. }
  80779. };
  80780. const supportsNativeMediaSources$1 = () => {
  80781. return browserSupportsCodec$1("avc1.4d400d,mp4a.40.2");
  80782. };
  80783. if (supportsNativeMediaSources$1()) {
  80784. videojs$2.getTech("Html5").registerSourceHandler(VhsSourceHandler$1, 0);
  80785. }
  80786. videojs$2.VhsHandler = VhsHandler$1;
  80787. videojs$2.VhsSourceHandler = VhsSourceHandler$1;
  80788. videojs$2.Vhs = Vhs$2;
  80789. if (!videojs$2.use) {
  80790. videojs$2.registerComponent("Vhs", Vhs$2);
  80791. }
  80792. videojs$2.options.vhs = videojs$2.options.vhs || {};
  80793. if (!videojs$2.getPlugin || !videojs$2.getPlugin("reloadSourceOnError")) {
  80794. videojs$2.registerPlugin("reloadSourceOnError", reloadSourceOnError$1);
  80795. }
  80796. var videoJs = "";
  80797. function _assertThisInitialized(self2) {
  80798. if (self2 === void 0) {
  80799. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80800. }
  80801. return self2;
  80802. }
  80803. function _setPrototypeOf(o, p) {
  80804. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
  80805. o2.__proto__ = p2;
  80806. return o2;
  80807. };
  80808. return _setPrototypeOf(o, p);
  80809. }
  80810. function _inheritsLoose(subClass, superClass) {
  80811. subClass.prototype = Object.create(superClass.prototype);
  80812. subClass.prototype.constructor = subClass;
  80813. _setPrototypeOf(subClass, superClass);
  80814. }
  80815. function _isNativeReflectConstruct() {
  80816. if (typeof Reflect === "undefined" || !Reflect.construct)
  80817. return false;
  80818. if (Reflect.construct.sham)
  80819. return false;
  80820. if (typeof Proxy === "function")
  80821. return true;
  80822. try {
  80823. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  80824. }));
  80825. return true;
  80826. } catch (e) {
  80827. return false;
  80828. }
  80829. }
  80830. function _construct(Parent, args, Class) {
  80831. if (_isNativeReflectConstruct()) {
  80832. _construct = Reflect.construct.bind();
  80833. } else {
  80834. _construct = function _construct2(Parent2, args2, Class2) {
  80835. var a = [null];
  80836. a.push.apply(a, args2);
  80837. var Constructor = Function.bind.apply(Parent2, a);
  80838. var instance = new Constructor();
  80839. if (Class2)
  80840. _setPrototypeOf(instance, Class2.prototype);
  80841. return instance;
  80842. };
  80843. }
  80844. return _construct.apply(null, arguments);
  80845. }
  80846. function _inherits(subClass, superClass) {
  80847. if (typeof superClass !== "function" && superClass !== null) {
  80848. throw new TypeError("Super expression must either be null or a function");
  80849. }
  80850. subClass.prototype = Object.create(superClass && superClass.prototype, {
  80851. constructor: {
  80852. value: subClass,
  80853. writable: true,
  80854. configurable: true
  80855. }
  80856. });
  80857. Object.defineProperty(subClass, "prototype", {
  80858. writable: false
  80859. });
  80860. if (superClass)
  80861. _setPrototypeOf(subClass, superClass);
  80862. }
  80863. var DEFAULT_LOCATION = "http://example.com";
  80864. var resolveUrl$1 = function resolveUrl3(baseUrl, relativeUrl) {
  80865. if (/^[a-z]+:/i.test(relativeUrl)) {
  80866. return relativeUrl;
  80867. }
  80868. if (/^data:/.test(baseUrl)) {
  80869. baseUrl = window_1.location && window_1.location.href || "";
  80870. }
  80871. var nativeURL = typeof window_1.URL === "function";
  80872. var protocolLess = /^\/\//.test(baseUrl);
  80873. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  80874. if (nativeURL) {
  80875. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION);
  80876. } else if (!/\/\//i.test(baseUrl)) {
  80877. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  80878. }
  80879. if (nativeURL) {
  80880. var newUrl = new URL(relativeUrl, baseUrl);
  80881. if (removeLocation) {
  80882. return newUrl.href.slice(DEFAULT_LOCATION.length);
  80883. } else if (protocolLess) {
  80884. return newUrl.href.slice(newUrl.protocol.length);
  80885. }
  80886. return newUrl.href;
  80887. }
  80888. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  80889. };
  80890. var Stream = /* @__PURE__ */ function() {
  80891. function Stream2() {
  80892. this.listeners = {};
  80893. }
  80894. var _proto = Stream2.prototype;
  80895. _proto.on = function on3(type2, listener) {
  80896. if (!this.listeners[type2]) {
  80897. this.listeners[type2] = [];
  80898. }
  80899. this.listeners[type2].push(listener);
  80900. };
  80901. _proto.off = function off2(type2, listener) {
  80902. if (!this.listeners[type2]) {
  80903. return false;
  80904. }
  80905. var index2 = this.listeners[type2].indexOf(listener);
  80906. this.listeners[type2] = this.listeners[type2].slice(0);
  80907. this.listeners[type2].splice(index2, 1);
  80908. return index2 > -1;
  80909. };
  80910. _proto.trigger = function trigger2(type2) {
  80911. var callbacks = this.listeners[type2];
  80912. if (!callbacks) {
  80913. return;
  80914. }
  80915. if (arguments.length === 2) {
  80916. var length = callbacks.length;
  80917. for (var i2 = 0; i2 < length; ++i2) {
  80918. callbacks[i2].call(this, arguments[1]);
  80919. }
  80920. } else {
  80921. var args = Array.prototype.slice.call(arguments, 1);
  80922. var _length = callbacks.length;
  80923. for (var _i = 0; _i < _length; ++_i) {
  80924. callbacks[_i].apply(this, args);
  80925. }
  80926. }
  80927. };
  80928. _proto.dispose = function dispose() {
  80929. this.listeners = {};
  80930. };
  80931. _proto.pipe = function pipe(destination2) {
  80932. this.on("data", function(data) {
  80933. destination2.push(data);
  80934. });
  80935. };
  80936. return Stream2;
  80937. }();
  80938. var atob3 = function atob4(s) {
  80939. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  80940. };
  80941. function decodeB64ToUint8Array(b64Text) {
  80942. var decodedString = atob3(b64Text);
  80943. var array = new Uint8Array(decodedString.length);
  80944. for (var i2 = 0; i2 < decodedString.length; i2++) {
  80945. array[i2] = decodedString.charCodeAt(i2);
  80946. }
  80947. return array;
  80948. }
  80949. /*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */
  80950. var LineStream = /* @__PURE__ */ function(_Stream) {
  80951. _inheritsLoose(LineStream2, _Stream);
  80952. function LineStream2() {
  80953. var _this;
  80954. _this = _Stream.call(this) || this;
  80955. _this.buffer = "";
  80956. return _this;
  80957. }
  80958. var _proto = LineStream2.prototype;
  80959. _proto.push = function push(data) {
  80960. var nextNewline;
  80961. this.buffer += data;
  80962. nextNewline = this.buffer.indexOf("\n");
  80963. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  80964. this.trigger("data", this.buffer.substring(0, nextNewline));
  80965. this.buffer = this.buffer.substring(nextNewline + 1);
  80966. }
  80967. };
  80968. return LineStream2;
  80969. }(Stream);
  80970. var TAB = String.fromCharCode(9);
  80971. var parseByterange = function parseByterange2(byterangeString) {
  80972. var match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  80973. var result = {};
  80974. if (match[1]) {
  80975. result.length = parseInt(match[1], 10);
  80976. }
  80977. if (match[2]) {
  80978. result.offset = parseInt(match[2], 10);
  80979. }
  80980. return result;
  80981. };
  80982. var attributeSeparator = function attributeSeparator2() {
  80983. var key = "[^=]*";
  80984. var value = '"[^"]*"|[^,]*';
  80985. var keyvalue = "(?:" + key + ")=(?:" + value + ")";
  80986. return new RegExp("(?:^|,)(" + keyvalue + ")");
  80987. };
  80988. var parseAttributes$1 = function parseAttributes(attributes) {
  80989. var attrs = attributes.split(attributeSeparator());
  80990. var result = {};
  80991. var i2 = attrs.length;
  80992. var attr;
  80993. while (i2--) {
  80994. if (attrs[i2] === "") {
  80995. continue;
  80996. }
  80997. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  80998. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  80999. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  81000. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  81001. result[attr[0]] = attr[1];
  81002. }
  81003. return result;
  81004. };
  81005. var ParseStream = /* @__PURE__ */ function(_Stream) {
  81006. _inheritsLoose(ParseStream2, _Stream);
  81007. function ParseStream2() {
  81008. var _this;
  81009. _this = _Stream.call(this) || this;
  81010. _this.customParsers = [];
  81011. _this.tagMappers = [];
  81012. return _this;
  81013. }
  81014. var _proto = ParseStream2.prototype;
  81015. _proto.push = function push(line) {
  81016. var _this2 = this;
  81017. var match;
  81018. var event2;
  81019. line = line.trim();
  81020. if (line.length === 0) {
  81021. return;
  81022. }
  81023. if (line[0] !== "#") {
  81024. this.trigger("data", {
  81025. type: "uri",
  81026. uri: line
  81027. });
  81028. return;
  81029. }
  81030. var newLines = this.tagMappers.reduce(function(acc, mapper) {
  81031. var mappedLine = mapper(line);
  81032. if (mappedLine === line) {
  81033. return acc;
  81034. }
  81035. return acc.concat([mappedLine]);
  81036. }, [line]);
  81037. newLines.forEach(function(newLine) {
  81038. for (var i2 = 0; i2 < _this2.customParsers.length; i2++) {
  81039. if (_this2.customParsers[i2].call(_this2, newLine)) {
  81040. return;
  81041. }
  81042. }
  81043. if (newLine.indexOf("#EXT") !== 0) {
  81044. _this2.trigger("data", {
  81045. type: "comment",
  81046. text: newLine.slice(1)
  81047. });
  81048. return;
  81049. }
  81050. newLine = newLine.replace("\r", "");
  81051. match = /^#EXTM3U/.exec(newLine);
  81052. if (match) {
  81053. _this2.trigger("data", {
  81054. type: "tag",
  81055. tagType: "m3u"
  81056. });
  81057. return;
  81058. }
  81059. match = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine);
  81060. if (match) {
  81061. event2 = {
  81062. type: "tag",
  81063. tagType: "inf"
  81064. };
  81065. if (match[1]) {
  81066. event2.duration = parseFloat(match[1]);
  81067. }
  81068. if (match[2]) {
  81069. event2.title = match[2];
  81070. }
  81071. _this2.trigger("data", event2);
  81072. return;
  81073. }
  81074. match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);
  81075. if (match) {
  81076. event2 = {
  81077. type: "tag",
  81078. tagType: "targetduration"
  81079. };
  81080. if (match[1]) {
  81081. event2.duration = parseInt(match[1], 10);
  81082. }
  81083. _this2.trigger("data", event2);
  81084. return;
  81085. }
  81086. match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);
  81087. if (match) {
  81088. event2 = {
  81089. type: "tag",
  81090. tagType: "version"
  81091. };
  81092. if (match[1]) {
  81093. event2.version = parseInt(match[1], 10);
  81094. }
  81095. _this2.trigger("data", event2);
  81096. return;
  81097. }
  81098. match = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81099. if (match) {
  81100. event2 = {
  81101. type: "tag",
  81102. tagType: "media-sequence"
  81103. };
  81104. if (match[1]) {
  81105. event2.number = parseInt(match[1], 10);
  81106. }
  81107. _this2.trigger("data", event2);
  81108. return;
  81109. }
  81110. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81111. if (match) {
  81112. event2 = {
  81113. type: "tag",
  81114. tagType: "discontinuity-sequence"
  81115. };
  81116. if (match[1]) {
  81117. event2.number = parseInt(match[1], 10);
  81118. }
  81119. _this2.trigger("data", event2);
  81120. return;
  81121. }
  81122. match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);
  81123. if (match) {
  81124. event2 = {
  81125. type: "tag",
  81126. tagType: "playlist-type"
  81127. };
  81128. if (match[1]) {
  81129. event2.playlistType = match[1];
  81130. }
  81131. _this2.trigger("data", event2);
  81132. return;
  81133. }
  81134. match = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine);
  81135. if (match) {
  81136. event2 = _extends$2(parseByterange(match[1]), {
  81137. type: "tag",
  81138. tagType: "byterange"
  81139. });
  81140. _this2.trigger("data", event2);
  81141. return;
  81142. }
  81143. match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);
  81144. if (match) {
  81145. event2 = {
  81146. type: "tag",
  81147. tagType: "allow-cache"
  81148. };
  81149. if (match[1]) {
  81150. event2.allowed = !/NO/.test(match[1]);
  81151. }
  81152. _this2.trigger("data", event2);
  81153. return;
  81154. }
  81155. match = /^#EXT-X-MAP:?(.*)$/.exec(newLine);
  81156. if (match) {
  81157. event2 = {
  81158. type: "tag",
  81159. tagType: "map"
  81160. };
  81161. if (match[1]) {
  81162. var attributes = parseAttributes$1(match[1]);
  81163. if (attributes.URI) {
  81164. event2.uri = attributes.URI;
  81165. }
  81166. if (attributes.BYTERANGE) {
  81167. event2.byterange = parseByterange(attributes.BYTERANGE);
  81168. }
  81169. }
  81170. _this2.trigger("data", event2);
  81171. return;
  81172. }
  81173. match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);
  81174. if (match) {
  81175. event2 = {
  81176. type: "tag",
  81177. tagType: "stream-inf"
  81178. };
  81179. if (match[1]) {
  81180. event2.attributes = parseAttributes$1(match[1]);
  81181. if (event2.attributes.RESOLUTION) {
  81182. var split2 = event2.attributes.RESOLUTION.split("x");
  81183. var resolution = {};
  81184. if (split2[0]) {
  81185. resolution.width = parseInt(split2[0], 10);
  81186. }
  81187. if (split2[1]) {
  81188. resolution.height = parseInt(split2[1], 10);
  81189. }
  81190. event2.attributes.RESOLUTION = resolution;
  81191. }
  81192. if (event2.attributes.BANDWIDTH) {
  81193. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  81194. }
  81195. if (event2.attributes["FRAME-RATE"]) {
  81196. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  81197. }
  81198. if (event2.attributes["PROGRAM-ID"]) {
  81199. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  81200. }
  81201. }
  81202. _this2.trigger("data", event2);
  81203. return;
  81204. }
  81205. match = /^#EXT-X-MEDIA:?(.*)$/.exec(newLine);
  81206. if (match) {
  81207. event2 = {
  81208. type: "tag",
  81209. tagType: "media"
  81210. };
  81211. if (match[1]) {
  81212. event2.attributes = parseAttributes$1(match[1]);
  81213. }
  81214. _this2.trigger("data", event2);
  81215. return;
  81216. }
  81217. match = /^#EXT-X-ENDLIST/.exec(newLine);
  81218. if (match) {
  81219. _this2.trigger("data", {
  81220. type: "tag",
  81221. tagType: "endlist"
  81222. });
  81223. return;
  81224. }
  81225. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  81226. if (match) {
  81227. _this2.trigger("data", {
  81228. type: "tag",
  81229. tagType: "discontinuity"
  81230. });
  81231. return;
  81232. }
  81233. match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);
  81234. if (match) {
  81235. event2 = {
  81236. type: "tag",
  81237. tagType: "program-date-time"
  81238. };
  81239. if (match[1]) {
  81240. event2.dateTimeString = match[1];
  81241. event2.dateTimeObject = new Date(match[1]);
  81242. }
  81243. _this2.trigger("data", event2);
  81244. return;
  81245. }
  81246. match = /^#EXT-X-KEY:?(.*)$/.exec(newLine);
  81247. if (match) {
  81248. event2 = {
  81249. type: "tag",
  81250. tagType: "key"
  81251. };
  81252. if (match[1]) {
  81253. event2.attributes = parseAttributes$1(match[1]);
  81254. if (event2.attributes.IV) {
  81255. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  81256. event2.attributes.IV = event2.attributes.IV.substring(2);
  81257. }
  81258. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  81259. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  81260. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  81261. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  81262. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  81263. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  81264. }
  81265. }
  81266. _this2.trigger("data", event2);
  81267. return;
  81268. }
  81269. match = /^#EXT-X-START:?(.*)$/.exec(newLine);
  81270. if (match) {
  81271. event2 = {
  81272. type: "tag",
  81273. tagType: "start"
  81274. };
  81275. if (match[1]) {
  81276. event2.attributes = parseAttributes$1(match[1]);
  81277. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  81278. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  81279. }
  81280. _this2.trigger("data", event2);
  81281. return;
  81282. }
  81283. match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);
  81284. if (match) {
  81285. event2 = {
  81286. type: "tag",
  81287. tagType: "cue-out-cont"
  81288. };
  81289. if (match[1]) {
  81290. event2.data = match[1];
  81291. } else {
  81292. event2.data = "";
  81293. }
  81294. _this2.trigger("data", event2);
  81295. return;
  81296. }
  81297. match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);
  81298. if (match) {
  81299. event2 = {
  81300. type: "tag",
  81301. tagType: "cue-out"
  81302. };
  81303. if (match[1]) {
  81304. event2.data = match[1];
  81305. } else {
  81306. event2.data = "";
  81307. }
  81308. _this2.trigger("data", event2);
  81309. return;
  81310. }
  81311. match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);
  81312. if (match) {
  81313. event2 = {
  81314. type: "tag",
  81315. tagType: "cue-in"
  81316. };
  81317. if (match[1]) {
  81318. event2.data = match[1];
  81319. } else {
  81320. event2.data = "";
  81321. }
  81322. _this2.trigger("data", event2);
  81323. return;
  81324. }
  81325. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  81326. if (match && match[1]) {
  81327. event2 = {
  81328. type: "tag",
  81329. tagType: "skip"
  81330. };
  81331. event2.attributes = parseAttributes$1(match[1]);
  81332. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  81333. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  81334. }
  81335. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  81336. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB);
  81337. }
  81338. _this2.trigger("data", event2);
  81339. return;
  81340. }
  81341. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  81342. if (match && match[1]) {
  81343. event2 = {
  81344. type: "tag",
  81345. tagType: "part"
  81346. };
  81347. event2.attributes = parseAttributes$1(match[1]);
  81348. ["DURATION"].forEach(function(key) {
  81349. if (event2.attributes.hasOwnProperty(key)) {
  81350. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81351. }
  81352. });
  81353. ["INDEPENDENT", "GAP"].forEach(function(key) {
  81354. if (event2.attributes.hasOwnProperty(key)) {
  81355. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81356. }
  81357. });
  81358. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  81359. event2.attributes.byterange = parseByterange(event2.attributes.BYTERANGE);
  81360. }
  81361. _this2.trigger("data", event2);
  81362. return;
  81363. }
  81364. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  81365. if (match && match[1]) {
  81366. event2 = {
  81367. type: "tag",
  81368. tagType: "server-control"
  81369. };
  81370. event2.attributes = parseAttributes$1(match[1]);
  81371. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  81372. if (event2.attributes.hasOwnProperty(key)) {
  81373. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81374. }
  81375. });
  81376. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  81377. if (event2.attributes.hasOwnProperty(key)) {
  81378. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81379. }
  81380. });
  81381. _this2.trigger("data", event2);
  81382. return;
  81383. }
  81384. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  81385. if (match && match[1]) {
  81386. event2 = {
  81387. type: "tag",
  81388. tagType: "part-inf"
  81389. };
  81390. event2.attributes = parseAttributes$1(match[1]);
  81391. ["PART-TARGET"].forEach(function(key) {
  81392. if (event2.attributes.hasOwnProperty(key)) {
  81393. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81394. }
  81395. });
  81396. _this2.trigger("data", event2);
  81397. return;
  81398. }
  81399. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  81400. if (match && match[1]) {
  81401. event2 = {
  81402. type: "tag",
  81403. tagType: "preload-hint"
  81404. };
  81405. event2.attributes = parseAttributes$1(match[1]);
  81406. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  81407. if (event2.attributes.hasOwnProperty(key)) {
  81408. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81409. var subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  81410. event2.attributes.byterange = event2.attributes.byterange || {};
  81411. event2.attributes.byterange[subkey] = event2.attributes[key];
  81412. delete event2.attributes[key];
  81413. }
  81414. });
  81415. _this2.trigger("data", event2);
  81416. return;
  81417. }
  81418. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  81419. if (match && match[1]) {
  81420. event2 = {
  81421. type: "tag",
  81422. tagType: "rendition-report"
  81423. };
  81424. event2.attributes = parseAttributes$1(match[1]);
  81425. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  81426. if (event2.attributes.hasOwnProperty(key)) {
  81427. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81428. }
  81429. });
  81430. _this2.trigger("data", event2);
  81431. return;
  81432. }
  81433. _this2.trigger("data", {
  81434. type: "tag",
  81435. data: newLine.slice(4)
  81436. });
  81437. });
  81438. };
  81439. _proto.addParser = function addParser(_ref) {
  81440. var _this3 = this;
  81441. var expression = _ref.expression, customType = _ref.customType, dataParser = _ref.dataParser, segment = _ref.segment;
  81442. if (typeof dataParser !== "function") {
  81443. dataParser = function dataParser2(line) {
  81444. return line;
  81445. };
  81446. }
  81447. this.customParsers.push(function(line) {
  81448. var match = expression.exec(line);
  81449. if (match) {
  81450. _this3.trigger("data", {
  81451. type: "custom",
  81452. data: dataParser(line),
  81453. customType,
  81454. segment
  81455. });
  81456. return true;
  81457. }
  81458. });
  81459. };
  81460. _proto.addTagMapper = function addTagMapper(_ref2) {
  81461. var expression = _ref2.expression, map = _ref2.map;
  81462. var mapFn = function mapFn2(line) {
  81463. if (expression.test(line)) {
  81464. return map(line);
  81465. }
  81466. return line;
  81467. };
  81468. this.tagMappers.push(mapFn);
  81469. };
  81470. return ParseStream2;
  81471. }(Stream);
  81472. var camelCase = function camelCase2(str) {
  81473. return str.toLowerCase().replace(/-(\w)/g, function(a) {
  81474. return a[1].toUpperCase();
  81475. });
  81476. };
  81477. var camelCaseKeys = function camelCaseKeys2(attributes) {
  81478. var result = {};
  81479. Object.keys(attributes).forEach(function(key) {
  81480. result[camelCase(key)] = attributes[key];
  81481. });
  81482. return result;
  81483. };
  81484. var setHoldBack = function setHoldBack2(manifest) {
  81485. var serverControl = manifest.serverControl, targetDuration = manifest.targetDuration, partTargetDuration = manifest.partTargetDuration;
  81486. if (!serverControl) {
  81487. return;
  81488. }
  81489. var tag = "#EXT-X-SERVER-CONTROL";
  81490. var hb = "holdBack";
  81491. var phb = "partHoldBack";
  81492. var minTargetDuration = targetDuration && targetDuration * 3;
  81493. var minPartDuration = partTargetDuration && partTargetDuration * 2;
  81494. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  81495. serverControl[hb] = minTargetDuration;
  81496. this.trigger("info", {
  81497. message: tag + " defaulting HOLD-BACK to targetDuration * 3 (" + minTargetDuration + ")."
  81498. });
  81499. }
  81500. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  81501. this.trigger("warn", {
  81502. message: tag + " clamping HOLD-BACK (" + serverControl[hb] + ") to targetDuration * 3 (" + minTargetDuration + ")"
  81503. });
  81504. serverControl[hb] = minTargetDuration;
  81505. }
  81506. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  81507. serverControl[phb] = partTargetDuration * 3;
  81508. this.trigger("info", {
  81509. message: tag + " defaulting PART-HOLD-BACK to partTargetDuration * 3 (" + serverControl[phb] + ")."
  81510. });
  81511. }
  81512. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  81513. this.trigger("warn", {
  81514. message: tag + " clamping PART-HOLD-BACK (" + serverControl[phb] + ") to partTargetDuration * 2 (" + minPartDuration + ")."
  81515. });
  81516. serverControl[phb] = minPartDuration;
  81517. }
  81518. };
  81519. var Parser = /* @__PURE__ */ function(_Stream) {
  81520. _inheritsLoose(Parser2, _Stream);
  81521. function Parser2() {
  81522. var _this;
  81523. _this = _Stream.call(this) || this;
  81524. _this.lineStream = new LineStream();
  81525. _this.parseStream = new ParseStream();
  81526. _this.lineStream.pipe(_this.parseStream);
  81527. var self2 = _assertThisInitialized(_this);
  81528. var uris = [];
  81529. var currentUri = {};
  81530. var currentMap;
  81531. var _key;
  81532. var hasParts = false;
  81533. var noop2 = function noop3() {
  81534. };
  81535. var defaultMediaGroups = {
  81536. "AUDIO": {},
  81537. "VIDEO": {},
  81538. "CLOSED-CAPTIONS": {},
  81539. "SUBTITLES": {}
  81540. };
  81541. var widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  81542. var currentTimeline = 0;
  81543. _this.manifest = {
  81544. allowCache: true,
  81545. discontinuityStarts: [],
  81546. segments: []
  81547. };
  81548. var lastByterangeEnd = 0;
  81549. var lastPartByterangeEnd = 0;
  81550. _this.on("end", function() {
  81551. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  81552. return;
  81553. }
  81554. if (!currentUri.map && currentMap) {
  81555. currentUri.map = currentMap;
  81556. }
  81557. if (!currentUri.key && _key) {
  81558. currentUri.key = _key;
  81559. }
  81560. if (!currentUri.timeline && typeof currentTimeline === "number") {
  81561. currentUri.timeline = currentTimeline;
  81562. }
  81563. _this.manifest.preloadSegment = currentUri;
  81564. });
  81565. _this.parseStream.on("data", function(entry) {
  81566. var mediaGroup;
  81567. var rendition;
  81568. ({
  81569. tag: function tag() {
  81570. ({
  81571. version: function version2() {
  81572. if (entry.version) {
  81573. this.manifest.version = entry.version;
  81574. }
  81575. },
  81576. "allow-cache": function allowCache() {
  81577. this.manifest.allowCache = entry.allowed;
  81578. if (!("allowed" in entry)) {
  81579. this.trigger("info", {
  81580. message: "defaulting allowCache to YES"
  81581. });
  81582. this.manifest.allowCache = true;
  81583. }
  81584. },
  81585. byterange: function byterange() {
  81586. var byterange2 = {};
  81587. if ("length" in entry) {
  81588. currentUri.byterange = byterange2;
  81589. byterange2.length = entry.length;
  81590. if (!("offset" in entry)) {
  81591. entry.offset = lastByterangeEnd;
  81592. }
  81593. }
  81594. if ("offset" in entry) {
  81595. currentUri.byterange = byterange2;
  81596. byterange2.offset = entry.offset;
  81597. }
  81598. lastByterangeEnd = byterange2.offset + byterange2.length;
  81599. },
  81600. endlist: function endlist() {
  81601. this.manifest.endList = true;
  81602. },
  81603. inf: function inf() {
  81604. if (!("mediaSequence" in this.manifest)) {
  81605. this.manifest.mediaSequence = 0;
  81606. this.trigger("info", {
  81607. message: "defaulting media sequence to zero"
  81608. });
  81609. }
  81610. if (!("discontinuitySequence" in this.manifest)) {
  81611. this.manifest.discontinuitySequence = 0;
  81612. this.trigger("info", {
  81613. message: "defaulting discontinuity sequence to zero"
  81614. });
  81615. }
  81616. if (entry.duration > 0) {
  81617. currentUri.duration = entry.duration;
  81618. }
  81619. if (entry.duration === 0) {
  81620. currentUri.duration = 0.01;
  81621. this.trigger("info", {
  81622. message: "updating zero segment duration to a small value"
  81623. });
  81624. }
  81625. this.manifest.segments = uris;
  81626. },
  81627. key: function key() {
  81628. if (!entry.attributes) {
  81629. this.trigger("warn", {
  81630. message: "ignoring key declaration without attribute list"
  81631. });
  81632. return;
  81633. }
  81634. if (entry.attributes.METHOD === "NONE") {
  81635. _key = null;
  81636. return;
  81637. }
  81638. if (!entry.attributes.URI) {
  81639. this.trigger("warn", {
  81640. message: "ignoring key declaration without URI"
  81641. });
  81642. return;
  81643. }
  81644. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  81645. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81646. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  81647. attributes: entry.attributes
  81648. };
  81649. return;
  81650. }
  81651. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  81652. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81653. this.manifest.contentProtection["com.microsoft.playready"] = {
  81654. uri: entry.attributes.URI
  81655. };
  81656. return;
  81657. }
  81658. if (entry.attributes.KEYFORMAT === widevineUuid) {
  81659. var VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  81660. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  81661. this.trigger("warn", {
  81662. message: "invalid key method provided for Widevine"
  81663. });
  81664. return;
  81665. }
  81666. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  81667. this.trigger("warn", {
  81668. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  81669. });
  81670. }
  81671. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  81672. this.trigger("warn", {
  81673. message: "invalid key URI provided for Widevine"
  81674. });
  81675. return;
  81676. }
  81677. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  81678. this.trigger("warn", {
  81679. message: "invalid key ID provided for Widevine"
  81680. });
  81681. return;
  81682. }
  81683. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81684. this.manifest.contentProtection["com.widevine.alpha"] = {
  81685. attributes: {
  81686. schemeIdUri: entry.attributes.KEYFORMAT,
  81687. keyId: entry.attributes.KEYID.substring(2)
  81688. },
  81689. pssh: decodeB64ToUint8Array(entry.attributes.URI.split(",")[1])
  81690. };
  81691. return;
  81692. }
  81693. if (!entry.attributes.METHOD) {
  81694. this.trigger("warn", {
  81695. message: "defaulting key method to AES-128"
  81696. });
  81697. }
  81698. _key = {
  81699. method: entry.attributes.METHOD || "AES-128",
  81700. uri: entry.attributes.URI
  81701. };
  81702. if (typeof entry.attributes.IV !== "undefined") {
  81703. _key.iv = entry.attributes.IV;
  81704. }
  81705. },
  81706. "media-sequence": function mediaSequence() {
  81707. if (!isFinite(entry.number)) {
  81708. this.trigger("warn", {
  81709. message: "ignoring invalid media sequence: " + entry.number
  81710. });
  81711. return;
  81712. }
  81713. this.manifest.mediaSequence = entry.number;
  81714. },
  81715. "discontinuity-sequence": function discontinuitySequence() {
  81716. if (!isFinite(entry.number)) {
  81717. this.trigger("warn", {
  81718. message: "ignoring invalid discontinuity sequence: " + entry.number
  81719. });
  81720. return;
  81721. }
  81722. this.manifest.discontinuitySequence = entry.number;
  81723. currentTimeline = entry.number;
  81724. },
  81725. "playlist-type": function playlistType() {
  81726. if (!/VOD|EVENT/.test(entry.playlistType)) {
  81727. this.trigger("warn", {
  81728. message: "ignoring unknown playlist type: " + entry.playlist
  81729. });
  81730. return;
  81731. }
  81732. this.manifest.playlistType = entry.playlistType;
  81733. },
  81734. map: function map() {
  81735. currentMap = {};
  81736. if (entry.uri) {
  81737. currentMap.uri = entry.uri;
  81738. }
  81739. if (entry.byterange) {
  81740. currentMap.byterange = entry.byterange;
  81741. }
  81742. if (_key) {
  81743. currentMap.key = _key;
  81744. }
  81745. },
  81746. "stream-inf": function streamInf() {
  81747. this.manifest.playlists = uris;
  81748. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81749. if (!entry.attributes) {
  81750. this.trigger("warn", {
  81751. message: "ignoring empty stream-inf attributes"
  81752. });
  81753. return;
  81754. }
  81755. if (!currentUri.attributes) {
  81756. currentUri.attributes = {};
  81757. }
  81758. _extends$2(currentUri.attributes, entry.attributes);
  81759. },
  81760. media: function media() {
  81761. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81762. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  81763. this.trigger("warn", {
  81764. message: "ignoring incomplete or missing media group"
  81765. });
  81766. return;
  81767. }
  81768. var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  81769. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  81770. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  81771. rendition = {
  81772. default: /yes/i.test(entry.attributes.DEFAULT)
  81773. };
  81774. if (rendition.default) {
  81775. rendition.autoselect = true;
  81776. } else {
  81777. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  81778. }
  81779. if (entry.attributes.LANGUAGE) {
  81780. rendition.language = entry.attributes.LANGUAGE;
  81781. }
  81782. if (entry.attributes.URI) {
  81783. rendition.uri = entry.attributes.URI;
  81784. }
  81785. if (entry.attributes["INSTREAM-ID"]) {
  81786. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  81787. }
  81788. if (entry.attributes.CHARACTERISTICS) {
  81789. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  81790. }
  81791. if (entry.attributes.FORCED) {
  81792. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  81793. }
  81794. mediaGroup[entry.attributes.NAME] = rendition;
  81795. },
  81796. discontinuity: function discontinuity() {
  81797. currentTimeline += 1;
  81798. currentUri.discontinuity = true;
  81799. this.manifest.discontinuityStarts.push(uris.length);
  81800. },
  81801. "program-date-time": function programDateTime() {
  81802. if (typeof this.manifest.dateTimeString === "undefined") {
  81803. this.manifest.dateTimeString = entry.dateTimeString;
  81804. this.manifest.dateTimeObject = entry.dateTimeObject;
  81805. }
  81806. currentUri.dateTimeString = entry.dateTimeString;
  81807. currentUri.dateTimeObject = entry.dateTimeObject;
  81808. },
  81809. targetduration: function targetduration() {
  81810. if (!isFinite(entry.duration) || entry.duration < 0) {
  81811. this.trigger("warn", {
  81812. message: "ignoring invalid target duration: " + entry.duration
  81813. });
  81814. return;
  81815. }
  81816. this.manifest.targetDuration = entry.duration;
  81817. setHoldBack.call(this, this.manifest);
  81818. },
  81819. start: function start2() {
  81820. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  81821. this.trigger("warn", {
  81822. message: "ignoring start declaration without appropriate attribute list"
  81823. });
  81824. return;
  81825. }
  81826. this.manifest.start = {
  81827. timeOffset: entry.attributes["TIME-OFFSET"],
  81828. precise: entry.attributes.PRECISE
  81829. };
  81830. },
  81831. "cue-out": function cueOut() {
  81832. currentUri.cueOut = entry.data;
  81833. },
  81834. "cue-out-cont": function cueOutCont() {
  81835. currentUri.cueOutCont = entry.data;
  81836. },
  81837. "cue-in": function cueIn() {
  81838. currentUri.cueIn = entry.data;
  81839. },
  81840. "skip": function skip() {
  81841. this.manifest.skip = camelCaseKeys(entry.attributes);
  81842. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  81843. },
  81844. "part": function part() {
  81845. var _this2 = this;
  81846. hasParts = true;
  81847. var segmentIndex = this.manifest.segments.length;
  81848. var part2 = camelCaseKeys(entry.attributes);
  81849. currentUri.parts = currentUri.parts || [];
  81850. currentUri.parts.push(part2);
  81851. if (part2.byterange) {
  81852. if (!part2.byterange.hasOwnProperty("offset")) {
  81853. part2.byterange.offset = lastPartByterangeEnd;
  81854. }
  81855. lastPartByterangeEnd = part2.byterange.offset + part2.byterange.length;
  81856. }
  81857. var partIndex = currentUri.parts.length - 1;
  81858. this.warnOnMissingAttributes_("#EXT-X-PART #" + partIndex + " for segment #" + segmentIndex, entry.attributes, ["URI", "DURATION"]);
  81859. if (this.manifest.renditionReports) {
  81860. this.manifest.renditionReports.forEach(function(r2, i2) {
  81861. if (!r2.hasOwnProperty("lastPart")) {
  81862. _this2.trigger("warn", {
  81863. message: "#EXT-X-RENDITION-REPORT #" + i2 + " lacks required attribute(s): LAST-PART"
  81864. });
  81865. }
  81866. });
  81867. }
  81868. },
  81869. "server-control": function serverControl() {
  81870. var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);
  81871. if (!attrs.hasOwnProperty("canBlockReload")) {
  81872. attrs.canBlockReload = false;
  81873. this.trigger("info", {
  81874. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  81875. });
  81876. }
  81877. setHoldBack.call(this, this.manifest);
  81878. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  81879. this.trigger("warn", {
  81880. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  81881. });
  81882. }
  81883. },
  81884. "preload-hint": function preloadHint() {
  81885. var segmentIndex = this.manifest.segments.length;
  81886. var hint = camelCaseKeys(entry.attributes);
  81887. var isPart = hint.type && hint.type === "PART";
  81888. currentUri.preloadHints = currentUri.preloadHints || [];
  81889. currentUri.preloadHints.push(hint);
  81890. if (hint.byterange) {
  81891. if (!hint.byterange.hasOwnProperty("offset")) {
  81892. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  81893. if (isPart) {
  81894. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  81895. }
  81896. }
  81897. }
  81898. var index2 = currentUri.preloadHints.length - 1;
  81899. this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex, entry.attributes, ["TYPE", "URI"]);
  81900. if (!hint.type) {
  81901. return;
  81902. }
  81903. for (var i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  81904. var otherHint = currentUri.preloadHints[i2];
  81905. if (!otherHint.type) {
  81906. continue;
  81907. }
  81908. if (otherHint.type === hint.type) {
  81909. this.trigger("warn", {
  81910. message: "#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex + " has the same TYPE " + hint.type + " as preload hint #" + i2
  81911. });
  81912. }
  81913. }
  81914. },
  81915. "rendition-report": function renditionReport() {
  81916. var report = camelCaseKeys(entry.attributes);
  81917. this.manifest.renditionReports = this.manifest.renditionReports || [];
  81918. this.manifest.renditionReports.push(report);
  81919. var index2 = this.manifest.renditionReports.length - 1;
  81920. var required = ["LAST-MSN", "URI"];
  81921. if (hasParts) {
  81922. required.push("LAST-PART");
  81923. }
  81924. this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #" + index2, entry.attributes, required);
  81925. },
  81926. "part-inf": function partInf() {
  81927. this.manifest.partInf = camelCaseKeys(entry.attributes);
  81928. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  81929. if (this.manifest.partInf.partTarget) {
  81930. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  81931. }
  81932. setHoldBack.call(this, this.manifest);
  81933. }
  81934. }[entry.tagType] || noop2).call(self2);
  81935. },
  81936. uri: function uri() {
  81937. currentUri.uri = entry.uri;
  81938. uris.push(currentUri);
  81939. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  81940. this.trigger("warn", {
  81941. message: "defaulting segment duration to the target duration"
  81942. });
  81943. currentUri.duration = this.manifest.targetDuration;
  81944. }
  81945. if (_key) {
  81946. currentUri.key = _key;
  81947. }
  81948. currentUri.timeline = currentTimeline;
  81949. if (currentMap) {
  81950. currentUri.map = currentMap;
  81951. }
  81952. lastPartByterangeEnd = 0;
  81953. currentUri = {};
  81954. },
  81955. comment: function comment() {
  81956. },
  81957. custom: function custom() {
  81958. if (entry.segment) {
  81959. currentUri.custom = currentUri.custom || {};
  81960. currentUri.custom[entry.customType] = entry.data;
  81961. } else {
  81962. this.manifest.custom = this.manifest.custom || {};
  81963. this.manifest.custom[entry.customType] = entry.data;
  81964. }
  81965. }
  81966. })[entry.type].call(self2);
  81967. });
  81968. return _this;
  81969. }
  81970. var _proto = Parser2.prototype;
  81971. _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) {
  81972. var missing = [];
  81973. required.forEach(function(key) {
  81974. if (!attributes.hasOwnProperty(key)) {
  81975. missing.push(key);
  81976. }
  81977. });
  81978. if (missing.length) {
  81979. this.trigger("warn", {
  81980. message: identifier + " lacks required attribute(s): " + missing.join(", ")
  81981. });
  81982. }
  81983. };
  81984. _proto.push = function push(chunk) {
  81985. this.lineStream.push(chunk);
  81986. };
  81987. _proto.end = function end() {
  81988. this.lineStream.push("\n");
  81989. this.trigger("end");
  81990. };
  81991. _proto.addParser = function addParser(options2) {
  81992. this.parseStream.addParser(options2);
  81993. };
  81994. _proto.addTagMapper = function addTagMapper(options2) {
  81995. this.parseStream.addTagMapper(options2);
  81996. };
  81997. return Parser2;
  81998. }(Stream);
  81999. var regexs = {
  82000. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  82001. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  82002. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  82003. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  82004. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  82005. text: /^(stpp.ttml.im1t)/,
  82006. muxerVideo: /^(avc0?1)/,
  82007. muxerAudio: /^(mp4a)/,
  82008. muxerText: /a^/
  82009. };
  82010. var mediaTypes = ["video", "audio", "text"];
  82011. var upperMediaTypes = ["Video", "Audio", "Text"];
  82012. var translateLegacyCodec2 = function translateLegacyCodec3(codec) {
  82013. if (!codec) {
  82014. return codec;
  82015. }
  82016. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  82017. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  82018. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  82019. return "avc1." + profileHex + "00" + avcLevelHex;
  82020. });
  82021. };
  82022. var parseCodecs2 = function parseCodecs3(codecString) {
  82023. if (codecString === void 0) {
  82024. codecString = "";
  82025. }
  82026. var codecs = codecString.split(",");
  82027. var result = [];
  82028. codecs.forEach(function(codec) {
  82029. codec = codec.trim();
  82030. var codecType;
  82031. mediaTypes.forEach(function(name) {
  82032. var match = regexs[name].exec(codec.toLowerCase());
  82033. if (!match || match.length <= 1) {
  82034. return;
  82035. }
  82036. codecType = name;
  82037. var type2 = codec.substring(0, match[1].length);
  82038. var details = codec.replace(type2, "");
  82039. result.push({
  82040. type: type2,
  82041. details,
  82042. mediaType: name
  82043. });
  82044. });
  82045. if (!codecType) {
  82046. result.push({
  82047. type: codec,
  82048. details: "",
  82049. mediaType: "unknown"
  82050. });
  82051. }
  82052. });
  82053. return result;
  82054. };
  82055. var codecsFromDefault2 = function codecsFromDefault3(master, audioGroupId) {
  82056. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  82057. return null;
  82058. }
  82059. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  82060. if (!audioGroup) {
  82061. return null;
  82062. }
  82063. for (var name in audioGroup) {
  82064. var audioType = audioGroup[name];
  82065. if (audioType.default && audioType.playlists) {
  82066. return parseCodecs2(audioType.playlists[0].attributes.CODECS);
  82067. }
  82068. }
  82069. return null;
  82070. };
  82071. var isAudioCodec2 = function isAudioCodec3(codec) {
  82072. if (codec === void 0) {
  82073. codec = "";
  82074. }
  82075. return regexs.audio.test(codec.trim().toLowerCase());
  82076. };
  82077. var isTextCodec2 = function isTextCodec3(codec) {
  82078. if (codec === void 0) {
  82079. codec = "";
  82080. }
  82081. return regexs.text.test(codec.trim().toLowerCase());
  82082. };
  82083. var getMimeForCodec2 = function getMimeForCodec3(codecString) {
  82084. if (!codecString || typeof codecString !== "string") {
  82085. return;
  82086. }
  82087. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  82088. return translateLegacyCodec2(c.trim());
  82089. });
  82090. var type2 = "video";
  82091. if (codecs.length === 1 && isAudioCodec2(codecs[0])) {
  82092. type2 = "audio";
  82093. } else if (codecs.length === 1 && isTextCodec2(codecs[0])) {
  82094. type2 = "application";
  82095. }
  82096. var container = "mp4";
  82097. if (codecs.every(function(c) {
  82098. return regexs.mp4.test(c);
  82099. })) {
  82100. container = "mp4";
  82101. } else if (codecs.every(function(c) {
  82102. return regexs.webm.test(c);
  82103. })) {
  82104. container = "webm";
  82105. } else if (codecs.every(function(c) {
  82106. return regexs.ogg.test(c);
  82107. })) {
  82108. container = "ogg";
  82109. }
  82110. return type2 + "/" + container + ';codecs="' + codecString + '"';
  82111. };
  82112. var browserSupportsCodec2 = function browserSupportsCodec3(codecString) {
  82113. if (codecString === void 0) {
  82114. codecString = "";
  82115. }
  82116. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec2(codecString)) || false;
  82117. };
  82118. var muxerSupportsCodec2 = function muxerSupportsCodec3(codecString) {
  82119. if (codecString === void 0) {
  82120. codecString = "";
  82121. }
  82122. return codecString.toLowerCase().split(",").every(function(codec) {
  82123. codec = codec.trim();
  82124. for (var i2 = 0; i2 < upperMediaTypes.length; i2++) {
  82125. var type2 = upperMediaTypes[i2];
  82126. if (regexs["muxer" + type2].test(codec)) {
  82127. return true;
  82128. }
  82129. }
  82130. return false;
  82131. });
  82132. };
  82133. var DEFAULT_AUDIO_CODEC = "mp4a.40.2";
  82134. var DEFAULT_VIDEO_CODEC = "avc1.4d400d";
  82135. var MPEGURL_REGEX = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  82136. var DASH_REGEX = /^application\/dash\+xml/i;
  82137. var simpleTypeFromSourceType2 = function simpleTypeFromSourceType3(type2) {
  82138. if (MPEGURL_REGEX.test(type2)) {
  82139. return "hls";
  82140. }
  82141. if (DASH_REGEX.test(type2)) {
  82142. return "dash";
  82143. }
  82144. if (type2 === "application/vnd.videojs.vhs+json") {
  82145. return "vhs-json";
  82146. }
  82147. return null;
  82148. };
  82149. var countBits2 = function countBits3(x) {
  82150. return x.toString(2).length;
  82151. };
  82152. var countBytes2 = function countBytes3(x) {
  82153. return Math.ceil(countBits2(x) / 8);
  82154. };
  82155. var isArrayBufferView2 = function isArrayBufferView3(obj) {
  82156. if (ArrayBuffer.isView === "function") {
  82157. return ArrayBuffer.isView(obj);
  82158. }
  82159. return obj && obj.buffer instanceof ArrayBuffer;
  82160. };
  82161. var isTypedArray2 = function isTypedArray3(obj) {
  82162. return isArrayBufferView2(obj);
  82163. };
  82164. var toUint82 = function toUint83(bytes) {
  82165. if (bytes instanceof Uint8Array) {
  82166. return bytes;
  82167. }
  82168. if (!Array.isArray(bytes) && !isTypedArray2(bytes) && !(bytes instanceof ArrayBuffer)) {
  82169. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  82170. bytes = 0;
  82171. } else {
  82172. bytes = [bytes];
  82173. }
  82174. }
  82175. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  82176. };
  82177. var BigInt = window_1.BigInt || Number;
  82178. var BYTE_TABLE = [BigInt("0x1"), BigInt("0x100"), BigInt("0x10000"), BigInt("0x1000000"), BigInt("0x100000000"), BigInt("0x10000000000"), BigInt("0x1000000000000"), BigInt("0x100000000000000"), BigInt("0x10000000000000000")];
  82179. (function() {
  82180. var a = new Uint16Array([65484]);
  82181. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  82182. if (b[0] === 255) {
  82183. return "big";
  82184. }
  82185. if (b[0] === 204) {
  82186. return "little";
  82187. }
  82188. return "unknown";
  82189. })();
  82190. var bytesToNumber2 = function bytesToNumber3(bytes, _temp) {
  82191. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  82192. bytes = toUint82(bytes);
  82193. var fn2 = le ? "reduce" : "reduceRight";
  82194. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  82195. var number = obj.call(bytes, function(total, byte, i2) {
  82196. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82197. return total + BigInt(byte) * BYTE_TABLE[exponent];
  82198. }, BigInt(0));
  82199. if (signed) {
  82200. var max2 = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);
  82201. number = BigInt(number);
  82202. if (number > max2) {
  82203. number -= max2;
  82204. number -= max2;
  82205. number -= BigInt(2);
  82206. }
  82207. }
  82208. return Number(number);
  82209. };
  82210. var numberToBytes2 = function numberToBytes3(number, _temp2) {
  82211. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  82212. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  82213. number = 0;
  82214. }
  82215. number = BigInt(number);
  82216. var byteCount = countBytes2(number);
  82217. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  82218. for (var i2 = 0; i2 < byteCount; i2++) {
  82219. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82220. bytes[byteIndex] = Number(number / BYTE_TABLE[i2] & BigInt(255));
  82221. if (number < 0) {
  82222. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  82223. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  82224. }
  82225. }
  82226. return bytes;
  82227. };
  82228. var stringToBytes2 = function stringToBytes3(string, stringIsBytes) {
  82229. if (typeof string !== "string" && string && typeof string.toString === "function") {
  82230. string = string.toString();
  82231. }
  82232. if (typeof string !== "string") {
  82233. return new Uint8Array();
  82234. }
  82235. if (!stringIsBytes) {
  82236. string = unescape(encodeURIComponent(string));
  82237. }
  82238. var view = new Uint8Array(string.length);
  82239. for (var i2 = 0; i2 < string.length; i2++) {
  82240. view[i2] = string.charCodeAt(i2);
  82241. }
  82242. return view;
  82243. };
  82244. var concatTypedArrays2 = function concatTypedArrays3() {
  82245. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  82246. buffers[_key] = arguments[_key];
  82247. }
  82248. buffers = buffers.filter(function(b) {
  82249. return b && (b.byteLength || b.length) && typeof b !== "string";
  82250. });
  82251. if (buffers.length <= 1) {
  82252. return toUint82(buffers[0]);
  82253. }
  82254. var totalLen = buffers.reduce(function(total, buf, i2) {
  82255. return total + (buf.byteLength || buf.length);
  82256. }, 0);
  82257. var tempBuffer = new Uint8Array(totalLen);
  82258. var offset = 0;
  82259. buffers.forEach(function(buf) {
  82260. buf = toUint82(buf);
  82261. tempBuffer.set(buf, offset);
  82262. offset += buf.byteLength;
  82263. });
  82264. return tempBuffer;
  82265. };
  82266. var bytesMatch2 = function bytesMatch3(a, b, _temp3) {
  82267. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  82268. a = toUint82(a);
  82269. b = toUint82(b);
  82270. var fn2 = b.every ? b.every : Array.prototype.every;
  82271. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  82272. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  82273. return bByte === aByte;
  82274. });
  82275. };
  82276. var forEachMediaGroup$1 = function forEachMediaGroup2(master, groups, callback2) {
  82277. groups.forEach(function(mediaType) {
  82278. for (var groupKey in master.mediaGroups[mediaType]) {
  82279. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  82280. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  82281. callback2(mediaProperties, mediaType, groupKey, labelKey);
  82282. }
  82283. }
  82284. });
  82285. };
  82286. /*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */
  82287. var isObject$1 = function isObject(obj) {
  82288. return !!obj && typeof obj === "object";
  82289. };
  82290. var merge = function merge2() {
  82291. for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
  82292. objects[_key] = arguments[_key];
  82293. }
  82294. return objects.reduce(function(result, source) {
  82295. if (typeof source !== "object") {
  82296. return result;
  82297. }
  82298. Object.keys(source).forEach(function(key) {
  82299. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  82300. result[key] = result[key].concat(source[key]);
  82301. } else if (isObject$1(result[key]) && isObject$1(source[key])) {
  82302. result[key] = merge2(result[key], source[key]);
  82303. } else {
  82304. result[key] = source[key];
  82305. }
  82306. });
  82307. return result;
  82308. }, {});
  82309. };
  82310. var values = function values2(o) {
  82311. return Object.keys(o).map(function(k) {
  82312. return o[k];
  82313. });
  82314. };
  82315. var range = function range2(start2, end) {
  82316. var result = [];
  82317. for (var i2 = start2; i2 < end; i2++) {
  82318. result.push(i2);
  82319. }
  82320. return result;
  82321. };
  82322. var flatten = function flatten2(lists) {
  82323. return lists.reduce(function(x, y) {
  82324. return x.concat(y);
  82325. }, []);
  82326. };
  82327. var from = function from2(list) {
  82328. if (!list.length) {
  82329. return [];
  82330. }
  82331. var result = [];
  82332. for (var i2 = 0; i2 < list.length; i2++) {
  82333. result.push(list[i2]);
  82334. }
  82335. return result;
  82336. };
  82337. var findIndexes = function findIndexes2(l, key) {
  82338. return l.reduce(function(a, e, i2) {
  82339. if (e[key]) {
  82340. a.push(i2);
  82341. }
  82342. return a;
  82343. }, []);
  82344. };
  82345. var findIndex = function findIndex2(list, matchingFunction) {
  82346. for (var i2 = 0; i2 < list.length; i2++) {
  82347. if (matchingFunction(list[i2])) {
  82348. return i2;
  82349. }
  82350. }
  82351. return -1;
  82352. };
  82353. var union = function union2(lists, keyFunction) {
  82354. return values(lists.reduce(function(acc, list) {
  82355. list.forEach(function(el) {
  82356. acc[keyFunction(el)] = el;
  82357. });
  82358. return acc;
  82359. }, {}));
  82360. };
  82361. var errors = {
  82362. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  82363. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  82364. DASH_INVALID_XML: "DASH_INVALID_XML",
  82365. NO_BASE_URL: "NO_BASE_URL",
  82366. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  82367. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  82368. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  82369. };
  82370. var urlTypeToSegment = function urlTypeToSegment2(_ref) {
  82371. var _ref$baseUrl = _ref.baseUrl, baseUrl = _ref$baseUrl === void 0 ? "" : _ref$baseUrl, _ref$source = _ref.source, source = _ref$source === void 0 ? "" : _ref$source, _ref$range = _ref.range, range3 = _ref$range === void 0 ? "" : _ref$range, _ref$indexRange = _ref.indexRange, indexRange = _ref$indexRange === void 0 ? "" : _ref$indexRange;
  82372. var segment = {
  82373. uri: source,
  82374. resolvedUri: resolveUrl$1(baseUrl || "", source)
  82375. };
  82376. if (range3 || indexRange) {
  82377. var rangeStr = range3 ? range3 : indexRange;
  82378. var ranges = rangeStr.split("-");
  82379. var startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  82380. var endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  82381. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  82382. startRange = Number(startRange);
  82383. }
  82384. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  82385. endRange = Number(endRange);
  82386. }
  82387. var length;
  82388. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  82389. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  82390. } else {
  82391. length = endRange - startRange + 1;
  82392. }
  82393. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  82394. length = Number(length);
  82395. }
  82396. segment.byterange = {
  82397. length,
  82398. offset: startRange
  82399. };
  82400. }
  82401. return segment;
  82402. };
  82403. var byteRangeToString = function byteRangeToString2(byterange) {
  82404. var endRange;
  82405. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  82406. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  82407. } else {
  82408. endRange = byterange.offset + byterange.length - 1;
  82409. }
  82410. return byterange.offset + "-" + endRange;
  82411. };
  82412. var parseEndNumber = function parseEndNumber2(endNumber) {
  82413. if (endNumber && typeof endNumber !== "number") {
  82414. endNumber = parseInt(endNumber, 10);
  82415. }
  82416. if (isNaN(endNumber)) {
  82417. return null;
  82418. }
  82419. return endNumber;
  82420. };
  82421. var segmentRange = {
  82422. static: function _static(attributes) {
  82423. var duration5 = attributes.duration, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, sourceDuration = attributes.sourceDuration, periodDuration = attributes.periodDuration;
  82424. var endNumber = parseEndNumber(attributes.endNumber);
  82425. var segmentDuration = duration5 / timescale2;
  82426. if (typeof endNumber === "number") {
  82427. return {
  82428. start: 0,
  82429. end: endNumber
  82430. };
  82431. }
  82432. if (typeof periodDuration === "number") {
  82433. return {
  82434. start: 0,
  82435. end: periodDuration / segmentDuration
  82436. };
  82437. }
  82438. return {
  82439. start: 0,
  82440. end: sourceDuration / segmentDuration
  82441. };
  82442. },
  82443. dynamic: function dynamic(attributes) {
  82444. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, duration5 = attributes.duration, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp, _attributes$timeShift = attributes.timeShiftBufferDepth, timeShiftBufferDepth2 = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;
  82445. var endNumber = parseEndNumber(attributes.endNumber);
  82446. var now2 = (NOW + clientOffset) / 1e3;
  82447. var periodStartWC = availabilityStartTime2 + periodStart;
  82448. var periodEndWC = now2 + minimumUpdatePeriod2;
  82449. var periodDuration = periodEndWC - periodStartWC;
  82450. var segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  82451. var availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  82452. var availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  82453. return {
  82454. start: Math.max(0, availableStart),
  82455. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  82456. };
  82457. }
  82458. };
  82459. var toSegments = function toSegments2(attributes) {
  82460. return function(number) {
  82461. var duration5 = attributes.duration, _attributes$timescale3 = attributes.timescale, timescale2 = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3, periodStart = attributes.periodStart, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;
  82462. return {
  82463. number: startNumber2 + number,
  82464. duration: duration5 / timescale2,
  82465. timeline: periodStart,
  82466. time: number * duration5
  82467. };
  82468. };
  82469. };
  82470. var parseByDuration = function parseByDuration2(attributes) {
  82471. var type2 = attributes.type, duration5 = attributes.duration, _attributes$timescale4 = attributes.timescale, timescale2 = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4, periodDuration = attributes.periodDuration, sourceDuration = attributes.sourceDuration;
  82472. var _segmentRange$type = segmentRange[type2](attributes), start2 = _segmentRange$type.start, end = _segmentRange$type.end;
  82473. var segments = range(start2, end).map(toSegments(attributes));
  82474. if (type2 === "static") {
  82475. var index2 = segments.length - 1;
  82476. var sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  82477. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  82478. }
  82479. return segments;
  82480. };
  82481. var segmentsFromBase = function segmentsFromBase2(attributes) {
  82482. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ, sourceDuration = attributes.sourceDuration, _attributes$indexRang = attributes.indexRange, indexRange = _attributes$indexRang === void 0 ? "" : _attributes$indexRang, periodStart = attributes.periodStart, presentationTime = attributes.presentationTime, _attributes$number = attributes.number, number = _attributes$number === void 0 ? 0 : _attributes$number, duration5 = attributes.duration;
  82483. if (!baseUrl) {
  82484. throw new Error(errors.NO_BASE_URL);
  82485. }
  82486. var initSegment = urlTypeToSegment({
  82487. baseUrl,
  82488. source: initialization.sourceURL,
  82489. range: initialization.range
  82490. });
  82491. var segment = urlTypeToSegment({
  82492. baseUrl,
  82493. source: baseUrl,
  82494. indexRange
  82495. });
  82496. segment.map = initSegment;
  82497. if (duration5) {
  82498. var segmentTimeInfo = parseByDuration(attributes);
  82499. if (segmentTimeInfo.length) {
  82500. segment.duration = segmentTimeInfo[0].duration;
  82501. segment.timeline = segmentTimeInfo[0].timeline;
  82502. }
  82503. } else if (sourceDuration) {
  82504. segment.duration = sourceDuration;
  82505. segment.timeline = periodStart;
  82506. }
  82507. segment.presentationTime = presentationTime || periodStart;
  82508. segment.number = number;
  82509. return [segment];
  82510. };
  82511. var addSidxSegmentsToPlaylist$1 = function addSidxSegmentsToPlaylist(playlist, sidx, baseUrl) {
  82512. var initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  82513. var sourceDuration = playlist.sidx.duration;
  82514. var timeline = playlist.timeline || 0;
  82515. var sidxByteRange = playlist.sidx.byterange;
  82516. var sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  82517. var timescale2 = sidx.timescale;
  82518. var mediaReferences = sidx.references.filter(function(r2) {
  82519. return r2.referenceType !== 1;
  82520. });
  82521. var segments = [];
  82522. var type2 = playlist.endList ? "static" : "dynamic";
  82523. var periodStart = playlist.sidx.timeline;
  82524. var presentationTime = periodStart;
  82525. var number = playlist.mediaSequence || 0;
  82526. var startIndex;
  82527. if (typeof sidx.firstOffset === "bigint") {
  82528. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  82529. } else {
  82530. startIndex = sidxEnd + sidx.firstOffset;
  82531. }
  82532. for (var i2 = 0; i2 < mediaReferences.length; i2++) {
  82533. var reference = sidx.references[i2];
  82534. var size = reference.referencedSize;
  82535. var duration5 = reference.subsegmentDuration;
  82536. var endIndex = void 0;
  82537. if (typeof startIndex === "bigint") {
  82538. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  82539. } else {
  82540. endIndex = startIndex + size - 1;
  82541. }
  82542. var indexRange = startIndex + "-" + endIndex;
  82543. var attributes = {
  82544. baseUrl,
  82545. timescale: timescale2,
  82546. timeline,
  82547. periodStart,
  82548. presentationTime,
  82549. number,
  82550. duration: duration5,
  82551. sourceDuration,
  82552. indexRange,
  82553. type: type2
  82554. };
  82555. var segment = segmentsFromBase(attributes)[0];
  82556. if (initSegment) {
  82557. segment.map = initSegment;
  82558. }
  82559. segments.push(segment);
  82560. if (typeof startIndex === "bigint") {
  82561. startIndex += window_1.BigInt(size);
  82562. } else {
  82563. startIndex += size;
  82564. }
  82565. presentationTime += duration5 / timescale2;
  82566. number++;
  82567. }
  82568. playlist.segments = segments;
  82569. return playlist;
  82570. };
  82571. var SUPPORTED_MEDIA_TYPES = ["AUDIO", "SUBTITLES"];
  82572. var TIME_FUDGE = 1 / 60;
  82573. var getUniqueTimelineStarts = function getUniqueTimelineStarts2(timelineStarts) {
  82574. return union(timelineStarts, function(_ref) {
  82575. var timeline = _ref.timeline;
  82576. return timeline;
  82577. }).sort(function(a, b) {
  82578. return a.timeline > b.timeline ? 1 : -1;
  82579. });
  82580. };
  82581. var findPlaylistWithName = function findPlaylistWithName2(playlists, name) {
  82582. for (var i2 = 0; i2 < playlists.length; i2++) {
  82583. if (playlists[i2].attributes.NAME === name) {
  82584. return playlists[i2];
  82585. }
  82586. }
  82587. return null;
  82588. };
  82589. var getMediaGroupPlaylists = function getMediaGroupPlaylists2(manifest) {
  82590. var mediaGroupPlaylists = [];
  82591. forEachMediaGroup$1(manifest, SUPPORTED_MEDIA_TYPES, function(properties, type2, group, label2) {
  82592. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  82593. });
  82594. return mediaGroupPlaylists;
  82595. };
  82596. var updateMediaSequenceForPlaylist = function updateMediaSequenceForPlaylist2(_ref2) {
  82597. var playlist = _ref2.playlist, mediaSequence = _ref2.mediaSequence;
  82598. playlist.mediaSequence = mediaSequence;
  82599. playlist.segments.forEach(function(segment, index2) {
  82600. segment.number = playlist.mediaSequence + index2;
  82601. });
  82602. };
  82603. var updateSequenceNumbers = function updateSequenceNumbers2(_ref3) {
  82604. var oldPlaylists = _ref3.oldPlaylists, newPlaylists = _ref3.newPlaylists, timelineStarts = _ref3.timelineStarts;
  82605. newPlaylists.forEach(function(playlist) {
  82606. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref4) {
  82607. var timeline = _ref4.timeline;
  82608. return timeline === playlist.timeline;
  82609. });
  82610. var oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);
  82611. if (!oldPlaylist) {
  82612. return;
  82613. }
  82614. if (playlist.sidx) {
  82615. return;
  82616. }
  82617. var firstNewSegment = playlist.segments[0];
  82618. var oldMatchingSegmentIndex = findIndex(oldPlaylist.segments, function(oldSegment) {
  82619. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;
  82620. });
  82621. if (oldMatchingSegmentIndex === -1) {
  82622. updateMediaSequenceForPlaylist({
  82623. playlist,
  82624. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  82625. });
  82626. playlist.segments[0].discontinuity = true;
  82627. playlist.discontinuityStarts.unshift(0);
  82628. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  82629. playlist.discontinuitySequence--;
  82630. }
  82631. return;
  82632. }
  82633. var oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  82634. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  82635. firstNewSegment.discontinuity = true;
  82636. playlist.discontinuityStarts.unshift(0);
  82637. playlist.discontinuitySequence--;
  82638. }
  82639. updateMediaSequenceForPlaylist({
  82640. playlist,
  82641. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  82642. });
  82643. });
  82644. };
  82645. var positionManifestOnTimeline = function positionManifestOnTimeline2(_ref5) {
  82646. var oldManifest = _ref5.oldManifest, newManifest = _ref5.newManifest;
  82647. var oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));
  82648. var newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest));
  82649. newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);
  82650. updateSequenceNumbers({
  82651. oldPlaylists,
  82652. newPlaylists,
  82653. timelineStarts: newManifest.timelineStarts
  82654. });
  82655. return newManifest;
  82656. };
  82657. var generateSidxKey = function generateSidxKey2(sidx) {
  82658. return sidx && sidx.uri + "-" + byteRangeToString(sidx.byterange);
  82659. };
  82660. var mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists2(playlists) {
  82661. var mergedPlaylists = values(playlists.reduce(function(acc, playlist) {
  82662. var name = playlist.attributes.id + (playlist.attributes.lang || "");
  82663. if (!acc[name]) {
  82664. acc[name] = playlist;
  82665. acc[name].attributes.timelineStarts = [];
  82666. } else {
  82667. if (playlist.segments) {
  82668. var _acc$name$segments;
  82669. if (playlist.segments[0]) {
  82670. playlist.segments[0].discontinuity = true;
  82671. }
  82672. (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments);
  82673. }
  82674. if (playlist.attributes.contentProtection) {
  82675. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  82676. }
  82677. }
  82678. acc[name].attributes.timelineStarts.push({
  82679. start: playlist.attributes.periodStart,
  82680. timeline: playlist.attributes.periodStart
  82681. });
  82682. return acc;
  82683. }, {}));
  82684. return mergedPlaylists.map(function(playlist) {
  82685. playlist.discontinuityStarts = findIndexes(playlist.segments || [], "discontinuity");
  82686. return playlist;
  82687. });
  82688. };
  82689. var addSidxSegmentsToPlaylist2 = function addSidxSegmentsToPlaylist3(playlist, sidxMapping) {
  82690. var sidxKey = generateSidxKey(playlist.sidx);
  82691. var sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  82692. if (sidxMatch) {
  82693. addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  82694. }
  82695. return playlist;
  82696. };
  82697. var addSidxSegmentsToPlaylists = function addSidxSegmentsToPlaylists2(playlists, sidxMapping) {
  82698. if (sidxMapping === void 0) {
  82699. sidxMapping = {};
  82700. }
  82701. if (!Object.keys(sidxMapping).length) {
  82702. return playlists;
  82703. }
  82704. for (var i2 in playlists) {
  82705. playlists[i2] = addSidxSegmentsToPlaylist2(playlists[i2], sidxMapping);
  82706. }
  82707. return playlists;
  82708. };
  82709. var formatAudioPlaylist = function formatAudioPlaylist2(_ref, isAudioOnly3) {
  82710. var _attributes;
  82711. var attributes = _ref.attributes, segments = _ref.segments, sidx = _ref.sidx, mediaSequence = _ref.mediaSequence, discontinuitySequence = _ref.discontinuitySequence, discontinuityStarts = _ref.discontinuityStarts;
  82712. var playlist = {
  82713. attributes: (_attributes = {
  82714. NAME: attributes.id,
  82715. BANDWIDTH: attributes.bandwidth,
  82716. CODECS: attributes.codecs
  82717. }, _attributes["PROGRAM-ID"] = 1, _attributes),
  82718. uri: "",
  82719. endList: attributes.type === "static",
  82720. timeline: attributes.periodStart,
  82721. resolvedUri: "",
  82722. targetDuration: attributes.duration,
  82723. discontinuitySequence,
  82724. discontinuityStarts,
  82725. timelineStarts: attributes.timelineStarts,
  82726. mediaSequence,
  82727. segments
  82728. };
  82729. if (attributes.contentProtection) {
  82730. playlist.contentProtection = attributes.contentProtection;
  82731. }
  82732. if (sidx) {
  82733. playlist.sidx = sidx;
  82734. }
  82735. if (isAudioOnly3) {
  82736. playlist.attributes.AUDIO = "audio";
  82737. playlist.attributes.SUBTITLES = "subs";
  82738. }
  82739. return playlist;
  82740. };
  82741. var formatVttPlaylist = function formatVttPlaylist2(_ref2) {
  82742. var _m3u8Attributes;
  82743. var attributes = _ref2.attributes, segments = _ref2.segments, mediaSequence = _ref2.mediaSequence, discontinuityStarts = _ref2.discontinuityStarts, discontinuitySequence = _ref2.discontinuitySequence;
  82744. if (typeof segments === "undefined") {
  82745. segments = [{
  82746. uri: attributes.baseUrl,
  82747. timeline: attributes.periodStart,
  82748. resolvedUri: attributes.baseUrl || "",
  82749. duration: attributes.sourceDuration,
  82750. number: 0
  82751. }];
  82752. attributes.duration = attributes.sourceDuration;
  82753. }
  82754. var m3u8Attributes = (_m3u8Attributes = {
  82755. NAME: attributes.id,
  82756. BANDWIDTH: attributes.bandwidth
  82757. }, _m3u8Attributes["PROGRAM-ID"] = 1, _m3u8Attributes);
  82758. if (attributes.codecs) {
  82759. m3u8Attributes.CODECS = attributes.codecs;
  82760. }
  82761. return {
  82762. attributes: m3u8Attributes,
  82763. uri: "",
  82764. endList: attributes.type === "static",
  82765. timeline: attributes.periodStart,
  82766. resolvedUri: attributes.baseUrl || "",
  82767. targetDuration: attributes.duration,
  82768. timelineStarts: attributes.timelineStarts,
  82769. discontinuityStarts,
  82770. discontinuitySequence,
  82771. mediaSequence,
  82772. segments
  82773. };
  82774. };
  82775. var organizeAudioPlaylists = function organizeAudioPlaylists2(playlists, sidxMapping, isAudioOnly3) {
  82776. if (sidxMapping === void 0) {
  82777. sidxMapping = {};
  82778. }
  82779. if (isAudioOnly3 === void 0) {
  82780. isAudioOnly3 = false;
  82781. }
  82782. var mainPlaylist;
  82783. var formattedPlaylists = playlists.reduce(function(a, playlist) {
  82784. var role = playlist.attributes.role && playlist.attributes.role.value || "";
  82785. var language = playlist.attributes.lang || "";
  82786. var label2 = playlist.attributes.label || "main";
  82787. if (language && !playlist.attributes.label) {
  82788. var roleLabel = role ? " (" + role + ")" : "";
  82789. label2 = "" + playlist.attributes.lang + roleLabel;
  82790. }
  82791. if (!a[label2]) {
  82792. a[label2] = {
  82793. language,
  82794. autoselect: true,
  82795. default: role === "main",
  82796. playlists: [],
  82797. uri: ""
  82798. };
  82799. }
  82800. var formatted = addSidxSegmentsToPlaylist2(formatAudioPlaylist(playlist, isAudioOnly3), sidxMapping);
  82801. a[label2].playlists.push(formatted);
  82802. if (typeof mainPlaylist === "undefined" && role === "main") {
  82803. mainPlaylist = playlist;
  82804. mainPlaylist.default = true;
  82805. }
  82806. return a;
  82807. }, {});
  82808. if (!mainPlaylist) {
  82809. var firstLabel = Object.keys(formattedPlaylists)[0];
  82810. formattedPlaylists[firstLabel].default = true;
  82811. }
  82812. return formattedPlaylists;
  82813. };
  82814. var organizeVttPlaylists = function organizeVttPlaylists2(playlists, sidxMapping) {
  82815. if (sidxMapping === void 0) {
  82816. sidxMapping = {};
  82817. }
  82818. return playlists.reduce(function(a, playlist) {
  82819. var label2 = playlist.attributes.lang || "text";
  82820. if (!a[label2]) {
  82821. a[label2] = {
  82822. language: label2,
  82823. default: false,
  82824. autoselect: false,
  82825. playlists: [],
  82826. uri: ""
  82827. };
  82828. }
  82829. a[label2].playlists.push(addSidxSegmentsToPlaylist2(formatVttPlaylist(playlist), sidxMapping));
  82830. return a;
  82831. }, {});
  82832. };
  82833. var organizeCaptionServices = function organizeCaptionServices2(captionServices) {
  82834. return captionServices.reduce(function(svcObj, svc) {
  82835. if (!svc) {
  82836. return svcObj;
  82837. }
  82838. svc.forEach(function(service) {
  82839. var channel = service.channel, language = service.language;
  82840. svcObj[language] = {
  82841. autoselect: false,
  82842. default: false,
  82843. instreamId: channel,
  82844. language
  82845. };
  82846. if (service.hasOwnProperty("aspectRatio")) {
  82847. svcObj[language].aspectRatio = service.aspectRatio;
  82848. }
  82849. if (service.hasOwnProperty("easyReader")) {
  82850. svcObj[language].easyReader = service.easyReader;
  82851. }
  82852. if (service.hasOwnProperty("3D")) {
  82853. svcObj[language]["3D"] = service["3D"];
  82854. }
  82855. });
  82856. return svcObj;
  82857. }, {});
  82858. };
  82859. var formatVideoPlaylist = function formatVideoPlaylist2(_ref3) {
  82860. var _attributes2;
  82861. var attributes = _ref3.attributes, segments = _ref3.segments, sidx = _ref3.sidx, discontinuityStarts = _ref3.discontinuityStarts;
  82862. var playlist = {
  82863. attributes: (_attributes2 = {
  82864. NAME: attributes.id,
  82865. AUDIO: "audio",
  82866. SUBTITLES: "subs",
  82867. RESOLUTION: {
  82868. width: attributes.width,
  82869. height: attributes.height
  82870. },
  82871. CODECS: attributes.codecs,
  82872. BANDWIDTH: attributes.bandwidth
  82873. }, _attributes2["PROGRAM-ID"] = 1, _attributes2),
  82874. uri: "",
  82875. endList: attributes.type === "static",
  82876. timeline: attributes.periodStart,
  82877. resolvedUri: "",
  82878. targetDuration: attributes.duration,
  82879. discontinuityStarts,
  82880. timelineStarts: attributes.timelineStarts,
  82881. segments
  82882. };
  82883. if (attributes.frameRate) {
  82884. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  82885. }
  82886. if (attributes.contentProtection) {
  82887. playlist.contentProtection = attributes.contentProtection;
  82888. }
  82889. if (sidx) {
  82890. playlist.sidx = sidx;
  82891. }
  82892. return playlist;
  82893. };
  82894. var videoOnly = function videoOnly2(_ref4) {
  82895. var attributes = _ref4.attributes;
  82896. return attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  82897. };
  82898. var audioOnly = function audioOnly2(_ref5) {
  82899. var attributes = _ref5.attributes;
  82900. return attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  82901. };
  82902. var vttOnly = function vttOnly2(_ref6) {
  82903. var attributes = _ref6.attributes;
  82904. return attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  82905. };
  82906. var addMediaSequenceValues = function addMediaSequenceValues2(playlists, timelineStarts) {
  82907. playlists.forEach(function(playlist) {
  82908. playlist.mediaSequence = 0;
  82909. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref7) {
  82910. var timeline = _ref7.timeline;
  82911. return timeline === playlist.timeline;
  82912. });
  82913. if (!playlist.segments) {
  82914. return;
  82915. }
  82916. playlist.segments.forEach(function(segment, index2) {
  82917. segment.number = index2;
  82918. });
  82919. });
  82920. };
  82921. var flattenMediaGroupPlaylists = function flattenMediaGroupPlaylists2(mediaGroupObject) {
  82922. if (!mediaGroupObject) {
  82923. return [];
  82924. }
  82925. return Object.keys(mediaGroupObject).reduce(function(acc, label2) {
  82926. var labelContents = mediaGroupObject[label2];
  82927. return acc.concat(labelContents.playlists);
  82928. }, []);
  82929. };
  82930. var toM3u8 = function toM3u82(_ref8) {
  82931. var _mediaGroups;
  82932. var dashPlaylists = _ref8.dashPlaylists, locations = _ref8.locations, _ref8$sidxMapping = _ref8.sidxMapping, sidxMapping = _ref8$sidxMapping === void 0 ? {} : _ref8$sidxMapping, previousManifest = _ref8.previousManifest;
  82933. if (!dashPlaylists.length) {
  82934. return {};
  82935. }
  82936. var _dashPlaylists$0$attr = dashPlaylists[0].attributes, duration5 = _dashPlaylists$0$attr.sourceDuration, type2 = _dashPlaylists$0$attr.type, suggestedPresentationDelay2 = _dashPlaylists$0$attr.suggestedPresentationDelay, minimumUpdatePeriod2 = _dashPlaylists$0$attr.minimumUpdatePeriod;
  82937. var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);
  82938. var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));
  82939. var vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));
  82940. var captions = dashPlaylists.map(function(playlist) {
  82941. return playlist.attributes.captionServices;
  82942. }).filter(Boolean);
  82943. var manifest = {
  82944. allowCache: true,
  82945. discontinuityStarts: [],
  82946. segments: [],
  82947. endList: true,
  82948. mediaGroups: (_mediaGroups = {
  82949. AUDIO: {},
  82950. VIDEO: {}
  82951. }, _mediaGroups["CLOSED-CAPTIONS"] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),
  82952. uri: "",
  82953. duration: duration5,
  82954. playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)
  82955. };
  82956. if (minimumUpdatePeriod2 >= 0) {
  82957. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  82958. }
  82959. if (locations) {
  82960. manifest.locations = locations;
  82961. }
  82962. if (type2 === "dynamic") {
  82963. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  82964. }
  82965. var isAudioOnly3 = manifest.playlists.length === 0;
  82966. var organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  82967. var organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;
  82968. var formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));
  82969. var playlistTimelineStarts = formattedPlaylists.map(function(_ref9) {
  82970. var timelineStarts = _ref9.timelineStarts;
  82971. return timelineStarts;
  82972. });
  82973. manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);
  82974. addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);
  82975. if (organizedAudioGroup) {
  82976. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  82977. }
  82978. if (organizedVttGroup) {
  82979. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  82980. }
  82981. if (captions.length) {
  82982. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices(captions);
  82983. }
  82984. if (previousManifest) {
  82985. return positionManifestOnTimeline({
  82986. oldManifest: previousManifest,
  82987. newManifest: manifest
  82988. });
  82989. }
  82990. return manifest;
  82991. };
  82992. var getLiveRValue = function getLiveRValue2(attributes, time, duration5) {
  82993. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;
  82994. var now2 = (NOW + clientOffset) / 1e3;
  82995. var periodStartWC = availabilityStartTime2 + periodStart;
  82996. var periodEndWC = now2 + minimumUpdatePeriod2;
  82997. var periodDuration = periodEndWC - periodStartWC;
  82998. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  82999. };
  83000. var parseByTimeline = function parseByTimeline2(attributes, segmentTimeline) {
  83001. var type2 = attributes.type, _attributes$minimumUp2 = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2, _attributes$media = attributes.media, media = _attributes$media === void 0 ? "" : _attributes$media, sourceDuration = attributes.sourceDuration, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb, timeline = attributes.periodStart;
  83002. var segments = [];
  83003. var time = -1;
  83004. for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  83005. var S = segmentTimeline[sIndex];
  83006. var duration5 = S.d;
  83007. var repeat = S.r || 0;
  83008. var segmentTime = S.t || 0;
  83009. if (time < 0) {
  83010. time = segmentTime;
  83011. }
  83012. if (segmentTime && segmentTime > time) {
  83013. time = segmentTime;
  83014. }
  83015. var count = void 0;
  83016. if (repeat < 0) {
  83017. var nextS = sIndex + 1;
  83018. if (nextS === segmentTimeline.length) {
  83019. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  83020. count = getLiveRValue(attributes, time, duration5);
  83021. } else {
  83022. count = (sourceDuration * timescale2 - time) / duration5;
  83023. }
  83024. } else {
  83025. count = (segmentTimeline[nextS].t - time) / duration5;
  83026. }
  83027. } else {
  83028. count = repeat + 1;
  83029. }
  83030. var end = startNumber2 + segments.length + count;
  83031. var number = startNumber2 + segments.length;
  83032. while (number < end) {
  83033. segments.push({
  83034. number,
  83035. duration: duration5 / timescale2,
  83036. time,
  83037. timeline
  83038. });
  83039. time += duration5;
  83040. number++;
  83041. }
  83042. }
  83043. return segments;
  83044. };
  83045. var identifierPattern = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  83046. var identifierReplacement = function identifierReplacement2(values3) {
  83047. return function(match, identifier, format, width2) {
  83048. if (match === "$$") {
  83049. return "$";
  83050. }
  83051. if (typeof values3[identifier] === "undefined") {
  83052. return match;
  83053. }
  83054. var value = "" + values3[identifier];
  83055. if (identifier === "RepresentationID") {
  83056. return value;
  83057. }
  83058. if (!format) {
  83059. width2 = 1;
  83060. } else {
  83061. width2 = parseInt(width2, 10);
  83062. }
  83063. if (value.length >= width2) {
  83064. return value;
  83065. }
  83066. return "" + new Array(width2 - value.length + 1).join("0") + value;
  83067. };
  83068. };
  83069. var constructTemplateUrl = function constructTemplateUrl2(url, values3) {
  83070. return url.replace(identifierPattern, identifierReplacement(values3));
  83071. };
  83072. var parseTemplateInfo = function parseTemplateInfo2(attributes, segmentTimeline) {
  83073. if (!attributes.duration && !segmentTimeline) {
  83074. return [{
  83075. number: attributes.startNumber || 1,
  83076. duration: attributes.sourceDuration,
  83077. time: 0,
  83078. timeline: attributes.periodStart
  83079. }];
  83080. }
  83081. if (attributes.duration) {
  83082. return parseByDuration(attributes);
  83083. }
  83084. return parseByTimeline(attributes, segmentTimeline);
  83085. };
  83086. var segmentsFromTemplate = function segmentsFromTemplate2(attributes, segmentTimeline) {
  83087. var templateValues = {
  83088. RepresentationID: attributes.id,
  83089. Bandwidth: attributes.bandwidth || 0
  83090. };
  83091. var _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {
  83092. sourceURL: "",
  83093. range: ""
  83094. } : _attributes$initializ;
  83095. var mapSegment = urlTypeToSegment({
  83096. baseUrl: attributes.baseUrl,
  83097. source: constructTemplateUrl(initialization.sourceURL, templateValues),
  83098. range: initialization.range
  83099. });
  83100. var segments = parseTemplateInfo(attributes, segmentTimeline);
  83101. return segments.map(function(segment) {
  83102. templateValues.Number = segment.number;
  83103. templateValues.Time = segment.time;
  83104. var uri = constructTemplateUrl(attributes.media || "", templateValues);
  83105. var timescale2 = attributes.timescale || 1;
  83106. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83107. var presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  83108. var map = {
  83109. uri,
  83110. timeline: segment.timeline,
  83111. duration: segment.duration,
  83112. resolvedUri: resolveUrl$1(attributes.baseUrl || "", uri),
  83113. map: mapSegment,
  83114. number: segment.number,
  83115. presentationTime
  83116. };
  83117. return map;
  83118. });
  83119. };
  83120. var SegmentURLToSegmentObject = function SegmentURLToSegmentObject2(attributes, segmentUrl) {
  83121. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;
  83122. var initSegment = urlTypeToSegment({
  83123. baseUrl,
  83124. source: initialization.sourceURL,
  83125. range: initialization.range
  83126. });
  83127. var segment = urlTypeToSegment({
  83128. baseUrl,
  83129. source: segmentUrl.media,
  83130. range: segmentUrl.mediaRange
  83131. });
  83132. segment.map = initSegment;
  83133. return segment;
  83134. };
  83135. var segmentsFromList = function segmentsFromList2(attributes, segmentTimeline) {
  83136. var duration5 = attributes.duration, _attributes$segmentUr = attributes.segmentUrls, segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr, periodStart = attributes.periodStart;
  83137. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  83138. throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);
  83139. }
  83140. var segmentUrlMap = segmentUrls.map(function(segmentUrlObject) {
  83141. return SegmentURLToSegmentObject(attributes, segmentUrlObject);
  83142. });
  83143. var segmentTimeInfo;
  83144. if (duration5) {
  83145. segmentTimeInfo = parseByDuration(attributes);
  83146. }
  83147. if (segmentTimeline) {
  83148. segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);
  83149. }
  83150. var segments = segmentTimeInfo.map(function(segmentTime, index2) {
  83151. if (segmentUrlMap[index2]) {
  83152. var segment = segmentUrlMap[index2];
  83153. var timescale2 = attributes.timescale || 1;
  83154. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83155. segment.timeline = segmentTime.timeline;
  83156. segment.duration = segmentTime.duration;
  83157. segment.number = segmentTime.number;
  83158. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  83159. return segment;
  83160. }
  83161. }).filter(function(segment) {
  83162. return segment;
  83163. });
  83164. return segments;
  83165. };
  83166. var generateSegments = function generateSegments2(_ref) {
  83167. var attributes = _ref.attributes, segmentInfo = _ref.segmentInfo;
  83168. var segmentAttributes;
  83169. var segmentsFn;
  83170. if (segmentInfo.template) {
  83171. segmentsFn = segmentsFromTemplate;
  83172. segmentAttributes = merge(attributes, segmentInfo.template);
  83173. } else if (segmentInfo.base) {
  83174. segmentsFn = segmentsFromBase;
  83175. segmentAttributes = merge(attributes, segmentInfo.base);
  83176. } else if (segmentInfo.list) {
  83177. segmentsFn = segmentsFromList;
  83178. segmentAttributes = merge(attributes, segmentInfo.list);
  83179. }
  83180. var segmentsInfo = {
  83181. attributes
  83182. };
  83183. if (!segmentsFn) {
  83184. return segmentsInfo;
  83185. }
  83186. var segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  83187. if (segmentAttributes.duration) {
  83188. var _segmentAttributes = segmentAttributes, duration5 = _segmentAttributes.duration, _segmentAttributes$ti = _segmentAttributes.timescale, timescale2 = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;
  83189. segmentAttributes.duration = duration5 / timescale2;
  83190. } else if (segments.length) {
  83191. segmentAttributes.duration = segments.reduce(function(max2, segment) {
  83192. return Math.max(max2, Math.ceil(segment.duration));
  83193. }, 0);
  83194. } else {
  83195. segmentAttributes.duration = 0;
  83196. }
  83197. segmentsInfo.attributes = segmentAttributes;
  83198. segmentsInfo.segments = segments;
  83199. if (segmentInfo.base && segmentAttributes.indexRange) {
  83200. segmentsInfo.sidx = segments[0];
  83201. segmentsInfo.segments = [];
  83202. }
  83203. return segmentsInfo;
  83204. };
  83205. var toPlaylists = function toPlaylists2(representations) {
  83206. return representations.map(generateSegments);
  83207. };
  83208. var findChildren = function findChildren2(element, name) {
  83209. return from(element.childNodes).filter(function(_ref) {
  83210. var tagName = _ref.tagName;
  83211. return tagName === name;
  83212. });
  83213. };
  83214. var getContent = function getContent2(element) {
  83215. return element.textContent.trim();
  83216. };
  83217. var parseDivisionValue = function parseDivisionValue2(value) {
  83218. return parseFloat(value.split("/").reduce(function(prev, current) {
  83219. return prev / current;
  83220. }));
  83221. };
  83222. var parseDuration = function parseDuration2(str) {
  83223. var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  83224. var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  83225. var SECONDS_IN_DAY = 24 * 60 * 60;
  83226. var SECONDS_IN_HOUR = 60 * 60;
  83227. var SECONDS_IN_MIN = 60;
  83228. var durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  83229. var match = durationRegex.exec(str);
  83230. if (!match) {
  83231. return 0;
  83232. }
  83233. var _match$slice = match.slice(1), year = _match$slice[0], month = _match$slice[1], day = _match$slice[2], hour = _match$slice[3], minute = _match$slice[4], second = _match$slice[5];
  83234. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  83235. };
  83236. var parseDate = function parseDate2(str) {
  83237. var dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  83238. if (dateRegex.test(str)) {
  83239. str += "Z";
  83240. }
  83241. return Date.parse(str);
  83242. };
  83243. var parsers = {
  83244. mediaPresentationDuration: function mediaPresentationDuration(value) {
  83245. return parseDuration(value);
  83246. },
  83247. availabilityStartTime: function availabilityStartTime(value) {
  83248. return parseDate(value) / 1e3;
  83249. },
  83250. minimumUpdatePeriod: function minimumUpdatePeriod(value) {
  83251. return parseDuration(value);
  83252. },
  83253. suggestedPresentationDelay: function suggestedPresentationDelay(value) {
  83254. return parseDuration(value);
  83255. },
  83256. type: function type(value) {
  83257. return value;
  83258. },
  83259. timeShiftBufferDepth: function timeShiftBufferDepth(value) {
  83260. return parseDuration(value);
  83261. },
  83262. start: function start(value) {
  83263. return parseDuration(value);
  83264. },
  83265. width: function width(value) {
  83266. return parseInt(value, 10);
  83267. },
  83268. height: function height(value) {
  83269. return parseInt(value, 10);
  83270. },
  83271. bandwidth: function bandwidth(value) {
  83272. return parseInt(value, 10);
  83273. },
  83274. frameRate: function frameRate(value) {
  83275. return parseDivisionValue(value);
  83276. },
  83277. startNumber: function startNumber(value) {
  83278. return parseInt(value, 10);
  83279. },
  83280. timescale: function timescale(value) {
  83281. return parseInt(value, 10);
  83282. },
  83283. presentationTimeOffset: function presentationTimeOffset(value) {
  83284. return parseInt(value, 10);
  83285. },
  83286. duration: function duration(value) {
  83287. var parsedValue = parseInt(value, 10);
  83288. if (isNaN(parsedValue)) {
  83289. return parseDuration(value);
  83290. }
  83291. return parsedValue;
  83292. },
  83293. d: function d(value) {
  83294. return parseInt(value, 10);
  83295. },
  83296. t: function t(value) {
  83297. return parseInt(value, 10);
  83298. },
  83299. r: function r(value) {
  83300. return parseInt(value, 10);
  83301. },
  83302. DEFAULT: function DEFAULT(value) {
  83303. return value;
  83304. }
  83305. };
  83306. var parseAttributes2 = function parseAttributes3(el) {
  83307. if (!(el && el.attributes)) {
  83308. return {};
  83309. }
  83310. return from(el.attributes).reduce(function(a, e) {
  83311. var parseFn = parsers[e.name] || parsers.DEFAULT;
  83312. a[e.name] = parseFn(e.value);
  83313. return a;
  83314. }, {});
  83315. };
  83316. var keySystemsMap = {
  83317. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  83318. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  83319. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  83320. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  83321. };
  83322. var buildBaseUrls = function buildBaseUrls2(referenceUrls, baseUrlElements) {
  83323. if (!baseUrlElements.length) {
  83324. return referenceUrls;
  83325. }
  83326. return flatten(referenceUrls.map(function(reference) {
  83327. return baseUrlElements.map(function(baseUrlElement) {
  83328. return resolveUrl$1(reference, getContent(baseUrlElement));
  83329. });
  83330. }));
  83331. };
  83332. var getSegmentInformation = function getSegmentInformation2(adaptationSet) {
  83333. var segmentTemplate = findChildren(adaptationSet, "SegmentTemplate")[0];
  83334. var segmentList = findChildren(adaptationSet, "SegmentList")[0];
  83335. var segmentUrls = segmentList && findChildren(segmentList, "SegmentURL").map(function(s) {
  83336. return merge({
  83337. tag: "SegmentURL"
  83338. }, parseAttributes2(s));
  83339. });
  83340. var segmentBase = findChildren(adaptationSet, "SegmentBase")[0];
  83341. var segmentTimelineParentNode = segmentList || segmentTemplate;
  83342. var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, "SegmentTimeline")[0];
  83343. var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  83344. var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, "Initialization")[0];
  83345. var template = segmentTemplate && parseAttributes2(segmentTemplate);
  83346. if (template && segmentInitialization) {
  83347. template.initialization = segmentInitialization && parseAttributes2(segmentInitialization);
  83348. } else if (template && template.initialization) {
  83349. template.initialization = {
  83350. sourceURL: template.initialization
  83351. };
  83352. }
  83353. var segmentInfo = {
  83354. template,
  83355. segmentTimeline: segmentTimeline && findChildren(segmentTimeline, "S").map(function(s) {
  83356. return parseAttributes2(s);
  83357. }),
  83358. list: segmentList && merge(parseAttributes2(segmentList), {
  83359. segmentUrls,
  83360. initialization: parseAttributes2(segmentInitialization)
  83361. }),
  83362. base: segmentBase && merge(parseAttributes2(segmentBase), {
  83363. initialization: parseAttributes2(segmentInitialization)
  83364. })
  83365. };
  83366. Object.keys(segmentInfo).forEach(function(key) {
  83367. if (!segmentInfo[key]) {
  83368. delete segmentInfo[key];
  83369. }
  83370. });
  83371. return segmentInfo;
  83372. };
  83373. var inheritBaseUrls = function inheritBaseUrls2(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {
  83374. return function(representation) {
  83375. var repBaseUrlElements = findChildren(representation, "BaseURL");
  83376. var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);
  83377. var attributes = merge(adaptationSetAttributes, parseAttributes2(representation));
  83378. var representationSegmentInfo = getSegmentInformation(representation);
  83379. return repBaseUrls.map(function(baseUrl) {
  83380. return {
  83381. segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),
  83382. attributes: merge(attributes, {
  83383. baseUrl
  83384. })
  83385. };
  83386. });
  83387. };
  83388. };
  83389. var generateKeySystemInformation = function generateKeySystemInformation2(contentProtectionNodes) {
  83390. return contentProtectionNodes.reduce(function(acc, node) {
  83391. var attributes = parseAttributes2(node);
  83392. if (attributes.schemeIdUri) {
  83393. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  83394. }
  83395. var keySystem = keySystemsMap[attributes.schemeIdUri];
  83396. if (keySystem) {
  83397. acc[keySystem] = {
  83398. attributes
  83399. };
  83400. var psshNode = findChildren(node, "cenc:pssh")[0];
  83401. if (psshNode) {
  83402. var pssh = getContent(psshNode);
  83403. acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);
  83404. }
  83405. }
  83406. return acc;
  83407. }, {});
  83408. };
  83409. var parseCaptionServiceMetadata = function parseCaptionServiceMetadata2(service) {
  83410. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  83411. var values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  83412. return values3.map(function(value) {
  83413. var channel;
  83414. var language;
  83415. language = value;
  83416. if (/^CC\d=/.test(value)) {
  83417. var _value$split = value.split("=");
  83418. channel = _value$split[0];
  83419. language = _value$split[1];
  83420. } else if (/^CC\d$/.test(value)) {
  83421. channel = value;
  83422. }
  83423. return {
  83424. channel,
  83425. language
  83426. };
  83427. });
  83428. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  83429. var _values = typeof service.value !== "string" ? [] : service.value.split(";");
  83430. return _values.map(function(value) {
  83431. var flags = {
  83432. "channel": void 0,
  83433. "language": void 0,
  83434. "aspectRatio": 1,
  83435. "easyReader": 0,
  83436. "3D": 0
  83437. };
  83438. if (/=/.test(value)) {
  83439. var _value$split2 = value.split("="), channel = _value$split2[0], _value$split2$ = _value$split2[1], opts = _value$split2$ === void 0 ? "" : _value$split2$;
  83440. flags.channel = channel;
  83441. flags.language = value;
  83442. opts.split(",").forEach(function(opt) {
  83443. var _opt$split = opt.split(":"), name = _opt$split[0], val = _opt$split[1];
  83444. if (name === "lang") {
  83445. flags.language = val;
  83446. } else if (name === "er") {
  83447. flags.easyReader = Number(val);
  83448. } else if (name === "war") {
  83449. flags.aspectRatio = Number(val);
  83450. } else if (name === "3D") {
  83451. flags["3D"] = Number(val);
  83452. }
  83453. });
  83454. } else {
  83455. flags.language = value;
  83456. }
  83457. if (flags.channel) {
  83458. flags.channel = "SERVICE" + flags.channel;
  83459. }
  83460. return flags;
  83461. });
  83462. }
  83463. };
  83464. var toRepresentations = function toRepresentations2(periodAttributes, periodBaseUrls, periodSegmentInfo) {
  83465. return function(adaptationSet) {
  83466. var adaptationSetAttributes = parseAttributes2(adaptationSet);
  83467. var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, "BaseURL"));
  83468. var role = findChildren(adaptationSet, "Role")[0];
  83469. var roleAttributes = {
  83470. role: parseAttributes2(role)
  83471. };
  83472. var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);
  83473. var accessibility = findChildren(adaptationSet, "Accessibility")[0];
  83474. var captionServices = parseCaptionServiceMetadata(parseAttributes2(accessibility));
  83475. if (captionServices) {
  83476. attrs = merge(attrs, {
  83477. captionServices
  83478. });
  83479. }
  83480. var label2 = findChildren(adaptationSet, "Label")[0];
  83481. if (label2 && label2.childNodes.length) {
  83482. var labelVal = label2.childNodes[0].nodeValue.trim();
  83483. attrs = merge(attrs, {
  83484. label: labelVal
  83485. });
  83486. }
  83487. var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, "ContentProtection"));
  83488. if (Object.keys(contentProtection).length) {
  83489. attrs = merge(attrs, {
  83490. contentProtection
  83491. });
  83492. }
  83493. var segmentInfo = getSegmentInformation(adaptationSet);
  83494. var representations = findChildren(adaptationSet, "Representation");
  83495. var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);
  83496. return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  83497. };
  83498. };
  83499. var toAdaptationSets = function toAdaptationSets2(mpdAttributes, mpdBaseUrls) {
  83500. return function(period, index2) {
  83501. var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, "BaseURL"));
  83502. var periodAttributes = merge(mpdAttributes, {
  83503. periodStart: period.attributes.start
  83504. });
  83505. if (typeof period.attributes.duration === "number") {
  83506. periodAttributes.periodDuration = period.attributes.duration;
  83507. }
  83508. var adaptationSets = findChildren(period.node, "AdaptationSet");
  83509. var periodSegmentInfo = getSegmentInformation(period.node);
  83510. return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  83511. };
  83512. };
  83513. var getPeriodStart = function getPeriodStart2(_ref) {
  83514. var attributes = _ref.attributes, priorPeriodAttributes = _ref.priorPeriodAttributes, mpdType = _ref.mpdType;
  83515. if (typeof attributes.start === "number") {
  83516. return attributes.start;
  83517. }
  83518. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  83519. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  83520. }
  83521. if (!priorPeriodAttributes && mpdType === "static") {
  83522. return 0;
  83523. }
  83524. return null;
  83525. };
  83526. var inheritAttributes = function inheritAttributes2(mpd, options2) {
  83527. if (options2 === void 0) {
  83528. options2 = {};
  83529. }
  83530. var _options = options2, _options$manifestUri = _options.manifestUri, manifestUri = _options$manifestUri === void 0 ? "" : _options$manifestUri, _options$NOW = _options.NOW, NOW = _options$NOW === void 0 ? Date.now() : _options$NOW, _options$clientOffset = _options.clientOffset, clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;
  83531. var periodNodes = findChildren(mpd, "Period");
  83532. if (!periodNodes.length) {
  83533. throw new Error(errors.INVALID_NUMBER_OF_PERIOD);
  83534. }
  83535. var locations = findChildren(mpd, "Location");
  83536. var mpdAttributes = parseAttributes2(mpd);
  83537. var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, "BaseURL"));
  83538. mpdAttributes.type = mpdAttributes.type || "static";
  83539. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  83540. mpdAttributes.NOW = NOW;
  83541. mpdAttributes.clientOffset = clientOffset;
  83542. if (locations.length) {
  83543. mpdAttributes.locations = locations.map(getContent);
  83544. }
  83545. var periods = [];
  83546. periodNodes.forEach(function(node, index2) {
  83547. var attributes = parseAttributes2(node);
  83548. var priorPeriod = periods[index2 - 1];
  83549. attributes.start = getPeriodStart({
  83550. attributes,
  83551. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  83552. mpdType: mpdAttributes.type
  83553. });
  83554. periods.push({
  83555. node,
  83556. attributes
  83557. });
  83558. });
  83559. return {
  83560. locations: mpdAttributes.locations,
  83561. representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)))
  83562. };
  83563. };
  83564. var stringToMpdXml = function stringToMpdXml2(manifestString) {
  83565. if (manifestString === "") {
  83566. throw new Error(errors.DASH_EMPTY_MANIFEST);
  83567. }
  83568. var parser2 = new DOMParser();
  83569. var xml;
  83570. var mpd;
  83571. try {
  83572. xml = parser2.parseFromString(manifestString, "application/xml");
  83573. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  83574. } catch (e) {
  83575. }
  83576. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  83577. throw new Error(errors.DASH_INVALID_XML);
  83578. }
  83579. return mpd;
  83580. };
  83581. var parseUTCTimingScheme = function parseUTCTimingScheme2(mpd) {
  83582. var UTCTimingNode = findChildren(mpd, "UTCTiming")[0];
  83583. if (!UTCTimingNode) {
  83584. return null;
  83585. }
  83586. var attributes = parseAttributes2(UTCTimingNode);
  83587. switch (attributes.schemeIdUri) {
  83588. case "urn:mpeg:dash:utc:http-head:2014":
  83589. case "urn:mpeg:dash:utc:http-head:2012":
  83590. attributes.method = "HEAD";
  83591. break;
  83592. case "urn:mpeg:dash:utc:http-xsdate:2014":
  83593. case "urn:mpeg:dash:utc:http-iso:2014":
  83594. case "urn:mpeg:dash:utc:http-xsdate:2012":
  83595. case "urn:mpeg:dash:utc:http-iso:2012":
  83596. attributes.method = "GET";
  83597. break;
  83598. case "urn:mpeg:dash:utc:direct:2014":
  83599. case "urn:mpeg:dash:utc:direct:2012":
  83600. attributes.method = "DIRECT";
  83601. attributes.value = Date.parse(attributes.value);
  83602. break;
  83603. case "urn:mpeg:dash:utc:http-ntp:2014":
  83604. case "urn:mpeg:dash:utc:ntp:2014":
  83605. case "urn:mpeg:dash:utc:sntp:2014":
  83606. default:
  83607. throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);
  83608. }
  83609. return attributes;
  83610. };
  83611. var parse = function parse2(manifestString, options2) {
  83612. if (options2 === void 0) {
  83613. options2 = {};
  83614. }
  83615. var parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options2);
  83616. var playlists = toPlaylists(parsedManifestInfo.representationInfo);
  83617. return toM3u8({
  83618. dashPlaylists: playlists,
  83619. locations: parsedManifestInfo.locations,
  83620. sidxMapping: options2.sidxMapping,
  83621. previousManifest: options2.previousManifest
  83622. });
  83623. };
  83624. var parseUTCTiming = function parseUTCTiming2(manifestString) {
  83625. return parseUTCTimingScheme(stringToMpdXml(manifestString));
  83626. };
  83627. var MAX_UINT32 = Math.pow(2, 32);
  83628. var getUint64$1 = function(uint8) {
  83629. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  83630. var value;
  83631. if (dv.getBigUint64) {
  83632. value = dv.getBigUint64(0);
  83633. if (value < Number.MAX_SAFE_INTEGER) {
  83634. return Number(value);
  83635. }
  83636. return value;
  83637. }
  83638. return dv.getUint32(0) * MAX_UINT32 + dv.getUint32(4);
  83639. };
  83640. var numbers = {
  83641. getUint64: getUint64$1,
  83642. MAX_UINT32
  83643. };
  83644. var getUint64 = numbers.getUint64;
  83645. var parseSidx = function(data) {
  83646. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  83647. version: data[0],
  83648. flags: new Uint8Array(data.subarray(1, 4)),
  83649. references: [],
  83650. referenceId: view.getUint32(4),
  83651. timescale: view.getUint32(8)
  83652. }, i2 = 12;
  83653. if (result.version === 0) {
  83654. result.earliestPresentationTime = view.getUint32(i2);
  83655. result.firstOffset = view.getUint32(i2 + 4);
  83656. i2 += 8;
  83657. } else {
  83658. result.earliestPresentationTime = getUint64(data.subarray(i2));
  83659. result.firstOffset = getUint64(data.subarray(i2 + 8));
  83660. i2 += 16;
  83661. }
  83662. i2 += 2;
  83663. var referenceCount = view.getUint16(i2);
  83664. i2 += 2;
  83665. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  83666. result.references.push({
  83667. referenceType: (data[i2] & 128) >>> 7,
  83668. referencedSize: view.getUint32(i2) & 2147483647,
  83669. subsegmentDuration: view.getUint32(i2 + 4),
  83670. startsWithSap: !!(data[i2 + 8] & 128),
  83671. sapType: (data[i2 + 8] & 112) >>> 4,
  83672. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  83673. });
  83674. }
  83675. return result;
  83676. };
  83677. var parseSidx_1 = parseSidx;
  83678. var ID3 = toUint82([73, 68, 51]);
  83679. var getId3Size2 = function getId3Size3(bytes, offset) {
  83680. if (offset === void 0) {
  83681. offset = 0;
  83682. }
  83683. bytes = toUint82(bytes);
  83684. var flags = bytes[offset + 5];
  83685. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  83686. var footerPresent = (flags & 16) >> 4;
  83687. if (footerPresent) {
  83688. return returnSize + 20;
  83689. }
  83690. return returnSize + 10;
  83691. };
  83692. var getId3Offset2 = function getId3Offset3(bytes, offset) {
  83693. if (offset === void 0) {
  83694. offset = 0;
  83695. }
  83696. bytes = toUint82(bytes);
  83697. if (bytes.length - offset < 10 || !bytesMatch2(bytes, ID3, {
  83698. offset
  83699. })) {
  83700. return offset;
  83701. }
  83702. offset += getId3Size2(bytes, offset);
  83703. return getId3Offset3(bytes, offset);
  83704. };
  83705. var normalizePath$1 = function normalizePath3(path) {
  83706. if (typeof path === "string") {
  83707. return stringToBytes2(path);
  83708. }
  83709. if (typeof path === "number") {
  83710. return path;
  83711. }
  83712. return path;
  83713. };
  83714. var normalizePaths$1 = function normalizePaths3(paths) {
  83715. if (!Array.isArray(paths)) {
  83716. return [normalizePath$1(paths)];
  83717. }
  83718. return paths.map(function(p) {
  83719. return normalizePath$1(p);
  83720. });
  83721. };
  83722. var findBox2 = function findBox3(bytes, paths, complete) {
  83723. if (complete === void 0) {
  83724. complete = false;
  83725. }
  83726. paths = normalizePaths$1(paths);
  83727. bytes = toUint82(bytes);
  83728. var results = [];
  83729. if (!paths.length) {
  83730. return results;
  83731. }
  83732. var i2 = 0;
  83733. while (i2 < bytes.length) {
  83734. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  83735. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  83736. if (size === 0) {
  83737. break;
  83738. }
  83739. var end = i2 + size;
  83740. if (end > bytes.length) {
  83741. if (complete) {
  83742. break;
  83743. }
  83744. end = bytes.length;
  83745. }
  83746. var data = bytes.subarray(i2 + 8, end);
  83747. if (bytesMatch2(type2, paths[0])) {
  83748. if (paths.length === 1) {
  83749. results.push(data);
  83750. } else {
  83751. results.push.apply(results, findBox3(data, paths.slice(1), complete));
  83752. }
  83753. }
  83754. i2 = end;
  83755. }
  83756. return results;
  83757. };
  83758. var EBML_TAGS = {
  83759. EBML: toUint82([26, 69, 223, 163]),
  83760. DocType: toUint82([66, 130]),
  83761. Segment: toUint82([24, 83, 128, 103]),
  83762. SegmentInfo: toUint82([21, 73, 169, 102]),
  83763. Tracks: toUint82([22, 84, 174, 107]),
  83764. Track: toUint82([174]),
  83765. TrackNumber: toUint82([215]),
  83766. DefaultDuration: toUint82([35, 227, 131]),
  83767. TrackEntry: toUint82([174]),
  83768. TrackType: toUint82([131]),
  83769. FlagDefault: toUint82([136]),
  83770. CodecID: toUint82([134]),
  83771. CodecPrivate: toUint82([99, 162]),
  83772. VideoTrack: toUint82([224]),
  83773. AudioTrack: toUint82([225]),
  83774. Cluster: toUint82([31, 67, 182, 117]),
  83775. Timestamp: toUint82([231]),
  83776. TimestampScale: toUint82([42, 215, 177]),
  83777. BlockGroup: toUint82([160]),
  83778. BlockDuration: toUint82([155]),
  83779. Block: toUint82([161]),
  83780. SimpleBlock: toUint82([163])
  83781. };
  83782. var LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];
  83783. var getLength2 = function getLength3(byte) {
  83784. var len = 1;
  83785. for (var i2 = 0; i2 < LENGTH_TABLE.length; i2++) {
  83786. if (byte & LENGTH_TABLE[i2]) {
  83787. break;
  83788. }
  83789. len++;
  83790. }
  83791. return len;
  83792. };
  83793. var getvint2 = function getvint3(bytes, offset, removeLength, signed) {
  83794. if (removeLength === void 0) {
  83795. removeLength = true;
  83796. }
  83797. if (signed === void 0) {
  83798. signed = false;
  83799. }
  83800. var length = getLength2(bytes[offset]);
  83801. var valueBytes = bytes.subarray(offset, offset + length);
  83802. if (removeLength) {
  83803. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  83804. valueBytes[0] ^= LENGTH_TABLE[length - 1];
  83805. }
  83806. return {
  83807. length,
  83808. value: bytesToNumber2(valueBytes, {
  83809. signed
  83810. }),
  83811. bytes: valueBytes
  83812. };
  83813. };
  83814. var normalizePath4 = function normalizePath5(path) {
  83815. if (typeof path === "string") {
  83816. return path.match(/.{1,2}/g).map(function(p) {
  83817. return normalizePath5(p);
  83818. });
  83819. }
  83820. if (typeof path === "number") {
  83821. return numberToBytes2(path);
  83822. }
  83823. return path;
  83824. };
  83825. var normalizePaths4 = function normalizePaths5(paths) {
  83826. if (!Array.isArray(paths)) {
  83827. return [normalizePath4(paths)];
  83828. }
  83829. return paths.map(function(p) {
  83830. return normalizePath4(p);
  83831. });
  83832. };
  83833. var getInfinityDataSize2 = function getInfinityDataSize3(id, bytes, offset) {
  83834. if (offset >= bytes.length) {
  83835. return bytes.length;
  83836. }
  83837. var innerid = getvint2(bytes, offset, false);
  83838. if (bytesMatch2(id.bytes, innerid.bytes)) {
  83839. return offset;
  83840. }
  83841. var dataHeader = getvint2(bytes, offset + innerid.length);
  83842. return getInfinityDataSize3(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  83843. };
  83844. var findEbml2 = function findEbml3(bytes, paths) {
  83845. paths = normalizePaths4(paths);
  83846. bytes = toUint82(bytes);
  83847. var results = [];
  83848. if (!paths.length) {
  83849. return results;
  83850. }
  83851. var i2 = 0;
  83852. while (i2 < bytes.length) {
  83853. var id = getvint2(bytes, i2, false);
  83854. var dataHeader = getvint2(bytes, i2 + id.length);
  83855. var dataStart = i2 + id.length + dataHeader.length;
  83856. if (dataHeader.value === 127) {
  83857. dataHeader.value = getInfinityDataSize2(id, bytes, dataStart);
  83858. if (dataHeader.value !== bytes.length) {
  83859. dataHeader.value -= dataStart;
  83860. }
  83861. }
  83862. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  83863. var data = bytes.subarray(dataStart, dataEnd);
  83864. if (bytesMatch2(paths[0], id.bytes)) {
  83865. if (paths.length === 1) {
  83866. results.push(data);
  83867. } else {
  83868. results = results.concat(findEbml3(data, paths.slice(1)));
  83869. }
  83870. }
  83871. var totalLength = id.length + dataHeader.length + data.length;
  83872. i2 += totalLength;
  83873. }
  83874. return results;
  83875. };
  83876. var NAL_TYPE_ONE = toUint82([0, 0, 0, 1]);
  83877. var NAL_TYPE_TWO = toUint82([0, 0, 1]);
  83878. var EMULATION_PREVENTION = toUint82([0, 0, 3]);
  83879. var discardEmulationPreventionBytes2 = function discardEmulationPreventionBytes3(bytes) {
  83880. var positions = [];
  83881. var i2 = 1;
  83882. while (i2 < bytes.length - 2) {
  83883. if (bytesMatch2(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION)) {
  83884. positions.push(i2 + 2);
  83885. i2++;
  83886. }
  83887. i2++;
  83888. }
  83889. if (positions.length === 0) {
  83890. return bytes;
  83891. }
  83892. var newLength = bytes.length - positions.length;
  83893. var newData = new Uint8Array(newLength);
  83894. var sourceIndex = 0;
  83895. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  83896. if (sourceIndex === positions[0]) {
  83897. sourceIndex++;
  83898. positions.shift();
  83899. }
  83900. newData[i2] = bytes[sourceIndex];
  83901. }
  83902. return newData;
  83903. };
  83904. var findNal2 = function findNal3(bytes, dataType, types, nalLimit) {
  83905. if (nalLimit === void 0) {
  83906. nalLimit = Infinity;
  83907. }
  83908. bytes = toUint82(bytes);
  83909. types = [].concat(types);
  83910. var i2 = 0;
  83911. var nalStart;
  83912. var nalsFound = 0;
  83913. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  83914. var nalOffset = void 0;
  83915. if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_ONE)) {
  83916. nalOffset = 4;
  83917. } else if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_TWO)) {
  83918. nalOffset = 3;
  83919. }
  83920. if (!nalOffset) {
  83921. i2++;
  83922. continue;
  83923. }
  83924. nalsFound++;
  83925. if (nalStart) {
  83926. return discardEmulationPreventionBytes2(bytes.subarray(nalStart, i2));
  83927. }
  83928. var nalType = void 0;
  83929. if (dataType === "h264") {
  83930. nalType = bytes[i2 + nalOffset] & 31;
  83931. } else if (dataType === "h265") {
  83932. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  83933. }
  83934. if (types.indexOf(nalType) !== -1) {
  83935. nalStart = i2 + nalOffset;
  83936. }
  83937. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  83938. }
  83939. return bytes.subarray(0, 0);
  83940. };
  83941. var findH264Nal2 = function findH264Nal3(bytes, type2, nalLimit) {
  83942. return findNal2(bytes, "h264", type2, nalLimit);
  83943. };
  83944. var findH265Nal2 = function findH265Nal3(bytes, type2, nalLimit) {
  83945. return findNal2(bytes, "h265", type2, nalLimit);
  83946. };
  83947. var CONSTANTS = {
  83948. "webm": toUint82([119, 101, 98, 109]),
  83949. "matroska": toUint82([109, 97, 116, 114, 111, 115, 107, 97]),
  83950. "flac": toUint82([102, 76, 97, 67]),
  83951. "ogg": toUint82([79, 103, 103, 83]),
  83952. "ac3": toUint82([11, 119]),
  83953. "riff": toUint82([82, 73, 70, 70]),
  83954. "avi": toUint82([65, 86, 73]),
  83955. "wav": toUint82([87, 65, 86, 69]),
  83956. "3gp": toUint82([102, 116, 121, 112, 51, 103]),
  83957. "mp4": toUint82([102, 116, 121, 112]),
  83958. "fmp4": toUint82([115, 116, 121, 112]),
  83959. "mov": toUint82([102, 116, 121, 112, 113, 116]),
  83960. "moov": toUint82([109, 111, 111, 118]),
  83961. "moof": toUint82([109, 111, 111, 102])
  83962. };
  83963. var _isLikely = {
  83964. aac: function aac2(bytes) {
  83965. var offset = getId3Offset2(bytes);
  83966. return bytesMatch2(bytes, [255, 16], {
  83967. offset,
  83968. mask: [255, 22]
  83969. });
  83970. },
  83971. mp3: function mp32(bytes) {
  83972. var offset = getId3Offset2(bytes);
  83973. return bytesMatch2(bytes, [255, 2], {
  83974. offset,
  83975. mask: [255, 6]
  83976. });
  83977. },
  83978. webm: function webm2(bytes) {
  83979. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83980. return bytesMatch2(docType, CONSTANTS.webm);
  83981. },
  83982. mkv: function mkv2(bytes) {
  83983. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83984. return bytesMatch2(docType, CONSTANTS.matroska);
  83985. },
  83986. mp4: function mp42(bytes) {
  83987. if (_isLikely["3gp"](bytes) || _isLikely.mov(bytes)) {
  83988. return false;
  83989. }
  83990. if (bytesMatch2(bytes, CONSTANTS.mp4, {
  83991. offset: 4
  83992. }) || bytesMatch2(bytes, CONSTANTS.fmp4, {
  83993. offset: 4
  83994. })) {
  83995. return true;
  83996. }
  83997. if (bytesMatch2(bytes, CONSTANTS.moof, {
  83998. offset: 4
  83999. }) || bytesMatch2(bytes, CONSTANTS.moov, {
  84000. offset: 4
  84001. })) {
  84002. return true;
  84003. }
  84004. },
  84005. mov: function mov2(bytes) {
  84006. return bytesMatch2(bytes, CONSTANTS.mov, {
  84007. offset: 4
  84008. });
  84009. },
  84010. "3gp": function gp2(bytes) {
  84011. return bytesMatch2(bytes, CONSTANTS["3gp"], {
  84012. offset: 4
  84013. });
  84014. },
  84015. ac3: function ac32(bytes) {
  84016. var offset = getId3Offset2(bytes);
  84017. return bytesMatch2(bytes, CONSTANTS.ac3, {
  84018. offset
  84019. });
  84020. },
  84021. ts: function ts2(bytes) {
  84022. if (bytes.length < 189 && bytes.length >= 1) {
  84023. return bytes[0] === 71;
  84024. }
  84025. var i2 = 0;
  84026. while (i2 + 188 < bytes.length && i2 < 188) {
  84027. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  84028. return true;
  84029. }
  84030. i2 += 1;
  84031. }
  84032. return false;
  84033. },
  84034. flac: function flac2(bytes) {
  84035. var offset = getId3Offset2(bytes);
  84036. return bytesMatch2(bytes, CONSTANTS.flac, {
  84037. offset
  84038. });
  84039. },
  84040. ogg: function ogg2(bytes) {
  84041. return bytesMatch2(bytes, CONSTANTS.ogg);
  84042. },
  84043. avi: function avi2(bytes) {
  84044. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.avi, {
  84045. offset: 8
  84046. });
  84047. },
  84048. wav: function wav2(bytes) {
  84049. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.wav, {
  84050. offset: 8
  84051. });
  84052. },
  84053. "h264": function h2642(bytes) {
  84054. return findH264Nal2(bytes, 7, 3).length;
  84055. },
  84056. "h265": function h2652(bytes) {
  84057. return findH265Nal2(bytes, [32, 33], 3).length;
  84058. }
  84059. };
  84060. var isLikelyTypes = Object.keys(_isLikely).filter(function(t2) {
  84061. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  84062. }).concat(["ts", "h264", "h265"]);
  84063. isLikelyTypes.forEach(function(type2) {
  84064. var isLikelyFn = _isLikely[type2];
  84065. _isLikely[type2] = function(bytes) {
  84066. return isLikelyFn(toUint82(bytes));
  84067. };
  84068. });
  84069. var isLikely = _isLikely;
  84070. var detectContainerForBytes2 = function detectContainerForBytes3(bytes) {
  84071. bytes = toUint82(bytes);
  84072. for (var i2 = 0; i2 < isLikelyTypes.length; i2++) {
  84073. var type2 = isLikelyTypes[i2];
  84074. if (isLikely[type2](bytes)) {
  84075. return type2;
  84076. }
  84077. }
  84078. return "";
  84079. };
  84080. var isLikelyFmp4MediaSegment2 = function isLikelyFmp4MediaSegment3(bytes) {
  84081. return findBox2(bytes, ["moof"]).length > 0;
  84082. };
  84083. var ONE_SECOND_IN_TS = 9e4, secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds;
  84084. secondsToVideoTs = function(seconds) {
  84085. return seconds * ONE_SECOND_IN_TS;
  84086. };
  84087. secondsToAudioTs = function(seconds, sampleRate) {
  84088. return seconds * sampleRate;
  84089. };
  84090. videoTsToSeconds = function(timestamp) {
  84091. return timestamp / ONE_SECOND_IN_TS;
  84092. };
  84093. audioTsToSeconds = function(timestamp, sampleRate) {
  84094. return timestamp / sampleRate;
  84095. };
  84096. audioTsToVideoTs = function(timestamp, sampleRate) {
  84097. return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));
  84098. };
  84099. videoTsToAudioTs = function(timestamp, sampleRate) {
  84100. return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);
  84101. };
  84102. metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  84103. return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  84104. };
  84105. var clock = {
  84106. ONE_SECOND_IN_TS,
  84107. secondsToVideoTs,
  84108. secondsToAudioTs,
  84109. videoTsToSeconds,
  84110. audioTsToSeconds,
  84111. audioTsToVideoTs,
  84112. videoTsToAudioTs,
  84113. metadataTsToSeconds
  84114. };
  84115. function _getPrototypeOf(o) {
  84116. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
  84117. return o2.__proto__ || Object.getPrototypeOf(o2);
  84118. };
  84119. return _getPrototypeOf(o);
  84120. }
  84121. function _isNativeFunction(fn2) {
  84122. return Function.toString.call(fn2).indexOf("[native code]") !== -1;
  84123. }
  84124. function _wrapNativeSuper(Class) {
  84125. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  84126. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  84127. if (Class2 === null || !_isNativeFunction(Class2))
  84128. return Class2;
  84129. if (typeof Class2 !== "function") {
  84130. throw new TypeError("Super expression must either be null or a function");
  84131. }
  84132. if (typeof _cache !== "undefined") {
  84133. if (_cache.has(Class2))
  84134. return _cache.get(Class2);
  84135. _cache.set(Class2, Wrapper);
  84136. }
  84137. function Wrapper() {
  84138. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  84139. }
  84140. Wrapper.prototype = Object.create(Class2.prototype, {
  84141. constructor: {
  84142. value: Wrapper,
  84143. enumerable: false,
  84144. writable: true,
  84145. configurable: true
  84146. }
  84147. });
  84148. return _setPrototypeOf(Wrapper, Class2);
  84149. };
  84150. return _wrapNativeSuper(Class);
  84151. }
  84152. /**
  84153. * @license
  84154. * Video.js 7.21.4 <http://videojs.com/>
  84155. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  84156. * Available under Apache License Version 2.0
  84157. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  84158. *
  84159. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  84160. * Available under Apache License Version 2.0
  84161. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  84162. */
  84163. var version$5 = "7.21.4";
  84164. var hooks_ = {};
  84165. var hooks = function hooks2(type2, fn2) {
  84166. hooks_[type2] = hooks_[type2] || [];
  84167. if (fn2) {
  84168. hooks_[type2] = hooks_[type2].concat(fn2);
  84169. }
  84170. return hooks_[type2];
  84171. };
  84172. var hook = function hook2(type2, fn2) {
  84173. hooks(type2, fn2);
  84174. };
  84175. var removeHook = function removeHook2(type2, fn2) {
  84176. var index2 = hooks(type2).indexOf(fn2);
  84177. if (index2 <= -1) {
  84178. return false;
  84179. }
  84180. hooks_[type2] = hooks_[type2].slice();
  84181. hooks_[type2].splice(index2, 1);
  84182. return true;
  84183. };
  84184. var hookOnce = function hookOnce2(type2, fn2) {
  84185. hooks(type2, [].concat(fn2).map(function(original) {
  84186. var wrapper = function wrapper2() {
  84187. removeHook(type2, wrapper2);
  84188. return original.apply(void 0, arguments);
  84189. };
  84190. return wrapper;
  84191. }));
  84192. };
  84193. var FullscreenApi = {
  84194. prefixed: true
  84195. };
  84196. var apiMap = [
  84197. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  84198. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  84199. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  84200. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  84201. ];
  84202. var specApi = apiMap[0];
  84203. var browserApi;
  84204. for (var i$2 = 0; i$2 < apiMap.length; i$2++) {
  84205. if (apiMap[i$2][1] in document_1) {
  84206. browserApi = apiMap[i$2];
  84207. break;
  84208. }
  84209. }
  84210. if (browserApi) {
  84211. for (var _i$1 = 0; _i$1 < browserApi.length; _i$1++) {
  84212. FullscreenApi[specApi[_i$1]] = browserApi[_i$1];
  84213. }
  84214. FullscreenApi.prefixed = browserApi[0] !== specApi[0];
  84215. }
  84216. var history = [];
  84217. var LogByTypeFactory = function LogByTypeFactory2(name, log2) {
  84218. return function(type2, level, args) {
  84219. var lvl = log2.levels[level];
  84220. var lvlRegExp = new RegExp("^(" + lvl + ")$");
  84221. if (type2 !== "log") {
  84222. args.unshift(type2.toUpperCase() + ":");
  84223. }
  84224. args.unshift(name + ":");
  84225. if (history) {
  84226. history.push([].concat(args));
  84227. var splice2 = history.length - 1e3;
  84228. history.splice(0, splice2 > 0 ? splice2 : 0);
  84229. }
  84230. if (!window_1.console) {
  84231. return;
  84232. }
  84233. var fn2 = window_1.console[type2];
  84234. if (!fn2 && type2 === "debug") {
  84235. fn2 = window_1.console.info || window_1.console.log;
  84236. }
  84237. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  84238. return;
  84239. }
  84240. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  84241. };
  84242. };
  84243. function createLogger$1(name) {
  84244. var level = "info";
  84245. var logByType;
  84246. var log2 = function log3() {
  84247. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  84248. args[_key] = arguments[_key];
  84249. }
  84250. logByType("log", level, args);
  84251. };
  84252. logByType = LogByTypeFactory(name, log2);
  84253. log2.createLogger = function(subname) {
  84254. return createLogger$1(name + ": " + subname);
  84255. };
  84256. log2.levels = {
  84257. all: "debug|log|warn|error",
  84258. off: "",
  84259. debug: "debug|log|warn|error",
  84260. info: "log|warn|error",
  84261. warn: "warn|error",
  84262. error: "error",
  84263. DEFAULT: level
  84264. };
  84265. log2.level = function(lvl) {
  84266. if (typeof lvl === "string") {
  84267. if (!log2.levels.hasOwnProperty(lvl)) {
  84268. throw new Error('"' + lvl + '" in not a valid log level');
  84269. }
  84270. level = lvl;
  84271. }
  84272. return level;
  84273. };
  84274. log2.history = function() {
  84275. return history ? [].concat(history) : [];
  84276. };
  84277. log2.history.filter = function(fname) {
  84278. return (history || []).filter(function(historyItem) {
  84279. return new RegExp(".*" + fname + ".*").test(historyItem[0]);
  84280. });
  84281. };
  84282. log2.history.clear = function() {
  84283. if (history) {
  84284. history.length = 0;
  84285. }
  84286. };
  84287. log2.history.disable = function() {
  84288. if (history !== null) {
  84289. history.length = 0;
  84290. history = null;
  84291. }
  84292. };
  84293. log2.history.enable = function() {
  84294. if (history === null) {
  84295. history = [];
  84296. }
  84297. };
  84298. log2.error = function() {
  84299. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  84300. args[_key2] = arguments[_key2];
  84301. }
  84302. return logByType("error", level, args);
  84303. };
  84304. log2.warn = function() {
  84305. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  84306. args[_key3] = arguments[_key3];
  84307. }
  84308. return logByType("warn", level, args);
  84309. };
  84310. log2.debug = function() {
  84311. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  84312. args[_key4] = arguments[_key4];
  84313. }
  84314. return logByType("debug", level, args);
  84315. };
  84316. return log2;
  84317. }
  84318. var log$1 = createLogger$1("VIDEOJS");
  84319. var createLogger = log$1.createLogger;
  84320. var toString = Object.prototype.toString;
  84321. var keys = function keys2(object) {
  84322. return isObject2(object) ? Object.keys(object) : [];
  84323. };
  84324. function each(object, fn2) {
  84325. keys(object).forEach(function(key) {
  84326. return fn2(object[key], key);
  84327. });
  84328. }
  84329. function reduce(object, fn2, initial) {
  84330. if (initial === void 0) {
  84331. initial = 0;
  84332. }
  84333. return keys(object).reduce(function(accum, key) {
  84334. return fn2(accum, object[key], key);
  84335. }, initial);
  84336. }
  84337. function assign(target) {
  84338. for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  84339. sources[_key - 1] = arguments[_key];
  84340. }
  84341. if (Object.assign) {
  84342. return _extends$2.apply(void 0, [target].concat(sources));
  84343. }
  84344. sources.forEach(function(source) {
  84345. if (!source) {
  84346. return;
  84347. }
  84348. each(source, function(value, key) {
  84349. target[key] = value;
  84350. });
  84351. });
  84352. return target;
  84353. }
  84354. function isObject2(value) {
  84355. return !!value && typeof value === "object";
  84356. }
  84357. function isPlain(value) {
  84358. return isObject2(value) && toString.call(value) === "[object Object]" && value.constructor === Object;
  84359. }
  84360. function computedStyle(el, prop) {
  84361. if (!el || !prop) {
  84362. return "";
  84363. }
  84364. if (typeof window_1.getComputedStyle === "function") {
  84365. var computedStyleValue;
  84366. try {
  84367. computedStyleValue = window_1.getComputedStyle(el);
  84368. } catch (e) {
  84369. return "";
  84370. }
  84371. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  84372. }
  84373. return "";
  84374. }
  84375. var USER_AGENT = window_1.navigator && window_1.navigator.userAgent || "";
  84376. var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);
  84377. var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;
  84378. var IS_IPOD = /iPod/i.test(USER_AGENT);
  84379. var IOS_VERSION = function() {
  84380. var match = USER_AGENT.match(/OS (\d+)_/i);
  84381. if (match && match[1]) {
  84382. return match[1];
  84383. }
  84384. return null;
  84385. }();
  84386. var IS_ANDROID = /Android/i.test(USER_AGENT);
  84387. var ANDROID_VERSION = function() {
  84388. var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  84389. if (!match) {
  84390. return null;
  84391. }
  84392. var major = match[1] && parseFloat(match[1]);
  84393. var minor = match[2] && parseFloat(match[2]);
  84394. if (major && minor) {
  84395. return parseFloat(match[1] + "." + match[2]);
  84396. } else if (major) {
  84397. return major;
  84398. }
  84399. return null;
  84400. }();
  84401. var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;
  84402. var IS_FIREFOX = /Firefox/i.test(USER_AGENT);
  84403. var IS_EDGE = /Edg/i.test(USER_AGENT);
  84404. var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));
  84405. var CHROME_VERSION = function() {
  84406. var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);
  84407. if (match && match[2]) {
  84408. return parseFloat(match[2]);
  84409. }
  84410. return null;
  84411. }();
  84412. var IE_VERSION = function() {
  84413. var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT);
  84414. var version2 = result && parseFloat(result[1]);
  84415. if (!version2 && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {
  84416. version2 = 11;
  84417. }
  84418. return version2;
  84419. }();
  84420. var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;
  84421. var IS_WINDOWS = /Windows/i.test(USER_AGENT);
  84422. var TOUCH_ENABLED = Boolean(isReal() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  84423. var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);
  84424. var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;
  84425. var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;
  84426. var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;
  84427. var browser = /* @__PURE__ */ Object.freeze({
  84428. __proto__: null,
  84429. IS_IPOD,
  84430. IOS_VERSION,
  84431. IS_ANDROID,
  84432. ANDROID_VERSION,
  84433. IS_NATIVE_ANDROID,
  84434. IS_FIREFOX,
  84435. IS_EDGE,
  84436. IS_CHROME,
  84437. CHROME_VERSION,
  84438. IE_VERSION,
  84439. IS_SAFARI,
  84440. IS_WINDOWS,
  84441. TOUCH_ENABLED,
  84442. IS_IPAD,
  84443. IS_IPHONE,
  84444. IS_IOS,
  84445. IS_ANY_SAFARI
  84446. });
  84447. function isNonBlankString(str) {
  84448. return typeof str === "string" && Boolean(str.trim());
  84449. }
  84450. function throwIfWhitespace(str) {
  84451. if (str.indexOf(" ") >= 0) {
  84452. throw new Error("class has illegal whitespace characters");
  84453. }
  84454. }
  84455. function classRegExp(className) {
  84456. return new RegExp("(^|\\s)" + className + "($|\\s)");
  84457. }
  84458. function isReal() {
  84459. return document_1 === window_1.document;
  84460. }
  84461. function isEl(value) {
  84462. return isObject2(value) && value.nodeType === 1;
  84463. }
  84464. function isInFrame() {
  84465. try {
  84466. return window_1.parent !== window_1.self;
  84467. } catch (x) {
  84468. return true;
  84469. }
  84470. }
  84471. function createQuerier(method) {
  84472. return function(selector, context) {
  84473. if (!isNonBlankString(selector)) {
  84474. return document_1[method](null);
  84475. }
  84476. if (isNonBlankString(context)) {
  84477. context = document_1.querySelector(context);
  84478. }
  84479. var ctx = isEl(context) ? context : document_1;
  84480. return ctx[method] && ctx[method](selector);
  84481. };
  84482. }
  84483. function createEl(tagName, properties, attributes, content) {
  84484. if (tagName === void 0) {
  84485. tagName = "div";
  84486. }
  84487. if (properties === void 0) {
  84488. properties = {};
  84489. }
  84490. if (attributes === void 0) {
  84491. attributes = {};
  84492. }
  84493. var el = document_1.createElement(tagName);
  84494. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  84495. var val = properties[propName];
  84496. if (propName.indexOf("aria-") !== -1 || propName === "role" || propName === "type") {
  84497. log$1.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\n" + ("createEl(type, properties, attributes). Attempting to set " + propName + " to " + val + "."));
  84498. el.setAttribute(propName, val);
  84499. } else if (propName === "textContent") {
  84500. textContent(el, val);
  84501. } else if (el[propName] !== val || propName === "tabIndex") {
  84502. el[propName] = val;
  84503. }
  84504. });
  84505. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84506. el.setAttribute(attrName, attributes[attrName]);
  84507. });
  84508. if (content) {
  84509. appendContent(el, content);
  84510. }
  84511. return el;
  84512. }
  84513. function textContent(el, text) {
  84514. if (typeof el.textContent === "undefined") {
  84515. el.innerText = text;
  84516. } else {
  84517. el.textContent = text;
  84518. }
  84519. return el;
  84520. }
  84521. function prependTo(child, parent) {
  84522. if (parent.firstChild) {
  84523. parent.insertBefore(child, parent.firstChild);
  84524. } else {
  84525. parent.appendChild(child);
  84526. }
  84527. }
  84528. function hasClass(element, classToCheck) {
  84529. throwIfWhitespace(classToCheck);
  84530. if (element.classList) {
  84531. return element.classList.contains(classToCheck);
  84532. }
  84533. return classRegExp(classToCheck).test(element.className);
  84534. }
  84535. function addClass(element, classToAdd) {
  84536. if (element.classList) {
  84537. element.classList.add(classToAdd);
  84538. } else if (!hasClass(element, classToAdd)) {
  84539. element.className = (element.className + " " + classToAdd).trim();
  84540. }
  84541. return element;
  84542. }
  84543. function removeClass(element, classToRemove) {
  84544. if (!element) {
  84545. log$1.warn("removeClass was called with an element that doesn't exist");
  84546. return null;
  84547. }
  84548. if (element.classList) {
  84549. element.classList.remove(classToRemove);
  84550. } else {
  84551. throwIfWhitespace(classToRemove);
  84552. element.className = element.className.split(/\s+/).filter(function(c) {
  84553. return c !== classToRemove;
  84554. }).join(" ");
  84555. }
  84556. return element;
  84557. }
  84558. function toggleClass(element, classToToggle, predicate) {
  84559. var has = hasClass(element, classToToggle);
  84560. if (typeof predicate === "function") {
  84561. predicate = predicate(element, classToToggle);
  84562. }
  84563. if (typeof predicate !== "boolean") {
  84564. predicate = !has;
  84565. }
  84566. if (predicate === has) {
  84567. return;
  84568. }
  84569. if (predicate) {
  84570. addClass(element, classToToggle);
  84571. } else {
  84572. removeClass(element, classToToggle);
  84573. }
  84574. return element;
  84575. }
  84576. function setAttributes(el, attributes) {
  84577. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84578. var attrValue = attributes[attrName];
  84579. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  84580. el.removeAttribute(attrName);
  84581. } else {
  84582. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  84583. }
  84584. });
  84585. }
  84586. function getAttributes(tag) {
  84587. var obj = {};
  84588. var knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  84589. if (tag && tag.attributes && tag.attributes.length > 0) {
  84590. var attrs = tag.attributes;
  84591. for (var i2 = attrs.length - 1; i2 >= 0; i2--) {
  84592. var attrName = attrs[i2].name;
  84593. var attrVal = attrs[i2].value;
  84594. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  84595. attrVal = attrVal !== null ? true : false;
  84596. }
  84597. obj[attrName] = attrVal;
  84598. }
  84599. }
  84600. return obj;
  84601. }
  84602. function getAttribute(el, attribute) {
  84603. return el.getAttribute(attribute);
  84604. }
  84605. function setAttribute(el, attribute, value) {
  84606. el.setAttribute(attribute, value);
  84607. }
  84608. function removeAttribute(el, attribute) {
  84609. el.removeAttribute(attribute);
  84610. }
  84611. function blockTextSelection() {
  84612. document_1.body.focus();
  84613. document_1.onselectstart = function() {
  84614. return false;
  84615. };
  84616. }
  84617. function unblockTextSelection() {
  84618. document_1.onselectstart = function() {
  84619. return true;
  84620. };
  84621. }
  84622. function getBoundingClientRect(el) {
  84623. if (el && el.getBoundingClientRect && el.parentNode) {
  84624. var rect = el.getBoundingClientRect();
  84625. var result = {};
  84626. ["bottom", "height", "left", "right", "top", "width"].forEach(function(k) {
  84627. if (rect[k] !== void 0) {
  84628. result[k] = rect[k];
  84629. }
  84630. });
  84631. if (!result.height) {
  84632. result.height = parseFloat(computedStyle(el, "height"));
  84633. }
  84634. if (!result.width) {
  84635. result.width = parseFloat(computedStyle(el, "width"));
  84636. }
  84637. return result;
  84638. }
  84639. }
  84640. function findPosition(el) {
  84641. if (!el || el && !el.offsetParent) {
  84642. return {
  84643. left: 0,
  84644. top: 0,
  84645. width: 0,
  84646. height: 0
  84647. };
  84648. }
  84649. var width2 = el.offsetWidth;
  84650. var height2 = el.offsetHeight;
  84651. var left = 0;
  84652. var top = 0;
  84653. while (el.offsetParent && el !== document_1[FullscreenApi.fullscreenElement]) {
  84654. left += el.offsetLeft;
  84655. top += el.offsetTop;
  84656. el = el.offsetParent;
  84657. }
  84658. return {
  84659. left,
  84660. top,
  84661. width: width2,
  84662. height: height2
  84663. };
  84664. }
  84665. function getPointerPosition(el, event2) {
  84666. var translated = {
  84667. x: 0,
  84668. y: 0
  84669. };
  84670. if (IS_IOS) {
  84671. var item = el;
  84672. while (item && item.nodeName.toLowerCase() !== "html") {
  84673. var transform3 = computedStyle(item, "transform");
  84674. if (/^matrix/.test(transform3)) {
  84675. var values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  84676. translated.x += values3[4];
  84677. translated.y += values3[5];
  84678. } else if (/^matrix3d/.test(transform3)) {
  84679. var _values = transform3.slice(9, -1).split(/,\s/).map(Number);
  84680. translated.x += _values[12];
  84681. translated.y += _values[13];
  84682. }
  84683. item = item.parentNode;
  84684. }
  84685. }
  84686. var position2 = {};
  84687. var boxTarget = findPosition(event2.target);
  84688. var box = findPosition(el);
  84689. var boxW = box.width;
  84690. var boxH = box.height;
  84691. var offsetY = event2.offsetY - (box.top - boxTarget.top);
  84692. var offsetX = event2.offsetX - (box.left - boxTarget.left);
  84693. if (event2.changedTouches) {
  84694. offsetX = event2.changedTouches[0].pageX - box.left;
  84695. offsetY = event2.changedTouches[0].pageY + box.top;
  84696. if (IS_IOS) {
  84697. offsetX -= translated.x;
  84698. offsetY -= translated.y;
  84699. }
  84700. }
  84701. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  84702. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  84703. return position2;
  84704. }
  84705. function isTextNode(value) {
  84706. return isObject2(value) && value.nodeType === 3;
  84707. }
  84708. function emptyEl(el) {
  84709. while (el.firstChild) {
  84710. el.removeChild(el.firstChild);
  84711. }
  84712. return el;
  84713. }
  84714. function normalizeContent(content) {
  84715. if (typeof content === "function") {
  84716. content = content();
  84717. }
  84718. return (Array.isArray(content) ? content : [content]).map(function(value) {
  84719. if (typeof value === "function") {
  84720. value = value();
  84721. }
  84722. if (isEl(value) || isTextNode(value)) {
  84723. return value;
  84724. }
  84725. if (typeof value === "string" && /\S/.test(value)) {
  84726. return document_1.createTextNode(value);
  84727. }
  84728. }).filter(function(value) {
  84729. return value;
  84730. });
  84731. }
  84732. function appendContent(el, content) {
  84733. normalizeContent(content).forEach(function(node) {
  84734. return el.appendChild(node);
  84735. });
  84736. return el;
  84737. }
  84738. function insertContent(el, content) {
  84739. return appendContent(emptyEl(el), content);
  84740. }
  84741. function isSingleLeftClick(event2) {
  84742. if (event2.button === void 0 && event2.buttons === void 0) {
  84743. return true;
  84744. }
  84745. if (event2.button === 0 && event2.buttons === void 0) {
  84746. return true;
  84747. }
  84748. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  84749. return true;
  84750. }
  84751. if (event2.button !== 0 || event2.buttons !== 1) {
  84752. return false;
  84753. }
  84754. return true;
  84755. }
  84756. var $ = createQuerier("querySelector");
  84757. var $$ = createQuerier("querySelectorAll");
  84758. var Dom$1 = /* @__PURE__ */ Object.freeze({
  84759. __proto__: null,
  84760. isReal,
  84761. isEl,
  84762. isInFrame,
  84763. createEl,
  84764. textContent,
  84765. prependTo,
  84766. hasClass,
  84767. addClass,
  84768. removeClass,
  84769. toggleClass,
  84770. setAttributes,
  84771. getAttributes,
  84772. getAttribute,
  84773. setAttribute,
  84774. removeAttribute,
  84775. blockTextSelection,
  84776. unblockTextSelection,
  84777. getBoundingClientRect,
  84778. findPosition,
  84779. getPointerPosition,
  84780. isTextNode,
  84781. emptyEl,
  84782. normalizeContent,
  84783. appendContent,
  84784. insertContent,
  84785. isSingleLeftClick,
  84786. $,
  84787. $$
  84788. });
  84789. var _windowLoaded = false;
  84790. var videojs$1;
  84791. var autoSetup = function autoSetup2() {
  84792. if (videojs$1.options.autoSetup === false) {
  84793. return;
  84794. }
  84795. var vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  84796. var audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  84797. var divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  84798. var mediaEls = vids.concat(audios, divs);
  84799. if (mediaEls && mediaEls.length > 0) {
  84800. for (var i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  84801. var mediaEl = mediaEls[i2];
  84802. if (mediaEl && mediaEl.getAttribute) {
  84803. if (mediaEl.player === void 0) {
  84804. var options2 = mediaEl.getAttribute("data-setup");
  84805. if (options2 !== null) {
  84806. videojs$1(mediaEl);
  84807. }
  84808. }
  84809. } else {
  84810. autoSetupTimeout(1);
  84811. break;
  84812. }
  84813. }
  84814. } else if (!_windowLoaded) {
  84815. autoSetupTimeout(1);
  84816. }
  84817. };
  84818. function autoSetupTimeout(wait, vjs) {
  84819. if (!isReal()) {
  84820. return;
  84821. }
  84822. if (vjs) {
  84823. videojs$1 = vjs;
  84824. }
  84825. window_1.setTimeout(autoSetup, wait);
  84826. }
  84827. function setWindowLoaded() {
  84828. _windowLoaded = true;
  84829. window_1.removeEventListener("load", setWindowLoaded);
  84830. }
  84831. if (isReal()) {
  84832. if (document_1.readyState === "complete") {
  84833. setWindowLoaded();
  84834. } else {
  84835. window_1.addEventListener("load", setWindowLoaded);
  84836. }
  84837. }
  84838. var createStyleElement = function createStyleElement2(className) {
  84839. var style = document_1.createElement("style");
  84840. style.className = className;
  84841. return style;
  84842. };
  84843. var setTextContent = function setTextContent2(el, content) {
  84844. if (el.styleSheet) {
  84845. el.styleSheet.cssText = content;
  84846. } else {
  84847. el.textContent = content;
  84848. }
  84849. };
  84850. var _initialGuid = 3;
  84851. var _guid = _initialGuid;
  84852. function newGUID() {
  84853. return _guid++;
  84854. }
  84855. var FakeWeakMap;
  84856. if (!window_1.WeakMap) {
  84857. FakeWeakMap = /* @__PURE__ */ function() {
  84858. function FakeWeakMap2() {
  84859. this.vdata = "vdata" + Math.floor(window_1.performance && window_1.performance.now() || Date.now());
  84860. this.data = {};
  84861. }
  84862. var _proto = FakeWeakMap2.prototype;
  84863. _proto.set = function set4(key, value) {
  84864. var access = key[this.vdata] || newGUID();
  84865. if (!key[this.vdata]) {
  84866. key[this.vdata] = access;
  84867. }
  84868. this.data[access] = value;
  84869. return this;
  84870. };
  84871. _proto.get = function get7(key) {
  84872. var access = key[this.vdata];
  84873. if (access) {
  84874. return this.data[access];
  84875. }
  84876. log$1("We have no data for this element", key);
  84877. return void 0;
  84878. };
  84879. _proto.has = function has(key) {
  84880. var access = key[this.vdata];
  84881. return access in this.data;
  84882. };
  84883. _proto["delete"] = function _delete(key) {
  84884. var access = key[this.vdata];
  84885. if (access) {
  84886. delete this.data[access];
  84887. delete key[this.vdata];
  84888. }
  84889. };
  84890. return FakeWeakMap2;
  84891. }();
  84892. }
  84893. var DomData = window_1.WeakMap ? /* @__PURE__ */ new WeakMap() : new FakeWeakMap();
  84894. function _cleanUpEvents(elem, type2) {
  84895. if (!DomData.has(elem)) {
  84896. return;
  84897. }
  84898. var data = DomData.get(elem);
  84899. if (data.handlers[type2].length === 0) {
  84900. delete data.handlers[type2];
  84901. if (elem.removeEventListener) {
  84902. elem.removeEventListener(type2, data.dispatcher, false);
  84903. } else if (elem.detachEvent) {
  84904. elem.detachEvent("on" + type2, data.dispatcher);
  84905. }
  84906. }
  84907. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  84908. delete data.handlers;
  84909. delete data.dispatcher;
  84910. delete data.disabled;
  84911. }
  84912. if (Object.getOwnPropertyNames(data).length === 0) {
  84913. DomData["delete"](elem);
  84914. }
  84915. }
  84916. function _handleMultipleEvents(fn2, elem, types, callback2) {
  84917. types.forEach(function(type2) {
  84918. fn2(elem, type2, callback2);
  84919. });
  84920. }
  84921. function fixEvent(event2) {
  84922. if (event2.fixed_) {
  84923. return event2;
  84924. }
  84925. function returnTrue() {
  84926. return true;
  84927. }
  84928. function returnFalse() {
  84929. return false;
  84930. }
  84931. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  84932. var old = event2 || window_1.event;
  84933. event2 = {};
  84934. for (var key in old) {
  84935. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  84936. if (!(key === "returnValue" && old.preventDefault)) {
  84937. event2[key] = old[key];
  84938. }
  84939. }
  84940. }
  84941. if (!event2.target) {
  84942. event2.target = event2.srcElement || document_1;
  84943. }
  84944. if (!event2.relatedTarget) {
  84945. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  84946. }
  84947. event2.preventDefault = function() {
  84948. if (old.preventDefault) {
  84949. old.preventDefault();
  84950. }
  84951. event2.returnValue = false;
  84952. old.returnValue = false;
  84953. event2.defaultPrevented = true;
  84954. };
  84955. event2.defaultPrevented = false;
  84956. event2.stopPropagation = function() {
  84957. if (old.stopPropagation) {
  84958. old.stopPropagation();
  84959. }
  84960. event2.cancelBubble = true;
  84961. old.cancelBubble = true;
  84962. event2.isPropagationStopped = returnTrue;
  84963. };
  84964. event2.isPropagationStopped = returnFalse;
  84965. event2.stopImmediatePropagation = function() {
  84966. if (old.stopImmediatePropagation) {
  84967. old.stopImmediatePropagation();
  84968. }
  84969. event2.isImmediatePropagationStopped = returnTrue;
  84970. event2.stopPropagation();
  84971. };
  84972. event2.isImmediatePropagationStopped = returnFalse;
  84973. if (event2.clientX !== null && event2.clientX !== void 0) {
  84974. var doc = document_1.documentElement;
  84975. var body = document_1.body;
  84976. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  84977. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  84978. }
  84979. event2.which = event2.charCode || event2.keyCode;
  84980. if (event2.button !== null && event2.button !== void 0) {
  84981. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  84982. }
  84983. }
  84984. event2.fixed_ = true;
  84985. return event2;
  84986. }
  84987. var _supportsPassive;
  84988. var supportsPassive = function supportsPassive2() {
  84989. if (typeof _supportsPassive !== "boolean") {
  84990. _supportsPassive = false;
  84991. try {
  84992. var opts = Object.defineProperty({}, "passive", {
  84993. get: function get7() {
  84994. _supportsPassive = true;
  84995. }
  84996. });
  84997. window_1.addEventListener("test", null, opts);
  84998. window_1.removeEventListener("test", null, opts);
  84999. } catch (e) {
  85000. }
  85001. }
  85002. return _supportsPassive;
  85003. };
  85004. var passiveEvents = ["touchstart", "touchmove"];
  85005. function on(elem, type2, fn2) {
  85006. if (Array.isArray(type2)) {
  85007. return _handleMultipleEvents(on, elem, type2, fn2);
  85008. }
  85009. if (!DomData.has(elem)) {
  85010. DomData.set(elem, {});
  85011. }
  85012. var data = DomData.get(elem);
  85013. if (!data.handlers) {
  85014. data.handlers = {};
  85015. }
  85016. if (!data.handlers[type2]) {
  85017. data.handlers[type2] = [];
  85018. }
  85019. if (!fn2.guid) {
  85020. fn2.guid = newGUID();
  85021. }
  85022. data.handlers[type2].push(fn2);
  85023. if (!data.dispatcher) {
  85024. data.disabled = false;
  85025. data.dispatcher = function(event2, hash) {
  85026. if (data.disabled) {
  85027. return;
  85028. }
  85029. event2 = fixEvent(event2);
  85030. var handlers = data.handlers[event2.type];
  85031. if (handlers) {
  85032. var handlersCopy = handlers.slice(0);
  85033. for (var m = 0, n = handlersCopy.length; m < n; m++) {
  85034. if (event2.isImmediatePropagationStopped()) {
  85035. break;
  85036. } else {
  85037. try {
  85038. handlersCopy[m].call(elem, event2, hash);
  85039. } catch (e) {
  85040. log$1.error(e);
  85041. }
  85042. }
  85043. }
  85044. }
  85045. };
  85046. }
  85047. if (data.handlers[type2].length === 1) {
  85048. if (elem.addEventListener) {
  85049. var options2 = false;
  85050. if (supportsPassive() && passiveEvents.indexOf(type2) > -1) {
  85051. options2 = {
  85052. passive: true
  85053. };
  85054. }
  85055. elem.addEventListener(type2, data.dispatcher, options2);
  85056. } else if (elem.attachEvent) {
  85057. elem.attachEvent("on" + type2, data.dispatcher);
  85058. }
  85059. }
  85060. }
  85061. function off(elem, type2, fn2) {
  85062. if (!DomData.has(elem)) {
  85063. return;
  85064. }
  85065. var data = DomData.get(elem);
  85066. if (!data.handlers) {
  85067. return;
  85068. }
  85069. if (Array.isArray(type2)) {
  85070. return _handleMultipleEvents(off, elem, type2, fn2);
  85071. }
  85072. var removeType = function removeType2(el, t3) {
  85073. data.handlers[t3] = [];
  85074. _cleanUpEvents(el, t3);
  85075. };
  85076. if (type2 === void 0) {
  85077. for (var t2 in data.handlers) {
  85078. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  85079. removeType(elem, t2);
  85080. }
  85081. }
  85082. return;
  85083. }
  85084. var handlers = data.handlers[type2];
  85085. if (!handlers) {
  85086. return;
  85087. }
  85088. if (!fn2) {
  85089. removeType(elem, type2);
  85090. return;
  85091. }
  85092. if (fn2.guid) {
  85093. for (var n = 0; n < handlers.length; n++) {
  85094. if (handlers[n].guid === fn2.guid) {
  85095. handlers.splice(n--, 1);
  85096. }
  85097. }
  85098. }
  85099. _cleanUpEvents(elem, type2);
  85100. }
  85101. function trigger(elem, event2, hash) {
  85102. var elemData = DomData.has(elem) ? DomData.get(elem) : {};
  85103. var parent = elem.parentNode || elem.ownerDocument;
  85104. if (typeof event2 === "string") {
  85105. event2 = {
  85106. type: event2,
  85107. target: elem
  85108. };
  85109. } else if (!event2.target) {
  85110. event2.target = elem;
  85111. }
  85112. event2 = fixEvent(event2);
  85113. if (elemData.dispatcher) {
  85114. elemData.dispatcher.call(elem, event2, hash);
  85115. }
  85116. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  85117. trigger.call(null, parent, event2, hash);
  85118. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  85119. if (!DomData.has(event2.target)) {
  85120. DomData.set(event2.target, {});
  85121. }
  85122. var targetData = DomData.get(event2.target);
  85123. if (event2.target[event2.type]) {
  85124. targetData.disabled = true;
  85125. if (typeof event2.target[event2.type] === "function") {
  85126. event2.target[event2.type]();
  85127. }
  85128. targetData.disabled = false;
  85129. }
  85130. }
  85131. return !event2.defaultPrevented;
  85132. }
  85133. function one(elem, type2, fn2) {
  85134. if (Array.isArray(type2)) {
  85135. return _handleMultipleEvents(one, elem, type2, fn2);
  85136. }
  85137. var func = function func2() {
  85138. off(elem, type2, func2);
  85139. fn2.apply(this, arguments);
  85140. };
  85141. func.guid = fn2.guid = fn2.guid || newGUID();
  85142. on(elem, type2, func);
  85143. }
  85144. function any(elem, type2, fn2) {
  85145. var func = function func2() {
  85146. off(elem, type2, func2);
  85147. fn2.apply(this, arguments);
  85148. };
  85149. func.guid = fn2.guid = fn2.guid || newGUID();
  85150. on(elem, type2, func);
  85151. }
  85152. var Events = /* @__PURE__ */ Object.freeze({
  85153. __proto__: null,
  85154. fixEvent,
  85155. on,
  85156. off,
  85157. trigger,
  85158. one,
  85159. any
  85160. });
  85161. var UPDATE_REFRESH_INTERVAL = 30;
  85162. var bind = function bind2(context, fn2, uid) {
  85163. if (!fn2.guid) {
  85164. fn2.guid = newGUID();
  85165. }
  85166. var bound = fn2.bind(context);
  85167. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  85168. return bound;
  85169. };
  85170. var throttle = function throttle2(fn2, wait) {
  85171. var last = window_1.performance.now();
  85172. var throttled = function throttled2() {
  85173. var now2 = window_1.performance.now();
  85174. if (now2 - last >= wait) {
  85175. fn2.apply(void 0, arguments);
  85176. last = now2;
  85177. }
  85178. };
  85179. return throttled;
  85180. };
  85181. var debounce = function debounce2(func, wait, immediate, context) {
  85182. if (context === void 0) {
  85183. context = window_1;
  85184. }
  85185. var timeout;
  85186. var cancel = function cancel2() {
  85187. context.clearTimeout(timeout);
  85188. timeout = null;
  85189. };
  85190. var debounced = function debounced2() {
  85191. var self2 = this;
  85192. var args = arguments;
  85193. var _later = function later() {
  85194. timeout = null;
  85195. _later = null;
  85196. if (!immediate) {
  85197. func.apply(self2, args);
  85198. }
  85199. };
  85200. if (!timeout && immediate) {
  85201. func.apply(self2, args);
  85202. }
  85203. context.clearTimeout(timeout);
  85204. timeout = context.setTimeout(_later, wait);
  85205. };
  85206. debounced.cancel = cancel;
  85207. return debounced;
  85208. };
  85209. var EventTarget$2 = function EventTarget() {
  85210. };
  85211. EventTarget$2.prototype.allowedEvents_ = {};
  85212. EventTarget$2.prototype.on = function(type2, fn2) {
  85213. var ael = this.addEventListener;
  85214. this.addEventListener = function() {
  85215. };
  85216. on(this, type2, fn2);
  85217. this.addEventListener = ael;
  85218. };
  85219. EventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;
  85220. EventTarget$2.prototype.off = function(type2, fn2) {
  85221. off(this, type2, fn2);
  85222. };
  85223. EventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;
  85224. EventTarget$2.prototype.one = function(type2, fn2) {
  85225. var ael = this.addEventListener;
  85226. this.addEventListener = function() {
  85227. };
  85228. one(this, type2, fn2);
  85229. this.addEventListener = ael;
  85230. };
  85231. EventTarget$2.prototype.any = function(type2, fn2) {
  85232. var ael = this.addEventListener;
  85233. this.addEventListener = function() {
  85234. };
  85235. any(this, type2, fn2);
  85236. this.addEventListener = ael;
  85237. };
  85238. EventTarget$2.prototype.trigger = function(event2) {
  85239. var type2 = event2.type || event2;
  85240. if (typeof event2 === "string") {
  85241. event2 = {
  85242. type: type2
  85243. };
  85244. }
  85245. event2 = fixEvent(event2);
  85246. if (this.allowedEvents_[type2] && this["on" + type2]) {
  85247. this["on" + type2](event2);
  85248. }
  85249. trigger(this, event2);
  85250. };
  85251. EventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;
  85252. var EVENT_MAP;
  85253. EventTarget$2.prototype.queueTrigger = function(event2) {
  85254. var _this = this;
  85255. if (!EVENT_MAP) {
  85256. EVENT_MAP = /* @__PURE__ */ new Map();
  85257. }
  85258. var type2 = event2.type || event2;
  85259. var map = EVENT_MAP.get(this);
  85260. if (!map) {
  85261. map = /* @__PURE__ */ new Map();
  85262. EVENT_MAP.set(this, map);
  85263. }
  85264. var oldTimeout = map.get(type2);
  85265. map["delete"](type2);
  85266. window_1.clearTimeout(oldTimeout);
  85267. var timeout = window_1.setTimeout(function() {
  85268. map["delete"](type2);
  85269. if (map.size === 0) {
  85270. map = null;
  85271. EVENT_MAP["delete"](_this);
  85272. }
  85273. _this.trigger(event2);
  85274. }, 0);
  85275. map.set(type2, timeout);
  85276. };
  85277. var objName = function objName2(obj) {
  85278. if (typeof obj.name === "function") {
  85279. return obj.name();
  85280. }
  85281. if (typeof obj.name === "string") {
  85282. return obj.name;
  85283. }
  85284. if (obj.name_) {
  85285. return obj.name_;
  85286. }
  85287. if (obj.constructor && obj.constructor.name) {
  85288. return obj.constructor.name;
  85289. }
  85290. return typeof obj;
  85291. };
  85292. var isEvented = function isEvented2(object) {
  85293. return object instanceof EventTarget$2 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(k) {
  85294. return typeof object[k] === "function";
  85295. });
  85296. };
  85297. var addEventedCallback = function addEventedCallback2(target, callback2) {
  85298. if (isEvented(target)) {
  85299. callback2();
  85300. } else {
  85301. if (!target.eventedCallbacks) {
  85302. target.eventedCallbacks = [];
  85303. }
  85304. target.eventedCallbacks.push(callback2);
  85305. }
  85306. };
  85307. var isValidEventType = function isValidEventType2(type2) {
  85308. return typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  85309. };
  85310. var validateTarget = function validateTarget2(target, obj, fnName) {
  85311. if (!target || !target.nodeName && !isEvented(target)) {
  85312. throw new Error("Invalid target for " + objName(obj) + "#" + fnName + "; must be a DOM node or evented object.");
  85313. }
  85314. };
  85315. var validateEventType = function validateEventType2(type2, obj, fnName) {
  85316. if (!isValidEventType(type2)) {
  85317. throw new Error("Invalid event type for " + objName(obj) + "#" + fnName + "; must be a non-empty string or array.");
  85318. }
  85319. };
  85320. var validateListener = function validateListener2(listener, obj, fnName) {
  85321. if (typeof listener !== "function") {
  85322. throw new Error("Invalid listener for " + objName(obj) + "#" + fnName + "; must be a function.");
  85323. }
  85324. };
  85325. var normalizeListenArgs = function normalizeListenArgs2(self2, args, fnName) {
  85326. var isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  85327. var target;
  85328. var type2;
  85329. var listener;
  85330. if (isTargetingSelf) {
  85331. target = self2.eventBusEl_;
  85332. if (args.length >= 3) {
  85333. args.shift();
  85334. }
  85335. type2 = args[0];
  85336. listener = args[1];
  85337. } else {
  85338. target = args[0];
  85339. type2 = args[1];
  85340. listener = args[2];
  85341. }
  85342. validateTarget(target, self2, fnName);
  85343. validateEventType(type2, self2, fnName);
  85344. validateListener(listener, self2, fnName);
  85345. listener = bind(self2, listener);
  85346. return {
  85347. isTargetingSelf,
  85348. target,
  85349. type: type2,
  85350. listener
  85351. };
  85352. };
  85353. var listen = function listen2(target, method, type2, listener) {
  85354. validateTarget(target, target, method);
  85355. if (target.nodeName) {
  85356. Events[method](target, type2, listener);
  85357. } else {
  85358. target[method](type2, listener);
  85359. }
  85360. };
  85361. var EventedMixin = {
  85362. on: function on2() {
  85363. var _this = this;
  85364. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  85365. args[_key] = arguments[_key];
  85366. }
  85367. var _normalizeListenArgs = normalizeListenArgs(this, args, "on"), isTargetingSelf = _normalizeListenArgs.isTargetingSelf, target = _normalizeListenArgs.target, type2 = _normalizeListenArgs.type, listener = _normalizeListenArgs.listener;
  85368. listen(target, "on", type2, listener);
  85369. if (!isTargetingSelf) {
  85370. var removeListenerOnDispose = function removeListenerOnDispose2() {
  85371. return _this.off(target, type2, listener);
  85372. };
  85373. removeListenerOnDispose.guid = listener.guid;
  85374. var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose2() {
  85375. return _this.off("dispose", removeListenerOnDispose);
  85376. };
  85377. removeRemoverOnTargetDispose.guid = listener.guid;
  85378. listen(this, "on", "dispose", removeListenerOnDispose);
  85379. listen(target, "on", "dispose", removeRemoverOnTargetDispose);
  85380. }
  85381. },
  85382. one: function one2() {
  85383. var _this2 = this;
  85384. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  85385. args[_key2] = arguments[_key2];
  85386. }
  85387. var _normalizeListenArgs2 = normalizeListenArgs(this, args, "one"), isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, target = _normalizeListenArgs2.target, type2 = _normalizeListenArgs2.type, listener = _normalizeListenArgs2.listener;
  85388. if (isTargetingSelf) {
  85389. listen(target, "one", type2, listener);
  85390. } else {
  85391. var wrapper = function wrapper2() {
  85392. _this2.off(target, type2, wrapper2);
  85393. for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  85394. largs[_key3] = arguments[_key3];
  85395. }
  85396. listener.apply(null, largs);
  85397. };
  85398. wrapper.guid = listener.guid;
  85399. listen(target, "one", type2, wrapper);
  85400. }
  85401. },
  85402. any: function any2() {
  85403. var _this3 = this;
  85404. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  85405. args[_key4] = arguments[_key4];
  85406. }
  85407. var _normalizeListenArgs3 = normalizeListenArgs(this, args, "any"), isTargetingSelf = _normalizeListenArgs3.isTargetingSelf, target = _normalizeListenArgs3.target, type2 = _normalizeListenArgs3.type, listener = _normalizeListenArgs3.listener;
  85408. if (isTargetingSelf) {
  85409. listen(target, "any", type2, listener);
  85410. } else {
  85411. var wrapper = function wrapper2() {
  85412. _this3.off(target, type2, wrapper2);
  85413. for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  85414. largs[_key5] = arguments[_key5];
  85415. }
  85416. listener.apply(null, largs);
  85417. };
  85418. wrapper.guid = listener.guid;
  85419. listen(target, "any", type2, wrapper);
  85420. }
  85421. },
  85422. off: function off$12(targetOrType, typeOrListener, listener) {
  85423. if (!targetOrType || isValidEventType(targetOrType)) {
  85424. off(this.eventBusEl_, targetOrType, typeOrListener);
  85425. } else {
  85426. var target = targetOrType;
  85427. var type2 = typeOrListener;
  85428. validateTarget(target, this, "off");
  85429. validateEventType(type2, this, "off");
  85430. validateListener(listener, this, "off");
  85431. listener = bind(this, listener);
  85432. this.off("dispose", listener);
  85433. if (target.nodeName) {
  85434. off(target, type2, listener);
  85435. off(target, "dispose", listener);
  85436. } else if (isEvented(target)) {
  85437. target.off(type2, listener);
  85438. target.off("dispose", listener);
  85439. }
  85440. }
  85441. },
  85442. trigger: function trigger$12(event2, hash) {
  85443. validateTarget(this.eventBusEl_, this, "trigger");
  85444. var type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  85445. if (!isValidEventType(type2)) {
  85446. var error = "Invalid event type for " + objName(this) + "#trigger; must be a non-empty string or object with a type key that has a non-empty value.";
  85447. if (event2) {
  85448. (this.log || log$1).error(error);
  85449. } else {
  85450. throw new Error(error);
  85451. }
  85452. }
  85453. return trigger(this.eventBusEl_, event2, hash);
  85454. }
  85455. };
  85456. function evented(target, options2) {
  85457. if (options2 === void 0) {
  85458. options2 = {};
  85459. }
  85460. var _options = options2, eventBusKey = _options.eventBusKey;
  85461. if (eventBusKey) {
  85462. if (!target[eventBusKey].nodeName) {
  85463. throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.');
  85464. }
  85465. target.eventBusEl_ = target[eventBusKey];
  85466. } else {
  85467. target.eventBusEl_ = createEl("span", {
  85468. className: "vjs-event-bus"
  85469. });
  85470. }
  85471. assign(target, EventedMixin);
  85472. if (target.eventedCallbacks) {
  85473. target.eventedCallbacks.forEach(function(callback2) {
  85474. callback2();
  85475. });
  85476. }
  85477. target.on("dispose", function() {
  85478. target.off();
  85479. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  85480. if (val && DomData.has(val)) {
  85481. DomData["delete"](val);
  85482. }
  85483. });
  85484. window_1.setTimeout(function() {
  85485. target.eventBusEl_ = null;
  85486. }, 0);
  85487. });
  85488. return target;
  85489. }
  85490. var StatefulMixin = {
  85491. state: {},
  85492. setState: function setState(stateUpdates) {
  85493. var _this = this;
  85494. if (typeof stateUpdates === "function") {
  85495. stateUpdates = stateUpdates();
  85496. }
  85497. var changes;
  85498. each(stateUpdates, function(value, key) {
  85499. if (_this.state[key] !== value) {
  85500. changes = changes || {};
  85501. changes[key] = {
  85502. from: _this.state[key],
  85503. to: value
  85504. };
  85505. }
  85506. _this.state[key] = value;
  85507. });
  85508. if (changes && isEvented(this)) {
  85509. this.trigger({
  85510. changes,
  85511. type: "statechanged"
  85512. });
  85513. }
  85514. return changes;
  85515. }
  85516. };
  85517. function stateful(target, defaultState) {
  85518. assign(target, StatefulMixin);
  85519. target.state = assign({}, target.state, defaultState);
  85520. if (typeof target.handleStateChanged === "function" && isEvented(target)) {
  85521. target.on("statechanged", target.handleStateChanged);
  85522. }
  85523. return target;
  85524. }
  85525. var toLowerCase = function toLowerCase2(string) {
  85526. if (typeof string !== "string") {
  85527. return string;
  85528. }
  85529. return string.replace(/./, function(w) {
  85530. return w.toLowerCase();
  85531. });
  85532. };
  85533. var toTitleCase$1 = function toTitleCase(string) {
  85534. if (typeof string !== "string") {
  85535. return string;
  85536. }
  85537. return string.replace(/./, function(w) {
  85538. return w.toUpperCase();
  85539. });
  85540. };
  85541. var titleCaseEquals = function titleCaseEquals2(str1, str2) {
  85542. return toTitleCase$1(str1) === toTitleCase$1(str2);
  85543. };
  85544. function mergeOptions$3() {
  85545. var result = {};
  85546. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  85547. sources[_key] = arguments[_key];
  85548. }
  85549. sources.forEach(function(source) {
  85550. if (!source) {
  85551. return;
  85552. }
  85553. each(source, function(value, key) {
  85554. if (!isPlain(value)) {
  85555. result[key] = value;
  85556. return;
  85557. }
  85558. if (!isPlain(result[key])) {
  85559. result[key] = {};
  85560. }
  85561. result[key] = mergeOptions$3(result[key], value);
  85562. });
  85563. });
  85564. return result;
  85565. }
  85566. var MapSham = /* @__PURE__ */ function() {
  85567. function MapSham2() {
  85568. this.map_ = {};
  85569. }
  85570. var _proto = MapSham2.prototype;
  85571. _proto.has = function has(key) {
  85572. return key in this.map_;
  85573. };
  85574. _proto["delete"] = function _delete(key) {
  85575. var has = this.has(key);
  85576. delete this.map_[key];
  85577. return has;
  85578. };
  85579. _proto.set = function set4(key, value) {
  85580. this.map_[key] = value;
  85581. return this;
  85582. };
  85583. _proto.forEach = function forEach(callback2, thisArg) {
  85584. for (var key in this.map_) {
  85585. callback2.call(thisArg, this.map_[key], key, this);
  85586. }
  85587. };
  85588. return MapSham2;
  85589. }();
  85590. var Map$1 = window_1.Map ? window_1.Map : MapSham;
  85591. var SetSham = /* @__PURE__ */ function() {
  85592. function SetSham2() {
  85593. this.set_ = {};
  85594. }
  85595. var _proto = SetSham2.prototype;
  85596. _proto.has = function has(key) {
  85597. return key in this.set_;
  85598. };
  85599. _proto["delete"] = function _delete(key) {
  85600. var has = this.has(key);
  85601. delete this.set_[key];
  85602. return has;
  85603. };
  85604. _proto.add = function add(key) {
  85605. this.set_[key] = 1;
  85606. return this;
  85607. };
  85608. _proto.forEach = function forEach(callback2, thisArg) {
  85609. for (var key in this.set_) {
  85610. callback2.call(thisArg, key, key, this);
  85611. }
  85612. };
  85613. return SetSham2;
  85614. }();
  85615. var Set$1 = window_1.Set ? window_1.Set : SetSham;
  85616. var Component$1 = /* @__PURE__ */ function() {
  85617. function Component2(player, options2, ready) {
  85618. var _this = this;
  85619. if (!player && this.play) {
  85620. this.player_ = player = this;
  85621. } else {
  85622. this.player_ = player;
  85623. }
  85624. this.isDisposed_ = false;
  85625. this.parentComponent_ = null;
  85626. this.options_ = mergeOptions$3({}, this.options_);
  85627. options2 = this.options_ = mergeOptions$3(this.options_, options2);
  85628. this.id_ = options2.id || options2.el && options2.el.id;
  85629. if (!this.id_) {
  85630. var id = player && player.id && player.id() || "no_player";
  85631. this.id_ = id + "_component_" + newGUID();
  85632. }
  85633. this.name_ = options2.name || null;
  85634. if (options2.el) {
  85635. this.el_ = options2.el;
  85636. } else if (options2.createEl !== false) {
  85637. this.el_ = this.createEl();
  85638. }
  85639. if (options2.className && this.el_) {
  85640. options2.className.split(" ").forEach(function(c) {
  85641. return _this.addClass(c);
  85642. });
  85643. }
  85644. if (options2.evented !== false) {
  85645. evented(this, {
  85646. eventBusKey: this.el_ ? "el_" : null
  85647. });
  85648. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  85649. this.on(this.player_, "languagechange", this.handleLanguagechange);
  85650. }
  85651. stateful(this, this.constructor.defaultState);
  85652. this.children_ = [];
  85653. this.childIndex_ = {};
  85654. this.childNameIndex_ = {};
  85655. this.setTimeoutIds_ = new Set$1();
  85656. this.setIntervalIds_ = new Set$1();
  85657. this.rafIds_ = new Set$1();
  85658. this.namedRafs_ = new Map$1();
  85659. this.clearingTimersOnDispose_ = false;
  85660. if (options2.initChildren !== false) {
  85661. this.initChildren();
  85662. }
  85663. this.ready(ready);
  85664. if (options2.reportTouchActivity !== false) {
  85665. this.enableTouchActivity();
  85666. }
  85667. }
  85668. var _proto = Component2.prototype;
  85669. _proto.dispose = function dispose(options2) {
  85670. if (options2 === void 0) {
  85671. options2 = {};
  85672. }
  85673. if (this.isDisposed_) {
  85674. return;
  85675. }
  85676. if (this.readyQueue_) {
  85677. this.readyQueue_.length = 0;
  85678. }
  85679. this.trigger({
  85680. type: "dispose",
  85681. bubbles: false
  85682. });
  85683. this.isDisposed_ = true;
  85684. if (this.children_) {
  85685. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85686. if (this.children_[i2].dispose) {
  85687. this.children_[i2].dispose();
  85688. }
  85689. }
  85690. }
  85691. this.children_ = null;
  85692. this.childIndex_ = null;
  85693. this.childNameIndex_ = null;
  85694. this.parentComponent_ = null;
  85695. if (this.el_) {
  85696. if (this.el_.parentNode) {
  85697. if (options2.restoreEl) {
  85698. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  85699. } else {
  85700. this.el_.parentNode.removeChild(this.el_);
  85701. }
  85702. }
  85703. this.el_ = null;
  85704. }
  85705. this.player_ = null;
  85706. };
  85707. _proto.isDisposed = function isDisposed() {
  85708. return Boolean(this.isDisposed_);
  85709. };
  85710. _proto.player = function player() {
  85711. return this.player_;
  85712. };
  85713. _proto.options = function options2(obj) {
  85714. if (!obj) {
  85715. return this.options_;
  85716. }
  85717. this.options_ = mergeOptions$3(this.options_, obj);
  85718. return this.options_;
  85719. };
  85720. _proto.el = function el() {
  85721. return this.el_;
  85722. };
  85723. _proto.createEl = function createEl$12(tagName, properties, attributes) {
  85724. return createEl(tagName, properties, attributes);
  85725. };
  85726. _proto.localize = function localize(string, tokens, defaultValue2) {
  85727. if (defaultValue2 === void 0) {
  85728. defaultValue2 = string;
  85729. }
  85730. var code = this.player_.language && this.player_.language();
  85731. var languages = this.player_.languages && this.player_.languages();
  85732. var language = languages && languages[code];
  85733. var primaryCode = code && code.split("-")[0];
  85734. var primaryLang = languages && languages[primaryCode];
  85735. var localizedString = defaultValue2;
  85736. if (language && language[string]) {
  85737. localizedString = language[string];
  85738. } else if (primaryLang && primaryLang[string]) {
  85739. localizedString = primaryLang[string];
  85740. }
  85741. if (tokens) {
  85742. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  85743. var value = tokens[index2 - 1];
  85744. var ret = value;
  85745. if (typeof value === "undefined") {
  85746. ret = match;
  85747. }
  85748. return ret;
  85749. });
  85750. }
  85751. return localizedString;
  85752. };
  85753. _proto.handleLanguagechange = function handleLanguagechange() {
  85754. };
  85755. _proto.contentEl = function contentEl() {
  85756. return this.contentEl_ || this.el_;
  85757. };
  85758. _proto.id = function id() {
  85759. return this.id_;
  85760. };
  85761. _proto.name = function name() {
  85762. return this.name_;
  85763. };
  85764. _proto.children = function children() {
  85765. return this.children_;
  85766. };
  85767. _proto.getChildById = function getChildById(id) {
  85768. return this.childIndex_[id];
  85769. };
  85770. _proto.getChild = function getChild(name) {
  85771. if (!name) {
  85772. return;
  85773. }
  85774. return this.childNameIndex_[name];
  85775. };
  85776. _proto.getDescendant = function getDescendant() {
  85777. for (var _len = arguments.length, names2 = new Array(_len), _key = 0; _key < _len; _key++) {
  85778. names2[_key] = arguments[_key];
  85779. }
  85780. names2 = names2.reduce(function(acc, n) {
  85781. return acc.concat(n);
  85782. }, []);
  85783. var currentChild = this;
  85784. for (var i2 = 0; i2 < names2.length; i2++) {
  85785. currentChild = currentChild.getChild(names2[i2]);
  85786. if (!currentChild || !currentChild.getChild) {
  85787. return;
  85788. }
  85789. }
  85790. return currentChild;
  85791. };
  85792. _proto.addChild = function addChild(child, options2, index2) {
  85793. if (options2 === void 0) {
  85794. options2 = {};
  85795. }
  85796. if (index2 === void 0) {
  85797. index2 = this.children_.length;
  85798. }
  85799. var component;
  85800. var componentName;
  85801. if (typeof child === "string") {
  85802. componentName = toTitleCase$1(child);
  85803. var componentClassName = options2.componentClass || componentName;
  85804. options2.name = componentName;
  85805. var ComponentClass = Component2.getComponent(componentClassName);
  85806. if (!ComponentClass) {
  85807. throw new Error("Component " + componentClassName + " does not exist");
  85808. }
  85809. if (typeof ComponentClass !== "function") {
  85810. return null;
  85811. }
  85812. component = new ComponentClass(this.player_ || this, options2);
  85813. } else {
  85814. component = child;
  85815. }
  85816. if (component.parentComponent_) {
  85817. component.parentComponent_.removeChild(component);
  85818. }
  85819. this.children_.splice(index2, 0, component);
  85820. component.parentComponent_ = this;
  85821. if (typeof component.id === "function") {
  85822. this.childIndex_[component.id()] = component;
  85823. }
  85824. componentName = componentName || component.name && toTitleCase$1(component.name());
  85825. if (componentName) {
  85826. this.childNameIndex_[componentName] = component;
  85827. this.childNameIndex_[toLowerCase(componentName)] = component;
  85828. }
  85829. if (typeof component.el === "function" && component.el()) {
  85830. var refNode = null;
  85831. if (this.children_[index2 + 1]) {
  85832. if (this.children_[index2 + 1].el_) {
  85833. refNode = this.children_[index2 + 1].el_;
  85834. } else if (isEl(this.children_[index2 + 1])) {
  85835. refNode = this.children_[index2 + 1];
  85836. }
  85837. }
  85838. this.contentEl().insertBefore(component.el(), refNode);
  85839. }
  85840. return component;
  85841. };
  85842. _proto.removeChild = function removeChild(component) {
  85843. if (typeof component === "string") {
  85844. component = this.getChild(component);
  85845. }
  85846. if (!component || !this.children_) {
  85847. return;
  85848. }
  85849. var childFound = false;
  85850. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85851. if (this.children_[i2] === component) {
  85852. childFound = true;
  85853. this.children_.splice(i2, 1);
  85854. break;
  85855. }
  85856. }
  85857. if (!childFound) {
  85858. return;
  85859. }
  85860. component.parentComponent_ = null;
  85861. this.childIndex_[component.id()] = null;
  85862. this.childNameIndex_[toTitleCase$1(component.name())] = null;
  85863. this.childNameIndex_[toLowerCase(component.name())] = null;
  85864. var compEl = component.el();
  85865. if (compEl && compEl.parentNode === this.contentEl()) {
  85866. this.contentEl().removeChild(component.el());
  85867. }
  85868. };
  85869. _proto.initChildren = function initChildren() {
  85870. var _this2 = this;
  85871. var children = this.options_.children;
  85872. if (children) {
  85873. var parentOptions = this.options_;
  85874. var handleAdd = function handleAdd2(child) {
  85875. var name = child.name;
  85876. var opts = child.opts;
  85877. if (parentOptions[name] !== void 0) {
  85878. opts = parentOptions[name];
  85879. }
  85880. if (opts === false) {
  85881. return;
  85882. }
  85883. if (opts === true) {
  85884. opts = {};
  85885. }
  85886. opts.playerOptions = _this2.options_.playerOptions;
  85887. var newChild = _this2.addChild(name, opts);
  85888. if (newChild) {
  85889. _this2[name] = newChild;
  85890. }
  85891. };
  85892. var workingChildren;
  85893. var Tech2 = Component2.getComponent("Tech");
  85894. if (Array.isArray(children)) {
  85895. workingChildren = children;
  85896. } else {
  85897. workingChildren = Object.keys(children);
  85898. }
  85899. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  85900. return !workingChildren.some(function(wchild) {
  85901. if (typeof wchild === "string") {
  85902. return child === wchild;
  85903. }
  85904. return child === wchild.name;
  85905. });
  85906. })).map(function(child) {
  85907. var name;
  85908. var opts;
  85909. if (typeof child === "string") {
  85910. name = child;
  85911. opts = children[name] || _this2.options_[name] || {};
  85912. } else {
  85913. name = child.name;
  85914. opts = child;
  85915. }
  85916. return {
  85917. name,
  85918. opts
  85919. };
  85920. }).filter(function(child) {
  85921. var c = Component2.getComponent(child.opts.componentClass || toTitleCase$1(child.name));
  85922. return c && !Tech2.isTech(c);
  85923. }).forEach(handleAdd);
  85924. }
  85925. };
  85926. _proto.buildCSSClass = function buildCSSClass() {
  85927. return "";
  85928. };
  85929. _proto.ready = function ready(fn2, sync) {
  85930. if (sync === void 0) {
  85931. sync = false;
  85932. }
  85933. if (!fn2) {
  85934. return;
  85935. }
  85936. if (!this.isReady_) {
  85937. this.readyQueue_ = this.readyQueue_ || [];
  85938. this.readyQueue_.push(fn2);
  85939. return;
  85940. }
  85941. if (sync) {
  85942. fn2.call(this);
  85943. } else {
  85944. this.setTimeout(fn2, 1);
  85945. }
  85946. };
  85947. _proto.triggerReady = function triggerReady() {
  85948. this.isReady_ = true;
  85949. this.setTimeout(function() {
  85950. var readyQueue = this.readyQueue_;
  85951. this.readyQueue_ = [];
  85952. if (readyQueue && readyQueue.length > 0) {
  85953. readyQueue.forEach(function(fn2) {
  85954. fn2.call(this);
  85955. }, this);
  85956. }
  85957. this.trigger("ready");
  85958. }, 1);
  85959. };
  85960. _proto.$ = function $$12(selector, context) {
  85961. return $(selector, context || this.contentEl());
  85962. };
  85963. _proto.$$ = function $$$12(selector, context) {
  85964. return $$(selector, context || this.contentEl());
  85965. };
  85966. _proto.hasClass = function hasClass$12(classToCheck) {
  85967. return hasClass(this.el_, classToCheck);
  85968. };
  85969. _proto.addClass = function addClass$12(classToAdd) {
  85970. addClass(this.el_, classToAdd);
  85971. };
  85972. _proto.removeClass = function removeClass$12(classToRemove) {
  85973. removeClass(this.el_, classToRemove);
  85974. };
  85975. _proto.toggleClass = function toggleClass$12(classToToggle, predicate) {
  85976. toggleClass(this.el_, classToToggle, predicate);
  85977. };
  85978. _proto.show = function show() {
  85979. this.removeClass("vjs-hidden");
  85980. };
  85981. _proto.hide = function hide() {
  85982. this.addClass("vjs-hidden");
  85983. };
  85984. _proto.lockShowing = function lockShowing() {
  85985. this.addClass("vjs-lock-showing");
  85986. };
  85987. _proto.unlockShowing = function unlockShowing() {
  85988. this.removeClass("vjs-lock-showing");
  85989. };
  85990. _proto.getAttribute = function getAttribute$12(attribute) {
  85991. return getAttribute(this.el_, attribute);
  85992. };
  85993. _proto.setAttribute = function setAttribute$12(attribute, value) {
  85994. setAttribute(this.el_, attribute, value);
  85995. };
  85996. _proto.removeAttribute = function removeAttribute$12(attribute) {
  85997. removeAttribute(this.el_, attribute);
  85998. };
  85999. _proto.width = function width2(num, skipListeners) {
  86000. return this.dimension("width", num, skipListeners);
  86001. };
  86002. _proto.height = function height2(num, skipListeners) {
  86003. return this.dimension("height", num, skipListeners);
  86004. };
  86005. _proto.dimensions = function dimensions(width2, height2) {
  86006. this.width(width2, true);
  86007. this.height(height2);
  86008. };
  86009. _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {
  86010. if (num !== void 0) {
  86011. if (num === null || num !== num) {
  86012. num = 0;
  86013. }
  86014. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  86015. this.el_.style[widthOrHeight] = num;
  86016. } else if (num === "auto") {
  86017. this.el_.style[widthOrHeight] = "";
  86018. } else {
  86019. this.el_.style[widthOrHeight] = num + "px";
  86020. }
  86021. if (!skipListeners) {
  86022. this.trigger("componentresize");
  86023. }
  86024. return;
  86025. }
  86026. if (!this.el_) {
  86027. return 0;
  86028. }
  86029. var val = this.el_.style[widthOrHeight];
  86030. var pxIndex = val.indexOf("px");
  86031. if (pxIndex !== -1) {
  86032. return parseInt(val.slice(0, pxIndex), 10);
  86033. }
  86034. return parseInt(this.el_["offset" + toTitleCase$1(widthOrHeight)], 10);
  86035. };
  86036. _proto.currentDimension = function currentDimension(widthOrHeight) {
  86037. var computedWidthOrHeight = 0;
  86038. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  86039. throw new Error("currentDimension only accepts width or height value");
  86040. }
  86041. computedWidthOrHeight = computedStyle(this.el_, widthOrHeight);
  86042. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  86043. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  86044. var rule = "offset" + toTitleCase$1(widthOrHeight);
  86045. computedWidthOrHeight = this.el_[rule];
  86046. }
  86047. return computedWidthOrHeight;
  86048. };
  86049. _proto.currentDimensions = function currentDimensions() {
  86050. return {
  86051. width: this.currentDimension("width"),
  86052. height: this.currentDimension("height")
  86053. };
  86054. };
  86055. _proto.currentWidth = function currentWidth() {
  86056. return this.currentDimension("width");
  86057. };
  86058. _proto.currentHeight = function currentHeight() {
  86059. return this.currentDimension("height");
  86060. };
  86061. _proto.focus = function focus() {
  86062. this.el_.focus();
  86063. };
  86064. _proto.blur = function blur() {
  86065. this.el_.blur();
  86066. };
  86067. _proto.handleKeyDown = function handleKeyDown(event2) {
  86068. if (this.player_) {
  86069. if (!keycode.isEventKey(event2, "Tab")) {
  86070. event2.stopPropagation();
  86071. }
  86072. this.player_.handleKeyDown(event2);
  86073. }
  86074. };
  86075. _proto.handleKeyPress = function handleKeyPress(event2) {
  86076. this.handleKeyDown(event2);
  86077. };
  86078. _proto.emitTapEvents = function emitTapEvents() {
  86079. var touchStart = 0;
  86080. var firstTouch = null;
  86081. var tapMovementThreshold = 10;
  86082. var touchTimeThreshold = 200;
  86083. var couldBeTap;
  86084. this.on("touchstart", function(event2) {
  86085. if (event2.touches.length === 1) {
  86086. firstTouch = {
  86087. pageX: event2.touches[0].pageX,
  86088. pageY: event2.touches[0].pageY
  86089. };
  86090. touchStart = window_1.performance.now();
  86091. couldBeTap = true;
  86092. }
  86093. });
  86094. this.on("touchmove", function(event2) {
  86095. if (event2.touches.length > 1) {
  86096. couldBeTap = false;
  86097. } else if (firstTouch) {
  86098. var xdiff = event2.touches[0].pageX - firstTouch.pageX;
  86099. var ydiff = event2.touches[0].pageY - firstTouch.pageY;
  86100. var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  86101. if (touchDistance > tapMovementThreshold) {
  86102. couldBeTap = false;
  86103. }
  86104. }
  86105. });
  86106. var noTap = function noTap2() {
  86107. couldBeTap = false;
  86108. };
  86109. this.on("touchleave", noTap);
  86110. this.on("touchcancel", noTap);
  86111. this.on("touchend", function(event2) {
  86112. firstTouch = null;
  86113. if (couldBeTap === true) {
  86114. var touchTime = window_1.performance.now() - touchStart;
  86115. if (touchTime < touchTimeThreshold) {
  86116. event2.preventDefault();
  86117. this.trigger("tap");
  86118. }
  86119. }
  86120. });
  86121. };
  86122. _proto.enableTouchActivity = function enableTouchActivity() {
  86123. if (!this.player() || !this.player().reportUserActivity) {
  86124. return;
  86125. }
  86126. var report = bind(this.player(), this.player().reportUserActivity);
  86127. var touchHolding;
  86128. this.on("touchstart", function() {
  86129. report();
  86130. this.clearInterval(touchHolding);
  86131. touchHolding = this.setInterval(report, 250);
  86132. });
  86133. var touchEnd = function touchEnd2(event2) {
  86134. report();
  86135. this.clearInterval(touchHolding);
  86136. };
  86137. this.on("touchmove", report);
  86138. this.on("touchend", touchEnd);
  86139. this.on("touchcancel", touchEnd);
  86140. };
  86141. _proto.setTimeout = function setTimeout2(fn2, timeout) {
  86142. var _this3 = this;
  86143. var timeoutId;
  86144. fn2 = bind(this, fn2);
  86145. this.clearTimersOnDispose_();
  86146. timeoutId = window_1.setTimeout(function() {
  86147. if (_this3.setTimeoutIds_.has(timeoutId)) {
  86148. _this3.setTimeoutIds_["delete"](timeoutId);
  86149. }
  86150. fn2();
  86151. }, timeout);
  86152. this.setTimeoutIds_.add(timeoutId);
  86153. return timeoutId;
  86154. };
  86155. _proto.clearTimeout = function clearTimeout2(timeoutId) {
  86156. if (this.setTimeoutIds_.has(timeoutId)) {
  86157. this.setTimeoutIds_["delete"](timeoutId);
  86158. window_1.clearTimeout(timeoutId);
  86159. }
  86160. return timeoutId;
  86161. };
  86162. _proto.setInterval = function setInterval2(fn2, interval) {
  86163. fn2 = bind(this, fn2);
  86164. this.clearTimersOnDispose_();
  86165. var intervalId = window_1.setInterval(fn2, interval);
  86166. this.setIntervalIds_.add(intervalId);
  86167. return intervalId;
  86168. };
  86169. _proto.clearInterval = function clearInterval2(intervalId) {
  86170. if (this.setIntervalIds_.has(intervalId)) {
  86171. this.setIntervalIds_["delete"](intervalId);
  86172. window_1.clearInterval(intervalId);
  86173. }
  86174. return intervalId;
  86175. };
  86176. _proto.requestAnimationFrame = function requestAnimationFrame(fn2) {
  86177. var _this4 = this;
  86178. if (!this.supportsRaf_) {
  86179. return this.setTimeout(fn2, 1e3 / 60);
  86180. }
  86181. this.clearTimersOnDispose_();
  86182. var id;
  86183. fn2 = bind(this, fn2);
  86184. id = window_1.requestAnimationFrame(function() {
  86185. if (_this4.rafIds_.has(id)) {
  86186. _this4.rafIds_["delete"](id);
  86187. }
  86188. fn2();
  86189. });
  86190. this.rafIds_.add(id);
  86191. return id;
  86192. };
  86193. _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn2) {
  86194. var _this5 = this;
  86195. if (this.namedRafs_.has(name)) {
  86196. return;
  86197. }
  86198. this.clearTimersOnDispose_();
  86199. fn2 = bind(this, fn2);
  86200. var id = this.requestAnimationFrame(function() {
  86201. fn2();
  86202. if (_this5.namedRafs_.has(name)) {
  86203. _this5.namedRafs_["delete"](name);
  86204. }
  86205. });
  86206. this.namedRafs_.set(name, id);
  86207. return name;
  86208. };
  86209. _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) {
  86210. if (!this.namedRafs_.has(name)) {
  86211. return;
  86212. }
  86213. this.cancelAnimationFrame(this.namedRafs_.get(name));
  86214. this.namedRafs_["delete"](name);
  86215. };
  86216. _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {
  86217. if (!this.supportsRaf_) {
  86218. return this.clearTimeout(id);
  86219. }
  86220. if (this.rafIds_.has(id)) {
  86221. this.rafIds_["delete"](id);
  86222. window_1.cancelAnimationFrame(id);
  86223. }
  86224. return id;
  86225. };
  86226. _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {
  86227. var _this6 = this;
  86228. if (this.clearingTimersOnDispose_) {
  86229. return;
  86230. }
  86231. this.clearingTimersOnDispose_ = true;
  86232. this.one("dispose", function() {
  86233. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function(_ref) {
  86234. var idName = _ref[0], cancelName = _ref[1];
  86235. _this6[idName].forEach(function(val, key) {
  86236. return _this6[cancelName](key);
  86237. });
  86238. });
  86239. _this6.clearingTimersOnDispose_ = false;
  86240. });
  86241. };
  86242. Component2.registerComponent = function registerComponent(name, ComponentToRegister) {
  86243. if (typeof name !== "string" || !name) {
  86244. throw new Error('Illegal component name, "' + name + '"; must be a non-empty string.');
  86245. }
  86246. var Tech2 = Component2.getComponent("Tech");
  86247. var isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  86248. var isComp = Component2 === ComponentToRegister || Component2.prototype.isPrototypeOf(ComponentToRegister.prototype);
  86249. if (isTech || !isComp) {
  86250. var reason;
  86251. if (isTech) {
  86252. reason = "techs must be registered using Tech.registerTech()";
  86253. } else {
  86254. reason = "must be a Component subclass";
  86255. }
  86256. throw new Error('Illegal component, "' + name + '"; ' + reason + ".");
  86257. }
  86258. name = toTitleCase$1(name);
  86259. if (!Component2.components_) {
  86260. Component2.components_ = {};
  86261. }
  86262. var Player2 = Component2.getComponent("Player");
  86263. if (name === "Player" && Player2 && Player2.players) {
  86264. var players = Player2.players;
  86265. var playerNames = Object.keys(players);
  86266. if (players && playerNames.length > 0 && playerNames.map(function(pname) {
  86267. return players[pname];
  86268. }).every(Boolean)) {
  86269. throw new Error("Can not register Player component after player has been created.");
  86270. }
  86271. }
  86272. Component2.components_[name] = ComponentToRegister;
  86273. Component2.components_[toLowerCase(name)] = ComponentToRegister;
  86274. return ComponentToRegister;
  86275. };
  86276. Component2.getComponent = function getComponent(name) {
  86277. if (!name || !Component2.components_) {
  86278. return;
  86279. }
  86280. return Component2.components_[name];
  86281. };
  86282. return Component2;
  86283. }();
  86284. Component$1.prototype.supportsRaf_ = typeof window_1.requestAnimationFrame === "function" && typeof window_1.cancelAnimationFrame === "function";
  86285. Component$1.registerComponent("Component", Component$1);
  86286. function rangeCheck(fnName, index2, maxIndex) {
  86287. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  86288. throw new Error("Failed to execute '" + fnName + "' on 'TimeRanges': The index provided (" + index2 + ") is non-numeric or out of bounds (0-" + maxIndex + ").");
  86289. }
  86290. }
  86291. function getRange(fnName, valueIndex, ranges, rangeIndex) {
  86292. rangeCheck(fnName, rangeIndex, ranges.length - 1);
  86293. return ranges[rangeIndex][valueIndex];
  86294. }
  86295. function createTimeRangesObj(ranges) {
  86296. var timeRangesObj;
  86297. if (ranges === void 0 || ranges.length === 0) {
  86298. timeRangesObj = {
  86299. length: 0,
  86300. start: function start2() {
  86301. throw new Error("This TimeRanges object is empty");
  86302. },
  86303. end: function end() {
  86304. throw new Error("This TimeRanges object is empty");
  86305. }
  86306. };
  86307. } else {
  86308. timeRangesObj = {
  86309. length: ranges.length,
  86310. start: getRange.bind(null, "start", 0, ranges),
  86311. end: getRange.bind(null, "end", 1, ranges)
  86312. };
  86313. }
  86314. if (window_1.Symbol && window_1.Symbol.iterator) {
  86315. timeRangesObj[window_1.Symbol.iterator] = function() {
  86316. return (ranges || []).values();
  86317. };
  86318. }
  86319. return timeRangesObj;
  86320. }
  86321. function createTimeRanges(start2, end) {
  86322. if (Array.isArray(start2)) {
  86323. return createTimeRangesObj(start2);
  86324. } else if (start2 === void 0 || end === void 0) {
  86325. return createTimeRangesObj();
  86326. }
  86327. return createTimeRangesObj([[start2, end]]);
  86328. }
  86329. function bufferedPercent(buffered, duration5) {
  86330. var bufferedDuration = 0;
  86331. var start2;
  86332. var end;
  86333. if (!duration5) {
  86334. return 0;
  86335. }
  86336. if (!buffered || !buffered.length) {
  86337. buffered = createTimeRanges(0, 0);
  86338. }
  86339. for (var i2 = 0; i2 < buffered.length; i2++) {
  86340. start2 = buffered.start(i2);
  86341. end = buffered.end(i2);
  86342. if (end > duration5) {
  86343. end = duration5;
  86344. }
  86345. bufferedDuration += end - start2;
  86346. }
  86347. return bufferedDuration / duration5;
  86348. }
  86349. function MediaError(value) {
  86350. if (value instanceof MediaError) {
  86351. return value;
  86352. }
  86353. if (typeof value === "number") {
  86354. this.code = value;
  86355. } else if (typeof value === "string") {
  86356. this.message = value;
  86357. } else if (isObject2(value)) {
  86358. if (typeof value.code === "number") {
  86359. this.code = value.code;
  86360. }
  86361. assign(this, value);
  86362. }
  86363. if (!this.message) {
  86364. this.message = MediaError.defaultMessages[this.code] || "";
  86365. }
  86366. }
  86367. MediaError.prototype.code = 0;
  86368. MediaError.prototype.message = "";
  86369. MediaError.prototype.status = null;
  86370. MediaError.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  86371. MediaError.defaultMessages = {
  86372. 1: "You aborted the media playback",
  86373. 2: "A network error caused the media download to fail part-way.",
  86374. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  86375. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  86376. 5: "The media is encrypted and we do not have the keys to decrypt it."
  86377. };
  86378. for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {
  86379. MediaError[MediaError.errorTypes[errNum]] = errNum;
  86380. MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;
  86381. }
  86382. function isPromise(value) {
  86383. return value !== void 0 && value !== null && typeof value.then === "function";
  86384. }
  86385. function silencePromise(value) {
  86386. if (isPromise(value)) {
  86387. value.then(null, function(e) {
  86388. });
  86389. }
  86390. }
  86391. var trackToJson_ = function trackToJson_2(track) {
  86392. var ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(acc, prop, i2) {
  86393. if (track[prop]) {
  86394. acc[prop] = track[prop];
  86395. }
  86396. return acc;
  86397. }, {
  86398. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  86399. return {
  86400. startTime: cue.startTime,
  86401. endTime: cue.endTime,
  86402. text: cue.text,
  86403. id: cue.id
  86404. };
  86405. })
  86406. });
  86407. return ret;
  86408. };
  86409. var textTracksToJson = function textTracksToJson2(tech) {
  86410. var trackEls = tech.$$("track");
  86411. var trackObjs = Array.prototype.map.call(trackEls, function(t2) {
  86412. return t2.track;
  86413. });
  86414. var tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  86415. var json = trackToJson_(trackEl.track);
  86416. if (trackEl.src) {
  86417. json.src = trackEl.src;
  86418. }
  86419. return json;
  86420. });
  86421. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  86422. return trackObjs.indexOf(track) === -1;
  86423. }).map(trackToJson_));
  86424. };
  86425. var jsonToTextTracks = function jsonToTextTracks2(json, tech) {
  86426. json.forEach(function(track) {
  86427. var addedTrack = tech.addRemoteTextTrack(track).track;
  86428. if (!track.src && track.cues) {
  86429. track.cues.forEach(function(cue) {
  86430. return addedTrack.addCue(cue);
  86431. });
  86432. }
  86433. });
  86434. return tech.textTracks();
  86435. };
  86436. var textTrackConverter = {
  86437. textTracksToJson,
  86438. jsonToTextTracks,
  86439. trackToJson_
  86440. };
  86441. var MODAL_CLASS_NAME = "vjs-modal-dialog";
  86442. var ModalDialog = /* @__PURE__ */ function(_Component) {
  86443. _inheritsLoose(ModalDialog2, _Component);
  86444. function ModalDialog2(player, options2) {
  86445. var _this;
  86446. _this = _Component.call(this, player, options2) || this;
  86447. _this.handleKeyDown_ = function(e) {
  86448. return _this.handleKeyDown(e);
  86449. };
  86450. _this.close_ = function(e) {
  86451. return _this.close(e);
  86452. };
  86453. _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;
  86454. _this.closeable(!_this.options_.uncloseable);
  86455. _this.content(_this.options_.content);
  86456. _this.contentEl_ = createEl("div", {
  86457. className: MODAL_CLASS_NAME + "-content"
  86458. }, {
  86459. role: "document"
  86460. });
  86461. _this.descEl_ = createEl("p", {
  86462. className: MODAL_CLASS_NAME + "-description vjs-control-text",
  86463. id: _this.el().getAttribute("aria-describedby")
  86464. });
  86465. textContent(_this.descEl_, _this.description());
  86466. _this.el_.appendChild(_this.descEl_);
  86467. _this.el_.appendChild(_this.contentEl_);
  86468. return _this;
  86469. }
  86470. var _proto = ModalDialog2.prototype;
  86471. _proto.createEl = function createEl2() {
  86472. return _Component.prototype.createEl.call(this, "div", {
  86473. className: this.buildCSSClass(),
  86474. tabIndex: -1
  86475. }, {
  86476. "aria-describedby": this.id() + "_description",
  86477. "aria-hidden": "true",
  86478. "aria-label": this.label(),
  86479. "role": "dialog"
  86480. });
  86481. };
  86482. _proto.dispose = function dispose() {
  86483. this.contentEl_ = null;
  86484. this.descEl_ = null;
  86485. this.previouslyActiveEl_ = null;
  86486. _Component.prototype.dispose.call(this);
  86487. };
  86488. _proto.buildCSSClass = function buildCSSClass() {
  86489. return MODAL_CLASS_NAME + " vjs-hidden " + _Component.prototype.buildCSSClass.call(this);
  86490. };
  86491. _proto.label = function label2() {
  86492. return this.localize(this.options_.label || "Modal Window");
  86493. };
  86494. _proto.description = function description() {
  86495. var desc = this.options_.description || this.localize("This is a modal window.");
  86496. if (this.closeable()) {
  86497. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  86498. }
  86499. return desc;
  86500. };
  86501. _proto.open = function open() {
  86502. if (!this.opened_) {
  86503. var player = this.player();
  86504. this.trigger("beforemodalopen");
  86505. this.opened_ = true;
  86506. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  86507. this.fill();
  86508. }
  86509. this.wasPlaying_ = !player.paused();
  86510. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  86511. player.pause();
  86512. }
  86513. this.on("keydown", this.handleKeyDown_);
  86514. this.hadControls_ = player.controls();
  86515. player.controls(false);
  86516. this.show();
  86517. this.conditionalFocus_();
  86518. this.el().setAttribute("aria-hidden", "false");
  86519. this.trigger("modalopen");
  86520. this.hasBeenOpened_ = true;
  86521. }
  86522. };
  86523. _proto.opened = function opened(value) {
  86524. if (typeof value === "boolean") {
  86525. this[value ? "open" : "close"]();
  86526. }
  86527. return this.opened_;
  86528. };
  86529. _proto.close = function close() {
  86530. if (!this.opened_) {
  86531. return;
  86532. }
  86533. var player = this.player();
  86534. this.trigger("beforemodalclose");
  86535. this.opened_ = false;
  86536. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  86537. player.play();
  86538. }
  86539. this.off("keydown", this.handleKeyDown_);
  86540. if (this.hadControls_) {
  86541. player.controls(true);
  86542. }
  86543. this.hide();
  86544. this.el().setAttribute("aria-hidden", "true");
  86545. this.trigger("modalclose");
  86546. this.conditionalBlur_();
  86547. if (this.options_.temporary) {
  86548. this.dispose();
  86549. }
  86550. };
  86551. _proto.closeable = function closeable(value) {
  86552. if (typeof value === "boolean") {
  86553. var closeable2 = this.closeable_ = !!value;
  86554. var close = this.getChild("closeButton");
  86555. if (closeable2 && !close) {
  86556. var temp = this.contentEl_;
  86557. this.contentEl_ = this.el_;
  86558. close = this.addChild("closeButton", {
  86559. controlText: "Close Modal Dialog"
  86560. });
  86561. this.contentEl_ = temp;
  86562. this.on(close, "close", this.close_);
  86563. }
  86564. if (!closeable2 && close) {
  86565. this.off(close, "close", this.close_);
  86566. this.removeChild(close);
  86567. close.dispose();
  86568. }
  86569. }
  86570. return this.closeable_;
  86571. };
  86572. _proto.fill = function fill() {
  86573. this.fillWith(this.content());
  86574. };
  86575. _proto.fillWith = function fillWith(content) {
  86576. var contentEl = this.contentEl();
  86577. var parentEl = contentEl.parentNode;
  86578. var nextSiblingEl = contentEl.nextSibling;
  86579. this.trigger("beforemodalfill");
  86580. this.hasBeenFilled_ = true;
  86581. parentEl.removeChild(contentEl);
  86582. this.empty();
  86583. insertContent(contentEl, content);
  86584. this.trigger("modalfill");
  86585. if (nextSiblingEl) {
  86586. parentEl.insertBefore(contentEl, nextSiblingEl);
  86587. } else {
  86588. parentEl.appendChild(contentEl);
  86589. }
  86590. var closeButton = this.getChild("closeButton");
  86591. if (closeButton) {
  86592. parentEl.appendChild(closeButton.el_);
  86593. }
  86594. };
  86595. _proto.empty = function empty() {
  86596. this.trigger("beforemodalempty");
  86597. emptyEl(this.contentEl());
  86598. this.trigger("modalempty");
  86599. };
  86600. _proto.content = function content(value) {
  86601. if (typeof value !== "undefined") {
  86602. this.content_ = value;
  86603. }
  86604. return this.content_;
  86605. };
  86606. _proto.conditionalFocus_ = function conditionalFocus_() {
  86607. var activeEl = document_1.activeElement;
  86608. var playerEl = this.player_.el_;
  86609. this.previouslyActiveEl_ = null;
  86610. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  86611. this.previouslyActiveEl_ = activeEl;
  86612. this.focus();
  86613. }
  86614. };
  86615. _proto.conditionalBlur_ = function conditionalBlur_() {
  86616. if (this.previouslyActiveEl_) {
  86617. this.previouslyActiveEl_.focus();
  86618. this.previouslyActiveEl_ = null;
  86619. }
  86620. };
  86621. _proto.handleKeyDown = function handleKeyDown(event2) {
  86622. event2.stopPropagation();
  86623. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  86624. event2.preventDefault();
  86625. this.close();
  86626. return;
  86627. }
  86628. if (!keycode.isEventKey(event2, "Tab")) {
  86629. return;
  86630. }
  86631. var focusableEls = this.focusableEls_();
  86632. var activeEl = this.el_.querySelector(":focus");
  86633. var focusIndex;
  86634. for (var i2 = 0; i2 < focusableEls.length; i2++) {
  86635. if (activeEl === focusableEls[i2]) {
  86636. focusIndex = i2;
  86637. break;
  86638. }
  86639. }
  86640. if (document_1.activeElement === this.el_) {
  86641. focusIndex = 0;
  86642. }
  86643. if (event2.shiftKey && focusIndex === 0) {
  86644. focusableEls[focusableEls.length - 1].focus();
  86645. event2.preventDefault();
  86646. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  86647. focusableEls[0].focus();
  86648. event2.preventDefault();
  86649. }
  86650. };
  86651. _proto.focusableEls_ = function focusableEls_() {
  86652. var allChildren = this.el_.querySelectorAll("*");
  86653. return Array.prototype.filter.call(allChildren, function(child) {
  86654. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  86655. });
  86656. };
  86657. return ModalDialog2;
  86658. }(Component$1);
  86659. ModalDialog.prototype.options_ = {
  86660. pauseOnOpen: true,
  86661. temporary: true
  86662. };
  86663. Component$1.registerComponent("ModalDialog", ModalDialog);
  86664. var TrackList = /* @__PURE__ */ function(_EventTarget) {
  86665. _inheritsLoose(TrackList2, _EventTarget);
  86666. function TrackList2(tracks) {
  86667. var _this;
  86668. if (tracks === void 0) {
  86669. tracks = [];
  86670. }
  86671. _this = _EventTarget.call(this) || this;
  86672. _this.tracks_ = [];
  86673. Object.defineProperty(_assertThisInitialized(_this), "length", {
  86674. get: function get7() {
  86675. return this.tracks_.length;
  86676. }
  86677. });
  86678. for (var i2 = 0; i2 < tracks.length; i2++) {
  86679. _this.addTrack(tracks[i2]);
  86680. }
  86681. return _this;
  86682. }
  86683. var _proto = TrackList2.prototype;
  86684. _proto.addTrack = function addTrack(track) {
  86685. var _this2 = this;
  86686. var index2 = this.tracks_.length;
  86687. if (!("" + index2 in this)) {
  86688. Object.defineProperty(this, index2, {
  86689. get: function get7() {
  86690. return this.tracks_[index2];
  86691. }
  86692. });
  86693. }
  86694. if (this.tracks_.indexOf(track) === -1) {
  86695. this.tracks_.push(track);
  86696. this.trigger({
  86697. track,
  86698. type: "addtrack",
  86699. target: this
  86700. });
  86701. }
  86702. track.labelchange_ = function() {
  86703. _this2.trigger({
  86704. track,
  86705. type: "labelchange",
  86706. target: _this2
  86707. });
  86708. };
  86709. if (isEvented(track)) {
  86710. track.addEventListener("labelchange", track.labelchange_);
  86711. }
  86712. };
  86713. _proto.removeTrack = function removeTrack(rtrack) {
  86714. var track;
  86715. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86716. if (this[i2] === rtrack) {
  86717. track = this[i2];
  86718. if (track.off) {
  86719. track.off();
  86720. }
  86721. this.tracks_.splice(i2, 1);
  86722. break;
  86723. }
  86724. }
  86725. if (!track) {
  86726. return;
  86727. }
  86728. this.trigger({
  86729. track,
  86730. type: "removetrack",
  86731. target: this
  86732. });
  86733. };
  86734. _proto.getTrackById = function getTrackById(id) {
  86735. var result = null;
  86736. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86737. var track = this[i2];
  86738. if (track.id === id) {
  86739. result = track;
  86740. break;
  86741. }
  86742. }
  86743. return result;
  86744. };
  86745. return TrackList2;
  86746. }(EventTarget$2);
  86747. TrackList.prototype.allowedEvents_ = {
  86748. change: "change",
  86749. addtrack: "addtrack",
  86750. removetrack: "removetrack",
  86751. labelchange: "labelchange"
  86752. };
  86753. for (var event$1 in TrackList.prototype.allowedEvents_) {
  86754. TrackList.prototype["on" + event$1] = null;
  86755. }
  86756. var disableOthers$1 = function disableOthers(list, track) {
  86757. for (var i2 = 0; i2 < list.length; i2++) {
  86758. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86759. continue;
  86760. }
  86761. list[i2].enabled = false;
  86762. }
  86763. };
  86764. var AudioTrackList = /* @__PURE__ */ function(_TrackList) {
  86765. _inheritsLoose(AudioTrackList2, _TrackList);
  86766. function AudioTrackList2(tracks) {
  86767. var _this;
  86768. if (tracks === void 0) {
  86769. tracks = [];
  86770. }
  86771. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86772. if (tracks[i2].enabled) {
  86773. disableOthers$1(tracks, tracks[i2]);
  86774. break;
  86775. }
  86776. }
  86777. _this = _TrackList.call(this, tracks) || this;
  86778. _this.changing_ = false;
  86779. return _this;
  86780. }
  86781. var _proto = AudioTrackList2.prototype;
  86782. _proto.addTrack = function addTrack(track) {
  86783. var _this2 = this;
  86784. if (track.enabled) {
  86785. disableOthers$1(this, track);
  86786. }
  86787. _TrackList.prototype.addTrack.call(this, track);
  86788. if (!track.addEventListener) {
  86789. return;
  86790. }
  86791. track.enabledChange_ = function() {
  86792. if (_this2.changing_) {
  86793. return;
  86794. }
  86795. _this2.changing_ = true;
  86796. disableOthers$1(_this2, track);
  86797. _this2.changing_ = false;
  86798. _this2.trigger("change");
  86799. };
  86800. track.addEventListener("enabledchange", track.enabledChange_);
  86801. };
  86802. _proto.removeTrack = function removeTrack(rtrack) {
  86803. _TrackList.prototype.removeTrack.call(this, rtrack);
  86804. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  86805. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  86806. rtrack.enabledChange_ = null;
  86807. }
  86808. };
  86809. return AudioTrackList2;
  86810. }(TrackList);
  86811. var disableOthers2 = function disableOthers3(list, track) {
  86812. for (var i2 = 0; i2 < list.length; i2++) {
  86813. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86814. continue;
  86815. }
  86816. list[i2].selected = false;
  86817. }
  86818. };
  86819. var VideoTrackList = /* @__PURE__ */ function(_TrackList) {
  86820. _inheritsLoose(VideoTrackList2, _TrackList);
  86821. function VideoTrackList2(tracks) {
  86822. var _this;
  86823. if (tracks === void 0) {
  86824. tracks = [];
  86825. }
  86826. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86827. if (tracks[i2].selected) {
  86828. disableOthers2(tracks, tracks[i2]);
  86829. break;
  86830. }
  86831. }
  86832. _this = _TrackList.call(this, tracks) || this;
  86833. _this.changing_ = false;
  86834. Object.defineProperty(_assertThisInitialized(_this), "selectedIndex", {
  86835. get: function get7() {
  86836. for (var _i = 0; _i < this.length; _i++) {
  86837. if (this[_i].selected) {
  86838. return _i;
  86839. }
  86840. }
  86841. return -1;
  86842. },
  86843. set: function set4() {
  86844. }
  86845. });
  86846. return _this;
  86847. }
  86848. var _proto = VideoTrackList2.prototype;
  86849. _proto.addTrack = function addTrack(track) {
  86850. var _this2 = this;
  86851. if (track.selected) {
  86852. disableOthers2(this, track);
  86853. }
  86854. _TrackList.prototype.addTrack.call(this, track);
  86855. if (!track.addEventListener) {
  86856. return;
  86857. }
  86858. track.selectedChange_ = function() {
  86859. if (_this2.changing_) {
  86860. return;
  86861. }
  86862. _this2.changing_ = true;
  86863. disableOthers2(_this2, track);
  86864. _this2.changing_ = false;
  86865. _this2.trigger("change");
  86866. };
  86867. track.addEventListener("selectedchange", track.selectedChange_);
  86868. };
  86869. _proto.removeTrack = function removeTrack(rtrack) {
  86870. _TrackList.prototype.removeTrack.call(this, rtrack);
  86871. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  86872. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  86873. rtrack.selectedChange_ = null;
  86874. }
  86875. };
  86876. return VideoTrackList2;
  86877. }(TrackList);
  86878. var TextTrackList = /* @__PURE__ */ function(_TrackList) {
  86879. _inheritsLoose(TextTrackList2, _TrackList);
  86880. function TextTrackList2() {
  86881. return _TrackList.apply(this, arguments) || this;
  86882. }
  86883. var _proto = TextTrackList2.prototype;
  86884. _proto.addTrack = function addTrack(track) {
  86885. var _this = this;
  86886. _TrackList.prototype.addTrack.call(this, track);
  86887. if (!this.queueChange_) {
  86888. this.queueChange_ = function() {
  86889. return _this.queueTrigger("change");
  86890. };
  86891. }
  86892. if (!this.triggerSelectedlanguagechange) {
  86893. this.triggerSelectedlanguagechange_ = function() {
  86894. return _this.trigger("selectedlanguagechange");
  86895. };
  86896. }
  86897. track.addEventListener("modechange", this.queueChange_);
  86898. var nonLanguageTextTrackKind = ["metadata", "chapters"];
  86899. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  86900. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  86901. }
  86902. };
  86903. _proto.removeTrack = function removeTrack(rtrack) {
  86904. _TrackList.prototype.removeTrack.call(this, rtrack);
  86905. if (rtrack.removeEventListener) {
  86906. if (this.queueChange_) {
  86907. rtrack.removeEventListener("modechange", this.queueChange_);
  86908. }
  86909. if (this.selectedlanguagechange_) {
  86910. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  86911. }
  86912. }
  86913. };
  86914. return TextTrackList2;
  86915. }(TrackList);
  86916. var HtmlTrackElementList = /* @__PURE__ */ function() {
  86917. function HtmlTrackElementList2(trackElements) {
  86918. if (trackElements === void 0) {
  86919. trackElements = [];
  86920. }
  86921. this.trackElements_ = [];
  86922. Object.defineProperty(this, "length", {
  86923. get: function get7() {
  86924. return this.trackElements_.length;
  86925. }
  86926. });
  86927. for (var i2 = 0, length = trackElements.length; i2 < length; i2++) {
  86928. this.addTrackElement_(trackElements[i2]);
  86929. }
  86930. }
  86931. var _proto = HtmlTrackElementList2.prototype;
  86932. _proto.addTrackElement_ = function addTrackElement_(trackElement) {
  86933. var index2 = this.trackElements_.length;
  86934. if (!("" + index2 in this)) {
  86935. Object.defineProperty(this, index2, {
  86936. get: function get7() {
  86937. return this.trackElements_[index2];
  86938. }
  86939. });
  86940. }
  86941. if (this.trackElements_.indexOf(trackElement) === -1) {
  86942. this.trackElements_.push(trackElement);
  86943. }
  86944. };
  86945. _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {
  86946. var trackElement_;
  86947. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86948. if (track === this.trackElements_[i2].track) {
  86949. trackElement_ = this.trackElements_[i2];
  86950. break;
  86951. }
  86952. }
  86953. return trackElement_;
  86954. };
  86955. _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {
  86956. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86957. if (trackElement === this.trackElements_[i2]) {
  86958. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  86959. this.trackElements_[i2].track.off();
  86960. }
  86961. if (typeof this.trackElements_[i2].off === "function") {
  86962. this.trackElements_[i2].off();
  86963. }
  86964. this.trackElements_.splice(i2, 1);
  86965. break;
  86966. }
  86967. }
  86968. };
  86969. return HtmlTrackElementList2;
  86970. }();
  86971. var TextTrackCueList = /* @__PURE__ */ function() {
  86972. function TextTrackCueList2(cues) {
  86973. TextTrackCueList2.prototype.setCues_.call(this, cues);
  86974. Object.defineProperty(this, "length", {
  86975. get: function get7() {
  86976. return this.length_;
  86977. }
  86978. });
  86979. }
  86980. var _proto = TextTrackCueList2.prototype;
  86981. _proto.setCues_ = function setCues_(cues) {
  86982. var oldLength = this.length || 0;
  86983. var i2 = 0;
  86984. var l = cues.length;
  86985. this.cues_ = cues;
  86986. this.length_ = cues.length;
  86987. var defineProp = function defineProp2(index2) {
  86988. if (!("" + index2 in this)) {
  86989. Object.defineProperty(this, "" + index2, {
  86990. get: function get7() {
  86991. return this.cues_[index2];
  86992. }
  86993. });
  86994. }
  86995. };
  86996. if (oldLength < l) {
  86997. i2 = oldLength;
  86998. for (; i2 < l; i2++) {
  86999. defineProp.call(this, i2);
  87000. }
  87001. }
  87002. };
  87003. _proto.getCueById = function getCueById(id) {
  87004. var result = null;
  87005. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  87006. var cue = this[i2];
  87007. if (cue.id === id) {
  87008. result = cue;
  87009. break;
  87010. }
  87011. }
  87012. return result;
  87013. };
  87014. return TextTrackCueList2;
  87015. }();
  87016. var VideoTrackKind = {
  87017. alternative: "alternative",
  87018. captions: "captions",
  87019. main: "main",
  87020. sign: "sign",
  87021. subtitles: "subtitles",
  87022. commentary: "commentary"
  87023. };
  87024. var AudioTrackKind = {
  87025. "alternative": "alternative",
  87026. "descriptions": "descriptions",
  87027. "main": "main",
  87028. "main-desc": "main-desc",
  87029. "translation": "translation",
  87030. "commentary": "commentary"
  87031. };
  87032. var TextTrackKind = {
  87033. subtitles: "subtitles",
  87034. captions: "captions",
  87035. descriptions: "descriptions",
  87036. chapters: "chapters",
  87037. metadata: "metadata"
  87038. };
  87039. var TextTrackMode = {
  87040. disabled: "disabled",
  87041. hidden: "hidden",
  87042. showing: "showing"
  87043. };
  87044. var Track = /* @__PURE__ */ function(_EventTarget) {
  87045. _inheritsLoose(Track2, _EventTarget);
  87046. function Track2(options2) {
  87047. var _this;
  87048. if (options2 === void 0) {
  87049. options2 = {};
  87050. }
  87051. _this = _EventTarget.call(this) || this;
  87052. var trackProps = {
  87053. id: options2.id || "vjs_track_" + newGUID(),
  87054. kind: options2.kind || "",
  87055. language: options2.language || ""
  87056. };
  87057. var label2 = options2.label || "";
  87058. var _loop = function _loop2(key2) {
  87059. Object.defineProperty(_assertThisInitialized(_this), key2, {
  87060. get: function get7() {
  87061. return trackProps[key2];
  87062. },
  87063. set: function set4() {
  87064. }
  87065. });
  87066. };
  87067. for (var key in trackProps) {
  87068. _loop(key);
  87069. }
  87070. Object.defineProperty(_assertThisInitialized(_this), "label", {
  87071. get: function get7() {
  87072. return label2;
  87073. },
  87074. set: function set4(newLabel) {
  87075. if (newLabel !== label2) {
  87076. label2 = newLabel;
  87077. this.trigger("labelchange");
  87078. }
  87079. }
  87080. });
  87081. return _this;
  87082. }
  87083. return Track2;
  87084. }(EventTarget$2);
  87085. var parseUrl = function parseUrl2(url) {
  87086. var props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  87087. var a = document_1.createElement("a");
  87088. a.href = url;
  87089. var details = {};
  87090. for (var i2 = 0; i2 < props.length; i2++) {
  87091. details[props[i2]] = a[props[i2]];
  87092. }
  87093. if (details.protocol === "http:") {
  87094. details.host = details.host.replace(/:80$/, "");
  87095. }
  87096. if (details.protocol === "https:") {
  87097. details.host = details.host.replace(/:443$/, "");
  87098. }
  87099. if (!details.protocol) {
  87100. details.protocol = window_1.location.protocol;
  87101. }
  87102. if (!details.host) {
  87103. details.host = window_1.location.host;
  87104. }
  87105. return details;
  87106. };
  87107. var getAbsoluteURL = function getAbsoluteURL2(url) {
  87108. if (!url.match(/^https?:\/\//)) {
  87109. var a = document_1.createElement("a");
  87110. a.href = url;
  87111. url = a.href;
  87112. }
  87113. return url;
  87114. };
  87115. var getFileExtension = function getFileExtension2(path) {
  87116. if (typeof path === "string") {
  87117. var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  87118. var pathParts = splitPathRe.exec(path);
  87119. if (pathParts) {
  87120. return pathParts.pop().toLowerCase();
  87121. }
  87122. }
  87123. return "";
  87124. };
  87125. var isCrossOrigin = function isCrossOrigin2(url, winLoc) {
  87126. if (winLoc === void 0) {
  87127. winLoc = window_1.location;
  87128. }
  87129. var urlInfo = parseUrl(url);
  87130. var srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  87131. var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  87132. return crossOrigin;
  87133. };
  87134. var Url$1 = /* @__PURE__ */ Object.freeze({
  87135. __proto__: null,
  87136. parseUrl,
  87137. getAbsoluteURL,
  87138. getFileExtension,
  87139. isCrossOrigin
  87140. });
  87141. var parseCues = function parseCues2(srcContent, track) {
  87142. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  87143. var errors2 = [];
  87144. parser2.oncue = function(cue) {
  87145. track.addCue(cue);
  87146. };
  87147. parser2.onparsingerror = function(error) {
  87148. errors2.push(error);
  87149. };
  87150. parser2.onflush = function() {
  87151. track.trigger({
  87152. type: "loadeddata",
  87153. target: track
  87154. });
  87155. };
  87156. parser2.parse(srcContent);
  87157. if (errors2.length > 0) {
  87158. if (window_1.console && window_1.console.groupCollapsed) {
  87159. window_1.console.groupCollapsed("Text Track parsing errors for " + track.src);
  87160. }
  87161. errors2.forEach(function(error) {
  87162. return log$1.error(error);
  87163. });
  87164. if (window_1.console && window_1.console.groupEnd) {
  87165. window_1.console.groupEnd();
  87166. }
  87167. }
  87168. parser2.flush();
  87169. };
  87170. var loadTrack = function loadTrack2(src, track) {
  87171. var opts = {
  87172. uri: src
  87173. };
  87174. var crossOrigin = isCrossOrigin(src);
  87175. if (crossOrigin) {
  87176. opts.cors = crossOrigin;
  87177. }
  87178. var withCredentials = track.tech_.crossOrigin() === "use-credentials";
  87179. if (withCredentials) {
  87180. opts.withCredentials = withCredentials;
  87181. }
  87182. XHR(opts, bind(this, function(err, response, responseBody) {
  87183. if (err) {
  87184. return log$1.error(err, response);
  87185. }
  87186. track.loaded_ = true;
  87187. if (typeof window_1.WebVTT !== "function") {
  87188. if (track.tech_) {
  87189. track.tech_.any(["vttjsloaded", "vttjserror"], function(event2) {
  87190. if (event2.type === "vttjserror") {
  87191. log$1.error("vttjs failed to load, stopping trying to process " + track.src);
  87192. return;
  87193. }
  87194. return parseCues(responseBody, track);
  87195. });
  87196. }
  87197. } else {
  87198. parseCues(responseBody, track);
  87199. }
  87200. }));
  87201. };
  87202. var TextTrack = /* @__PURE__ */ function(_Track) {
  87203. _inheritsLoose(TextTrack2, _Track);
  87204. function TextTrack2(options2) {
  87205. var _this;
  87206. if (options2 === void 0) {
  87207. options2 = {};
  87208. }
  87209. if (!options2.tech) {
  87210. throw new Error("A tech was not provided.");
  87211. }
  87212. var settings = mergeOptions$3(options2, {
  87213. kind: TextTrackKind[options2.kind] || "subtitles",
  87214. language: options2.language || options2.srclang || ""
  87215. });
  87216. var mode = TextTrackMode[settings.mode] || "disabled";
  87217. var default_ = settings["default"];
  87218. if (settings.kind === "metadata" || settings.kind === "chapters") {
  87219. mode = "hidden";
  87220. }
  87221. _this = _Track.call(this, settings) || this;
  87222. _this.tech_ = settings.tech;
  87223. _this.cues_ = [];
  87224. _this.activeCues_ = [];
  87225. _this.preload_ = _this.tech_.preloadTextTracks !== false;
  87226. var cues = new TextTrackCueList(_this.cues_);
  87227. var activeCues = new TextTrackCueList(_this.activeCues_);
  87228. var changed = false;
  87229. _this.timeupdateHandler = bind(_assertThisInitialized(_this), function(event2) {
  87230. if (event2 === void 0) {
  87231. event2 = {};
  87232. }
  87233. if (this.tech_.isDisposed()) {
  87234. return;
  87235. }
  87236. if (!this.tech_.isReady_) {
  87237. if (event2.type !== "timeupdate") {
  87238. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87239. }
  87240. return;
  87241. }
  87242. this.activeCues = this.activeCues;
  87243. if (changed) {
  87244. this.trigger("cuechange");
  87245. changed = false;
  87246. }
  87247. if (event2.type !== "timeupdate") {
  87248. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87249. }
  87250. });
  87251. var disposeHandler = function disposeHandler2() {
  87252. _this.stopTracking();
  87253. };
  87254. _this.tech_.one("dispose", disposeHandler);
  87255. if (mode !== "disabled") {
  87256. _this.startTracking();
  87257. }
  87258. Object.defineProperties(_assertThisInitialized(_this), {
  87259. "default": {
  87260. get: function get7() {
  87261. return default_;
  87262. },
  87263. set: function set4() {
  87264. }
  87265. },
  87266. mode: {
  87267. get: function get7() {
  87268. return mode;
  87269. },
  87270. set: function set4(newMode) {
  87271. if (!TextTrackMode[newMode]) {
  87272. return;
  87273. }
  87274. if (mode === newMode) {
  87275. return;
  87276. }
  87277. mode = newMode;
  87278. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  87279. loadTrack(this.src, this);
  87280. }
  87281. this.stopTracking();
  87282. if (mode !== "disabled") {
  87283. this.startTracking();
  87284. }
  87285. this.trigger("modechange");
  87286. }
  87287. },
  87288. cues: {
  87289. get: function get7() {
  87290. if (!this.loaded_) {
  87291. return null;
  87292. }
  87293. return cues;
  87294. },
  87295. set: function set4() {
  87296. }
  87297. },
  87298. activeCues: {
  87299. get: function get7() {
  87300. if (!this.loaded_) {
  87301. return null;
  87302. }
  87303. if (this.cues.length === 0) {
  87304. return activeCues;
  87305. }
  87306. var ct2 = this.tech_.currentTime();
  87307. var active = [];
  87308. for (var i2 = 0, l = this.cues.length; i2 < l; i2++) {
  87309. var cue = this.cues[i2];
  87310. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  87311. active.push(cue);
  87312. } else if (cue.startTime === cue.endTime && cue.startTime <= ct2 && cue.startTime + 0.5 >= ct2) {
  87313. active.push(cue);
  87314. }
  87315. }
  87316. changed = false;
  87317. if (active.length !== this.activeCues_.length) {
  87318. changed = true;
  87319. } else {
  87320. for (var _i = 0; _i < active.length; _i++) {
  87321. if (this.activeCues_.indexOf(active[_i]) === -1) {
  87322. changed = true;
  87323. }
  87324. }
  87325. }
  87326. this.activeCues_ = active;
  87327. activeCues.setCues_(this.activeCues_);
  87328. return activeCues;
  87329. },
  87330. set: function set4() {
  87331. }
  87332. }
  87333. });
  87334. if (settings.src) {
  87335. _this.src = settings.src;
  87336. if (!_this.preload_) {
  87337. _this.loaded_ = true;
  87338. }
  87339. if (_this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  87340. loadTrack(_this.src, _assertThisInitialized(_this));
  87341. }
  87342. } else {
  87343. _this.loaded_ = true;
  87344. }
  87345. return _this;
  87346. }
  87347. var _proto = TextTrack2.prototype;
  87348. _proto.startTracking = function startTracking() {
  87349. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87350. this.tech_.on("timeupdate", this.timeupdateHandler);
  87351. };
  87352. _proto.stopTracking = function stopTracking() {
  87353. if (this.rvf_) {
  87354. this.tech_.cancelVideoFrameCallback(this.rvf_);
  87355. this.rvf_ = void 0;
  87356. }
  87357. this.tech_.off("timeupdate", this.timeupdateHandler);
  87358. };
  87359. _proto.addCue = function addCue(originalCue) {
  87360. var cue = originalCue;
  87361. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  87362. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  87363. for (var prop in originalCue) {
  87364. if (!(prop in cue)) {
  87365. cue[prop] = originalCue[prop];
  87366. }
  87367. }
  87368. cue.id = originalCue.id;
  87369. cue.originalCue_ = originalCue;
  87370. }
  87371. var tracks = this.tech_.textTracks();
  87372. for (var i2 = 0; i2 < tracks.length; i2++) {
  87373. if (tracks[i2] !== this) {
  87374. tracks[i2].removeCue(cue);
  87375. }
  87376. }
  87377. this.cues_.push(cue);
  87378. this.cues.setCues_(this.cues_);
  87379. };
  87380. _proto.removeCue = function removeCue(_removeCue) {
  87381. var i2 = this.cues_.length;
  87382. while (i2--) {
  87383. var cue = this.cues_[i2];
  87384. if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {
  87385. this.cues_.splice(i2, 1);
  87386. this.cues.setCues_(this.cues_);
  87387. break;
  87388. }
  87389. }
  87390. };
  87391. return TextTrack2;
  87392. }(Track);
  87393. TextTrack.prototype.allowedEvents_ = {
  87394. cuechange: "cuechange"
  87395. };
  87396. var AudioTrack = /* @__PURE__ */ function(_Track) {
  87397. _inheritsLoose(AudioTrack2, _Track);
  87398. function AudioTrack2(options2) {
  87399. var _this;
  87400. if (options2 === void 0) {
  87401. options2 = {};
  87402. }
  87403. var settings = mergeOptions$3(options2, {
  87404. kind: AudioTrackKind[options2.kind] || ""
  87405. });
  87406. _this = _Track.call(this, settings) || this;
  87407. var enabled = false;
  87408. Object.defineProperty(_assertThisInitialized(_this), "enabled", {
  87409. get: function get7() {
  87410. return enabled;
  87411. },
  87412. set: function set4(newEnabled) {
  87413. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  87414. return;
  87415. }
  87416. enabled = newEnabled;
  87417. this.trigger("enabledchange");
  87418. }
  87419. });
  87420. if (settings.enabled) {
  87421. _this.enabled = settings.enabled;
  87422. }
  87423. _this.loaded_ = true;
  87424. return _this;
  87425. }
  87426. return AudioTrack2;
  87427. }(Track);
  87428. var VideoTrack = /* @__PURE__ */ function(_Track) {
  87429. _inheritsLoose(VideoTrack2, _Track);
  87430. function VideoTrack2(options2) {
  87431. var _this;
  87432. if (options2 === void 0) {
  87433. options2 = {};
  87434. }
  87435. var settings = mergeOptions$3(options2, {
  87436. kind: VideoTrackKind[options2.kind] || ""
  87437. });
  87438. _this = _Track.call(this, settings) || this;
  87439. var selected = false;
  87440. Object.defineProperty(_assertThisInitialized(_this), "selected", {
  87441. get: function get7() {
  87442. return selected;
  87443. },
  87444. set: function set4(newSelected) {
  87445. if (typeof newSelected !== "boolean" || newSelected === selected) {
  87446. return;
  87447. }
  87448. selected = newSelected;
  87449. this.trigger("selectedchange");
  87450. }
  87451. });
  87452. if (settings.selected) {
  87453. _this.selected = settings.selected;
  87454. }
  87455. return _this;
  87456. }
  87457. return VideoTrack2;
  87458. }(Track);
  87459. var NONE = 0;
  87460. var LOADING = 1;
  87461. var LOADED = 2;
  87462. var ERROR = 3;
  87463. var HTMLTrackElement = /* @__PURE__ */ function(_EventTarget) {
  87464. _inheritsLoose(HTMLTrackElement2, _EventTarget);
  87465. function HTMLTrackElement2(options2) {
  87466. var _this;
  87467. if (options2 === void 0) {
  87468. options2 = {};
  87469. }
  87470. _this = _EventTarget.call(this) || this;
  87471. var readyState;
  87472. var track = new TextTrack(options2);
  87473. _this.kind = track.kind;
  87474. _this.src = track.src;
  87475. _this.srclang = track.language;
  87476. _this.label = track.label;
  87477. _this["default"] = track["default"];
  87478. Object.defineProperties(_assertThisInitialized(_this), {
  87479. readyState: {
  87480. get: function get7() {
  87481. return readyState;
  87482. }
  87483. },
  87484. track: {
  87485. get: function get7() {
  87486. return track;
  87487. }
  87488. }
  87489. });
  87490. readyState = NONE;
  87491. track.addEventListener("loadeddata", function() {
  87492. readyState = LOADED;
  87493. _this.trigger({
  87494. type: "load",
  87495. target: _assertThisInitialized(_this)
  87496. });
  87497. });
  87498. return _this;
  87499. }
  87500. return HTMLTrackElement2;
  87501. }(EventTarget$2);
  87502. HTMLTrackElement.prototype.allowedEvents_ = {
  87503. load: "load"
  87504. };
  87505. HTMLTrackElement.NONE = NONE;
  87506. HTMLTrackElement.LOADING = LOADING;
  87507. HTMLTrackElement.LOADED = LOADED;
  87508. HTMLTrackElement.ERROR = ERROR;
  87509. var NORMAL = {
  87510. audio: {
  87511. ListClass: AudioTrackList,
  87512. TrackClass: AudioTrack,
  87513. capitalName: "Audio"
  87514. },
  87515. video: {
  87516. ListClass: VideoTrackList,
  87517. TrackClass: VideoTrack,
  87518. capitalName: "Video"
  87519. },
  87520. text: {
  87521. ListClass: TextTrackList,
  87522. TrackClass: TextTrack,
  87523. capitalName: "Text"
  87524. }
  87525. };
  87526. Object.keys(NORMAL).forEach(function(type2) {
  87527. NORMAL[type2].getterName = type2 + "Tracks";
  87528. NORMAL[type2].privateName = type2 + "Tracks_";
  87529. });
  87530. var REMOTE = {
  87531. remoteText: {
  87532. ListClass: TextTrackList,
  87533. TrackClass: TextTrack,
  87534. capitalName: "RemoteText",
  87535. getterName: "remoteTextTracks",
  87536. privateName: "remoteTextTracks_"
  87537. },
  87538. remoteTextEl: {
  87539. ListClass: HtmlTrackElementList,
  87540. TrackClass: HTMLTrackElement,
  87541. capitalName: "RemoteTextTrackEls",
  87542. getterName: "remoteTextTrackEls",
  87543. privateName: "remoteTextTrackEls_"
  87544. }
  87545. };
  87546. var ALL = _extends$2({}, NORMAL, REMOTE);
  87547. REMOTE.names = Object.keys(REMOTE);
  87548. NORMAL.names = Object.keys(NORMAL);
  87549. ALL.names = [].concat(REMOTE.names).concat(NORMAL.names);
  87550. function createTrackHelper(self2, kind, label2, language, options2) {
  87551. if (options2 === void 0) {
  87552. options2 = {};
  87553. }
  87554. var tracks = self2.textTracks();
  87555. options2.kind = kind;
  87556. if (label2) {
  87557. options2.label = label2;
  87558. }
  87559. if (language) {
  87560. options2.language = language;
  87561. }
  87562. options2.tech = self2;
  87563. var track = new ALL.text.TrackClass(options2);
  87564. tracks.addTrack(track);
  87565. return track;
  87566. }
  87567. var Tech$1 = /* @__PURE__ */ function(_Component) {
  87568. _inheritsLoose(Tech2, _Component);
  87569. function Tech2(options2, ready) {
  87570. var _this;
  87571. if (options2 === void 0) {
  87572. options2 = {};
  87573. }
  87574. if (ready === void 0) {
  87575. ready = function ready2() {
  87576. };
  87577. }
  87578. options2.reportTouchActivity = false;
  87579. _this = _Component.call(this, null, options2, ready) || this;
  87580. _this.onDurationChange_ = function(e) {
  87581. return _this.onDurationChange(e);
  87582. };
  87583. _this.trackProgress_ = function(e) {
  87584. return _this.trackProgress(e);
  87585. };
  87586. _this.trackCurrentTime_ = function(e) {
  87587. return _this.trackCurrentTime(e);
  87588. };
  87589. _this.stopTrackingCurrentTime_ = function(e) {
  87590. return _this.stopTrackingCurrentTime(e);
  87591. };
  87592. _this.disposeSourceHandler_ = function(e) {
  87593. return _this.disposeSourceHandler(e);
  87594. };
  87595. _this.queuedHanders_ = /* @__PURE__ */ new Set();
  87596. _this.hasStarted_ = false;
  87597. _this.on("playing", function() {
  87598. this.hasStarted_ = true;
  87599. });
  87600. _this.on("loadstart", function() {
  87601. this.hasStarted_ = false;
  87602. });
  87603. ALL.names.forEach(function(name) {
  87604. var props = ALL[name];
  87605. if (options2 && options2[props.getterName]) {
  87606. _this[props.privateName] = options2[props.getterName];
  87607. }
  87608. });
  87609. if (!_this.featuresProgressEvents) {
  87610. _this.manualProgressOn();
  87611. }
  87612. if (!_this.featuresTimeupdateEvents) {
  87613. _this.manualTimeUpdatesOn();
  87614. }
  87615. ["Text", "Audio", "Video"].forEach(function(track) {
  87616. if (options2["native" + track + "Tracks"] === false) {
  87617. _this["featuresNative" + track + "Tracks"] = false;
  87618. }
  87619. });
  87620. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  87621. _this.featuresNativeTextTracks = false;
  87622. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  87623. _this.featuresNativeTextTracks = true;
  87624. }
  87625. if (!_this.featuresNativeTextTracks) {
  87626. _this.emulateTextTracks();
  87627. }
  87628. _this.preloadTextTracks = options2.preloadTextTracks !== false;
  87629. _this.autoRemoteTextTracks_ = new ALL.text.ListClass();
  87630. _this.initTrackListeners();
  87631. if (!options2.nativeControlsForTouch) {
  87632. _this.emitTapEvents();
  87633. }
  87634. if (_this.constructor) {
  87635. _this.name_ = _this.constructor.name || "Unknown Tech";
  87636. }
  87637. return _this;
  87638. }
  87639. var _proto = Tech2.prototype;
  87640. _proto.triggerSourceset = function triggerSourceset(src) {
  87641. var _this2 = this;
  87642. if (!this.isReady_) {
  87643. this.one("ready", function() {
  87644. return _this2.setTimeout(function() {
  87645. return _this2.triggerSourceset(src);
  87646. }, 1);
  87647. });
  87648. }
  87649. this.trigger({
  87650. src,
  87651. type: "sourceset"
  87652. });
  87653. };
  87654. _proto.manualProgressOn = function manualProgressOn() {
  87655. this.on("durationchange", this.onDurationChange_);
  87656. this.manualProgress = true;
  87657. this.one("ready", this.trackProgress_);
  87658. };
  87659. _proto.manualProgressOff = function manualProgressOff() {
  87660. this.manualProgress = false;
  87661. this.stopTrackingProgress();
  87662. this.off("durationchange", this.onDurationChange_);
  87663. };
  87664. _proto.trackProgress = function trackProgress(event2) {
  87665. this.stopTrackingProgress();
  87666. this.progressInterval = this.setInterval(bind(this, function() {
  87667. var numBufferedPercent = this.bufferedPercent();
  87668. if (this.bufferedPercent_ !== numBufferedPercent) {
  87669. this.trigger("progress");
  87670. }
  87671. this.bufferedPercent_ = numBufferedPercent;
  87672. if (numBufferedPercent === 1) {
  87673. this.stopTrackingProgress();
  87674. }
  87675. }), 500);
  87676. };
  87677. _proto.onDurationChange = function onDurationChange(event2) {
  87678. this.duration_ = this.duration();
  87679. };
  87680. _proto.buffered = function buffered() {
  87681. return createTimeRanges(0, 0);
  87682. };
  87683. _proto.bufferedPercent = function bufferedPercent$12() {
  87684. return bufferedPercent(this.buffered(), this.duration_);
  87685. };
  87686. _proto.stopTrackingProgress = function stopTrackingProgress() {
  87687. this.clearInterval(this.progressInterval);
  87688. };
  87689. _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {
  87690. this.manualTimeUpdates = true;
  87691. this.on("play", this.trackCurrentTime_);
  87692. this.on("pause", this.stopTrackingCurrentTime_);
  87693. };
  87694. _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {
  87695. this.manualTimeUpdates = false;
  87696. this.stopTrackingCurrentTime();
  87697. this.off("play", this.trackCurrentTime_);
  87698. this.off("pause", this.stopTrackingCurrentTime_);
  87699. };
  87700. _proto.trackCurrentTime = function trackCurrentTime() {
  87701. if (this.currentTimeInterval) {
  87702. this.stopTrackingCurrentTime();
  87703. }
  87704. this.currentTimeInterval = this.setInterval(function() {
  87705. this.trigger({
  87706. type: "timeupdate",
  87707. target: this,
  87708. manuallyTriggered: true
  87709. });
  87710. }, 250);
  87711. };
  87712. _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {
  87713. this.clearInterval(this.currentTimeInterval);
  87714. this.trigger({
  87715. type: "timeupdate",
  87716. target: this,
  87717. manuallyTriggered: true
  87718. });
  87719. };
  87720. _proto.dispose = function dispose() {
  87721. this.clearTracks(NORMAL.names);
  87722. if (this.manualProgress) {
  87723. this.manualProgressOff();
  87724. }
  87725. if (this.manualTimeUpdates) {
  87726. this.manualTimeUpdatesOff();
  87727. }
  87728. _Component.prototype.dispose.call(this);
  87729. };
  87730. _proto.clearTracks = function clearTracks(types) {
  87731. var _this3 = this;
  87732. types = [].concat(types);
  87733. types.forEach(function(type2) {
  87734. var list = _this3[type2 + "Tracks"]() || [];
  87735. var i2 = list.length;
  87736. while (i2--) {
  87737. var track = list[i2];
  87738. if (type2 === "text") {
  87739. _this3.removeRemoteTextTrack(track);
  87740. }
  87741. list.removeTrack(track);
  87742. }
  87743. });
  87744. };
  87745. _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {
  87746. var list = this.autoRemoteTextTracks_ || [];
  87747. var i2 = list.length;
  87748. while (i2--) {
  87749. var track = list[i2];
  87750. this.removeRemoteTextTrack(track);
  87751. }
  87752. };
  87753. _proto.reset = function reset3() {
  87754. };
  87755. _proto.crossOrigin = function crossOrigin() {
  87756. };
  87757. _proto.setCrossOrigin = function setCrossOrigin() {
  87758. };
  87759. _proto.error = function error(err) {
  87760. if (err !== void 0) {
  87761. this.error_ = new MediaError(err);
  87762. this.trigger("error");
  87763. }
  87764. return this.error_;
  87765. };
  87766. _proto.played = function played() {
  87767. if (this.hasStarted_) {
  87768. return createTimeRanges(0, 0);
  87769. }
  87770. return createTimeRanges();
  87771. };
  87772. _proto.play = function play() {
  87773. };
  87774. _proto.setScrubbing = function setScrubbing() {
  87775. };
  87776. _proto.scrubbing = function scrubbing() {
  87777. };
  87778. _proto.setCurrentTime = function setCurrentTime() {
  87779. if (this.manualTimeUpdates) {
  87780. this.trigger({
  87781. type: "timeupdate",
  87782. target: this,
  87783. manuallyTriggered: true
  87784. });
  87785. }
  87786. };
  87787. _proto.initTrackListeners = function initTrackListeners() {
  87788. var _this4 = this;
  87789. NORMAL.names.forEach(function(name) {
  87790. var props = NORMAL[name];
  87791. var trackListChanges = function trackListChanges2() {
  87792. _this4.trigger(name + "trackchange");
  87793. };
  87794. var tracks = _this4[props.getterName]();
  87795. tracks.addEventListener("removetrack", trackListChanges);
  87796. tracks.addEventListener("addtrack", trackListChanges);
  87797. _this4.on("dispose", function() {
  87798. tracks.removeEventListener("removetrack", trackListChanges);
  87799. tracks.removeEventListener("addtrack", trackListChanges);
  87800. });
  87801. });
  87802. };
  87803. _proto.addWebVttScript_ = function addWebVttScript_() {
  87804. var _this5 = this;
  87805. if (window_1.WebVTT) {
  87806. return;
  87807. }
  87808. if (document_1.body.contains(this.el())) {
  87809. if (!this.options_["vtt.js"] && isPlain(vtt) && Object.keys(vtt).length > 0) {
  87810. this.trigger("vttjsloaded");
  87811. return;
  87812. }
  87813. var script = document_1.createElement("script");
  87814. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  87815. script.onload = function() {
  87816. _this5.trigger("vttjsloaded");
  87817. };
  87818. script.onerror = function() {
  87819. _this5.trigger("vttjserror");
  87820. };
  87821. this.on("dispose", function() {
  87822. script.onload = null;
  87823. script.onerror = null;
  87824. });
  87825. window_1.WebVTT = true;
  87826. this.el().parentNode.appendChild(script);
  87827. } else {
  87828. this.ready(this.addWebVttScript_);
  87829. }
  87830. };
  87831. _proto.emulateTextTracks = function emulateTextTracks() {
  87832. var _this6 = this;
  87833. var tracks = this.textTracks();
  87834. var remoteTracks = this.remoteTextTracks();
  87835. var handleAddTrack = function handleAddTrack2(e) {
  87836. return tracks.addTrack(e.track);
  87837. };
  87838. var handleRemoveTrack = function handleRemoveTrack2(e) {
  87839. return tracks.removeTrack(e.track);
  87840. };
  87841. remoteTracks.on("addtrack", handleAddTrack);
  87842. remoteTracks.on("removetrack", handleRemoveTrack);
  87843. this.addWebVttScript_();
  87844. var updateDisplay = function updateDisplay2() {
  87845. return _this6.trigger("texttrackchange");
  87846. };
  87847. var textTracksChanges = function textTracksChanges2() {
  87848. updateDisplay();
  87849. for (var i2 = 0; i2 < tracks.length; i2++) {
  87850. var track = tracks[i2];
  87851. track.removeEventListener("cuechange", updateDisplay);
  87852. if (track.mode === "showing") {
  87853. track.addEventListener("cuechange", updateDisplay);
  87854. }
  87855. }
  87856. };
  87857. textTracksChanges();
  87858. tracks.addEventListener("change", textTracksChanges);
  87859. tracks.addEventListener("addtrack", textTracksChanges);
  87860. tracks.addEventListener("removetrack", textTracksChanges);
  87861. this.on("dispose", function() {
  87862. remoteTracks.off("addtrack", handleAddTrack);
  87863. remoteTracks.off("removetrack", handleRemoveTrack);
  87864. tracks.removeEventListener("change", textTracksChanges);
  87865. tracks.removeEventListener("addtrack", textTracksChanges);
  87866. tracks.removeEventListener("removetrack", textTracksChanges);
  87867. for (var i2 = 0; i2 < tracks.length; i2++) {
  87868. var track = tracks[i2];
  87869. track.removeEventListener("cuechange", updateDisplay);
  87870. }
  87871. });
  87872. };
  87873. _proto.addTextTrack = function addTextTrack(kind, label2, language) {
  87874. if (!kind) {
  87875. throw new Error("TextTrack kind is required but was not provided");
  87876. }
  87877. return createTrackHelper(this, kind, label2, language);
  87878. };
  87879. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  87880. var track = mergeOptions$3(options2, {
  87881. tech: this
  87882. });
  87883. return new REMOTE.remoteTextEl.TrackClass(track);
  87884. };
  87885. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  87886. var _this7 = this;
  87887. if (options2 === void 0) {
  87888. options2 = {};
  87889. }
  87890. var htmlTrackElement = this.createRemoteTextTrack(options2);
  87891. if (manualCleanup !== true && manualCleanup !== false) {
  87892. log$1.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');
  87893. manualCleanup = true;
  87894. }
  87895. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  87896. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  87897. if (manualCleanup !== true) {
  87898. this.ready(function() {
  87899. return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);
  87900. });
  87901. }
  87902. return htmlTrackElement;
  87903. };
  87904. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  87905. var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  87906. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  87907. this.remoteTextTracks().removeTrack(track);
  87908. this.autoRemoteTextTracks_.removeTrack(track);
  87909. };
  87910. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  87911. return {};
  87912. };
  87913. _proto.requestPictureInPicture = function requestPictureInPicture() {
  87914. var PromiseClass = this.options_.Promise || window_1.Promise;
  87915. if (PromiseClass) {
  87916. return PromiseClass.reject();
  87917. }
  87918. };
  87919. _proto.disablePictureInPicture = function disablePictureInPicture() {
  87920. return true;
  87921. };
  87922. _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {
  87923. };
  87924. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  87925. var _this8 = this;
  87926. var id = newGUID();
  87927. if (!this.isReady_ || this.paused()) {
  87928. this.queuedHanders_.add(id);
  87929. this.one("playing", function() {
  87930. if (_this8.queuedHanders_.has(id)) {
  87931. _this8.queuedHanders_["delete"](id);
  87932. cb();
  87933. }
  87934. });
  87935. } else {
  87936. this.requestNamedAnimationFrame(id, cb);
  87937. }
  87938. return id;
  87939. };
  87940. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  87941. if (this.queuedHanders_.has(id)) {
  87942. this.queuedHanders_["delete"](id);
  87943. } else {
  87944. this.cancelNamedAnimationFrame(id);
  87945. }
  87946. };
  87947. _proto.setPoster = function setPoster() {
  87948. };
  87949. _proto.playsinline = function playsinline() {
  87950. };
  87951. _proto.setPlaysinline = function setPlaysinline() {
  87952. };
  87953. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {
  87954. };
  87955. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {
  87956. };
  87957. _proto.canPlayType = function canPlayType3() {
  87958. return "";
  87959. };
  87960. Tech2.canPlayType = function canPlayType3() {
  87961. return "";
  87962. };
  87963. Tech2.canPlaySource = function canPlaySource(srcObj, options2) {
  87964. return Tech2.canPlayType(srcObj.type);
  87965. };
  87966. Tech2.isTech = function isTech(component) {
  87967. return component.prototype instanceof Tech2 || component instanceof Tech2 || component === Tech2;
  87968. };
  87969. Tech2.registerTech = function registerTech(name, tech) {
  87970. if (!Tech2.techs_) {
  87971. Tech2.techs_ = {};
  87972. }
  87973. if (!Tech2.isTech(tech)) {
  87974. throw new Error("Tech " + name + " must be a Tech");
  87975. }
  87976. if (!Tech2.canPlayType) {
  87977. throw new Error("Techs must have a static canPlayType method on them");
  87978. }
  87979. if (!Tech2.canPlaySource) {
  87980. throw new Error("Techs must have a static canPlaySource method on them");
  87981. }
  87982. name = toTitleCase$1(name);
  87983. Tech2.techs_[name] = tech;
  87984. Tech2.techs_[toLowerCase(name)] = tech;
  87985. if (name !== "Tech") {
  87986. Tech2.defaultTechOrder_.push(name);
  87987. }
  87988. return tech;
  87989. };
  87990. Tech2.getTech = function getTech(name) {
  87991. if (!name) {
  87992. return;
  87993. }
  87994. if (Tech2.techs_ && Tech2.techs_[name]) {
  87995. return Tech2.techs_[name];
  87996. }
  87997. name = toTitleCase$1(name);
  87998. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  87999. log$1.warn("The " + name + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");
  88000. return window_1.videojs[name];
  88001. }
  88002. };
  88003. return Tech2;
  88004. }(Component$1);
  88005. ALL.names.forEach(function(name) {
  88006. var props = ALL[name];
  88007. Tech$1.prototype[props.getterName] = function() {
  88008. this[props.privateName] = this[props.privateName] || new props.ListClass();
  88009. return this[props.privateName];
  88010. };
  88011. });
  88012. Tech$1.prototype.featuresVolumeControl = true;
  88013. Tech$1.prototype.featuresMuteControl = true;
  88014. Tech$1.prototype.featuresFullscreenResize = false;
  88015. Tech$1.prototype.featuresPlaybackRate = false;
  88016. Tech$1.prototype.featuresProgressEvents = false;
  88017. Tech$1.prototype.featuresSourceset = false;
  88018. Tech$1.prototype.featuresTimeupdateEvents = false;
  88019. Tech$1.prototype.featuresNativeTextTracks = false;
  88020. Tech$1.prototype.featuresVideoFrameCallback = false;
  88021. Tech$1.withSourceHandlers = function(_Tech) {
  88022. _Tech.registerSourceHandler = function(handler, index2) {
  88023. var handlers = _Tech.sourceHandlers;
  88024. if (!handlers) {
  88025. handlers = _Tech.sourceHandlers = [];
  88026. }
  88027. if (index2 === void 0) {
  88028. index2 = handlers.length;
  88029. }
  88030. handlers.splice(index2, 0, handler);
  88031. };
  88032. _Tech.canPlayType = function(type2) {
  88033. var handlers = _Tech.sourceHandlers || [];
  88034. var can;
  88035. for (var i2 = 0; i2 < handlers.length; i2++) {
  88036. can = handlers[i2].canPlayType(type2);
  88037. if (can) {
  88038. return can;
  88039. }
  88040. }
  88041. return "";
  88042. };
  88043. _Tech.selectSourceHandler = function(source, options2) {
  88044. var handlers = _Tech.sourceHandlers || [];
  88045. var can;
  88046. for (var i2 = 0; i2 < handlers.length; i2++) {
  88047. can = handlers[i2].canHandleSource(source, options2);
  88048. if (can) {
  88049. return handlers[i2];
  88050. }
  88051. }
  88052. return null;
  88053. };
  88054. _Tech.canPlaySource = function(srcObj, options2) {
  88055. var sh = _Tech.selectSourceHandler(srcObj, options2);
  88056. if (sh) {
  88057. return sh.canHandleSource(srcObj, options2);
  88058. }
  88059. return "";
  88060. };
  88061. var deferrable = ["seekable", "seeking", "duration"];
  88062. deferrable.forEach(function(fnName) {
  88063. var originalFn = this[fnName];
  88064. if (typeof originalFn !== "function") {
  88065. return;
  88066. }
  88067. this[fnName] = function() {
  88068. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  88069. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  88070. }
  88071. return originalFn.apply(this, arguments);
  88072. };
  88073. }, _Tech.prototype);
  88074. _Tech.prototype.setSource = function(source) {
  88075. var sh = _Tech.selectSourceHandler(source, this.options_);
  88076. if (!sh) {
  88077. if (_Tech.nativeSourceHandler) {
  88078. sh = _Tech.nativeSourceHandler;
  88079. } else {
  88080. log$1.error("No source handler found for the current source.");
  88081. }
  88082. }
  88083. this.disposeSourceHandler();
  88084. this.off("dispose", this.disposeSourceHandler_);
  88085. if (sh !== _Tech.nativeSourceHandler) {
  88086. this.currentSource_ = source;
  88087. }
  88088. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  88089. this.one("dispose", this.disposeSourceHandler_);
  88090. };
  88091. _Tech.prototype.disposeSourceHandler = function() {
  88092. if (this.currentSource_) {
  88093. this.clearTracks(["audio", "video"]);
  88094. this.currentSource_ = null;
  88095. }
  88096. this.cleanupAutoTextTracks();
  88097. if (this.sourceHandler_) {
  88098. if (this.sourceHandler_.dispose) {
  88099. this.sourceHandler_.dispose();
  88100. }
  88101. this.sourceHandler_ = null;
  88102. }
  88103. };
  88104. };
  88105. Component$1.registerComponent("Tech", Tech$1);
  88106. Tech$1.registerTech("Tech", Tech$1);
  88107. Tech$1.defaultTechOrder_ = [];
  88108. var middlewares = {};
  88109. var middlewareInstances = {};
  88110. var TERMINATOR = {};
  88111. function use(type2, middleware) {
  88112. middlewares[type2] = middlewares[type2] || [];
  88113. middlewares[type2].push(middleware);
  88114. }
  88115. function setSource(player, src, next) {
  88116. player.setTimeout(function() {
  88117. return setSourceHelper(src, middlewares[src.type], next, player);
  88118. }, 1);
  88119. }
  88120. function setTech(middleware, tech) {
  88121. middleware.forEach(function(mw) {
  88122. return mw.setTech && mw.setTech(tech);
  88123. });
  88124. }
  88125. function get(middleware, tech, method) {
  88126. return middleware.reduceRight(middlewareIterator(method), tech[method]());
  88127. }
  88128. function set(middleware, tech, method, arg) {
  88129. return tech[method](middleware.reduce(middlewareIterator(method), arg));
  88130. }
  88131. function mediate(middleware, tech, method, arg) {
  88132. if (arg === void 0) {
  88133. arg = null;
  88134. }
  88135. var callMethod = "call" + toTitleCase$1(method);
  88136. var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);
  88137. var terminated = middlewareValue === TERMINATOR;
  88138. var returnValue = terminated ? null : tech[method](middlewareValue);
  88139. executeRight(middleware, method, returnValue, terminated);
  88140. return returnValue;
  88141. }
  88142. var allowedGetters = {
  88143. buffered: 1,
  88144. currentTime: 1,
  88145. duration: 1,
  88146. muted: 1,
  88147. played: 1,
  88148. paused: 1,
  88149. seekable: 1,
  88150. volume: 1,
  88151. ended: 1
  88152. };
  88153. var allowedSetters = {
  88154. setCurrentTime: 1,
  88155. setMuted: 1,
  88156. setVolume: 1
  88157. };
  88158. var allowedMediators = {
  88159. play: 1,
  88160. pause: 1
  88161. };
  88162. function middlewareIterator(method) {
  88163. return function(value, mw) {
  88164. if (value === TERMINATOR) {
  88165. return TERMINATOR;
  88166. }
  88167. if (mw[method]) {
  88168. return mw[method](value);
  88169. }
  88170. return value;
  88171. };
  88172. }
  88173. function executeRight(mws, method, value, terminated) {
  88174. for (var i2 = mws.length - 1; i2 >= 0; i2--) {
  88175. var mw = mws[i2];
  88176. if (mw[method]) {
  88177. mw[method](terminated, value);
  88178. }
  88179. }
  88180. }
  88181. function clearCacheForPlayer(player) {
  88182. middlewareInstances[player.id()] = null;
  88183. }
  88184. function getOrCreateFactory(player, mwFactory) {
  88185. var mws = middlewareInstances[player.id()];
  88186. var mw = null;
  88187. if (mws === void 0 || mws === null) {
  88188. mw = mwFactory(player);
  88189. middlewareInstances[player.id()] = [[mwFactory, mw]];
  88190. return mw;
  88191. }
  88192. for (var i2 = 0; i2 < mws.length; i2++) {
  88193. var _mws$i = mws[i2], mwf = _mws$i[0], mwi = _mws$i[1];
  88194. if (mwf !== mwFactory) {
  88195. continue;
  88196. }
  88197. mw = mwi;
  88198. }
  88199. if (mw === null) {
  88200. mw = mwFactory(player);
  88201. mws.push([mwFactory, mw]);
  88202. }
  88203. return mw;
  88204. }
  88205. function setSourceHelper(src, middleware, next, player, acc, lastRun) {
  88206. if (src === void 0) {
  88207. src = {};
  88208. }
  88209. if (middleware === void 0) {
  88210. middleware = [];
  88211. }
  88212. if (acc === void 0) {
  88213. acc = [];
  88214. }
  88215. if (lastRun === void 0) {
  88216. lastRun = false;
  88217. }
  88218. var _middleware = middleware, mwFactory = _middleware[0], mwrest = _middleware.slice(1);
  88219. if (typeof mwFactory === "string") {
  88220. setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun);
  88221. } else if (mwFactory) {
  88222. var mw = getOrCreateFactory(player, mwFactory);
  88223. if (!mw.setSource) {
  88224. acc.push(mw);
  88225. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88226. }
  88227. mw.setSource(assign({}, src), function(err, _src) {
  88228. if (err) {
  88229. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88230. }
  88231. acc.push(mw);
  88232. setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);
  88233. });
  88234. } else if (mwrest.length) {
  88235. setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88236. } else if (lastRun) {
  88237. next(src, acc);
  88238. } else {
  88239. setSourceHelper(src, middlewares["*"], next, player, acc, true);
  88240. }
  88241. }
  88242. var MimetypesKind = {
  88243. opus: "video/ogg",
  88244. ogv: "video/ogg",
  88245. mp4: "video/mp4",
  88246. mov: "video/mp4",
  88247. m4v: "video/mp4",
  88248. mkv: "video/x-matroska",
  88249. m4a: "audio/mp4",
  88250. mp3: "audio/mpeg",
  88251. aac: "audio/aac",
  88252. caf: "audio/x-caf",
  88253. flac: "audio/flac",
  88254. oga: "audio/ogg",
  88255. wav: "audio/wav",
  88256. m3u8: "application/x-mpegURL",
  88257. mpd: "application/dash+xml",
  88258. jpg: "image/jpeg",
  88259. jpeg: "image/jpeg",
  88260. gif: "image/gif",
  88261. png: "image/png",
  88262. svg: "image/svg+xml",
  88263. webp: "image/webp"
  88264. };
  88265. var getMimetype = function getMimetype2(src) {
  88266. if (src === void 0) {
  88267. src = "";
  88268. }
  88269. var ext = getFileExtension(src);
  88270. var mimetype = MimetypesKind[ext.toLowerCase()];
  88271. return mimetype || "";
  88272. };
  88273. var findMimetype = function findMimetype2(player, src) {
  88274. if (!src) {
  88275. return "";
  88276. }
  88277. if (player.cache_.source.src === src && player.cache_.source.type) {
  88278. return player.cache_.source.type;
  88279. }
  88280. var matchingSources = player.cache_.sources.filter(function(s2) {
  88281. return s2.src === src;
  88282. });
  88283. if (matchingSources.length) {
  88284. return matchingSources[0].type;
  88285. }
  88286. var sources = player.$$("source");
  88287. for (var i2 = 0; i2 < sources.length; i2++) {
  88288. var s = sources[i2];
  88289. if (s.type && s.src && s.src === src) {
  88290. return s.type;
  88291. }
  88292. }
  88293. return getMimetype(src);
  88294. };
  88295. var filterSource = function filterSource2(src) {
  88296. if (Array.isArray(src)) {
  88297. var newsrc = [];
  88298. src.forEach(function(srcobj) {
  88299. srcobj = filterSource2(srcobj);
  88300. if (Array.isArray(srcobj)) {
  88301. newsrc = newsrc.concat(srcobj);
  88302. } else if (isObject2(srcobj)) {
  88303. newsrc.push(srcobj);
  88304. }
  88305. });
  88306. src = newsrc;
  88307. } else if (typeof src === "string" && src.trim()) {
  88308. src = [fixSource({
  88309. src
  88310. })];
  88311. } else if (isObject2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  88312. src = [fixSource(src)];
  88313. } else {
  88314. src = [];
  88315. }
  88316. return src;
  88317. };
  88318. function fixSource(src) {
  88319. if (!src.type) {
  88320. var mimetype = getMimetype(src.src);
  88321. if (mimetype) {
  88322. src.type = mimetype;
  88323. }
  88324. }
  88325. return src;
  88326. }
  88327. var MediaLoader = /* @__PURE__ */ function(_Component) {
  88328. _inheritsLoose(MediaLoader2, _Component);
  88329. function MediaLoader2(player, options2, ready) {
  88330. var _this;
  88331. var options_ = mergeOptions$3({
  88332. createEl: false
  88333. }, options2);
  88334. _this = _Component.call(this, player, options_, ready) || this;
  88335. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  88336. for (var i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  88337. var techName = toTitleCase$1(j[i2]);
  88338. var tech = Tech$1.getTech(techName);
  88339. if (!techName) {
  88340. tech = Component$1.getComponent(techName);
  88341. }
  88342. if (tech && tech.isSupported()) {
  88343. player.loadTech_(techName);
  88344. break;
  88345. }
  88346. }
  88347. } else {
  88348. player.src(options2.playerOptions.sources);
  88349. }
  88350. return _this;
  88351. }
  88352. return MediaLoader2;
  88353. }(Component$1);
  88354. Component$1.registerComponent("MediaLoader", MediaLoader);
  88355. var ClickableComponent = /* @__PURE__ */ function(_Component) {
  88356. _inheritsLoose(ClickableComponent2, _Component);
  88357. function ClickableComponent2(player, options2) {
  88358. var _this;
  88359. _this = _Component.call(this, player, options2) || this;
  88360. if (_this.options_.controlText) {
  88361. _this.controlText(_this.options_.controlText);
  88362. }
  88363. _this.handleMouseOver_ = function(e) {
  88364. return _this.handleMouseOver(e);
  88365. };
  88366. _this.handleMouseOut_ = function(e) {
  88367. return _this.handleMouseOut(e);
  88368. };
  88369. _this.handleClick_ = function(e) {
  88370. return _this.handleClick(e);
  88371. };
  88372. _this.handleKeyDown_ = function(e) {
  88373. return _this.handleKeyDown(e);
  88374. };
  88375. _this.emitTapEvents();
  88376. _this.enable();
  88377. return _this;
  88378. }
  88379. var _proto = ClickableComponent2.prototype;
  88380. _proto.createEl = function createEl$12(tag, props, attributes) {
  88381. if (tag === void 0) {
  88382. tag = "div";
  88383. }
  88384. if (props === void 0) {
  88385. props = {};
  88386. }
  88387. if (attributes === void 0) {
  88388. attributes = {};
  88389. }
  88390. props = assign({
  88391. className: this.buildCSSClass(),
  88392. tabIndex: 0
  88393. }, props);
  88394. if (tag === "button") {
  88395. log$1.error("Creating a ClickableComponent with an HTML element of " + tag + " is not supported; use a Button instead.");
  88396. }
  88397. attributes = assign({
  88398. role: "button"
  88399. }, attributes);
  88400. this.tabIndex_ = props.tabIndex;
  88401. var el = createEl(tag, props, attributes);
  88402. el.appendChild(createEl("span", {
  88403. className: "vjs-icon-placeholder"
  88404. }, {
  88405. "aria-hidden": true
  88406. }));
  88407. this.createControlTextEl(el);
  88408. return el;
  88409. };
  88410. _proto.dispose = function dispose() {
  88411. this.controlTextEl_ = null;
  88412. _Component.prototype.dispose.call(this);
  88413. };
  88414. _proto.createControlTextEl = function createControlTextEl(el) {
  88415. this.controlTextEl_ = createEl("span", {
  88416. className: "vjs-control-text"
  88417. }, {
  88418. "aria-live": "polite"
  88419. });
  88420. if (el) {
  88421. el.appendChild(this.controlTextEl_);
  88422. }
  88423. this.controlText(this.controlText_, el);
  88424. return this.controlTextEl_;
  88425. };
  88426. _proto.controlText = function controlText(text, el) {
  88427. if (el === void 0) {
  88428. el = this.el();
  88429. }
  88430. if (text === void 0) {
  88431. return this.controlText_ || "Need Text";
  88432. }
  88433. var localizedText = this.localize(text);
  88434. this.controlText_ = text;
  88435. textContent(this.controlTextEl_, localizedText);
  88436. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  88437. el.setAttribute("title", localizedText);
  88438. }
  88439. };
  88440. _proto.buildCSSClass = function buildCSSClass() {
  88441. return "vjs-control vjs-button " + _Component.prototype.buildCSSClass.call(this);
  88442. };
  88443. _proto.enable = function enable() {
  88444. if (!this.enabled_) {
  88445. this.enabled_ = true;
  88446. this.removeClass("vjs-disabled");
  88447. this.el_.setAttribute("aria-disabled", "false");
  88448. if (typeof this.tabIndex_ !== "undefined") {
  88449. this.el_.setAttribute("tabIndex", this.tabIndex_);
  88450. }
  88451. this.on(["tap", "click"], this.handleClick_);
  88452. this.on("keydown", this.handleKeyDown_);
  88453. }
  88454. };
  88455. _proto.disable = function disable() {
  88456. this.enabled_ = false;
  88457. this.addClass("vjs-disabled");
  88458. this.el_.setAttribute("aria-disabled", "true");
  88459. if (typeof this.tabIndex_ !== "undefined") {
  88460. this.el_.removeAttribute("tabIndex");
  88461. }
  88462. this.off("mouseover", this.handleMouseOver_);
  88463. this.off("mouseout", this.handleMouseOut_);
  88464. this.off(["tap", "click"], this.handleClick_);
  88465. this.off("keydown", this.handleKeyDown_);
  88466. };
  88467. _proto.handleLanguagechange = function handleLanguagechange() {
  88468. this.controlText(this.controlText_);
  88469. };
  88470. _proto.handleClick = function handleClick(event2) {
  88471. if (this.options_.clickHandler) {
  88472. this.options_.clickHandler.call(this, arguments);
  88473. }
  88474. };
  88475. _proto.handleKeyDown = function handleKeyDown(event2) {
  88476. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88477. event2.preventDefault();
  88478. event2.stopPropagation();
  88479. this.trigger("click");
  88480. } else {
  88481. _Component.prototype.handleKeyDown.call(this, event2);
  88482. }
  88483. };
  88484. return ClickableComponent2;
  88485. }(Component$1);
  88486. Component$1.registerComponent("ClickableComponent", ClickableComponent);
  88487. var PosterImage = /* @__PURE__ */ function(_ClickableComponent) {
  88488. _inheritsLoose(PosterImage2, _ClickableComponent);
  88489. function PosterImage2(player, options2) {
  88490. var _this;
  88491. _this = _ClickableComponent.call(this, player, options2) || this;
  88492. _this.update();
  88493. _this.update_ = function(e) {
  88494. return _this.update(e);
  88495. };
  88496. player.on("posterchange", _this.update_);
  88497. return _this;
  88498. }
  88499. var _proto = PosterImage2.prototype;
  88500. _proto.dispose = function dispose() {
  88501. this.player().off("posterchange", this.update_);
  88502. _ClickableComponent.prototype.dispose.call(this);
  88503. };
  88504. _proto.createEl = function createEl$12() {
  88505. var el = createEl("div", {
  88506. className: "vjs-poster",
  88507. tabIndex: -1
  88508. });
  88509. return el;
  88510. };
  88511. _proto.update = function update(event2) {
  88512. var url = this.player().poster();
  88513. this.setSrc(url);
  88514. if (url) {
  88515. this.show();
  88516. } else {
  88517. this.hide();
  88518. }
  88519. };
  88520. _proto.setSrc = function setSrc(url) {
  88521. var backgroundImage = "";
  88522. if (url) {
  88523. backgroundImage = 'url("' + url + '")';
  88524. }
  88525. this.el_.style.backgroundImage = backgroundImage;
  88526. };
  88527. _proto.handleClick = function handleClick(event2) {
  88528. if (!this.player_.controls()) {
  88529. return;
  88530. }
  88531. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88532. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88533. this.player_.tech(true).focus();
  88534. }
  88535. if (this.player_.paused()) {
  88536. silencePromise(this.player_.play());
  88537. } else {
  88538. this.player_.pause();
  88539. }
  88540. };
  88541. return PosterImage2;
  88542. }(ClickableComponent);
  88543. Component$1.registerComponent("PosterImage", PosterImage);
  88544. var darkGray = "#222";
  88545. var lightGray = "#ccc";
  88546. var fontMap = {
  88547. monospace: "monospace",
  88548. sansSerif: "sans-serif",
  88549. serif: "serif",
  88550. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  88551. monospaceSerif: '"Courier New", monospace',
  88552. proportionalSansSerif: "sans-serif",
  88553. proportionalSerif: "serif",
  88554. casual: '"Comic Sans MS", Impact, fantasy',
  88555. script: '"Monotype Corsiva", cursive',
  88556. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  88557. };
  88558. function constructColor(color2, opacity) {
  88559. var hex;
  88560. if (color2.length === 4) {
  88561. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  88562. } else if (color2.length === 7) {
  88563. hex = color2.slice(1);
  88564. } else {
  88565. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  88566. }
  88567. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  88568. }
  88569. function tryUpdateStyle(el, style, rule) {
  88570. try {
  88571. el.style[style] = rule;
  88572. } catch (e) {
  88573. return;
  88574. }
  88575. }
  88576. var TextTrackDisplay = /* @__PURE__ */ function(_Component) {
  88577. _inheritsLoose(TextTrackDisplay2, _Component);
  88578. function TextTrackDisplay2(player, options2, ready) {
  88579. var _this;
  88580. _this = _Component.call(this, player, options2, ready) || this;
  88581. var updateDisplayHandler = function updateDisplayHandler2(e) {
  88582. return _this.updateDisplay(e);
  88583. };
  88584. player.on("loadstart", function(e) {
  88585. return _this.toggleDisplay(e);
  88586. });
  88587. player.on("texttrackchange", updateDisplayHandler);
  88588. player.on("loadedmetadata", function(e) {
  88589. return _this.preselectTrack(e);
  88590. });
  88591. player.ready(bind(_assertThisInitialized(_this), function() {
  88592. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  88593. this.hide();
  88594. return;
  88595. }
  88596. player.on("fullscreenchange", updateDisplayHandler);
  88597. player.on("playerresize", updateDisplayHandler);
  88598. window_1.addEventListener("orientationchange", updateDisplayHandler);
  88599. player.on("dispose", function() {
  88600. return window_1.removeEventListener("orientationchange", updateDisplayHandler);
  88601. });
  88602. var tracks = this.options_.playerOptions.tracks || [];
  88603. for (var i2 = 0; i2 < tracks.length; i2++) {
  88604. this.player_.addRemoteTextTrack(tracks[i2], true);
  88605. }
  88606. this.preselectTrack();
  88607. }));
  88608. return _this;
  88609. }
  88610. var _proto = TextTrackDisplay2.prototype;
  88611. _proto.preselectTrack = function preselectTrack() {
  88612. var modes = {
  88613. captions: 1,
  88614. subtitles: 1
  88615. };
  88616. var trackList = this.player_.textTracks();
  88617. var userPref = this.player_.cache_.selectedLanguage;
  88618. var firstDesc;
  88619. var firstCaptions;
  88620. var preferredTrack;
  88621. for (var i2 = 0; i2 < trackList.length; i2++) {
  88622. var track = trackList[i2];
  88623. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  88624. if (track.kind === userPref.kind) {
  88625. preferredTrack = track;
  88626. } else if (!preferredTrack) {
  88627. preferredTrack = track;
  88628. }
  88629. } else if (userPref && !userPref.enabled) {
  88630. preferredTrack = null;
  88631. firstDesc = null;
  88632. firstCaptions = null;
  88633. } else if (track["default"]) {
  88634. if (track.kind === "descriptions" && !firstDesc) {
  88635. firstDesc = track;
  88636. } else if (track.kind in modes && !firstCaptions) {
  88637. firstCaptions = track;
  88638. }
  88639. }
  88640. }
  88641. if (preferredTrack) {
  88642. preferredTrack.mode = "showing";
  88643. } else if (firstCaptions) {
  88644. firstCaptions.mode = "showing";
  88645. } else if (firstDesc) {
  88646. firstDesc.mode = "showing";
  88647. }
  88648. };
  88649. _proto.toggleDisplay = function toggleDisplay() {
  88650. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  88651. this.hide();
  88652. } else {
  88653. this.show();
  88654. }
  88655. };
  88656. _proto.createEl = function createEl2() {
  88657. return _Component.prototype.createEl.call(this, "div", {
  88658. className: "vjs-text-track-display"
  88659. }, {
  88660. "translate": "yes",
  88661. "aria-live": "off",
  88662. "aria-atomic": "true"
  88663. });
  88664. };
  88665. _proto.clearDisplay = function clearDisplay() {
  88666. if (typeof window_1.WebVTT === "function") {
  88667. window_1.WebVTT.processCues(window_1, [], this.el_);
  88668. }
  88669. };
  88670. _proto.updateDisplay = function updateDisplay() {
  88671. var tracks = this.player_.textTracks();
  88672. var allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  88673. this.clearDisplay();
  88674. if (allowMultipleShowingTracks) {
  88675. var showingTracks = [];
  88676. for (var _i = 0; _i < tracks.length; ++_i) {
  88677. var track = tracks[_i];
  88678. if (track.mode !== "showing") {
  88679. continue;
  88680. }
  88681. showingTracks.push(track);
  88682. }
  88683. this.updateForTrack(showingTracks);
  88684. return;
  88685. }
  88686. var descriptionsTrack = null;
  88687. var captionsSubtitlesTrack = null;
  88688. var i2 = tracks.length;
  88689. while (i2--) {
  88690. var _track = tracks[i2];
  88691. if (_track.mode === "showing") {
  88692. if (_track.kind === "descriptions") {
  88693. descriptionsTrack = _track;
  88694. } else {
  88695. captionsSubtitlesTrack = _track;
  88696. }
  88697. }
  88698. }
  88699. if (captionsSubtitlesTrack) {
  88700. if (this.getAttribute("aria-live") !== "off") {
  88701. this.setAttribute("aria-live", "off");
  88702. }
  88703. this.updateForTrack(captionsSubtitlesTrack);
  88704. } else if (descriptionsTrack) {
  88705. if (this.getAttribute("aria-live") !== "assertive") {
  88706. this.setAttribute("aria-live", "assertive");
  88707. }
  88708. this.updateForTrack(descriptionsTrack);
  88709. }
  88710. };
  88711. _proto.updateDisplayState = function updateDisplayState(track) {
  88712. var overrides = this.player_.textTrackSettings.getValues();
  88713. var cues = track.activeCues;
  88714. var i2 = cues.length;
  88715. while (i2--) {
  88716. var cue = cues[i2];
  88717. if (!cue) {
  88718. continue;
  88719. }
  88720. var cueDiv = cue.displayState;
  88721. if (overrides.color) {
  88722. cueDiv.firstChild.style.color = overrides.color;
  88723. }
  88724. if (overrides.textOpacity) {
  88725. tryUpdateStyle(cueDiv.firstChild, "color", constructColor(overrides.color || "#fff", overrides.textOpacity));
  88726. }
  88727. if (overrides.backgroundColor) {
  88728. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  88729. }
  88730. if (overrides.backgroundOpacity) {
  88731. tryUpdateStyle(cueDiv.firstChild, "backgroundColor", constructColor(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  88732. }
  88733. if (overrides.windowColor) {
  88734. if (overrides.windowOpacity) {
  88735. tryUpdateStyle(cueDiv, "backgroundColor", constructColor(overrides.windowColor, overrides.windowOpacity));
  88736. } else {
  88737. cueDiv.style.backgroundColor = overrides.windowColor;
  88738. }
  88739. }
  88740. if (overrides.edgeStyle) {
  88741. if (overrides.edgeStyle === "dropshadow") {
  88742. cueDiv.firstChild.style.textShadow = "2px 2px 3px " + darkGray + ", 2px 2px 4px " + darkGray + ", 2px 2px 5px " + darkGray;
  88743. } else if (overrides.edgeStyle === "raised") {
  88744. cueDiv.firstChild.style.textShadow = "1px 1px " + darkGray + ", 2px 2px " + darkGray + ", 3px 3px " + darkGray;
  88745. } else if (overrides.edgeStyle === "depressed") {
  88746. cueDiv.firstChild.style.textShadow = "1px 1px " + lightGray + ", 0 1px " + lightGray + ", -1px -1px " + darkGray + ", 0 -1px " + darkGray;
  88747. } else if (overrides.edgeStyle === "uniform") {
  88748. cueDiv.firstChild.style.textShadow = "0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray;
  88749. }
  88750. }
  88751. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  88752. var fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  88753. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  88754. cueDiv.style.height = "auto";
  88755. cueDiv.style.top = "auto";
  88756. }
  88757. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  88758. if (overrides.fontFamily === "small-caps") {
  88759. cueDiv.firstChild.style.fontVariant = "small-caps";
  88760. } else {
  88761. cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];
  88762. }
  88763. }
  88764. }
  88765. };
  88766. _proto.updateForTrack = function updateForTrack(tracks) {
  88767. if (!Array.isArray(tracks)) {
  88768. tracks = [tracks];
  88769. }
  88770. if (typeof window_1.WebVTT !== "function" || tracks.every(function(track2) {
  88771. return !track2.activeCues;
  88772. })) {
  88773. return;
  88774. }
  88775. var cues = [];
  88776. for (var i2 = 0; i2 < tracks.length; ++i2) {
  88777. var track = tracks[i2];
  88778. for (var j = 0; j < track.activeCues.length; ++j) {
  88779. cues.push(track.activeCues[j]);
  88780. }
  88781. }
  88782. window_1.WebVTT.processCues(window_1, cues, this.el_);
  88783. for (var _i2 = 0; _i2 < tracks.length; ++_i2) {
  88784. var _track2 = tracks[_i2];
  88785. for (var _j = 0; _j < _track2.activeCues.length; ++_j) {
  88786. var cueEl = _track2.activeCues[_j].displayState;
  88787. addClass(cueEl, "vjs-text-track-cue");
  88788. addClass(cueEl, "vjs-text-track-cue-" + (_track2.language ? _track2.language : _i2));
  88789. if (_track2.language) {
  88790. setAttribute(cueEl, "lang", _track2.language);
  88791. }
  88792. }
  88793. if (this.player_.textTrackSettings) {
  88794. this.updateDisplayState(_track2);
  88795. }
  88796. }
  88797. };
  88798. return TextTrackDisplay2;
  88799. }(Component$1);
  88800. Component$1.registerComponent("TextTrackDisplay", TextTrackDisplay);
  88801. var LoadingSpinner = /* @__PURE__ */ function(_Component) {
  88802. _inheritsLoose(LoadingSpinner2, _Component);
  88803. function LoadingSpinner2() {
  88804. return _Component.apply(this, arguments) || this;
  88805. }
  88806. var _proto = LoadingSpinner2.prototype;
  88807. _proto.createEl = function createEl$12() {
  88808. var isAudio = this.player_.isAudio();
  88809. var playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  88810. var controlText = createEl("span", {
  88811. className: "vjs-control-text",
  88812. textContent: this.localize("{1} is loading.", [playerType])
  88813. });
  88814. var el = _Component.prototype.createEl.call(this, "div", {
  88815. className: "vjs-loading-spinner",
  88816. dir: "ltr"
  88817. });
  88818. el.appendChild(controlText);
  88819. return el;
  88820. };
  88821. return LoadingSpinner2;
  88822. }(Component$1);
  88823. Component$1.registerComponent("LoadingSpinner", LoadingSpinner);
  88824. var Button = /* @__PURE__ */ function(_ClickableComponent) {
  88825. _inheritsLoose(Button2, _ClickableComponent);
  88826. function Button2() {
  88827. return _ClickableComponent.apply(this, arguments) || this;
  88828. }
  88829. var _proto = Button2.prototype;
  88830. _proto.createEl = function createEl$12(tag, props, attributes) {
  88831. if (props === void 0) {
  88832. props = {};
  88833. }
  88834. if (attributes === void 0) {
  88835. attributes = {};
  88836. }
  88837. tag = "button";
  88838. props = assign({
  88839. className: this.buildCSSClass()
  88840. }, props);
  88841. attributes = assign({
  88842. type: "button"
  88843. }, attributes);
  88844. var el = createEl(tag, props, attributes);
  88845. el.appendChild(createEl("span", {
  88846. className: "vjs-icon-placeholder"
  88847. }, {
  88848. "aria-hidden": true
  88849. }));
  88850. this.createControlTextEl(el);
  88851. return el;
  88852. };
  88853. _proto.addChild = function addChild(child, options2) {
  88854. if (options2 === void 0) {
  88855. options2 = {};
  88856. }
  88857. var className = this.constructor.name;
  88858. log$1.warn("Adding an actionable (user controllable) child to a Button (" + className + ") is not supported; use a ClickableComponent instead.");
  88859. return Component$1.prototype.addChild.call(this, child, options2);
  88860. };
  88861. _proto.enable = function enable() {
  88862. _ClickableComponent.prototype.enable.call(this);
  88863. this.el_.removeAttribute("disabled");
  88864. };
  88865. _proto.disable = function disable() {
  88866. _ClickableComponent.prototype.disable.call(this);
  88867. this.el_.setAttribute("disabled", "disabled");
  88868. };
  88869. _proto.handleKeyDown = function handleKeyDown(event2) {
  88870. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88871. event2.stopPropagation();
  88872. return;
  88873. }
  88874. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  88875. };
  88876. return Button2;
  88877. }(ClickableComponent);
  88878. Component$1.registerComponent("Button", Button);
  88879. var BigPlayButton = /* @__PURE__ */ function(_Button) {
  88880. _inheritsLoose(BigPlayButton2, _Button);
  88881. function BigPlayButton2(player, options2) {
  88882. var _this;
  88883. _this = _Button.call(this, player, options2) || this;
  88884. _this.mouseused_ = false;
  88885. _this.on("mousedown", function(e) {
  88886. return _this.handleMouseDown(e);
  88887. });
  88888. return _this;
  88889. }
  88890. var _proto = BigPlayButton2.prototype;
  88891. _proto.buildCSSClass = function buildCSSClass() {
  88892. return "vjs-big-play-button";
  88893. };
  88894. _proto.handleClick = function handleClick(event2) {
  88895. var playPromise = this.player_.play();
  88896. if (this.mouseused_ && event2.clientX && event2.clientY) {
  88897. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88898. silencePromise(playPromise);
  88899. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88900. this.player_.tech(true).focus();
  88901. }
  88902. return;
  88903. }
  88904. var cb = this.player_.getChild("controlBar");
  88905. var playToggle = cb && cb.getChild("playToggle");
  88906. if (!playToggle) {
  88907. this.player_.tech(true).focus();
  88908. return;
  88909. }
  88910. var playFocus = function playFocus2() {
  88911. return playToggle.focus();
  88912. };
  88913. if (isPromise(playPromise)) {
  88914. playPromise.then(playFocus, function() {
  88915. });
  88916. } else {
  88917. this.setTimeout(playFocus, 1);
  88918. }
  88919. };
  88920. _proto.handleKeyDown = function handleKeyDown(event2) {
  88921. this.mouseused_ = false;
  88922. _Button.prototype.handleKeyDown.call(this, event2);
  88923. };
  88924. _proto.handleMouseDown = function handleMouseDown(event2) {
  88925. this.mouseused_ = true;
  88926. };
  88927. return BigPlayButton2;
  88928. }(Button);
  88929. BigPlayButton.prototype.controlText_ = "Play Video";
  88930. Component$1.registerComponent("BigPlayButton", BigPlayButton);
  88931. var CloseButton = /* @__PURE__ */ function(_Button) {
  88932. _inheritsLoose(CloseButton2, _Button);
  88933. function CloseButton2(player, options2) {
  88934. var _this;
  88935. _this = _Button.call(this, player, options2) || this;
  88936. _this.controlText(options2 && options2.controlText || _this.localize("Close"));
  88937. return _this;
  88938. }
  88939. var _proto = CloseButton2.prototype;
  88940. _proto.buildCSSClass = function buildCSSClass() {
  88941. return "vjs-close-button " + _Button.prototype.buildCSSClass.call(this);
  88942. };
  88943. _proto.handleClick = function handleClick(event2) {
  88944. this.trigger({
  88945. type: "close",
  88946. bubbles: false
  88947. });
  88948. };
  88949. _proto.handleKeyDown = function handleKeyDown(event2) {
  88950. if (keycode.isEventKey(event2, "Esc")) {
  88951. event2.preventDefault();
  88952. event2.stopPropagation();
  88953. this.trigger("click");
  88954. } else {
  88955. _Button.prototype.handleKeyDown.call(this, event2);
  88956. }
  88957. };
  88958. return CloseButton2;
  88959. }(Button);
  88960. Component$1.registerComponent("CloseButton", CloseButton);
  88961. var PlayToggle = /* @__PURE__ */ function(_Button) {
  88962. _inheritsLoose(PlayToggle2, _Button);
  88963. function PlayToggle2(player, options2) {
  88964. var _this;
  88965. if (options2 === void 0) {
  88966. options2 = {};
  88967. }
  88968. _this = _Button.call(this, player, options2) || this;
  88969. options2.replay = options2.replay === void 0 || options2.replay;
  88970. _this.on(player, "play", function(e) {
  88971. return _this.handlePlay(e);
  88972. });
  88973. _this.on(player, "pause", function(e) {
  88974. return _this.handlePause(e);
  88975. });
  88976. if (options2.replay) {
  88977. _this.on(player, "ended", function(e) {
  88978. return _this.handleEnded(e);
  88979. });
  88980. }
  88981. return _this;
  88982. }
  88983. var _proto = PlayToggle2.prototype;
  88984. _proto.buildCSSClass = function buildCSSClass() {
  88985. return "vjs-play-control " + _Button.prototype.buildCSSClass.call(this);
  88986. };
  88987. _proto.handleClick = function handleClick(event2) {
  88988. if (this.player_.paused()) {
  88989. silencePromise(this.player_.play());
  88990. } else {
  88991. this.player_.pause();
  88992. }
  88993. };
  88994. _proto.handleSeeked = function handleSeeked(event2) {
  88995. this.removeClass("vjs-ended");
  88996. if (this.player_.paused()) {
  88997. this.handlePause(event2);
  88998. } else {
  88999. this.handlePlay(event2);
  89000. }
  89001. };
  89002. _proto.handlePlay = function handlePlay(event2) {
  89003. this.removeClass("vjs-ended");
  89004. this.removeClass("vjs-paused");
  89005. this.addClass("vjs-playing");
  89006. this.controlText("Pause");
  89007. };
  89008. _proto.handlePause = function handlePause(event2) {
  89009. this.removeClass("vjs-playing");
  89010. this.addClass("vjs-paused");
  89011. this.controlText("Play");
  89012. };
  89013. _proto.handleEnded = function handleEnded(event2) {
  89014. var _this2 = this;
  89015. this.removeClass("vjs-playing");
  89016. this.addClass("vjs-ended");
  89017. this.controlText("Replay");
  89018. this.one(this.player_, "seeked", function(e) {
  89019. return _this2.handleSeeked(e);
  89020. });
  89021. };
  89022. return PlayToggle2;
  89023. }(Button);
  89024. PlayToggle.prototype.controlText_ = "Play";
  89025. Component$1.registerComponent("PlayToggle", PlayToggle);
  89026. var defaultImplementation = function defaultImplementation2(seconds, guide) {
  89027. seconds = seconds < 0 ? 0 : seconds;
  89028. var s = Math.floor(seconds % 60);
  89029. var m = Math.floor(seconds / 60 % 60);
  89030. var h2 = Math.floor(seconds / 3600);
  89031. var gm = Math.floor(guide / 60 % 60);
  89032. var gh = Math.floor(guide / 3600);
  89033. if (isNaN(seconds) || seconds === Infinity) {
  89034. h2 = m = s = "-";
  89035. }
  89036. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  89037. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  89038. s = s < 10 ? "0" + s : s;
  89039. return h2 + m + s;
  89040. };
  89041. var implementation = defaultImplementation;
  89042. function setFormatTime(customImplementation) {
  89043. implementation = customImplementation;
  89044. }
  89045. function resetFormatTime() {
  89046. implementation = defaultImplementation;
  89047. }
  89048. function formatTime(seconds, guide) {
  89049. if (guide === void 0) {
  89050. guide = seconds;
  89051. }
  89052. return implementation(seconds, guide);
  89053. }
  89054. var TimeDisplay = /* @__PURE__ */ function(_Component) {
  89055. _inheritsLoose(TimeDisplay2, _Component);
  89056. function TimeDisplay2(player, options2) {
  89057. var _this;
  89058. _this = _Component.call(this, player, options2) || this;
  89059. _this.on(player, ["timeupdate", "ended"], function(e) {
  89060. return _this.updateContent(e);
  89061. });
  89062. _this.updateTextNode_();
  89063. return _this;
  89064. }
  89065. var _proto = TimeDisplay2.prototype;
  89066. _proto.createEl = function createEl$12() {
  89067. var className = this.buildCSSClass();
  89068. var el = _Component.prototype.createEl.call(this, "div", {
  89069. className: className + " vjs-time-control vjs-control"
  89070. });
  89071. var span = createEl("span", {
  89072. className: "vjs-control-text",
  89073. textContent: this.localize(this.labelText_) + "\xA0"
  89074. }, {
  89075. role: "presentation"
  89076. });
  89077. el.appendChild(span);
  89078. this.contentEl_ = createEl("span", {
  89079. className: className + "-display"
  89080. }, {
  89081. "aria-live": "off",
  89082. "role": "presentation"
  89083. });
  89084. el.appendChild(this.contentEl_);
  89085. return el;
  89086. };
  89087. _proto.dispose = function dispose() {
  89088. this.contentEl_ = null;
  89089. this.textNode_ = null;
  89090. _Component.prototype.dispose.call(this);
  89091. };
  89092. _proto.updateTextNode_ = function updateTextNode_(time) {
  89093. var _this2 = this;
  89094. if (time === void 0) {
  89095. time = 0;
  89096. }
  89097. time = formatTime(time);
  89098. if (this.formattedTime_ === time) {
  89099. return;
  89100. }
  89101. this.formattedTime_ = time;
  89102. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", function() {
  89103. if (!_this2.contentEl_) {
  89104. return;
  89105. }
  89106. var oldNode = _this2.textNode_;
  89107. if (oldNode && _this2.contentEl_.firstChild !== oldNode) {
  89108. oldNode = null;
  89109. log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  89110. }
  89111. _this2.textNode_ = document_1.createTextNode(_this2.formattedTime_);
  89112. if (!_this2.textNode_) {
  89113. return;
  89114. }
  89115. if (oldNode) {
  89116. _this2.contentEl_.replaceChild(_this2.textNode_, oldNode);
  89117. } else {
  89118. _this2.contentEl_.appendChild(_this2.textNode_);
  89119. }
  89120. });
  89121. };
  89122. _proto.updateContent = function updateContent(event2) {
  89123. };
  89124. return TimeDisplay2;
  89125. }(Component$1);
  89126. TimeDisplay.prototype.labelText_ = "Time";
  89127. TimeDisplay.prototype.controlText_ = "Time";
  89128. Component$1.registerComponent("TimeDisplay", TimeDisplay);
  89129. var CurrentTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89130. _inheritsLoose(CurrentTimeDisplay2, _TimeDisplay);
  89131. function CurrentTimeDisplay2() {
  89132. return _TimeDisplay.apply(this, arguments) || this;
  89133. }
  89134. var _proto = CurrentTimeDisplay2.prototype;
  89135. _proto.buildCSSClass = function buildCSSClass() {
  89136. return "vjs-current-time";
  89137. };
  89138. _proto.updateContent = function updateContent(event2) {
  89139. var time;
  89140. if (this.player_.ended()) {
  89141. time = this.player_.duration();
  89142. } else {
  89143. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89144. }
  89145. this.updateTextNode_(time);
  89146. };
  89147. return CurrentTimeDisplay2;
  89148. }(TimeDisplay);
  89149. CurrentTimeDisplay.prototype.labelText_ = "Current Time";
  89150. CurrentTimeDisplay.prototype.controlText_ = "Current Time";
  89151. Component$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay);
  89152. var DurationDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89153. _inheritsLoose(DurationDisplay2, _TimeDisplay);
  89154. function DurationDisplay2(player, options2) {
  89155. var _this;
  89156. _this = _TimeDisplay.call(this, player, options2) || this;
  89157. var updateContent = function updateContent2(e) {
  89158. return _this.updateContent(e);
  89159. };
  89160. _this.on(player, "durationchange", updateContent);
  89161. _this.on(player, "loadstart", updateContent);
  89162. _this.on(player, "loadedmetadata", updateContent);
  89163. return _this;
  89164. }
  89165. var _proto = DurationDisplay2.prototype;
  89166. _proto.buildCSSClass = function buildCSSClass() {
  89167. return "vjs-duration";
  89168. };
  89169. _proto.updateContent = function updateContent(event2) {
  89170. var duration5 = this.player_.duration();
  89171. this.updateTextNode_(duration5);
  89172. };
  89173. return DurationDisplay2;
  89174. }(TimeDisplay);
  89175. DurationDisplay.prototype.labelText_ = "Duration";
  89176. DurationDisplay.prototype.controlText_ = "Duration";
  89177. Component$1.registerComponent("DurationDisplay", DurationDisplay);
  89178. var TimeDivider = /* @__PURE__ */ function(_Component) {
  89179. _inheritsLoose(TimeDivider2, _Component);
  89180. function TimeDivider2() {
  89181. return _Component.apply(this, arguments) || this;
  89182. }
  89183. var _proto = TimeDivider2.prototype;
  89184. _proto.createEl = function createEl2() {
  89185. var el = _Component.prototype.createEl.call(this, "div", {
  89186. className: "vjs-time-control vjs-time-divider"
  89187. }, {
  89188. "aria-hidden": true
  89189. });
  89190. var div = _Component.prototype.createEl.call(this, "div");
  89191. var span = _Component.prototype.createEl.call(this, "span", {
  89192. textContent: "/"
  89193. });
  89194. div.appendChild(span);
  89195. el.appendChild(div);
  89196. return el;
  89197. };
  89198. return TimeDivider2;
  89199. }(Component$1);
  89200. Component$1.registerComponent("TimeDivider", TimeDivider);
  89201. var RemainingTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89202. _inheritsLoose(RemainingTimeDisplay2, _TimeDisplay);
  89203. function RemainingTimeDisplay2(player, options2) {
  89204. var _this;
  89205. _this = _TimeDisplay.call(this, player, options2) || this;
  89206. _this.on(player, "durationchange", function(e) {
  89207. return _this.updateContent(e);
  89208. });
  89209. return _this;
  89210. }
  89211. var _proto = RemainingTimeDisplay2.prototype;
  89212. _proto.buildCSSClass = function buildCSSClass() {
  89213. return "vjs-remaining-time";
  89214. };
  89215. _proto.createEl = function createEl$12() {
  89216. var el = _TimeDisplay.prototype.createEl.call(this);
  89217. if (this.options_.displayNegative !== false) {
  89218. el.insertBefore(createEl("span", {}, {
  89219. "aria-hidden": true
  89220. }, "-"), this.contentEl_);
  89221. }
  89222. return el;
  89223. };
  89224. _proto.updateContent = function updateContent(event2) {
  89225. if (typeof this.player_.duration() !== "number") {
  89226. return;
  89227. }
  89228. var time;
  89229. if (this.player_.ended()) {
  89230. time = 0;
  89231. } else if (this.player_.remainingTimeDisplay) {
  89232. time = this.player_.remainingTimeDisplay();
  89233. } else {
  89234. time = this.player_.remainingTime();
  89235. }
  89236. this.updateTextNode_(time);
  89237. };
  89238. return RemainingTimeDisplay2;
  89239. }(TimeDisplay);
  89240. RemainingTimeDisplay.prototype.labelText_ = "Remaining Time";
  89241. RemainingTimeDisplay.prototype.controlText_ = "Remaining Time";
  89242. Component$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay);
  89243. var LiveDisplay = /* @__PURE__ */ function(_Component) {
  89244. _inheritsLoose(LiveDisplay2, _Component);
  89245. function LiveDisplay2(player, options2) {
  89246. var _this;
  89247. _this = _Component.call(this, player, options2) || this;
  89248. _this.updateShowing();
  89249. _this.on(_this.player(), "durationchange", function(e) {
  89250. return _this.updateShowing(e);
  89251. });
  89252. return _this;
  89253. }
  89254. var _proto = LiveDisplay2.prototype;
  89255. _proto.createEl = function createEl$12() {
  89256. var el = _Component.prototype.createEl.call(this, "div", {
  89257. className: "vjs-live-control vjs-control"
  89258. });
  89259. this.contentEl_ = createEl("div", {
  89260. className: "vjs-live-display"
  89261. }, {
  89262. "aria-live": "off"
  89263. });
  89264. this.contentEl_.appendChild(createEl("span", {
  89265. className: "vjs-control-text",
  89266. textContent: this.localize("Stream Type") + "\xA0"
  89267. }));
  89268. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  89269. el.appendChild(this.contentEl_);
  89270. return el;
  89271. };
  89272. _proto.dispose = function dispose() {
  89273. this.contentEl_ = null;
  89274. _Component.prototype.dispose.call(this);
  89275. };
  89276. _proto.updateShowing = function updateShowing(event2) {
  89277. if (this.player().duration() === Infinity) {
  89278. this.show();
  89279. } else {
  89280. this.hide();
  89281. }
  89282. };
  89283. return LiveDisplay2;
  89284. }(Component$1);
  89285. Component$1.registerComponent("LiveDisplay", LiveDisplay);
  89286. var SeekToLive = /* @__PURE__ */ function(_Button) {
  89287. _inheritsLoose(SeekToLive2, _Button);
  89288. function SeekToLive2(player, options2) {
  89289. var _this;
  89290. _this = _Button.call(this, player, options2) || this;
  89291. _this.updateLiveEdgeStatus();
  89292. if (_this.player_.liveTracker) {
  89293. _this.updateLiveEdgeStatusHandler_ = function(e) {
  89294. return _this.updateLiveEdgeStatus(e);
  89295. };
  89296. _this.on(_this.player_.liveTracker, "liveedgechange", _this.updateLiveEdgeStatusHandler_);
  89297. }
  89298. return _this;
  89299. }
  89300. var _proto = SeekToLive2.prototype;
  89301. _proto.createEl = function createEl$12() {
  89302. var el = _Button.prototype.createEl.call(this, "button", {
  89303. className: "vjs-seek-to-live-control vjs-control"
  89304. });
  89305. this.textEl_ = createEl("span", {
  89306. className: "vjs-seek-to-live-text",
  89307. textContent: this.localize("LIVE")
  89308. }, {
  89309. "aria-hidden": "true"
  89310. });
  89311. el.appendChild(this.textEl_);
  89312. return el;
  89313. };
  89314. _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() {
  89315. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  89316. this.setAttribute("aria-disabled", true);
  89317. this.addClass("vjs-at-live-edge");
  89318. this.controlText("Seek to live, currently playing live");
  89319. } else {
  89320. this.setAttribute("aria-disabled", false);
  89321. this.removeClass("vjs-at-live-edge");
  89322. this.controlText("Seek to live, currently behind live");
  89323. }
  89324. };
  89325. _proto.handleClick = function handleClick() {
  89326. this.player_.liveTracker.seekToLiveEdge();
  89327. };
  89328. _proto.dispose = function dispose() {
  89329. if (this.player_.liveTracker) {
  89330. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  89331. }
  89332. this.textEl_ = null;
  89333. _Button.prototype.dispose.call(this);
  89334. };
  89335. return SeekToLive2;
  89336. }(Button);
  89337. SeekToLive.prototype.controlText_ = "Seek to live, currently playing live";
  89338. Component$1.registerComponent("SeekToLive", SeekToLive);
  89339. var clamp = function clamp2(number, min2, max2) {
  89340. number = Number(number);
  89341. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  89342. };
  89343. var Slider = /* @__PURE__ */ function(_Component) {
  89344. _inheritsLoose(Slider2, _Component);
  89345. function Slider2(player, options2) {
  89346. var _this;
  89347. _this = _Component.call(this, player, options2) || this;
  89348. _this.handleMouseDown_ = function(e) {
  89349. return _this.handleMouseDown(e);
  89350. };
  89351. _this.handleMouseUp_ = function(e) {
  89352. return _this.handleMouseUp(e);
  89353. };
  89354. _this.handleKeyDown_ = function(e) {
  89355. return _this.handleKeyDown(e);
  89356. };
  89357. _this.handleClick_ = function(e) {
  89358. return _this.handleClick(e);
  89359. };
  89360. _this.handleMouseMove_ = function(e) {
  89361. return _this.handleMouseMove(e);
  89362. };
  89363. _this.update_ = function(e) {
  89364. return _this.update(e);
  89365. };
  89366. _this.bar = _this.getChild(_this.options_.barName);
  89367. _this.vertical(!!_this.options_.vertical);
  89368. _this.enable();
  89369. return _this;
  89370. }
  89371. var _proto = Slider2.prototype;
  89372. _proto.enabled = function enabled() {
  89373. return this.enabled_;
  89374. };
  89375. _proto.enable = function enable() {
  89376. if (this.enabled()) {
  89377. return;
  89378. }
  89379. this.on("mousedown", this.handleMouseDown_);
  89380. this.on("touchstart", this.handleMouseDown_);
  89381. this.on("keydown", this.handleKeyDown_);
  89382. this.on("click", this.handleClick_);
  89383. this.on(this.player_, "controlsvisible", this.update);
  89384. if (this.playerEvent) {
  89385. this.on(this.player_, this.playerEvent, this.update);
  89386. }
  89387. this.removeClass("disabled");
  89388. this.setAttribute("tabindex", 0);
  89389. this.enabled_ = true;
  89390. };
  89391. _proto.disable = function disable() {
  89392. if (!this.enabled()) {
  89393. return;
  89394. }
  89395. var doc = this.bar.el_.ownerDocument;
  89396. this.off("mousedown", this.handleMouseDown_);
  89397. this.off("touchstart", this.handleMouseDown_);
  89398. this.off("keydown", this.handleKeyDown_);
  89399. this.off("click", this.handleClick_);
  89400. this.off(this.player_, "controlsvisible", this.update_);
  89401. this.off(doc, "mousemove", this.handleMouseMove_);
  89402. this.off(doc, "mouseup", this.handleMouseUp_);
  89403. this.off(doc, "touchmove", this.handleMouseMove_);
  89404. this.off(doc, "touchend", this.handleMouseUp_);
  89405. this.removeAttribute("tabindex");
  89406. this.addClass("disabled");
  89407. if (this.playerEvent) {
  89408. this.off(this.player_, this.playerEvent, this.update);
  89409. }
  89410. this.enabled_ = false;
  89411. };
  89412. _proto.createEl = function createEl2(type2, props, attributes) {
  89413. if (props === void 0) {
  89414. props = {};
  89415. }
  89416. if (attributes === void 0) {
  89417. attributes = {};
  89418. }
  89419. props.className = props.className + " vjs-slider";
  89420. props = assign({
  89421. tabIndex: 0
  89422. }, props);
  89423. attributes = assign({
  89424. "role": "slider",
  89425. "aria-valuenow": 0,
  89426. "aria-valuemin": 0,
  89427. "aria-valuemax": 100,
  89428. "tabIndex": 0
  89429. }, attributes);
  89430. return _Component.prototype.createEl.call(this, type2, props, attributes);
  89431. };
  89432. _proto.handleMouseDown = function handleMouseDown(event2) {
  89433. var doc = this.bar.el_.ownerDocument;
  89434. if (event2.type === "mousedown") {
  89435. event2.preventDefault();
  89436. }
  89437. if (event2.type === "touchstart" && !IS_CHROME) {
  89438. event2.preventDefault();
  89439. }
  89440. blockTextSelection();
  89441. this.addClass("vjs-sliding");
  89442. this.trigger("slideractive");
  89443. this.on(doc, "mousemove", this.handleMouseMove_);
  89444. this.on(doc, "mouseup", this.handleMouseUp_);
  89445. this.on(doc, "touchmove", this.handleMouseMove_);
  89446. this.on(doc, "touchend", this.handleMouseUp_);
  89447. this.handleMouseMove(event2, true);
  89448. };
  89449. _proto.handleMouseMove = function handleMouseMove(event2) {
  89450. };
  89451. _proto.handleMouseUp = function handleMouseUp() {
  89452. var doc = this.bar.el_.ownerDocument;
  89453. unblockTextSelection();
  89454. this.removeClass("vjs-sliding");
  89455. this.trigger("sliderinactive");
  89456. this.off(doc, "mousemove", this.handleMouseMove_);
  89457. this.off(doc, "mouseup", this.handleMouseUp_);
  89458. this.off(doc, "touchmove", this.handleMouseMove_);
  89459. this.off(doc, "touchend", this.handleMouseUp_);
  89460. this.update();
  89461. };
  89462. _proto.update = function update() {
  89463. var _this2 = this;
  89464. if (!this.el_ || !this.bar) {
  89465. return;
  89466. }
  89467. var progress = this.getProgress();
  89468. if (progress === this.progress_) {
  89469. return progress;
  89470. }
  89471. this.progress_ = progress;
  89472. this.requestNamedAnimationFrame("Slider#update", function() {
  89473. var sizeKey = _this2.vertical() ? "height" : "width";
  89474. _this2.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  89475. });
  89476. return progress;
  89477. };
  89478. _proto.getProgress = function getProgress() {
  89479. return Number(clamp(this.getPercent(), 0, 1).toFixed(4));
  89480. };
  89481. _proto.calculateDistance = function calculateDistance(event2) {
  89482. var position2 = getPointerPosition(this.el_, event2);
  89483. if (this.vertical()) {
  89484. return position2.y;
  89485. }
  89486. return position2.x;
  89487. };
  89488. _proto.handleKeyDown = function handleKeyDown(event2) {
  89489. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  89490. event2.preventDefault();
  89491. event2.stopPropagation();
  89492. this.stepBack();
  89493. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  89494. event2.preventDefault();
  89495. event2.stopPropagation();
  89496. this.stepForward();
  89497. } else {
  89498. _Component.prototype.handleKeyDown.call(this, event2);
  89499. }
  89500. };
  89501. _proto.handleClick = function handleClick(event2) {
  89502. event2.stopPropagation();
  89503. event2.preventDefault();
  89504. };
  89505. _proto.vertical = function vertical(bool) {
  89506. if (bool === void 0) {
  89507. return this.vertical_ || false;
  89508. }
  89509. this.vertical_ = !!bool;
  89510. if (this.vertical_) {
  89511. this.addClass("vjs-slider-vertical");
  89512. } else {
  89513. this.addClass("vjs-slider-horizontal");
  89514. }
  89515. };
  89516. return Slider2;
  89517. }(Component$1);
  89518. Component$1.registerComponent("Slider", Slider);
  89519. var percentify = function percentify2(time, end) {
  89520. return clamp(time / end * 100, 0, 100).toFixed(2) + "%";
  89521. };
  89522. var LoadProgressBar = /* @__PURE__ */ function(_Component) {
  89523. _inheritsLoose(LoadProgressBar2, _Component);
  89524. function LoadProgressBar2(player, options2) {
  89525. var _this;
  89526. _this = _Component.call(this, player, options2) || this;
  89527. _this.partEls_ = [];
  89528. _this.on(player, "progress", function(e) {
  89529. return _this.update(e);
  89530. });
  89531. return _this;
  89532. }
  89533. var _proto = LoadProgressBar2.prototype;
  89534. _proto.createEl = function createEl$12() {
  89535. var el = _Component.prototype.createEl.call(this, "div", {
  89536. className: "vjs-load-progress"
  89537. });
  89538. var wrapper = createEl("span", {
  89539. className: "vjs-control-text"
  89540. });
  89541. var loadedText = createEl("span", {
  89542. textContent: this.localize("Loaded")
  89543. });
  89544. var separator = document_1.createTextNode(": ");
  89545. this.percentageEl_ = createEl("span", {
  89546. className: "vjs-control-text-loaded-percentage",
  89547. textContent: "0%"
  89548. });
  89549. el.appendChild(wrapper);
  89550. wrapper.appendChild(loadedText);
  89551. wrapper.appendChild(separator);
  89552. wrapper.appendChild(this.percentageEl_);
  89553. return el;
  89554. };
  89555. _proto.dispose = function dispose() {
  89556. this.partEls_ = null;
  89557. this.percentageEl_ = null;
  89558. _Component.prototype.dispose.call(this);
  89559. };
  89560. _proto.update = function update(event2) {
  89561. var _this2 = this;
  89562. this.requestNamedAnimationFrame("LoadProgressBar#update", function() {
  89563. var liveTracker = _this2.player_.liveTracker;
  89564. var buffered = _this2.player_.buffered();
  89565. var duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration();
  89566. var bufferedEnd = _this2.player_.bufferedEnd();
  89567. var children = _this2.partEls_;
  89568. var percent = percentify(bufferedEnd, duration5);
  89569. if (_this2.percent_ !== percent) {
  89570. _this2.el_.style.width = percent;
  89571. textContent(_this2.percentageEl_, percent);
  89572. _this2.percent_ = percent;
  89573. }
  89574. for (var i2 = 0; i2 < buffered.length; i2++) {
  89575. var start2 = buffered.start(i2);
  89576. var end = buffered.end(i2);
  89577. var part = children[i2];
  89578. if (!part) {
  89579. part = _this2.el_.appendChild(createEl());
  89580. children[i2] = part;
  89581. }
  89582. if (part.dataset.start === start2 && part.dataset.end === end) {
  89583. continue;
  89584. }
  89585. part.dataset.start = start2;
  89586. part.dataset.end = end;
  89587. part.style.left = percentify(start2, bufferedEnd);
  89588. part.style.width = percentify(end - start2, bufferedEnd);
  89589. }
  89590. for (var _i = children.length; _i > buffered.length; _i--) {
  89591. _this2.el_.removeChild(children[_i - 1]);
  89592. }
  89593. children.length = buffered.length;
  89594. });
  89595. };
  89596. return LoadProgressBar2;
  89597. }(Component$1);
  89598. Component$1.registerComponent("LoadProgressBar", LoadProgressBar);
  89599. var TimeTooltip = /* @__PURE__ */ function(_Component) {
  89600. _inheritsLoose(TimeTooltip2, _Component);
  89601. function TimeTooltip2(player, options2) {
  89602. var _this;
  89603. _this = _Component.call(this, player, options2) || this;
  89604. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89605. return _this;
  89606. }
  89607. var _proto = TimeTooltip2.prototype;
  89608. _proto.createEl = function createEl2() {
  89609. return _Component.prototype.createEl.call(this, "div", {
  89610. className: "vjs-time-tooltip"
  89611. }, {
  89612. "aria-hidden": "true"
  89613. });
  89614. };
  89615. _proto.update = function update(seekBarRect, seekBarPoint, content) {
  89616. var tooltipRect = findPosition(this.el_);
  89617. var playerRect = getBoundingClientRect(this.player_.el());
  89618. var seekBarPointPx = seekBarRect.width * seekBarPoint;
  89619. if (!playerRect || !tooltipRect) {
  89620. return;
  89621. }
  89622. var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  89623. var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  89624. var pullTooltipBy = tooltipRect.width / 2;
  89625. if (spaceLeftOfPoint < pullTooltipBy) {
  89626. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  89627. } else if (spaceRightOfPoint < pullTooltipBy) {
  89628. pullTooltipBy = spaceRightOfPoint;
  89629. }
  89630. if (pullTooltipBy < 0) {
  89631. pullTooltipBy = 0;
  89632. } else if (pullTooltipBy > tooltipRect.width) {
  89633. pullTooltipBy = tooltipRect.width;
  89634. }
  89635. pullTooltipBy = Math.round(pullTooltipBy);
  89636. this.el_.style.right = "-" + pullTooltipBy + "px";
  89637. this.write(content);
  89638. };
  89639. _proto.write = function write(content) {
  89640. textContent(this.el_, content);
  89641. };
  89642. _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {
  89643. var _this2 = this;
  89644. this.requestNamedAnimationFrame("TimeTooltip#updateTime", function() {
  89645. var content;
  89646. var duration5 = _this2.player_.duration();
  89647. if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive()) {
  89648. var liveWindow = _this2.player_.liveTracker.liveWindow();
  89649. var secondsBehind = liveWindow - seekBarPoint * liveWindow;
  89650. content = (secondsBehind < 1 ? "" : "-") + formatTime(secondsBehind, liveWindow);
  89651. } else {
  89652. content = formatTime(time, duration5);
  89653. }
  89654. _this2.update(seekBarRect, seekBarPoint, content);
  89655. if (cb) {
  89656. cb();
  89657. }
  89658. });
  89659. };
  89660. return TimeTooltip2;
  89661. }(Component$1);
  89662. Component$1.registerComponent("TimeTooltip", TimeTooltip);
  89663. var PlayProgressBar = /* @__PURE__ */ function(_Component) {
  89664. _inheritsLoose(PlayProgressBar2, _Component);
  89665. function PlayProgressBar2(player, options2) {
  89666. var _this;
  89667. _this = _Component.call(this, player, options2) || this;
  89668. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89669. return _this;
  89670. }
  89671. var _proto = PlayProgressBar2.prototype;
  89672. _proto.createEl = function createEl2() {
  89673. return _Component.prototype.createEl.call(this, "div", {
  89674. className: "vjs-play-progress vjs-slider-bar"
  89675. }, {
  89676. "aria-hidden": "true"
  89677. });
  89678. };
  89679. _proto.update = function update(seekBarRect, seekBarPoint) {
  89680. var timeTooltip = this.getChild("timeTooltip");
  89681. if (!timeTooltip) {
  89682. return;
  89683. }
  89684. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89685. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  89686. };
  89687. return PlayProgressBar2;
  89688. }(Component$1);
  89689. PlayProgressBar.prototype.options_ = {
  89690. children: []
  89691. };
  89692. if (!IS_IOS && !IS_ANDROID) {
  89693. PlayProgressBar.prototype.options_.children.push("timeTooltip");
  89694. }
  89695. Component$1.registerComponent("PlayProgressBar", PlayProgressBar);
  89696. var MouseTimeDisplay = /* @__PURE__ */ function(_Component) {
  89697. _inheritsLoose(MouseTimeDisplay2, _Component);
  89698. function MouseTimeDisplay2(player, options2) {
  89699. var _this;
  89700. _this = _Component.call(this, player, options2) || this;
  89701. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89702. return _this;
  89703. }
  89704. var _proto = MouseTimeDisplay2.prototype;
  89705. _proto.createEl = function createEl2() {
  89706. return _Component.prototype.createEl.call(this, "div", {
  89707. className: "vjs-mouse-display"
  89708. });
  89709. };
  89710. _proto.update = function update(seekBarRect, seekBarPoint) {
  89711. var _this2 = this;
  89712. var time = seekBarPoint * this.player_.duration();
  89713. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, function() {
  89714. _this2.el_.style.left = seekBarRect.width * seekBarPoint + "px";
  89715. });
  89716. };
  89717. return MouseTimeDisplay2;
  89718. }(Component$1);
  89719. MouseTimeDisplay.prototype.options_ = {
  89720. children: ["timeTooltip"]
  89721. };
  89722. Component$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay);
  89723. var STEP_SECONDS = 5;
  89724. var PAGE_KEY_MULTIPLIER = 12;
  89725. var SeekBar = /* @__PURE__ */ function(_Slider) {
  89726. _inheritsLoose(SeekBar2, _Slider);
  89727. function SeekBar2(player, options2) {
  89728. var _this;
  89729. _this = _Slider.call(this, player, options2) || this;
  89730. _this.setEventHandlers_();
  89731. return _this;
  89732. }
  89733. var _proto = SeekBar2.prototype;
  89734. _proto.setEventHandlers_ = function setEventHandlers_() {
  89735. var _this2 = this;
  89736. this.update_ = bind(this, this.update);
  89737. this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);
  89738. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89739. if (this.player_.liveTracker) {
  89740. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  89741. }
  89742. this.updateInterval = null;
  89743. this.enableIntervalHandler_ = function(e) {
  89744. return _this2.enableInterval_(e);
  89745. };
  89746. this.disableIntervalHandler_ = function(e) {
  89747. return _this2.disableInterval_(e);
  89748. };
  89749. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  89750. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89751. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89752. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  89753. }
  89754. };
  89755. _proto.toggleVisibility_ = function toggleVisibility_(e) {
  89756. if (document_1.visibilityState === "hidden") {
  89757. this.cancelNamedAnimationFrame("SeekBar#update");
  89758. this.cancelNamedAnimationFrame("Slider#update");
  89759. this.disableInterval_(e);
  89760. } else {
  89761. if (!this.player_.ended() && !this.player_.paused()) {
  89762. this.enableInterval_();
  89763. }
  89764. this.update();
  89765. }
  89766. };
  89767. _proto.enableInterval_ = function enableInterval_() {
  89768. if (this.updateInterval) {
  89769. return;
  89770. }
  89771. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);
  89772. };
  89773. _proto.disableInterval_ = function disableInterval_(e) {
  89774. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  89775. return;
  89776. }
  89777. if (!this.updateInterval) {
  89778. return;
  89779. }
  89780. this.clearInterval(this.updateInterval);
  89781. this.updateInterval = null;
  89782. };
  89783. _proto.createEl = function createEl2() {
  89784. return _Slider.prototype.createEl.call(this, "div", {
  89785. className: "vjs-progress-holder"
  89786. }, {
  89787. "aria-label": this.localize("Progress Bar")
  89788. });
  89789. };
  89790. _proto.update = function update(event2) {
  89791. var _this3 = this;
  89792. if (document_1.visibilityState === "hidden") {
  89793. return;
  89794. }
  89795. var percent = _Slider.prototype.update.call(this);
  89796. this.requestNamedAnimationFrame("SeekBar#update", function() {
  89797. var currentTime = _this3.player_.ended() ? _this3.player_.duration() : _this3.getCurrentTime_();
  89798. var liveTracker = _this3.player_.liveTracker;
  89799. var duration5 = _this3.player_.duration();
  89800. if (liveTracker && liveTracker.isLive()) {
  89801. duration5 = _this3.player_.liveTracker.liveCurrentTime();
  89802. }
  89803. if (_this3.percent_ !== percent) {
  89804. _this3.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  89805. _this3.percent_ = percent;
  89806. }
  89807. if (_this3.currentTime_ !== currentTime || _this3.duration_ !== duration5) {
  89808. _this3.el_.setAttribute("aria-valuetext", _this3.localize("progress bar timing: currentTime={1} duration={2}", [formatTime(currentTime, duration5), formatTime(duration5, duration5)], "{1} of {2}"));
  89809. _this3.currentTime_ = currentTime;
  89810. _this3.duration_ = duration5;
  89811. }
  89812. if (_this3.bar) {
  89813. _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress());
  89814. }
  89815. });
  89816. return percent;
  89817. };
  89818. _proto.userSeek_ = function userSeek_(ct2) {
  89819. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  89820. this.player_.liveTracker.nextSeekedFromUser();
  89821. }
  89822. this.player_.currentTime(ct2);
  89823. };
  89824. _proto.getCurrentTime_ = function getCurrentTime_() {
  89825. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89826. };
  89827. _proto.getPercent = function getPercent() {
  89828. var currentTime = this.getCurrentTime_();
  89829. var percent;
  89830. var liveTracker = this.player_.liveTracker;
  89831. if (liveTracker && liveTracker.isLive()) {
  89832. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  89833. if (liveTracker.atLiveEdge()) {
  89834. percent = 1;
  89835. }
  89836. } else {
  89837. percent = currentTime / this.player_.duration();
  89838. }
  89839. return percent;
  89840. };
  89841. _proto.handleMouseDown = function handleMouseDown(event2) {
  89842. if (!isSingleLeftClick(event2)) {
  89843. return;
  89844. }
  89845. event2.stopPropagation();
  89846. this.videoWasPlaying = !this.player_.paused();
  89847. this.player_.pause();
  89848. _Slider.prototype.handleMouseDown.call(this, event2);
  89849. };
  89850. _proto.handleMouseMove = function handleMouseMove(event2, mouseDown) {
  89851. if (mouseDown === void 0) {
  89852. mouseDown = false;
  89853. }
  89854. if (!isSingleLeftClick(event2)) {
  89855. return;
  89856. }
  89857. if (!mouseDown && !this.player_.scrubbing()) {
  89858. this.player_.scrubbing(true);
  89859. }
  89860. var newTime;
  89861. var distance2 = this.calculateDistance(event2);
  89862. var liveTracker = this.player_.liveTracker;
  89863. if (!liveTracker || !liveTracker.isLive()) {
  89864. newTime = distance2 * this.player_.duration();
  89865. if (newTime === this.player_.duration()) {
  89866. newTime = newTime - 0.1;
  89867. }
  89868. } else {
  89869. if (distance2 >= 0.99) {
  89870. liveTracker.seekToLiveEdge();
  89871. return;
  89872. }
  89873. var seekableStart = liveTracker.seekableStart();
  89874. var seekableEnd = liveTracker.liveCurrentTime();
  89875. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  89876. if (newTime >= seekableEnd) {
  89877. newTime = seekableEnd;
  89878. }
  89879. if (newTime <= seekableStart) {
  89880. newTime = seekableStart + 0.1;
  89881. }
  89882. if (newTime === Infinity) {
  89883. return;
  89884. }
  89885. }
  89886. this.userSeek_(newTime);
  89887. };
  89888. _proto.enable = function enable() {
  89889. _Slider.prototype.enable.call(this);
  89890. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89891. if (!mouseTimeDisplay) {
  89892. return;
  89893. }
  89894. mouseTimeDisplay.show();
  89895. };
  89896. _proto.disable = function disable() {
  89897. _Slider.prototype.disable.call(this);
  89898. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89899. if (!mouseTimeDisplay) {
  89900. return;
  89901. }
  89902. mouseTimeDisplay.hide();
  89903. };
  89904. _proto.handleMouseUp = function handleMouseUp(event2) {
  89905. _Slider.prototype.handleMouseUp.call(this, event2);
  89906. if (event2) {
  89907. event2.stopPropagation();
  89908. }
  89909. this.player_.scrubbing(false);
  89910. this.player_.trigger({
  89911. type: "timeupdate",
  89912. target: this,
  89913. manuallyTriggered: true
  89914. });
  89915. if (this.videoWasPlaying) {
  89916. silencePromise(this.player_.play());
  89917. } else {
  89918. this.update_();
  89919. }
  89920. };
  89921. _proto.stepForward = function stepForward() {
  89922. this.userSeek_(this.player_.currentTime() + STEP_SECONDS);
  89923. };
  89924. _proto.stepBack = function stepBack() {
  89925. this.userSeek_(this.player_.currentTime() - STEP_SECONDS);
  89926. };
  89927. _proto.handleAction = function handleAction(event2) {
  89928. if (this.player_.paused()) {
  89929. this.player_.play();
  89930. } else {
  89931. this.player_.pause();
  89932. }
  89933. };
  89934. _proto.handleKeyDown = function handleKeyDown(event2) {
  89935. var liveTracker = this.player_.liveTracker;
  89936. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  89937. event2.preventDefault();
  89938. event2.stopPropagation();
  89939. this.handleAction(event2);
  89940. } else if (keycode.isEventKey(event2, "Home")) {
  89941. event2.preventDefault();
  89942. event2.stopPropagation();
  89943. this.userSeek_(0);
  89944. } else if (keycode.isEventKey(event2, "End")) {
  89945. event2.preventDefault();
  89946. event2.stopPropagation();
  89947. if (liveTracker && liveTracker.isLive()) {
  89948. this.userSeek_(liveTracker.liveCurrentTime());
  89949. } else {
  89950. this.userSeek_(this.player_.duration());
  89951. }
  89952. } else if (/^[0-9]$/.test(keycode(event2))) {
  89953. event2.preventDefault();
  89954. event2.stopPropagation();
  89955. var gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  89956. if (liveTracker && liveTracker.isLive()) {
  89957. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  89958. } else {
  89959. this.userSeek_(this.player_.duration() * gotoFraction);
  89960. }
  89961. } else if (keycode.isEventKey(event2, "PgDn")) {
  89962. event2.preventDefault();
  89963. event2.stopPropagation();
  89964. this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89965. } else if (keycode.isEventKey(event2, "PgUp")) {
  89966. event2.preventDefault();
  89967. event2.stopPropagation();
  89968. this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89969. } else {
  89970. _Slider.prototype.handleKeyDown.call(this, event2);
  89971. }
  89972. };
  89973. _proto.dispose = function dispose() {
  89974. this.disableInterval_();
  89975. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89976. if (this.player_.liveTracker) {
  89977. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  89978. }
  89979. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  89980. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89981. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89982. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  89983. }
  89984. _Slider.prototype.dispose.call(this);
  89985. };
  89986. return SeekBar2;
  89987. }(Slider);
  89988. SeekBar.prototype.options_ = {
  89989. children: ["loadProgressBar", "playProgressBar"],
  89990. barName: "playProgressBar"
  89991. };
  89992. if (!IS_IOS && !IS_ANDROID) {
  89993. SeekBar.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  89994. }
  89995. Component$1.registerComponent("SeekBar", SeekBar);
  89996. var ProgressControl = /* @__PURE__ */ function(_Component) {
  89997. _inheritsLoose(ProgressControl2, _Component);
  89998. function ProgressControl2(player, options2) {
  89999. var _this;
  90000. _this = _Component.call(this, player, options2) || this;
  90001. _this.handleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  90002. _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_this), _this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);
  90003. _this.handleMouseUpHandler_ = function(e) {
  90004. return _this.handleMouseUp(e);
  90005. };
  90006. _this.handleMouseDownHandler_ = function(e) {
  90007. return _this.handleMouseDown(e);
  90008. };
  90009. _this.enable();
  90010. return _this;
  90011. }
  90012. var _proto = ProgressControl2.prototype;
  90013. _proto.createEl = function createEl2() {
  90014. return _Component.prototype.createEl.call(this, "div", {
  90015. className: "vjs-progress-control vjs-control"
  90016. });
  90017. };
  90018. _proto.handleMouseMove = function handleMouseMove(event2) {
  90019. var seekBar = this.getChild("seekBar");
  90020. if (!seekBar) {
  90021. return;
  90022. }
  90023. var playProgressBar = seekBar.getChild("playProgressBar");
  90024. var mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  90025. if (!playProgressBar && !mouseTimeDisplay) {
  90026. return;
  90027. }
  90028. var seekBarEl = seekBar.el();
  90029. var seekBarRect = findPosition(seekBarEl);
  90030. var seekBarPoint = getPointerPosition(seekBarEl, event2).x;
  90031. seekBarPoint = clamp(seekBarPoint, 0, 1);
  90032. if (mouseTimeDisplay) {
  90033. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  90034. }
  90035. if (playProgressBar) {
  90036. playProgressBar.update(seekBarRect, seekBar.getProgress());
  90037. }
  90038. };
  90039. _proto.handleMouseSeek = function handleMouseSeek(event2) {
  90040. var seekBar = this.getChild("seekBar");
  90041. if (seekBar) {
  90042. seekBar.handleMouseMove(event2);
  90043. }
  90044. };
  90045. _proto.enabled = function enabled() {
  90046. return this.enabled_;
  90047. };
  90048. _proto.disable = function disable() {
  90049. this.children().forEach(function(child) {
  90050. return child.disable && child.disable();
  90051. });
  90052. if (!this.enabled()) {
  90053. return;
  90054. }
  90055. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  90056. this.off(this.el_, "mousemove", this.handleMouseMove);
  90057. this.removeListenersAddedOnMousedownAndTouchstart();
  90058. this.addClass("disabled");
  90059. this.enabled_ = false;
  90060. if (this.player_.scrubbing()) {
  90061. var seekBar = this.getChild("seekBar");
  90062. this.player_.scrubbing(false);
  90063. if (seekBar.videoWasPlaying) {
  90064. silencePromise(this.player_.play());
  90065. }
  90066. }
  90067. };
  90068. _proto.enable = function enable() {
  90069. this.children().forEach(function(child) {
  90070. return child.enable && child.enable();
  90071. });
  90072. if (this.enabled()) {
  90073. return;
  90074. }
  90075. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  90076. this.on(this.el_, "mousemove", this.handleMouseMove);
  90077. this.removeClass("disabled");
  90078. this.enabled_ = true;
  90079. };
  90080. _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() {
  90081. var doc = this.el_.ownerDocument;
  90082. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  90083. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  90084. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90085. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90086. };
  90087. _proto.handleMouseDown = function handleMouseDown(event2) {
  90088. var doc = this.el_.ownerDocument;
  90089. var seekBar = this.getChild("seekBar");
  90090. if (seekBar) {
  90091. seekBar.handleMouseDown(event2);
  90092. }
  90093. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  90094. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  90095. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90096. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90097. };
  90098. _proto.handleMouseUp = function handleMouseUp(event2) {
  90099. var seekBar = this.getChild("seekBar");
  90100. if (seekBar) {
  90101. seekBar.handleMouseUp(event2);
  90102. }
  90103. this.removeListenersAddedOnMousedownAndTouchstart();
  90104. };
  90105. return ProgressControl2;
  90106. }(Component$1);
  90107. ProgressControl.prototype.options_ = {
  90108. children: ["seekBar"]
  90109. };
  90110. Component$1.registerComponent("ProgressControl", ProgressControl);
  90111. var PictureInPictureToggle = /* @__PURE__ */ function(_Button) {
  90112. _inheritsLoose(PictureInPictureToggle2, _Button);
  90113. function PictureInPictureToggle2(player, options2) {
  90114. var _this;
  90115. _this = _Button.call(this, player, options2) || this;
  90116. _this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], function(e) {
  90117. return _this.handlePictureInPictureChange(e);
  90118. });
  90119. _this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], function(e) {
  90120. return _this.handlePictureInPictureEnabledChange(e);
  90121. });
  90122. _this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], function() {
  90123. var isSourceAudio = player.currentType().substring(0, 5) === "audio";
  90124. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  90125. if (player.isInPictureInPicture()) {
  90126. player.exitPictureInPicture();
  90127. }
  90128. _this.hide();
  90129. } else {
  90130. _this.show();
  90131. }
  90132. });
  90133. _this.disable();
  90134. return _this;
  90135. }
  90136. var _proto = PictureInPictureToggle2.prototype;
  90137. _proto.buildCSSClass = function buildCSSClass() {
  90138. return "vjs-picture-in-picture-control " + _Button.prototype.buildCSSClass.call(this);
  90139. };
  90140. _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() {
  90141. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false) {
  90142. this.enable();
  90143. } else {
  90144. this.disable();
  90145. }
  90146. };
  90147. _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event2) {
  90148. if (this.player_.isInPictureInPicture()) {
  90149. this.controlText("Exit Picture-in-Picture");
  90150. } else {
  90151. this.controlText("Picture-in-Picture");
  90152. }
  90153. this.handlePictureInPictureEnabledChange();
  90154. };
  90155. _proto.handleClick = function handleClick(event2) {
  90156. if (!this.player_.isInPictureInPicture()) {
  90157. this.player_.requestPictureInPicture();
  90158. } else {
  90159. this.player_.exitPictureInPicture();
  90160. }
  90161. };
  90162. return PictureInPictureToggle2;
  90163. }(Button);
  90164. PictureInPictureToggle.prototype.controlText_ = "Picture-in-Picture";
  90165. Component$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle);
  90166. var FullscreenToggle = /* @__PURE__ */ function(_Button) {
  90167. _inheritsLoose(FullscreenToggle2, _Button);
  90168. function FullscreenToggle2(player, options2) {
  90169. var _this;
  90170. _this = _Button.call(this, player, options2) || this;
  90171. _this.on(player, "fullscreenchange", function(e) {
  90172. return _this.handleFullscreenChange(e);
  90173. });
  90174. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  90175. _this.disable();
  90176. }
  90177. return _this;
  90178. }
  90179. var _proto = FullscreenToggle2.prototype;
  90180. _proto.buildCSSClass = function buildCSSClass() {
  90181. return "vjs-fullscreen-control " + _Button.prototype.buildCSSClass.call(this);
  90182. };
  90183. _proto.handleFullscreenChange = function handleFullscreenChange(event2) {
  90184. if (this.player_.isFullscreen()) {
  90185. this.controlText("Non-Fullscreen");
  90186. } else {
  90187. this.controlText("Fullscreen");
  90188. }
  90189. };
  90190. _proto.handleClick = function handleClick(event2) {
  90191. if (!this.player_.isFullscreen()) {
  90192. this.player_.requestFullscreen();
  90193. } else {
  90194. this.player_.exitFullscreen();
  90195. }
  90196. };
  90197. return FullscreenToggle2;
  90198. }(Button);
  90199. FullscreenToggle.prototype.controlText_ = "Fullscreen";
  90200. Component$1.registerComponent("FullscreenToggle", FullscreenToggle);
  90201. var checkVolumeSupport = function checkVolumeSupport2(self2, player) {
  90202. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  90203. self2.addClass("vjs-hidden");
  90204. }
  90205. self2.on(player, "loadstart", function() {
  90206. if (!player.tech_.featuresVolumeControl) {
  90207. self2.addClass("vjs-hidden");
  90208. } else {
  90209. self2.removeClass("vjs-hidden");
  90210. }
  90211. });
  90212. };
  90213. var VolumeLevel = /* @__PURE__ */ function(_Component) {
  90214. _inheritsLoose(VolumeLevel2, _Component);
  90215. function VolumeLevel2() {
  90216. return _Component.apply(this, arguments) || this;
  90217. }
  90218. var _proto = VolumeLevel2.prototype;
  90219. _proto.createEl = function createEl2() {
  90220. var el = _Component.prototype.createEl.call(this, "div", {
  90221. className: "vjs-volume-level"
  90222. });
  90223. el.appendChild(_Component.prototype.createEl.call(this, "span", {
  90224. className: "vjs-control-text"
  90225. }));
  90226. return el;
  90227. };
  90228. return VolumeLevel2;
  90229. }(Component$1);
  90230. Component$1.registerComponent("VolumeLevel", VolumeLevel);
  90231. var VolumeLevelTooltip = /* @__PURE__ */ function(_Component) {
  90232. _inheritsLoose(VolumeLevelTooltip2, _Component);
  90233. function VolumeLevelTooltip2(player, options2) {
  90234. var _this;
  90235. _this = _Component.call(this, player, options2) || this;
  90236. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90237. return _this;
  90238. }
  90239. var _proto = VolumeLevelTooltip2.prototype;
  90240. _proto.createEl = function createEl2() {
  90241. return _Component.prototype.createEl.call(this, "div", {
  90242. className: "vjs-volume-tooltip"
  90243. }, {
  90244. "aria-hidden": "true"
  90245. });
  90246. };
  90247. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) {
  90248. if (!vertical) {
  90249. var tooltipRect = getBoundingClientRect(this.el_);
  90250. var playerRect = getBoundingClientRect(this.player_.el());
  90251. var volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  90252. if (!playerRect || !tooltipRect) {
  90253. return;
  90254. }
  90255. var spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  90256. var spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  90257. var pullTooltipBy = tooltipRect.width / 2;
  90258. if (spaceLeftOfPoint < pullTooltipBy) {
  90259. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  90260. } else if (spaceRightOfPoint < pullTooltipBy) {
  90261. pullTooltipBy = spaceRightOfPoint;
  90262. }
  90263. if (pullTooltipBy < 0) {
  90264. pullTooltipBy = 0;
  90265. } else if (pullTooltipBy > tooltipRect.width) {
  90266. pullTooltipBy = tooltipRect.width;
  90267. }
  90268. this.el_.style.right = "-" + pullTooltipBy + "px";
  90269. }
  90270. this.write(content + "%");
  90271. };
  90272. _proto.write = function write(content) {
  90273. textContent(this.el_, content);
  90274. };
  90275. _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  90276. var _this2 = this;
  90277. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", function() {
  90278. _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  90279. if (cb) {
  90280. cb();
  90281. }
  90282. });
  90283. };
  90284. return VolumeLevelTooltip2;
  90285. }(Component$1);
  90286. Component$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip);
  90287. var MouseVolumeLevelDisplay = /* @__PURE__ */ function(_Component) {
  90288. _inheritsLoose(MouseVolumeLevelDisplay2, _Component);
  90289. function MouseVolumeLevelDisplay2(player, options2) {
  90290. var _this;
  90291. _this = _Component.call(this, player, options2) || this;
  90292. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90293. return _this;
  90294. }
  90295. var _proto = MouseVolumeLevelDisplay2.prototype;
  90296. _proto.createEl = function createEl2() {
  90297. return _Component.prototype.createEl.call(this, "div", {
  90298. className: "vjs-mouse-display"
  90299. });
  90300. };
  90301. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) {
  90302. var _this2 = this;
  90303. var volume = 100 * rangeBarPoint;
  90304. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function() {
  90305. if (vertical) {
  90306. _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + "px";
  90307. } else {
  90308. _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + "px";
  90309. }
  90310. });
  90311. };
  90312. return MouseVolumeLevelDisplay2;
  90313. }(Component$1);
  90314. MouseVolumeLevelDisplay.prototype.options_ = {
  90315. children: ["volumeLevelTooltip"]
  90316. };
  90317. Component$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay);
  90318. var VolumeBar = /* @__PURE__ */ function(_Slider) {
  90319. _inheritsLoose(VolumeBar2, _Slider);
  90320. function VolumeBar2(player, options2) {
  90321. var _this;
  90322. _this = _Slider.call(this, player, options2) || this;
  90323. _this.on("slideractive", function(e) {
  90324. return _this.updateLastVolume_(e);
  90325. });
  90326. _this.on(player, "volumechange", function(e) {
  90327. return _this.updateARIAAttributes(e);
  90328. });
  90329. player.ready(function() {
  90330. return _this.updateARIAAttributes();
  90331. });
  90332. return _this;
  90333. }
  90334. var _proto = VolumeBar2.prototype;
  90335. _proto.createEl = function createEl2() {
  90336. return _Slider.prototype.createEl.call(this, "div", {
  90337. className: "vjs-volume-bar vjs-slider-bar"
  90338. }, {
  90339. "aria-label": this.localize("Volume Level"),
  90340. "aria-live": "polite"
  90341. });
  90342. };
  90343. _proto.handleMouseDown = function handleMouseDown(event2) {
  90344. if (!isSingleLeftClick(event2)) {
  90345. return;
  90346. }
  90347. _Slider.prototype.handleMouseDown.call(this, event2);
  90348. };
  90349. _proto.handleMouseMove = function handleMouseMove(event2) {
  90350. var mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  90351. if (mouseVolumeLevelDisplay) {
  90352. var volumeBarEl = this.el();
  90353. var volumeBarRect = getBoundingClientRect(volumeBarEl);
  90354. var vertical = this.vertical();
  90355. var volumeBarPoint = getPointerPosition(volumeBarEl, event2);
  90356. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  90357. volumeBarPoint = clamp(volumeBarPoint, 0, 1);
  90358. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  90359. }
  90360. if (!isSingleLeftClick(event2)) {
  90361. return;
  90362. }
  90363. this.checkMuted();
  90364. this.player_.volume(this.calculateDistance(event2));
  90365. };
  90366. _proto.checkMuted = function checkMuted() {
  90367. if (this.player_.muted()) {
  90368. this.player_.muted(false);
  90369. }
  90370. };
  90371. _proto.getPercent = function getPercent() {
  90372. if (this.player_.muted()) {
  90373. return 0;
  90374. }
  90375. return this.player_.volume();
  90376. };
  90377. _proto.stepForward = function stepForward() {
  90378. this.checkMuted();
  90379. this.player_.volume(this.player_.volume() + 0.1);
  90380. };
  90381. _proto.stepBack = function stepBack() {
  90382. this.checkMuted();
  90383. this.player_.volume(this.player_.volume() - 0.1);
  90384. };
  90385. _proto.updateARIAAttributes = function updateARIAAttributes(event2) {
  90386. var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  90387. this.el_.setAttribute("aria-valuenow", ariaValue);
  90388. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  90389. };
  90390. _proto.volumeAsPercentage_ = function volumeAsPercentage_() {
  90391. return Math.round(this.player_.volume() * 100);
  90392. };
  90393. _proto.updateLastVolume_ = function updateLastVolume_() {
  90394. var _this2 = this;
  90395. var volumeBeforeDrag = this.player_.volume();
  90396. this.one("sliderinactive", function() {
  90397. if (_this2.player_.volume() === 0) {
  90398. _this2.player_.lastVolume_(volumeBeforeDrag);
  90399. }
  90400. });
  90401. };
  90402. return VolumeBar2;
  90403. }(Slider);
  90404. VolumeBar.prototype.options_ = {
  90405. children: ["volumeLevel"],
  90406. barName: "volumeLevel"
  90407. };
  90408. if (!IS_IOS && !IS_ANDROID) {
  90409. VolumeBar.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  90410. }
  90411. VolumeBar.prototype.playerEvent = "volumechange";
  90412. Component$1.registerComponent("VolumeBar", VolumeBar);
  90413. var VolumeControl = /* @__PURE__ */ function(_Component) {
  90414. _inheritsLoose(VolumeControl2, _Component);
  90415. function VolumeControl2(player, options2) {
  90416. var _this;
  90417. if (options2 === void 0) {
  90418. options2 = {};
  90419. }
  90420. options2.vertical = options2.vertical || false;
  90421. if (typeof options2.volumeBar === "undefined" || isPlain(options2.volumeBar)) {
  90422. options2.volumeBar = options2.volumeBar || {};
  90423. options2.volumeBar.vertical = options2.vertical;
  90424. }
  90425. _this = _Component.call(this, player, options2) || this;
  90426. checkVolumeSupport(_assertThisInitialized(_this), player);
  90427. _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  90428. _this.handleMouseUpHandler_ = function(e) {
  90429. return _this.handleMouseUp(e);
  90430. };
  90431. _this.on("mousedown", function(e) {
  90432. return _this.handleMouseDown(e);
  90433. });
  90434. _this.on("touchstart", function(e) {
  90435. return _this.handleMouseDown(e);
  90436. });
  90437. _this.on("mousemove", function(e) {
  90438. return _this.handleMouseMove(e);
  90439. });
  90440. _this.on(_this.volumeBar, ["focus", "slideractive"], function() {
  90441. _this.volumeBar.addClass("vjs-slider-active");
  90442. _this.addClass("vjs-slider-active");
  90443. _this.trigger("slideractive");
  90444. });
  90445. _this.on(_this.volumeBar, ["blur", "sliderinactive"], function() {
  90446. _this.volumeBar.removeClass("vjs-slider-active");
  90447. _this.removeClass("vjs-slider-active");
  90448. _this.trigger("sliderinactive");
  90449. });
  90450. return _this;
  90451. }
  90452. var _proto = VolumeControl2.prototype;
  90453. _proto.createEl = function createEl2() {
  90454. var orientationClass = "vjs-volume-horizontal";
  90455. if (this.options_.vertical) {
  90456. orientationClass = "vjs-volume-vertical";
  90457. }
  90458. return _Component.prototype.createEl.call(this, "div", {
  90459. className: "vjs-volume-control vjs-control " + orientationClass
  90460. });
  90461. };
  90462. _proto.handleMouseDown = function handleMouseDown(event2) {
  90463. var doc = this.el_.ownerDocument;
  90464. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  90465. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  90466. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90467. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90468. };
  90469. _proto.handleMouseUp = function handleMouseUp(event2) {
  90470. var doc = this.el_.ownerDocument;
  90471. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  90472. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  90473. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90474. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90475. };
  90476. _proto.handleMouseMove = function handleMouseMove(event2) {
  90477. this.volumeBar.handleMouseMove(event2);
  90478. };
  90479. return VolumeControl2;
  90480. }(Component$1);
  90481. VolumeControl.prototype.options_ = {
  90482. children: ["volumeBar"]
  90483. };
  90484. Component$1.registerComponent("VolumeControl", VolumeControl);
  90485. var checkMuteSupport = function checkMuteSupport2(self2, player) {
  90486. if (player.tech_ && !player.tech_.featuresMuteControl) {
  90487. self2.addClass("vjs-hidden");
  90488. }
  90489. self2.on(player, "loadstart", function() {
  90490. if (!player.tech_.featuresMuteControl) {
  90491. self2.addClass("vjs-hidden");
  90492. } else {
  90493. self2.removeClass("vjs-hidden");
  90494. }
  90495. });
  90496. };
  90497. var MuteToggle = /* @__PURE__ */ function(_Button) {
  90498. _inheritsLoose(MuteToggle2, _Button);
  90499. function MuteToggle2(player, options2) {
  90500. var _this;
  90501. _this = _Button.call(this, player, options2) || this;
  90502. checkMuteSupport(_assertThisInitialized(_this), player);
  90503. _this.on(player, ["loadstart", "volumechange"], function(e) {
  90504. return _this.update(e);
  90505. });
  90506. return _this;
  90507. }
  90508. var _proto = MuteToggle2.prototype;
  90509. _proto.buildCSSClass = function buildCSSClass() {
  90510. return "vjs-mute-control " + _Button.prototype.buildCSSClass.call(this);
  90511. };
  90512. _proto.handleClick = function handleClick(event2) {
  90513. var vol = this.player_.volume();
  90514. var lastVolume = this.player_.lastVolume_();
  90515. if (vol === 0) {
  90516. var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  90517. this.player_.volume(volumeToSet);
  90518. this.player_.muted(false);
  90519. } else {
  90520. this.player_.muted(this.player_.muted() ? false : true);
  90521. }
  90522. };
  90523. _proto.update = function update(event2) {
  90524. this.updateIcon_();
  90525. this.updateControlText_();
  90526. };
  90527. _proto.updateIcon_ = function updateIcon_() {
  90528. var vol = this.player_.volume();
  90529. var level = 3;
  90530. if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {
  90531. this.player_.muted(this.player_.tech_.el_.muted);
  90532. }
  90533. if (vol === 0 || this.player_.muted()) {
  90534. level = 0;
  90535. } else if (vol < 0.33) {
  90536. level = 1;
  90537. } else if (vol < 0.67) {
  90538. level = 2;
  90539. }
  90540. for (var i2 = 0; i2 < 4; i2++) {
  90541. removeClass(this.el_, "vjs-vol-" + i2);
  90542. }
  90543. addClass(this.el_, "vjs-vol-" + level);
  90544. };
  90545. _proto.updateControlText_ = function updateControlText_() {
  90546. var soundOff = this.player_.muted() || this.player_.volume() === 0;
  90547. var text = soundOff ? "Unmute" : "Mute";
  90548. if (this.controlText() !== text) {
  90549. this.controlText(text);
  90550. }
  90551. };
  90552. return MuteToggle2;
  90553. }(Button);
  90554. MuteToggle.prototype.controlText_ = "Mute";
  90555. Component$1.registerComponent("MuteToggle", MuteToggle);
  90556. var VolumePanel = /* @__PURE__ */ function(_Component) {
  90557. _inheritsLoose(VolumePanel2, _Component);
  90558. function VolumePanel2(player, options2) {
  90559. var _this;
  90560. if (options2 === void 0) {
  90561. options2 = {};
  90562. }
  90563. if (typeof options2.inline !== "undefined") {
  90564. options2.inline = options2.inline;
  90565. } else {
  90566. options2.inline = true;
  90567. }
  90568. if (typeof options2.volumeControl === "undefined" || isPlain(options2.volumeControl)) {
  90569. options2.volumeControl = options2.volumeControl || {};
  90570. options2.volumeControl.vertical = !options2.inline;
  90571. }
  90572. _this = _Component.call(this, player, options2) || this;
  90573. _this.handleKeyPressHandler_ = function(e) {
  90574. return _this.handleKeyPress(e);
  90575. };
  90576. _this.on(player, ["loadstart"], function(e) {
  90577. return _this.volumePanelState_(e);
  90578. });
  90579. _this.on(_this.muteToggle, "keyup", function(e) {
  90580. return _this.handleKeyPress(e);
  90581. });
  90582. _this.on(_this.volumeControl, "keyup", function(e) {
  90583. return _this.handleVolumeControlKeyUp(e);
  90584. });
  90585. _this.on("keydown", function(e) {
  90586. return _this.handleKeyPress(e);
  90587. });
  90588. _this.on("mouseover", function(e) {
  90589. return _this.handleMouseOver(e);
  90590. });
  90591. _this.on("mouseout", function(e) {
  90592. return _this.handleMouseOut(e);
  90593. });
  90594. _this.on(_this.volumeControl, ["slideractive"], _this.sliderActive_);
  90595. _this.on(_this.volumeControl, ["sliderinactive"], _this.sliderInactive_);
  90596. return _this;
  90597. }
  90598. var _proto = VolumePanel2.prototype;
  90599. _proto.sliderActive_ = function sliderActive_() {
  90600. this.addClass("vjs-slider-active");
  90601. };
  90602. _proto.sliderInactive_ = function sliderInactive_() {
  90603. this.removeClass("vjs-slider-active");
  90604. };
  90605. _proto.volumePanelState_ = function volumePanelState_() {
  90606. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  90607. this.addClass("vjs-hidden");
  90608. }
  90609. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  90610. this.addClass("vjs-mute-toggle-only");
  90611. }
  90612. };
  90613. _proto.createEl = function createEl2() {
  90614. var orientationClass = "vjs-volume-panel-horizontal";
  90615. if (!this.options_.inline) {
  90616. orientationClass = "vjs-volume-panel-vertical";
  90617. }
  90618. return _Component.prototype.createEl.call(this, "div", {
  90619. className: "vjs-volume-panel vjs-control " + orientationClass
  90620. });
  90621. };
  90622. _proto.dispose = function dispose() {
  90623. this.handleMouseOut();
  90624. _Component.prototype.dispose.call(this);
  90625. };
  90626. _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event2) {
  90627. if (keycode.isEventKey(event2, "Esc")) {
  90628. this.muteToggle.focus();
  90629. }
  90630. };
  90631. _proto.handleMouseOver = function handleMouseOver(event2) {
  90632. this.addClass("vjs-hover");
  90633. on(document_1, "keyup", this.handleKeyPressHandler_);
  90634. };
  90635. _proto.handleMouseOut = function handleMouseOut(event2) {
  90636. this.removeClass("vjs-hover");
  90637. off(document_1, "keyup", this.handleKeyPressHandler_);
  90638. };
  90639. _proto.handleKeyPress = function handleKeyPress(event2) {
  90640. if (keycode.isEventKey(event2, "Esc")) {
  90641. this.handleMouseOut();
  90642. }
  90643. };
  90644. return VolumePanel2;
  90645. }(Component$1);
  90646. VolumePanel.prototype.options_ = {
  90647. children: ["muteToggle", "volumeControl"]
  90648. };
  90649. Component$1.registerComponent("VolumePanel", VolumePanel);
  90650. var Menu = /* @__PURE__ */ function(_Component) {
  90651. _inheritsLoose(Menu2, _Component);
  90652. function Menu2(player, options2) {
  90653. var _this;
  90654. _this = _Component.call(this, player, options2) || this;
  90655. if (options2) {
  90656. _this.menuButton_ = options2.menuButton;
  90657. }
  90658. _this.focusedChild_ = -1;
  90659. _this.on("keydown", function(e) {
  90660. return _this.handleKeyDown(e);
  90661. });
  90662. _this.boundHandleBlur_ = function(e) {
  90663. return _this.handleBlur(e);
  90664. };
  90665. _this.boundHandleTapClick_ = function(e) {
  90666. return _this.handleTapClick(e);
  90667. };
  90668. return _this;
  90669. }
  90670. var _proto = Menu2.prototype;
  90671. _proto.addEventListenerForItem = function addEventListenerForItem(component) {
  90672. if (!(component instanceof Component$1)) {
  90673. return;
  90674. }
  90675. this.on(component, "blur", this.boundHandleBlur_);
  90676. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  90677. };
  90678. _proto.removeEventListenerForItem = function removeEventListenerForItem(component) {
  90679. if (!(component instanceof Component$1)) {
  90680. return;
  90681. }
  90682. this.off(component, "blur", this.boundHandleBlur_);
  90683. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  90684. };
  90685. _proto.removeChild = function removeChild(component) {
  90686. if (typeof component === "string") {
  90687. component = this.getChild(component);
  90688. }
  90689. this.removeEventListenerForItem(component);
  90690. _Component.prototype.removeChild.call(this, component);
  90691. };
  90692. _proto.addItem = function addItem(component) {
  90693. var childComponent = this.addChild(component);
  90694. if (childComponent) {
  90695. this.addEventListenerForItem(childComponent);
  90696. }
  90697. };
  90698. _proto.createEl = function createEl$12() {
  90699. var contentElType = this.options_.contentElType || "ul";
  90700. this.contentEl_ = createEl(contentElType, {
  90701. className: "vjs-menu-content"
  90702. });
  90703. this.contentEl_.setAttribute("role", "menu");
  90704. var el = _Component.prototype.createEl.call(this, "div", {
  90705. append: this.contentEl_,
  90706. className: "vjs-menu"
  90707. });
  90708. el.appendChild(this.contentEl_);
  90709. on(el, "click", function(event2) {
  90710. event2.preventDefault();
  90711. event2.stopImmediatePropagation();
  90712. });
  90713. return el;
  90714. };
  90715. _proto.dispose = function dispose() {
  90716. this.contentEl_ = null;
  90717. this.boundHandleBlur_ = null;
  90718. this.boundHandleTapClick_ = null;
  90719. _Component.prototype.dispose.call(this);
  90720. };
  90721. _proto.handleBlur = function handleBlur(event2) {
  90722. var relatedTarget = event2.relatedTarget || document_1.activeElement;
  90723. if (!this.children().some(function(element) {
  90724. return element.el() === relatedTarget;
  90725. })) {
  90726. var btn = this.menuButton_;
  90727. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  90728. btn.unpressButton();
  90729. }
  90730. }
  90731. };
  90732. _proto.handleTapClick = function handleTapClick(event2) {
  90733. if (this.menuButton_) {
  90734. this.menuButton_.unpressButton();
  90735. var childComponents = this.children();
  90736. if (!Array.isArray(childComponents)) {
  90737. return;
  90738. }
  90739. var foundComponent = childComponents.filter(function(component) {
  90740. return component.el() === event2.target;
  90741. })[0];
  90742. if (!foundComponent) {
  90743. return;
  90744. }
  90745. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  90746. this.menuButton_.focus();
  90747. }
  90748. }
  90749. };
  90750. _proto.handleKeyDown = function handleKeyDown(event2) {
  90751. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  90752. event2.preventDefault();
  90753. event2.stopPropagation();
  90754. this.stepForward();
  90755. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  90756. event2.preventDefault();
  90757. event2.stopPropagation();
  90758. this.stepBack();
  90759. }
  90760. };
  90761. _proto.stepForward = function stepForward() {
  90762. var stepChild = 0;
  90763. if (this.focusedChild_ !== void 0) {
  90764. stepChild = this.focusedChild_ + 1;
  90765. }
  90766. this.focus(stepChild);
  90767. };
  90768. _proto.stepBack = function stepBack() {
  90769. var stepChild = 0;
  90770. if (this.focusedChild_ !== void 0) {
  90771. stepChild = this.focusedChild_ - 1;
  90772. }
  90773. this.focus(stepChild);
  90774. };
  90775. _proto.focus = function focus(item) {
  90776. if (item === void 0) {
  90777. item = 0;
  90778. }
  90779. var children = this.children().slice();
  90780. var haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  90781. if (haveTitle) {
  90782. children.shift();
  90783. }
  90784. if (children.length > 0) {
  90785. if (item < 0) {
  90786. item = 0;
  90787. } else if (item >= children.length) {
  90788. item = children.length - 1;
  90789. }
  90790. this.focusedChild_ = item;
  90791. children[item].el_.focus();
  90792. }
  90793. };
  90794. return Menu2;
  90795. }(Component$1);
  90796. Component$1.registerComponent("Menu", Menu);
  90797. var MenuButton = /* @__PURE__ */ function(_Component) {
  90798. _inheritsLoose(MenuButton2, _Component);
  90799. function MenuButton2(player, options2) {
  90800. var _this;
  90801. if (options2 === void 0) {
  90802. options2 = {};
  90803. }
  90804. _this = _Component.call(this, player, options2) || this;
  90805. _this.menuButton_ = new Button(player, options2);
  90806. _this.menuButton_.controlText(_this.controlText_);
  90807. _this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  90808. var buttonClass = Button.prototype.buildCSSClass();
  90809. _this.menuButton_.el_.className = _this.buildCSSClass() + " " + buttonClass;
  90810. _this.menuButton_.removeClass("vjs-control");
  90811. _this.addChild(_this.menuButton_);
  90812. _this.update();
  90813. _this.enabled_ = true;
  90814. var handleClick = function handleClick2(e) {
  90815. return _this.handleClick(e);
  90816. };
  90817. _this.handleMenuKeyUp_ = function(e) {
  90818. return _this.handleMenuKeyUp(e);
  90819. };
  90820. _this.on(_this.menuButton_, "tap", handleClick);
  90821. _this.on(_this.menuButton_, "click", handleClick);
  90822. _this.on(_this.menuButton_, "keydown", function(e) {
  90823. return _this.handleKeyDown(e);
  90824. });
  90825. _this.on(_this.menuButton_, "mouseenter", function() {
  90826. _this.addClass("vjs-hover");
  90827. _this.menu.show();
  90828. on(document_1, "keyup", _this.handleMenuKeyUp_);
  90829. });
  90830. _this.on("mouseleave", function(e) {
  90831. return _this.handleMouseLeave(e);
  90832. });
  90833. _this.on("keydown", function(e) {
  90834. return _this.handleSubmenuKeyDown(e);
  90835. });
  90836. return _this;
  90837. }
  90838. var _proto = MenuButton2.prototype;
  90839. _proto.update = function update() {
  90840. var menu = this.createMenu();
  90841. if (this.menu) {
  90842. this.menu.dispose();
  90843. this.removeChild(this.menu);
  90844. }
  90845. this.menu = menu;
  90846. this.addChild(menu);
  90847. this.buttonPressed_ = false;
  90848. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90849. if (this.items && this.items.length <= this.hideThreshold_) {
  90850. this.hide();
  90851. this.menu.contentEl_.removeAttribute("role");
  90852. } else {
  90853. this.show();
  90854. this.menu.contentEl_.setAttribute("role", "menu");
  90855. }
  90856. };
  90857. _proto.createMenu = function createMenu() {
  90858. var menu = new Menu(this.player_, {
  90859. menuButton: this
  90860. });
  90861. this.hideThreshold_ = 0;
  90862. if (this.options_.title) {
  90863. var titleEl = createEl("li", {
  90864. className: "vjs-menu-title",
  90865. textContent: toTitleCase$1(this.options_.title),
  90866. tabIndex: -1
  90867. });
  90868. var titleComponent = new Component$1(this.player_, {
  90869. el: titleEl
  90870. });
  90871. menu.addItem(titleComponent);
  90872. }
  90873. this.items = this.createItems();
  90874. if (this.items) {
  90875. for (var i2 = 0; i2 < this.items.length; i2++) {
  90876. menu.addItem(this.items[i2]);
  90877. }
  90878. }
  90879. return menu;
  90880. };
  90881. _proto.createItems = function createItems() {
  90882. };
  90883. _proto.createEl = function createEl2() {
  90884. return _Component.prototype.createEl.call(this, "div", {
  90885. className: this.buildWrapperCSSClass()
  90886. }, {});
  90887. };
  90888. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  90889. var menuButtonClass = "vjs-menu-button";
  90890. if (this.options_.inline === true) {
  90891. menuButtonClass += "-inline";
  90892. } else {
  90893. menuButtonClass += "-popup";
  90894. }
  90895. var buttonClass = Button.prototype.buildCSSClass();
  90896. return "vjs-menu-button " + menuButtonClass + " " + buttonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90897. };
  90898. _proto.buildCSSClass = function buildCSSClass() {
  90899. var menuButtonClass = "vjs-menu-button";
  90900. if (this.options_.inline === true) {
  90901. menuButtonClass += "-inline";
  90902. } else {
  90903. menuButtonClass += "-popup";
  90904. }
  90905. return "vjs-menu-button " + menuButtonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90906. };
  90907. _proto.controlText = function controlText(text, el) {
  90908. if (el === void 0) {
  90909. el = this.menuButton_.el();
  90910. }
  90911. return this.menuButton_.controlText(text, el);
  90912. };
  90913. _proto.dispose = function dispose() {
  90914. this.handleMouseLeave();
  90915. _Component.prototype.dispose.call(this);
  90916. };
  90917. _proto.handleClick = function handleClick(event2) {
  90918. if (this.buttonPressed_) {
  90919. this.unpressButton();
  90920. } else {
  90921. this.pressButton();
  90922. }
  90923. };
  90924. _proto.handleMouseLeave = function handleMouseLeave(event2) {
  90925. this.removeClass("vjs-hover");
  90926. off(document_1, "keyup", this.handleMenuKeyUp_);
  90927. };
  90928. _proto.focus = function focus() {
  90929. this.menuButton_.focus();
  90930. };
  90931. _proto.blur = function blur() {
  90932. this.menuButton_.blur();
  90933. };
  90934. _proto.handleKeyDown = function handleKeyDown(event2) {
  90935. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90936. if (this.buttonPressed_) {
  90937. this.unpressButton();
  90938. }
  90939. if (!keycode.isEventKey(event2, "Tab")) {
  90940. event2.preventDefault();
  90941. this.menuButton_.focus();
  90942. }
  90943. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  90944. if (!this.buttonPressed_) {
  90945. event2.preventDefault();
  90946. this.pressButton();
  90947. }
  90948. }
  90949. };
  90950. _proto.handleMenuKeyUp = function handleMenuKeyUp(event2) {
  90951. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90952. this.removeClass("vjs-hover");
  90953. }
  90954. };
  90955. _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event2) {
  90956. this.handleSubmenuKeyDown(event2);
  90957. };
  90958. _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event2) {
  90959. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90960. if (this.buttonPressed_) {
  90961. this.unpressButton();
  90962. }
  90963. if (!keycode.isEventKey(event2, "Tab")) {
  90964. event2.preventDefault();
  90965. this.menuButton_.focus();
  90966. }
  90967. }
  90968. };
  90969. _proto.pressButton = function pressButton() {
  90970. if (this.enabled_) {
  90971. this.buttonPressed_ = true;
  90972. this.menu.show();
  90973. this.menu.lockShowing();
  90974. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  90975. if (IS_IOS && isInFrame()) {
  90976. return;
  90977. }
  90978. this.menu.focus();
  90979. }
  90980. };
  90981. _proto.unpressButton = function unpressButton() {
  90982. if (this.enabled_) {
  90983. this.buttonPressed_ = false;
  90984. this.menu.unlockShowing();
  90985. this.menu.hide();
  90986. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90987. }
  90988. };
  90989. _proto.disable = function disable() {
  90990. this.unpressButton();
  90991. this.enabled_ = false;
  90992. this.addClass("vjs-disabled");
  90993. this.menuButton_.disable();
  90994. };
  90995. _proto.enable = function enable() {
  90996. this.enabled_ = true;
  90997. this.removeClass("vjs-disabled");
  90998. this.menuButton_.enable();
  90999. };
  91000. return MenuButton2;
  91001. }(Component$1);
  91002. Component$1.registerComponent("MenuButton", MenuButton);
  91003. var TrackButton = /* @__PURE__ */ function(_MenuButton) {
  91004. _inheritsLoose(TrackButton2, _MenuButton);
  91005. function TrackButton2(player, options2) {
  91006. var _this;
  91007. var tracks = options2.tracks;
  91008. _this = _MenuButton.call(this, player, options2) || this;
  91009. if (_this.items.length <= 1) {
  91010. _this.hide();
  91011. }
  91012. if (!tracks) {
  91013. return _assertThisInitialized(_this);
  91014. }
  91015. var updateHandler = bind(_assertThisInitialized(_this), _this.update);
  91016. tracks.addEventListener("removetrack", updateHandler);
  91017. tracks.addEventListener("addtrack", updateHandler);
  91018. tracks.addEventListener("labelchange", updateHandler);
  91019. _this.player_.on("ready", updateHandler);
  91020. _this.player_.on("dispose", function() {
  91021. tracks.removeEventListener("removetrack", updateHandler);
  91022. tracks.removeEventListener("addtrack", updateHandler);
  91023. tracks.removeEventListener("labelchange", updateHandler);
  91024. });
  91025. return _this;
  91026. }
  91027. return TrackButton2;
  91028. }(MenuButton);
  91029. Component$1.registerComponent("TrackButton", TrackButton);
  91030. var MenuKeys = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  91031. var MenuItem = /* @__PURE__ */ function(_ClickableComponent) {
  91032. _inheritsLoose(MenuItem2, _ClickableComponent);
  91033. function MenuItem2(player, options2) {
  91034. var _this;
  91035. _this = _ClickableComponent.call(this, player, options2) || this;
  91036. _this.selectable = options2.selectable;
  91037. _this.isSelected_ = options2.selected || false;
  91038. _this.multiSelectable = options2.multiSelectable;
  91039. _this.selected(_this.isSelected_);
  91040. if (_this.selectable) {
  91041. if (_this.multiSelectable) {
  91042. _this.el_.setAttribute("role", "menuitemcheckbox");
  91043. } else {
  91044. _this.el_.setAttribute("role", "menuitemradio");
  91045. }
  91046. } else {
  91047. _this.el_.setAttribute("role", "menuitem");
  91048. }
  91049. return _this;
  91050. }
  91051. var _proto = MenuItem2.prototype;
  91052. _proto.createEl = function createEl$12(type2, props, attrs) {
  91053. this.nonIconControl = true;
  91054. var el = _ClickableComponent.prototype.createEl.call(this, "li", assign({
  91055. className: "vjs-menu-item",
  91056. tabIndex: -1
  91057. }, props), attrs);
  91058. el.replaceChild(createEl("span", {
  91059. className: "vjs-menu-item-text",
  91060. textContent: this.localize(this.options_.label)
  91061. }), el.querySelector(".vjs-icon-placeholder"));
  91062. return el;
  91063. };
  91064. _proto.handleKeyDown = function handleKeyDown(event2) {
  91065. if (!MenuKeys.some(function(key) {
  91066. return keycode.isEventKey(event2, key);
  91067. })) {
  91068. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  91069. }
  91070. };
  91071. _proto.handleClick = function handleClick(event2) {
  91072. this.selected(true);
  91073. };
  91074. _proto.selected = function selected(_selected) {
  91075. if (this.selectable) {
  91076. if (_selected) {
  91077. this.addClass("vjs-selected");
  91078. this.el_.setAttribute("aria-checked", "true");
  91079. this.controlText(", selected");
  91080. this.isSelected_ = true;
  91081. } else {
  91082. this.removeClass("vjs-selected");
  91083. this.el_.setAttribute("aria-checked", "false");
  91084. this.controlText("");
  91085. this.isSelected_ = false;
  91086. }
  91087. }
  91088. };
  91089. return MenuItem2;
  91090. }(ClickableComponent);
  91091. Component$1.registerComponent("MenuItem", MenuItem);
  91092. var TextTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91093. _inheritsLoose(TextTrackMenuItem2, _MenuItem);
  91094. function TextTrackMenuItem2(player, options2) {
  91095. var _this;
  91096. var track = options2.track;
  91097. var tracks = player.textTracks();
  91098. options2.label = track.label || track.language || "Unknown";
  91099. options2.selected = track.mode === "showing";
  91100. _this = _MenuItem.call(this, player, options2) || this;
  91101. _this.track = track;
  91102. _this.kinds = (options2.kinds || [options2.kind || _this.track.kind]).filter(Boolean);
  91103. var changeHandler = function changeHandler2() {
  91104. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91105. args[_key] = arguments[_key];
  91106. }
  91107. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91108. };
  91109. var selectedLanguageChangeHandler = function selectedLanguageChangeHandler2() {
  91110. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  91111. args[_key2] = arguments[_key2];
  91112. }
  91113. _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_this), args);
  91114. };
  91115. player.on(["loadstart", "texttrackchange"], changeHandler);
  91116. tracks.addEventListener("change", changeHandler);
  91117. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91118. _this.on("dispose", function() {
  91119. player.off(["loadstart", "texttrackchange"], changeHandler);
  91120. tracks.removeEventListener("change", changeHandler);
  91121. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91122. });
  91123. if (tracks.onchange === void 0) {
  91124. var event2;
  91125. _this.on(["tap", "click"], function() {
  91126. if (typeof window_1.Event !== "object") {
  91127. try {
  91128. event2 = new window_1.Event("change");
  91129. } catch (err) {
  91130. }
  91131. }
  91132. if (!event2) {
  91133. event2 = document_1.createEvent("Event");
  91134. event2.initEvent("change", true, true);
  91135. }
  91136. tracks.dispatchEvent(event2);
  91137. });
  91138. }
  91139. _this.handleTracksChange();
  91140. return _this;
  91141. }
  91142. var _proto = TextTrackMenuItem2.prototype;
  91143. _proto.handleClick = function handleClick(event2) {
  91144. var referenceTrack = this.track;
  91145. var tracks = this.player_.textTracks();
  91146. _MenuItem.prototype.handleClick.call(this, event2);
  91147. if (!tracks) {
  91148. return;
  91149. }
  91150. for (var i2 = 0; i2 < tracks.length; i2++) {
  91151. var track = tracks[i2];
  91152. if (this.kinds.indexOf(track.kind) === -1) {
  91153. continue;
  91154. }
  91155. if (track === referenceTrack) {
  91156. if (track.mode !== "showing") {
  91157. track.mode = "showing";
  91158. }
  91159. } else if (track.mode !== "disabled") {
  91160. track.mode = "disabled";
  91161. }
  91162. }
  91163. };
  91164. _proto.handleTracksChange = function handleTracksChange(event2) {
  91165. var shouldBeSelected = this.track.mode === "showing";
  91166. if (shouldBeSelected !== this.isSelected_) {
  91167. this.selected(shouldBeSelected);
  91168. }
  91169. };
  91170. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91171. if (this.track.mode === "showing") {
  91172. var selectedLanguage = this.player_.cache_.selectedLanguage;
  91173. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  91174. return;
  91175. }
  91176. this.player_.cache_.selectedLanguage = {
  91177. enabled: true,
  91178. language: this.track.language,
  91179. kind: this.track.kind
  91180. };
  91181. }
  91182. };
  91183. _proto.dispose = function dispose() {
  91184. this.track = null;
  91185. _MenuItem.prototype.dispose.call(this);
  91186. };
  91187. return TextTrackMenuItem2;
  91188. }(MenuItem);
  91189. Component$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem);
  91190. var OffTextTrackMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91191. _inheritsLoose(OffTextTrackMenuItem2, _TextTrackMenuItem);
  91192. function OffTextTrackMenuItem2(player, options2) {
  91193. options2.track = {
  91194. player,
  91195. kind: options2.kind,
  91196. kinds: options2.kinds,
  91197. "default": false,
  91198. mode: "disabled"
  91199. };
  91200. if (!options2.kinds) {
  91201. options2.kinds = [options2.kind];
  91202. }
  91203. if (options2.label) {
  91204. options2.track.label = options2.label;
  91205. } else {
  91206. options2.track.label = options2.kinds.join(" and ") + " off";
  91207. }
  91208. options2.selectable = true;
  91209. options2.multiSelectable = false;
  91210. return _TextTrackMenuItem.call(this, player, options2) || this;
  91211. }
  91212. var _proto = OffTextTrackMenuItem2.prototype;
  91213. _proto.handleTracksChange = function handleTracksChange(event2) {
  91214. var tracks = this.player().textTracks();
  91215. var shouldBeSelected = true;
  91216. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91217. var track = tracks[i2];
  91218. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  91219. shouldBeSelected = false;
  91220. break;
  91221. }
  91222. }
  91223. if (shouldBeSelected !== this.isSelected_) {
  91224. this.selected(shouldBeSelected);
  91225. }
  91226. };
  91227. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91228. var tracks = this.player().textTracks();
  91229. var allHidden = true;
  91230. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91231. var track = tracks[i2];
  91232. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  91233. allHidden = false;
  91234. break;
  91235. }
  91236. }
  91237. if (allHidden) {
  91238. this.player_.cache_.selectedLanguage = {
  91239. enabled: false
  91240. };
  91241. }
  91242. };
  91243. return OffTextTrackMenuItem2;
  91244. }(TextTrackMenuItem);
  91245. Component$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem);
  91246. var TextTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91247. _inheritsLoose(TextTrackButton2, _TrackButton);
  91248. function TextTrackButton2(player, options2) {
  91249. if (options2 === void 0) {
  91250. options2 = {};
  91251. }
  91252. options2.tracks = player.textTracks();
  91253. return _TrackButton.call(this, player, options2) || this;
  91254. }
  91255. var _proto = TextTrackButton2.prototype;
  91256. _proto.createItems = function createItems(items, TrackMenuItem) {
  91257. if (items === void 0) {
  91258. items = [];
  91259. }
  91260. if (TrackMenuItem === void 0) {
  91261. TrackMenuItem = TextTrackMenuItem;
  91262. }
  91263. var label2;
  91264. if (this.label_) {
  91265. label2 = this.label_ + " off";
  91266. }
  91267. items.push(new OffTextTrackMenuItem(this.player_, {
  91268. kinds: this.kinds_,
  91269. kind: this.kind_,
  91270. label: label2
  91271. }));
  91272. this.hideThreshold_ += 1;
  91273. var tracks = this.player_.textTracks();
  91274. if (!Array.isArray(this.kinds_)) {
  91275. this.kinds_ = [this.kind_];
  91276. }
  91277. for (var i2 = 0; i2 < tracks.length; i2++) {
  91278. var track = tracks[i2];
  91279. if (this.kinds_.indexOf(track.kind) > -1) {
  91280. var item = new TrackMenuItem(this.player_, {
  91281. track,
  91282. kinds: this.kinds_,
  91283. kind: this.kind_,
  91284. selectable: true,
  91285. multiSelectable: false
  91286. });
  91287. item.addClass("vjs-" + track.kind + "-menu-item");
  91288. items.push(item);
  91289. }
  91290. }
  91291. return items;
  91292. };
  91293. return TextTrackButton2;
  91294. }(TrackButton);
  91295. Component$1.registerComponent("TextTrackButton", TextTrackButton);
  91296. var ChaptersTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91297. _inheritsLoose(ChaptersTrackMenuItem2, _MenuItem);
  91298. function ChaptersTrackMenuItem2(player, options2) {
  91299. var _this;
  91300. var track = options2.track;
  91301. var cue = options2.cue;
  91302. var currentTime = player.currentTime();
  91303. options2.selectable = true;
  91304. options2.multiSelectable = false;
  91305. options2.label = cue.text;
  91306. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  91307. _this = _MenuItem.call(this, player, options2) || this;
  91308. _this.track = track;
  91309. _this.cue = cue;
  91310. return _this;
  91311. }
  91312. var _proto = ChaptersTrackMenuItem2.prototype;
  91313. _proto.handleClick = function handleClick(event2) {
  91314. _MenuItem.prototype.handleClick.call(this);
  91315. this.player_.currentTime(this.cue.startTime);
  91316. };
  91317. return ChaptersTrackMenuItem2;
  91318. }(MenuItem);
  91319. Component$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem);
  91320. var ChaptersButton = /* @__PURE__ */ function(_TextTrackButton) {
  91321. _inheritsLoose(ChaptersButton2, _TextTrackButton);
  91322. function ChaptersButton2(player, options2, ready) {
  91323. var _this;
  91324. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91325. _this.selectCurrentItem_ = function() {
  91326. _this.items.forEach(function(item) {
  91327. item.selected(_this.track_.activeCues[0] === item.cue);
  91328. });
  91329. };
  91330. return _this;
  91331. }
  91332. var _proto = ChaptersButton2.prototype;
  91333. _proto.buildCSSClass = function buildCSSClass() {
  91334. return "vjs-chapters-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91335. };
  91336. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91337. return "vjs-chapters-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91338. };
  91339. _proto.update = function update(event2) {
  91340. if (event2 && event2.track && event2.track.kind !== "chapters") {
  91341. return;
  91342. }
  91343. var track = this.findChaptersTrack();
  91344. if (track !== this.track_) {
  91345. this.setTrack(track);
  91346. _TextTrackButton.prototype.update.call(this);
  91347. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  91348. _TextTrackButton.prototype.update.call(this);
  91349. }
  91350. };
  91351. _proto.setTrack = function setTrack(track) {
  91352. if (this.track_ === track) {
  91353. return;
  91354. }
  91355. if (!this.updateHandler_) {
  91356. this.updateHandler_ = this.update.bind(this);
  91357. }
  91358. if (this.track_) {
  91359. var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91360. if (remoteTextTrackEl) {
  91361. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  91362. }
  91363. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  91364. this.track_ = null;
  91365. }
  91366. this.track_ = track;
  91367. if (this.track_) {
  91368. this.track_.mode = "hidden";
  91369. var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91370. if (_remoteTextTrackEl) {
  91371. _remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  91372. }
  91373. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  91374. }
  91375. };
  91376. _proto.findChaptersTrack = function findChaptersTrack() {
  91377. var tracks = this.player_.textTracks() || [];
  91378. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  91379. var track = tracks[i2];
  91380. if (track.kind === this.kind_) {
  91381. return track;
  91382. }
  91383. }
  91384. };
  91385. _proto.getMenuCaption = function getMenuCaption() {
  91386. if (this.track_ && this.track_.label) {
  91387. return this.track_.label;
  91388. }
  91389. return this.localize(toTitleCase$1(this.kind_));
  91390. };
  91391. _proto.createMenu = function createMenu() {
  91392. this.options_.title = this.getMenuCaption();
  91393. return _TextTrackButton.prototype.createMenu.call(this);
  91394. };
  91395. _proto.createItems = function createItems() {
  91396. var items = [];
  91397. if (!this.track_) {
  91398. return items;
  91399. }
  91400. var cues = this.track_.cues;
  91401. if (!cues) {
  91402. return items;
  91403. }
  91404. for (var i2 = 0, l = cues.length; i2 < l; i2++) {
  91405. var cue = cues[i2];
  91406. var mi = new ChaptersTrackMenuItem(this.player_, {
  91407. track: this.track_,
  91408. cue
  91409. });
  91410. items.push(mi);
  91411. }
  91412. return items;
  91413. };
  91414. return ChaptersButton2;
  91415. }(TextTrackButton);
  91416. ChaptersButton.prototype.kind_ = "chapters";
  91417. ChaptersButton.prototype.controlText_ = "Chapters";
  91418. Component$1.registerComponent("ChaptersButton", ChaptersButton);
  91419. var DescriptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91420. _inheritsLoose(DescriptionsButton2, _TextTrackButton);
  91421. function DescriptionsButton2(player, options2, ready) {
  91422. var _this;
  91423. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91424. var tracks = player.textTracks();
  91425. var changeHandler = bind(_assertThisInitialized(_this), _this.handleTracksChange);
  91426. tracks.addEventListener("change", changeHandler);
  91427. _this.on("dispose", function() {
  91428. tracks.removeEventListener("change", changeHandler);
  91429. });
  91430. return _this;
  91431. }
  91432. var _proto = DescriptionsButton2.prototype;
  91433. _proto.handleTracksChange = function handleTracksChange(event2) {
  91434. var tracks = this.player().textTracks();
  91435. var disabled = false;
  91436. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91437. var track = tracks[i2];
  91438. if (track.kind !== this.kind_ && track.mode === "showing") {
  91439. disabled = true;
  91440. break;
  91441. }
  91442. }
  91443. if (disabled) {
  91444. this.disable();
  91445. } else {
  91446. this.enable();
  91447. }
  91448. };
  91449. _proto.buildCSSClass = function buildCSSClass() {
  91450. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91451. };
  91452. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91453. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91454. };
  91455. return DescriptionsButton2;
  91456. }(TextTrackButton);
  91457. DescriptionsButton.prototype.kind_ = "descriptions";
  91458. DescriptionsButton.prototype.controlText_ = "Descriptions";
  91459. Component$1.registerComponent("DescriptionsButton", DescriptionsButton);
  91460. var SubtitlesButton = /* @__PURE__ */ function(_TextTrackButton) {
  91461. _inheritsLoose(SubtitlesButton2, _TextTrackButton);
  91462. function SubtitlesButton2(player, options2, ready) {
  91463. return _TextTrackButton.call(this, player, options2, ready) || this;
  91464. }
  91465. var _proto = SubtitlesButton2.prototype;
  91466. _proto.buildCSSClass = function buildCSSClass() {
  91467. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91468. };
  91469. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91470. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91471. };
  91472. return SubtitlesButton2;
  91473. }(TextTrackButton);
  91474. SubtitlesButton.prototype.kind_ = "subtitles";
  91475. SubtitlesButton.prototype.controlText_ = "Subtitles";
  91476. Component$1.registerComponent("SubtitlesButton", SubtitlesButton);
  91477. var CaptionSettingsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91478. _inheritsLoose(CaptionSettingsMenuItem2, _TextTrackMenuItem);
  91479. function CaptionSettingsMenuItem2(player, options2) {
  91480. var _this;
  91481. options2.track = {
  91482. player,
  91483. kind: options2.kind,
  91484. label: options2.kind + " settings",
  91485. selectable: false,
  91486. "default": false,
  91487. mode: "disabled"
  91488. };
  91489. options2.selectable = false;
  91490. options2.name = "CaptionSettingsMenuItem";
  91491. _this = _TextTrackMenuItem.call(this, player, options2) || this;
  91492. _this.addClass("vjs-texttrack-settings");
  91493. _this.controlText(", opens " + options2.kind + " settings dialog");
  91494. return _this;
  91495. }
  91496. var _proto = CaptionSettingsMenuItem2.prototype;
  91497. _proto.handleClick = function handleClick(event2) {
  91498. this.player().getChild("textTrackSettings").open();
  91499. };
  91500. return CaptionSettingsMenuItem2;
  91501. }(TextTrackMenuItem);
  91502. Component$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem);
  91503. var CaptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91504. _inheritsLoose(CaptionsButton2, _TextTrackButton);
  91505. function CaptionsButton2(player, options2, ready) {
  91506. return _TextTrackButton.call(this, player, options2, ready) || this;
  91507. }
  91508. var _proto = CaptionsButton2.prototype;
  91509. _proto.buildCSSClass = function buildCSSClass() {
  91510. return "vjs-captions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91511. };
  91512. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91513. return "vjs-captions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91514. };
  91515. _proto.createItems = function createItems() {
  91516. var items = [];
  91517. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91518. items.push(new CaptionSettingsMenuItem(this.player_, {
  91519. kind: this.kind_
  91520. }));
  91521. this.hideThreshold_ += 1;
  91522. }
  91523. return _TextTrackButton.prototype.createItems.call(this, items);
  91524. };
  91525. return CaptionsButton2;
  91526. }(TextTrackButton);
  91527. CaptionsButton.prototype.kind_ = "captions";
  91528. CaptionsButton.prototype.controlText_ = "Captions";
  91529. Component$1.registerComponent("CaptionsButton", CaptionsButton);
  91530. var SubsCapsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91531. _inheritsLoose(SubsCapsMenuItem2, _TextTrackMenuItem);
  91532. function SubsCapsMenuItem2() {
  91533. return _TextTrackMenuItem.apply(this, arguments) || this;
  91534. }
  91535. var _proto = SubsCapsMenuItem2.prototype;
  91536. _proto.createEl = function createEl$12(type2, props, attrs) {
  91537. var el = _TextTrackMenuItem.prototype.createEl.call(this, type2, props, attrs);
  91538. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91539. if (this.options_.track.kind === "captions") {
  91540. parentSpan.appendChild(createEl("span", {
  91541. className: "vjs-icon-placeholder"
  91542. }, {
  91543. "aria-hidden": true
  91544. }));
  91545. parentSpan.appendChild(createEl("span", {
  91546. className: "vjs-control-text",
  91547. textContent: " " + this.localize("Captions")
  91548. }));
  91549. }
  91550. return el;
  91551. };
  91552. return SubsCapsMenuItem2;
  91553. }(TextTrackMenuItem);
  91554. Component$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem);
  91555. var SubsCapsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91556. _inheritsLoose(SubsCapsButton2, _TextTrackButton);
  91557. function SubsCapsButton2(player, options2) {
  91558. var _this;
  91559. if (options2 === void 0) {
  91560. options2 = {};
  91561. }
  91562. _this = _TextTrackButton.call(this, player, options2) || this;
  91563. _this.label_ = "subtitles";
  91564. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(_this.player_.language_) > -1) {
  91565. _this.label_ = "captions";
  91566. }
  91567. _this.menuButton_.controlText(toTitleCase$1(_this.label_));
  91568. return _this;
  91569. }
  91570. var _proto = SubsCapsButton2.prototype;
  91571. _proto.buildCSSClass = function buildCSSClass() {
  91572. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91573. };
  91574. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91575. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91576. };
  91577. _proto.createItems = function createItems() {
  91578. var items = [];
  91579. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91580. items.push(new CaptionSettingsMenuItem(this.player_, {
  91581. kind: this.label_
  91582. }));
  91583. this.hideThreshold_ += 1;
  91584. }
  91585. items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);
  91586. return items;
  91587. };
  91588. return SubsCapsButton2;
  91589. }(TextTrackButton);
  91590. SubsCapsButton.prototype.kinds_ = ["captions", "subtitles"];
  91591. SubsCapsButton.prototype.controlText_ = "Subtitles";
  91592. Component$1.registerComponent("SubsCapsButton", SubsCapsButton);
  91593. var AudioTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91594. _inheritsLoose(AudioTrackMenuItem2, _MenuItem);
  91595. function AudioTrackMenuItem2(player, options2) {
  91596. var _this;
  91597. var track = options2.track;
  91598. var tracks = player.audioTracks();
  91599. options2.label = track.label || track.language || "Unknown";
  91600. options2.selected = track.enabled;
  91601. _this = _MenuItem.call(this, player, options2) || this;
  91602. _this.track = track;
  91603. _this.addClass("vjs-" + track.kind + "-menu-item");
  91604. var changeHandler = function changeHandler2() {
  91605. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91606. args[_key] = arguments[_key];
  91607. }
  91608. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91609. };
  91610. tracks.addEventListener("change", changeHandler);
  91611. _this.on("dispose", function() {
  91612. tracks.removeEventListener("change", changeHandler);
  91613. });
  91614. return _this;
  91615. }
  91616. var _proto = AudioTrackMenuItem2.prototype;
  91617. _proto.createEl = function createEl$12(type2, props, attrs) {
  91618. var el = _MenuItem.prototype.createEl.call(this, type2, props, attrs);
  91619. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91620. if (this.options_.track.kind === "main-desc") {
  91621. parentSpan.appendChild(createEl("span", {
  91622. className: "vjs-icon-placeholder"
  91623. }, {
  91624. "aria-hidden": true
  91625. }));
  91626. parentSpan.appendChild(createEl("span", {
  91627. className: "vjs-control-text",
  91628. textContent: " " + this.localize("Descriptions")
  91629. }));
  91630. }
  91631. return el;
  91632. };
  91633. _proto.handleClick = function handleClick(event2) {
  91634. _MenuItem.prototype.handleClick.call(this, event2);
  91635. this.track.enabled = true;
  91636. if (this.player_.tech_.featuresNativeAudioTracks) {
  91637. var tracks = this.player_.audioTracks();
  91638. for (var i2 = 0; i2 < tracks.length; i2++) {
  91639. var track = tracks[i2];
  91640. if (track === this.track) {
  91641. continue;
  91642. }
  91643. track.enabled = track === this.track;
  91644. }
  91645. }
  91646. };
  91647. _proto.handleTracksChange = function handleTracksChange(event2) {
  91648. this.selected(this.track.enabled);
  91649. };
  91650. return AudioTrackMenuItem2;
  91651. }(MenuItem);
  91652. Component$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem);
  91653. var AudioTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91654. _inheritsLoose(AudioTrackButton2, _TrackButton);
  91655. function AudioTrackButton2(player, options2) {
  91656. if (options2 === void 0) {
  91657. options2 = {};
  91658. }
  91659. options2.tracks = player.audioTracks();
  91660. return _TrackButton.call(this, player, options2) || this;
  91661. }
  91662. var _proto = AudioTrackButton2.prototype;
  91663. _proto.buildCSSClass = function buildCSSClass() {
  91664. return "vjs-audio-button " + _TrackButton.prototype.buildCSSClass.call(this);
  91665. };
  91666. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91667. return "vjs-audio-button " + _TrackButton.prototype.buildWrapperCSSClass.call(this);
  91668. };
  91669. _proto.createItems = function createItems(items) {
  91670. if (items === void 0) {
  91671. items = [];
  91672. }
  91673. this.hideThreshold_ = 1;
  91674. var tracks = this.player_.audioTracks();
  91675. for (var i2 = 0; i2 < tracks.length; i2++) {
  91676. var track = tracks[i2];
  91677. items.push(new AudioTrackMenuItem(this.player_, {
  91678. track,
  91679. selectable: true,
  91680. multiSelectable: false
  91681. }));
  91682. }
  91683. return items;
  91684. };
  91685. return AudioTrackButton2;
  91686. }(TrackButton);
  91687. AudioTrackButton.prototype.controlText_ = "Audio Track";
  91688. Component$1.registerComponent("AudioTrackButton", AudioTrackButton);
  91689. var PlaybackRateMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91690. _inheritsLoose(PlaybackRateMenuItem2, _MenuItem);
  91691. function PlaybackRateMenuItem2(player, options2) {
  91692. var _this;
  91693. var label2 = options2.rate;
  91694. var rate = parseFloat(label2, 10);
  91695. options2.label = label2;
  91696. options2.selected = rate === player.playbackRate();
  91697. options2.selectable = true;
  91698. options2.multiSelectable = false;
  91699. _this = _MenuItem.call(this, player, options2) || this;
  91700. _this.label = label2;
  91701. _this.rate = rate;
  91702. _this.on(player, "ratechange", function(e) {
  91703. return _this.update(e);
  91704. });
  91705. return _this;
  91706. }
  91707. var _proto = PlaybackRateMenuItem2.prototype;
  91708. _proto.handleClick = function handleClick(event2) {
  91709. _MenuItem.prototype.handleClick.call(this);
  91710. this.player().playbackRate(this.rate);
  91711. };
  91712. _proto.update = function update(event2) {
  91713. this.selected(this.player().playbackRate() === this.rate);
  91714. };
  91715. return PlaybackRateMenuItem2;
  91716. }(MenuItem);
  91717. PlaybackRateMenuItem.prototype.contentElType = "button";
  91718. Component$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem);
  91719. var PlaybackRateMenuButton = /* @__PURE__ */ function(_MenuButton) {
  91720. _inheritsLoose(PlaybackRateMenuButton2, _MenuButton);
  91721. function PlaybackRateMenuButton2(player, options2) {
  91722. var _this;
  91723. _this = _MenuButton.call(this, player, options2) || this;
  91724. _this.menuButton_.el_.setAttribute("aria-describedby", _this.labelElId_);
  91725. _this.updateVisibility();
  91726. _this.updateLabel();
  91727. _this.on(player, "loadstart", function(e) {
  91728. return _this.updateVisibility(e);
  91729. });
  91730. _this.on(player, "ratechange", function(e) {
  91731. return _this.updateLabel(e);
  91732. });
  91733. _this.on(player, "playbackrateschange", function(e) {
  91734. return _this.handlePlaybackRateschange(e);
  91735. });
  91736. return _this;
  91737. }
  91738. var _proto = PlaybackRateMenuButton2.prototype;
  91739. _proto.createEl = function createEl$12() {
  91740. var el = _MenuButton.prototype.createEl.call(this);
  91741. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  91742. this.labelEl_ = createEl("div", {
  91743. className: "vjs-playback-rate-value",
  91744. id: this.labelElId_,
  91745. textContent: "1x"
  91746. });
  91747. el.appendChild(this.labelEl_);
  91748. return el;
  91749. };
  91750. _proto.dispose = function dispose() {
  91751. this.labelEl_ = null;
  91752. _MenuButton.prototype.dispose.call(this);
  91753. };
  91754. _proto.buildCSSClass = function buildCSSClass() {
  91755. return "vjs-playback-rate " + _MenuButton.prototype.buildCSSClass.call(this);
  91756. };
  91757. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91758. return "vjs-playback-rate " + _MenuButton.prototype.buildWrapperCSSClass.call(this);
  91759. };
  91760. _proto.createItems = function createItems() {
  91761. var rates = this.playbackRates();
  91762. var items = [];
  91763. for (var i2 = rates.length - 1; i2 >= 0; i2--) {
  91764. items.push(new PlaybackRateMenuItem(this.player(), {
  91765. rate: rates[i2] + "x"
  91766. }));
  91767. }
  91768. return items;
  91769. };
  91770. _proto.updateARIAAttributes = function updateARIAAttributes() {
  91771. this.el().setAttribute("aria-valuenow", this.player().playbackRate());
  91772. };
  91773. _proto.handleClick = function handleClick(event2) {
  91774. var currentRate = this.player().playbackRate();
  91775. var rates = this.playbackRates();
  91776. var currentIndex = rates.indexOf(currentRate);
  91777. var newIndex = (currentIndex + 1) % rates.length;
  91778. this.player().playbackRate(rates[newIndex]);
  91779. };
  91780. _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event2) {
  91781. this.update();
  91782. };
  91783. _proto.playbackRates = function playbackRates() {
  91784. var player = this.player();
  91785. return player.playbackRates && player.playbackRates() || [];
  91786. };
  91787. _proto.playbackRateSupported = function playbackRateSupported() {
  91788. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  91789. };
  91790. _proto.updateVisibility = function updateVisibility(event2) {
  91791. if (this.playbackRateSupported()) {
  91792. this.removeClass("vjs-hidden");
  91793. } else {
  91794. this.addClass("vjs-hidden");
  91795. }
  91796. };
  91797. _proto.updateLabel = function updateLabel(event2) {
  91798. if (this.playbackRateSupported()) {
  91799. this.labelEl_.textContent = this.player().playbackRate() + "x";
  91800. }
  91801. };
  91802. return PlaybackRateMenuButton2;
  91803. }(MenuButton);
  91804. PlaybackRateMenuButton.prototype.controlText_ = "Playback Rate";
  91805. Component$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton);
  91806. var Spacer = /* @__PURE__ */ function(_Component) {
  91807. _inheritsLoose(Spacer2, _Component);
  91808. function Spacer2() {
  91809. return _Component.apply(this, arguments) || this;
  91810. }
  91811. var _proto = Spacer2.prototype;
  91812. _proto.buildCSSClass = function buildCSSClass() {
  91813. return "vjs-spacer " + _Component.prototype.buildCSSClass.call(this);
  91814. };
  91815. _proto.createEl = function createEl2(tag, props, attributes) {
  91816. if (tag === void 0) {
  91817. tag = "div";
  91818. }
  91819. if (props === void 0) {
  91820. props = {};
  91821. }
  91822. if (attributes === void 0) {
  91823. attributes = {};
  91824. }
  91825. if (!props.className) {
  91826. props.className = this.buildCSSClass();
  91827. }
  91828. return _Component.prototype.createEl.call(this, tag, props, attributes);
  91829. };
  91830. return Spacer2;
  91831. }(Component$1);
  91832. Component$1.registerComponent("Spacer", Spacer);
  91833. var CustomControlSpacer = /* @__PURE__ */ function(_Spacer) {
  91834. _inheritsLoose(CustomControlSpacer2, _Spacer);
  91835. function CustomControlSpacer2() {
  91836. return _Spacer.apply(this, arguments) || this;
  91837. }
  91838. var _proto = CustomControlSpacer2.prototype;
  91839. _proto.buildCSSClass = function buildCSSClass() {
  91840. return "vjs-custom-control-spacer " + _Spacer.prototype.buildCSSClass.call(this);
  91841. };
  91842. _proto.createEl = function createEl2() {
  91843. return _Spacer.prototype.createEl.call(this, "div", {
  91844. className: this.buildCSSClass(),
  91845. textContent: "\xA0"
  91846. });
  91847. };
  91848. return CustomControlSpacer2;
  91849. }(Spacer);
  91850. Component$1.registerComponent("CustomControlSpacer", CustomControlSpacer);
  91851. var ControlBar = /* @__PURE__ */ function(_Component) {
  91852. _inheritsLoose(ControlBar2, _Component);
  91853. function ControlBar2() {
  91854. return _Component.apply(this, arguments) || this;
  91855. }
  91856. var _proto = ControlBar2.prototype;
  91857. _proto.createEl = function createEl2() {
  91858. return _Component.prototype.createEl.call(this, "div", {
  91859. className: "vjs-control-bar",
  91860. dir: "ltr"
  91861. });
  91862. };
  91863. return ControlBar2;
  91864. }(Component$1);
  91865. ControlBar.prototype.options_ = {
  91866. children: ["playToggle", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  91867. };
  91868. if ("exitPictureInPicture" in document_1) {
  91869. ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  91870. }
  91871. Component$1.registerComponent("ControlBar", ControlBar);
  91872. var ErrorDisplay = /* @__PURE__ */ function(_ModalDialog) {
  91873. _inheritsLoose(ErrorDisplay2, _ModalDialog);
  91874. function ErrorDisplay2(player, options2) {
  91875. var _this;
  91876. _this = _ModalDialog.call(this, player, options2) || this;
  91877. _this.on(player, "error", function(e) {
  91878. return _this.open(e);
  91879. });
  91880. return _this;
  91881. }
  91882. var _proto = ErrorDisplay2.prototype;
  91883. _proto.buildCSSClass = function buildCSSClass() {
  91884. return "vjs-error-display " + _ModalDialog.prototype.buildCSSClass.call(this);
  91885. };
  91886. _proto.content = function content() {
  91887. var error = this.player().error();
  91888. return error ? this.localize(error.message) : "";
  91889. };
  91890. return ErrorDisplay2;
  91891. }(ModalDialog);
  91892. ErrorDisplay.prototype.options_ = _extends$2({}, ModalDialog.prototype.options_, {
  91893. pauseOnOpen: false,
  91894. fillAlways: true,
  91895. temporary: false,
  91896. uncloseable: true
  91897. });
  91898. Component$1.registerComponent("ErrorDisplay", ErrorDisplay);
  91899. var LOCAL_STORAGE_KEY$1 = "vjs-text-track-settings";
  91900. var COLOR_BLACK = ["#000", "Black"];
  91901. var COLOR_BLUE = ["#00F", "Blue"];
  91902. var COLOR_CYAN = ["#0FF", "Cyan"];
  91903. var COLOR_GREEN = ["#0F0", "Green"];
  91904. var COLOR_MAGENTA = ["#F0F", "Magenta"];
  91905. var COLOR_RED = ["#F00", "Red"];
  91906. var COLOR_WHITE = ["#FFF", "White"];
  91907. var COLOR_YELLOW = ["#FF0", "Yellow"];
  91908. var OPACITY_OPAQUE = ["1", "Opaque"];
  91909. var OPACITY_SEMI = ["0.5", "Semi-Transparent"];
  91910. var OPACITY_TRANS = ["0", "Transparent"];
  91911. var selectConfigs = {
  91912. backgroundColor: {
  91913. selector: ".vjs-bg-color > select",
  91914. id: "captions-background-color-%s",
  91915. label: "Color",
  91916. options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91917. },
  91918. backgroundOpacity: {
  91919. selector: ".vjs-bg-opacity > select",
  91920. id: "captions-background-opacity-%s",
  91921. label: "Transparency",
  91922. options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]
  91923. },
  91924. color: {
  91925. selector: ".vjs-fg-color > select",
  91926. id: "captions-foreground-color-%s",
  91927. label: "Color",
  91928. options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91929. },
  91930. edgeStyle: {
  91931. selector: ".vjs-edge-style > select",
  91932. id: "%s",
  91933. label: "Text Edge Style",
  91934. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  91935. },
  91936. fontFamily: {
  91937. selector: ".vjs-font-family > select",
  91938. id: "captions-font-family-%s",
  91939. label: "Font Family",
  91940. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  91941. },
  91942. fontPercent: {
  91943. selector: ".vjs-font-percent > select",
  91944. id: "captions-font-size-%s",
  91945. label: "Font Size",
  91946. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  91947. "default": 2,
  91948. parser: function parser(v) {
  91949. return v === "1.00" ? null : Number(v);
  91950. }
  91951. },
  91952. textOpacity: {
  91953. selector: ".vjs-text-opacity > select",
  91954. id: "captions-foreground-opacity-%s",
  91955. label: "Transparency",
  91956. options: [OPACITY_OPAQUE, OPACITY_SEMI]
  91957. },
  91958. windowColor: {
  91959. selector: ".vjs-window-color > select",
  91960. id: "captions-window-color-%s",
  91961. label: "Color"
  91962. },
  91963. windowOpacity: {
  91964. selector: ".vjs-window-opacity > select",
  91965. id: "captions-window-opacity-%s",
  91966. label: "Transparency",
  91967. options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]
  91968. }
  91969. };
  91970. selectConfigs.windowColor.options = selectConfigs.backgroundColor.options;
  91971. function parseOptionValue(value, parser2) {
  91972. if (parser2) {
  91973. value = parser2(value);
  91974. }
  91975. if (value && value !== "none") {
  91976. return value;
  91977. }
  91978. }
  91979. function getSelectedOptionValue(el, parser2) {
  91980. var value = el.options[el.options.selectedIndex].value;
  91981. return parseOptionValue(value, parser2);
  91982. }
  91983. function setSelectedOption(el, value, parser2) {
  91984. if (!value) {
  91985. return;
  91986. }
  91987. for (var i2 = 0; i2 < el.options.length; i2++) {
  91988. if (parseOptionValue(el.options[i2].value, parser2) === value) {
  91989. el.selectedIndex = i2;
  91990. break;
  91991. }
  91992. }
  91993. }
  91994. var TextTrackSettings = /* @__PURE__ */ function(_ModalDialog) {
  91995. _inheritsLoose(TextTrackSettings2, _ModalDialog);
  91996. function TextTrackSettings2(player, options2) {
  91997. var _this;
  91998. options2.temporary = false;
  91999. _this = _ModalDialog.call(this, player, options2) || this;
  92000. _this.updateDisplay = _this.updateDisplay.bind(_assertThisInitialized(_this));
  92001. _this.fill();
  92002. _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;
  92003. _this.endDialog = createEl("p", {
  92004. className: "vjs-control-text",
  92005. textContent: _this.localize("End of dialog window.")
  92006. });
  92007. _this.el().appendChild(_this.endDialog);
  92008. _this.setDefaults();
  92009. if (options2.persistTextTrackSettings === void 0) {
  92010. _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;
  92011. }
  92012. _this.on(_this.$(".vjs-done-button"), "click", function() {
  92013. _this.saveSettings();
  92014. _this.close();
  92015. });
  92016. _this.on(_this.$(".vjs-default-button"), "click", function() {
  92017. _this.setDefaults();
  92018. _this.updateDisplay();
  92019. });
  92020. each(selectConfigs, function(config) {
  92021. _this.on(_this.$(config.selector), "change", _this.updateDisplay);
  92022. });
  92023. if (_this.options_.persistTextTrackSettings) {
  92024. _this.restoreSettings();
  92025. }
  92026. return _this;
  92027. }
  92028. var _proto = TextTrackSettings2.prototype;
  92029. _proto.dispose = function dispose() {
  92030. this.endDialog = null;
  92031. _ModalDialog.prototype.dispose.call(this);
  92032. };
  92033. _proto.createElSelect_ = function createElSelect_(key, legendId, type2) {
  92034. var _this2 = this;
  92035. if (legendId === void 0) {
  92036. legendId = "";
  92037. }
  92038. if (type2 === void 0) {
  92039. type2 = "label";
  92040. }
  92041. var config = selectConfigs[key];
  92042. var id = config.id.replace("%s", this.id_);
  92043. var selectLabelledbyIds = [legendId, id].join(" ").trim();
  92044. return ["<" + type2 + ' id="' + id + '" class="' + (type2 === "label" ? "vjs-label" : "") + '">', this.localize(config.label), "</" + type2 + ">", '<select aria-labelledby="' + selectLabelledbyIds + '">'].concat(config.options.map(function(o) {
  92045. var optionId = id + "-" + o[1].replace(/\W+/g, "");
  92046. return ['<option id="' + optionId + '" value="' + o[0] + '" ', 'aria-labelledby="' + selectLabelledbyIds + " " + optionId + '">', _this2.localize(o[1]), "</option>"].join("");
  92047. })).concat("</select>").join("");
  92048. };
  92049. _proto.createElFgColor_ = function createElFgColor_() {
  92050. var legendId = "captions-text-legend-" + this.id_;
  92051. return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", legendId), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  92052. };
  92053. _proto.createElBgColor_ = function createElBgColor_() {
  92054. var legendId = "captions-background-" + this.id_;
  92055. return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", legendId), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  92056. };
  92057. _proto.createElWinColor_ = function createElWinColor_() {
  92058. var legendId = "captions-window-" + this.id_;
  92059. return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", legendId), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  92060. };
  92061. _proto.createElColors_ = function createElColors_() {
  92062. return createEl("div", {
  92063. className: "vjs-track-settings-colors",
  92064. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  92065. });
  92066. };
  92067. _proto.createElFont_ = function createElFont_() {
  92068. return createEl("div", {
  92069. className: "vjs-track-settings-font",
  92070. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  92071. });
  92072. };
  92073. _proto.createElControls_ = function createElControls_() {
  92074. var defaultsDescription = this.localize("restore all settings to the default values");
  92075. return createEl("div", {
  92076. className: "vjs-track-settings-controls",
  92077. innerHTML: ['<button type="button" class="vjs-default-button" title="' + defaultsDescription + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + defaultsDescription + "</span>", "</button>", '<button type="button" class="vjs-done-button">' + this.localize("Done") + "</button>"].join("")
  92078. });
  92079. };
  92080. _proto.content = function content() {
  92081. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  92082. };
  92083. _proto.label = function label2() {
  92084. return this.localize("Caption Settings Dialog");
  92085. };
  92086. _proto.description = function description() {
  92087. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  92088. };
  92089. _proto.buildCSSClass = function buildCSSClass() {
  92090. return _ModalDialog.prototype.buildCSSClass.call(this) + " vjs-text-track-settings";
  92091. };
  92092. _proto.getValues = function getValues() {
  92093. var _this3 = this;
  92094. return reduce(selectConfigs, function(accum, config, key) {
  92095. var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);
  92096. if (value !== void 0) {
  92097. accum[key] = value;
  92098. }
  92099. return accum;
  92100. }, {});
  92101. };
  92102. _proto.setValues = function setValues(values3) {
  92103. var _this4 = this;
  92104. each(selectConfigs, function(config, key) {
  92105. setSelectedOption(_this4.$(config.selector), values3[key], config.parser);
  92106. });
  92107. };
  92108. _proto.setDefaults = function setDefaults() {
  92109. var _this5 = this;
  92110. each(selectConfigs, function(config) {
  92111. var index2 = config.hasOwnProperty("default") ? config["default"] : 0;
  92112. _this5.$(config.selector).selectedIndex = index2;
  92113. });
  92114. };
  92115. _proto.restoreSettings = function restoreSettings() {
  92116. var values3;
  92117. try {
  92118. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1));
  92119. } catch (err) {
  92120. log$1.warn(err);
  92121. }
  92122. if (values3) {
  92123. this.setValues(values3);
  92124. }
  92125. };
  92126. _proto.saveSettings = function saveSettings() {
  92127. if (!this.options_.persistTextTrackSettings) {
  92128. return;
  92129. }
  92130. var values3 = this.getValues();
  92131. try {
  92132. if (Object.keys(values3).length) {
  92133. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values3));
  92134. } else {
  92135. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);
  92136. }
  92137. } catch (err) {
  92138. log$1.warn(err);
  92139. }
  92140. };
  92141. _proto.updateDisplay = function updateDisplay() {
  92142. var ttDisplay = this.player_.getChild("textTrackDisplay");
  92143. if (ttDisplay) {
  92144. ttDisplay.updateDisplay();
  92145. }
  92146. };
  92147. _proto.conditionalBlur_ = function conditionalBlur_() {
  92148. this.previouslyActiveEl_ = null;
  92149. var cb = this.player_.controlBar;
  92150. var subsCapsBtn = cb && cb.subsCapsButton;
  92151. var ccBtn = cb && cb.captionsButton;
  92152. if (subsCapsBtn) {
  92153. subsCapsBtn.focus();
  92154. } else if (ccBtn) {
  92155. ccBtn.focus();
  92156. }
  92157. };
  92158. return TextTrackSettings2;
  92159. }(ModalDialog);
  92160. Component$1.registerComponent("TextTrackSettings", TextTrackSettings);
  92161. var ResizeManager = /* @__PURE__ */ function(_Component) {
  92162. _inheritsLoose(ResizeManager2, _Component);
  92163. function ResizeManager2(player, options2) {
  92164. var _this;
  92165. var RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  92166. if (options2.ResizeObserver === null) {
  92167. RESIZE_OBSERVER_AVAILABLE = false;
  92168. }
  92169. var options_ = mergeOptions$3({
  92170. createEl: !RESIZE_OBSERVER_AVAILABLE,
  92171. reportTouchActivity: false
  92172. }, options2);
  92173. _this = _Component.call(this, player, options_) || this;
  92174. _this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  92175. _this.loadListener_ = null;
  92176. _this.resizeObserver_ = null;
  92177. _this.debouncedHandler_ = debounce(function() {
  92178. _this.resizeHandler();
  92179. }, 100, false, _assertThisInitialized(_this));
  92180. if (RESIZE_OBSERVER_AVAILABLE) {
  92181. _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);
  92182. _this.resizeObserver_.observe(player.el());
  92183. } else {
  92184. _this.loadListener_ = function() {
  92185. if (!_this.el_ || !_this.el_.contentWindow) {
  92186. return;
  92187. }
  92188. var debouncedHandler_ = _this.debouncedHandler_;
  92189. var unloadListener_ = _this.unloadListener_ = function() {
  92190. off(this, "resize", debouncedHandler_);
  92191. off(this, "unload", unloadListener_);
  92192. unloadListener_ = null;
  92193. };
  92194. on(_this.el_.contentWindow, "unload", unloadListener_);
  92195. on(_this.el_.contentWindow, "resize", debouncedHandler_);
  92196. };
  92197. _this.one("load", _this.loadListener_);
  92198. }
  92199. return _this;
  92200. }
  92201. var _proto = ResizeManager2.prototype;
  92202. _proto.createEl = function createEl2() {
  92203. return _Component.prototype.createEl.call(this, "iframe", {
  92204. className: "vjs-resize-manager",
  92205. tabIndex: -1,
  92206. title: this.localize("No content")
  92207. }, {
  92208. "aria-hidden": "true"
  92209. });
  92210. };
  92211. _proto.resizeHandler = function resizeHandler() {
  92212. if (!this.player_ || !this.player_.trigger) {
  92213. return;
  92214. }
  92215. this.player_.trigger("playerresize");
  92216. };
  92217. _proto.dispose = function dispose() {
  92218. if (this.debouncedHandler_) {
  92219. this.debouncedHandler_.cancel();
  92220. }
  92221. if (this.resizeObserver_) {
  92222. if (this.player_.el()) {
  92223. this.resizeObserver_.unobserve(this.player_.el());
  92224. }
  92225. this.resizeObserver_.disconnect();
  92226. }
  92227. if (this.loadListener_) {
  92228. this.off("load", this.loadListener_);
  92229. }
  92230. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  92231. this.unloadListener_.call(this.el_.contentWindow);
  92232. }
  92233. this.ResizeObserver = null;
  92234. this.resizeObserver = null;
  92235. this.debouncedHandler_ = null;
  92236. this.loadListener_ = null;
  92237. _Component.prototype.dispose.call(this);
  92238. };
  92239. return ResizeManager2;
  92240. }(Component$1);
  92241. Component$1.registerComponent("ResizeManager", ResizeManager);
  92242. var defaults$1 = {
  92243. trackingThreshold: 20,
  92244. liveTolerance: 15
  92245. };
  92246. var LiveTracker = /* @__PURE__ */ function(_Component) {
  92247. _inheritsLoose(LiveTracker2, _Component);
  92248. function LiveTracker2(player, options2) {
  92249. var _this;
  92250. var options_ = mergeOptions$3(defaults$1, options2, {
  92251. createEl: false
  92252. });
  92253. _this = _Component.call(this, player, options_) || this;
  92254. _this.handleVisibilityChange_ = function(e) {
  92255. return _this.handleVisibilityChange(e);
  92256. };
  92257. _this.trackLiveHandler_ = function() {
  92258. return _this.trackLive_();
  92259. };
  92260. _this.handlePlay_ = function(e) {
  92261. return _this.handlePlay(e);
  92262. };
  92263. _this.handleFirstTimeupdate_ = function(e) {
  92264. return _this.handleFirstTimeupdate(e);
  92265. };
  92266. _this.handleSeeked_ = function(e) {
  92267. return _this.handleSeeked(e);
  92268. };
  92269. _this.seekToLiveEdge_ = function(e) {
  92270. return _this.seekToLiveEdge(e);
  92271. };
  92272. _this.reset_();
  92273. _this.on(_this.player_, "durationchange", function(e) {
  92274. return _this.handleDurationchange(e);
  92275. });
  92276. _this.on(_this.player_, "canplay", function() {
  92277. return _this.toggleTracking();
  92278. });
  92279. if (IE_VERSION && "hidden" in document_1 && "visibilityState" in document_1) {
  92280. _this.on(document_1, "visibilitychange", _this.handleVisibilityChange_);
  92281. }
  92282. return _this;
  92283. }
  92284. var _proto = LiveTracker2.prototype;
  92285. _proto.handleVisibilityChange = function handleVisibilityChange() {
  92286. if (this.player_.duration() !== Infinity) {
  92287. return;
  92288. }
  92289. if (document_1.hidden) {
  92290. this.stopTracking();
  92291. } else {
  92292. this.startTracking();
  92293. }
  92294. };
  92295. _proto.trackLive_ = function trackLive_() {
  92296. var seekable3 = this.player_.seekable();
  92297. if (!seekable3 || !seekable3.length) {
  92298. return;
  92299. }
  92300. var newTime = Number(window_1.performance.now().toFixed(4));
  92301. var deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  92302. this.lastTime_ = newTime;
  92303. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  92304. var liveCurrentTime = this.liveCurrentTime();
  92305. var currentTime = this.player_.currentTime();
  92306. var isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  92307. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  92308. isBehind = false;
  92309. }
  92310. if (isBehind !== this.behindLiveEdge_) {
  92311. this.behindLiveEdge_ = isBehind;
  92312. this.trigger("liveedgechange");
  92313. }
  92314. };
  92315. _proto.handleDurationchange = function handleDurationchange() {
  92316. this.toggleTracking();
  92317. };
  92318. _proto.toggleTracking = function toggleTracking() {
  92319. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  92320. if (this.player_.options_.liveui) {
  92321. this.player_.addClass("vjs-liveui");
  92322. }
  92323. this.startTracking();
  92324. } else {
  92325. this.player_.removeClass("vjs-liveui");
  92326. this.stopTracking();
  92327. }
  92328. };
  92329. _proto.startTracking = function startTracking() {
  92330. if (this.isTracking()) {
  92331. return;
  92332. }
  92333. if (!this.timeupdateSeen_) {
  92334. this.timeupdateSeen_ = this.player_.hasStarted();
  92335. }
  92336. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);
  92337. this.trackLive_();
  92338. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92339. if (!this.timeupdateSeen_) {
  92340. this.one(this.player_, "play", this.handlePlay_);
  92341. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92342. } else {
  92343. this.on(this.player_, "seeked", this.handleSeeked_);
  92344. }
  92345. };
  92346. _proto.handleFirstTimeupdate = function handleFirstTimeupdate() {
  92347. this.timeupdateSeen_ = true;
  92348. this.on(this.player_, "seeked", this.handleSeeked_);
  92349. };
  92350. _proto.handleSeeked = function handleSeeked() {
  92351. var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  92352. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  92353. this.nextSeekedFromUser_ = false;
  92354. this.trackLive_();
  92355. };
  92356. _proto.handlePlay = function handlePlay() {
  92357. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  92358. };
  92359. _proto.reset_ = function reset_() {
  92360. this.lastTime_ = -1;
  92361. this.pastSeekEnd_ = 0;
  92362. this.lastSeekEnd_ = -1;
  92363. this.behindLiveEdge_ = true;
  92364. this.timeupdateSeen_ = false;
  92365. this.seekedBehindLive_ = false;
  92366. this.nextSeekedFromUser_ = false;
  92367. this.clearInterval(this.trackingInterval_);
  92368. this.trackingInterval_ = null;
  92369. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92370. this.off(this.player_, "seeked", this.handleSeeked_);
  92371. this.off(this.player_, "play", this.handlePlay_);
  92372. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92373. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  92374. };
  92375. _proto.nextSeekedFromUser = function nextSeekedFromUser() {
  92376. this.nextSeekedFromUser_ = true;
  92377. };
  92378. _proto.stopTracking = function stopTracking() {
  92379. if (!this.isTracking()) {
  92380. return;
  92381. }
  92382. this.reset_();
  92383. this.trigger("liveedgechange");
  92384. };
  92385. _proto.seekableEnd = function seekableEnd() {
  92386. var seekable3 = this.player_.seekable();
  92387. var seekableEnds = [];
  92388. var i2 = seekable3 ? seekable3.length : 0;
  92389. while (i2--) {
  92390. seekableEnds.push(seekable3.end(i2));
  92391. }
  92392. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  92393. };
  92394. _proto.seekableStart = function seekableStart() {
  92395. var seekable3 = this.player_.seekable();
  92396. var seekableStarts = [];
  92397. var i2 = seekable3 ? seekable3.length : 0;
  92398. while (i2--) {
  92399. seekableStarts.push(seekable3.start(i2));
  92400. }
  92401. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  92402. };
  92403. _proto.liveWindow = function liveWindow() {
  92404. var liveCurrentTime = this.liveCurrentTime();
  92405. if (liveCurrentTime === Infinity) {
  92406. return 0;
  92407. }
  92408. return liveCurrentTime - this.seekableStart();
  92409. };
  92410. _proto.isLive = function isLive() {
  92411. return this.isTracking();
  92412. };
  92413. _proto.atLiveEdge = function atLiveEdge() {
  92414. return !this.behindLiveEdge();
  92415. };
  92416. _proto.liveCurrentTime = function liveCurrentTime() {
  92417. return this.pastSeekEnd() + this.seekableEnd();
  92418. };
  92419. _proto.pastSeekEnd = function pastSeekEnd() {
  92420. var seekableEnd = this.seekableEnd();
  92421. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  92422. this.pastSeekEnd_ = 0;
  92423. }
  92424. this.lastSeekEnd_ = seekableEnd;
  92425. return this.pastSeekEnd_;
  92426. };
  92427. _proto.behindLiveEdge = function behindLiveEdge() {
  92428. return this.behindLiveEdge_;
  92429. };
  92430. _proto.isTracking = function isTracking() {
  92431. return typeof this.trackingInterval_ === "number";
  92432. };
  92433. _proto.seekToLiveEdge = function seekToLiveEdge() {
  92434. this.seekedBehindLive_ = false;
  92435. if (this.atLiveEdge()) {
  92436. return;
  92437. }
  92438. this.nextSeekedFromUser_ = false;
  92439. this.player_.currentTime(this.liveCurrentTime());
  92440. };
  92441. _proto.dispose = function dispose() {
  92442. this.off(document_1, "visibilitychange", this.handleVisibilityChange_);
  92443. this.stopTracking();
  92444. _Component.prototype.dispose.call(this);
  92445. };
  92446. return LiveTracker2;
  92447. }(Component$1);
  92448. Component$1.registerComponent("LiveTracker", LiveTracker);
  92449. var sourcesetLoad = function sourcesetLoad2(tech) {
  92450. var el = tech.el();
  92451. if (el.hasAttribute("src")) {
  92452. tech.triggerSourceset(el.src);
  92453. return true;
  92454. }
  92455. var sources = tech.$$("source");
  92456. var srcUrls = [];
  92457. var src = "";
  92458. if (!sources.length) {
  92459. return false;
  92460. }
  92461. for (var i2 = 0; i2 < sources.length; i2++) {
  92462. var url = sources[i2].src;
  92463. if (url && srcUrls.indexOf(url) === -1) {
  92464. srcUrls.push(url);
  92465. }
  92466. }
  92467. if (!srcUrls.length) {
  92468. return false;
  92469. }
  92470. if (srcUrls.length === 1) {
  92471. src = srcUrls[0];
  92472. }
  92473. tech.triggerSourceset(src);
  92474. return true;
  92475. };
  92476. var innerHTMLDescriptorPolyfill = Object.defineProperty({}, "innerHTML", {
  92477. get: function get2() {
  92478. return this.cloneNode(true).innerHTML;
  92479. },
  92480. set: function set2(v) {
  92481. var dummy = document_1.createElement(this.nodeName.toLowerCase());
  92482. dummy.innerHTML = v;
  92483. var docFrag = document_1.createDocumentFragment();
  92484. while (dummy.childNodes.length) {
  92485. docFrag.appendChild(dummy.childNodes[0]);
  92486. }
  92487. this.innerText = "";
  92488. window_1.Element.prototype.appendChild.call(this, docFrag);
  92489. return this.innerHTML;
  92490. }
  92491. });
  92492. var getDescriptor = function getDescriptor2(priority, prop) {
  92493. var descriptor = {};
  92494. for (var i2 = 0; i2 < priority.length; i2++) {
  92495. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  92496. if (descriptor && descriptor.set && descriptor.get) {
  92497. break;
  92498. }
  92499. }
  92500. descriptor.enumerable = true;
  92501. descriptor.configurable = true;
  92502. return descriptor;
  92503. };
  92504. var getInnerHTMLDescriptor = function getInnerHTMLDescriptor2(tech) {
  92505. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill], "innerHTML");
  92506. };
  92507. var firstSourceWatch = function firstSourceWatch2(tech) {
  92508. var el = tech.el();
  92509. if (el.resetSourceWatch_) {
  92510. return;
  92511. }
  92512. var old = {};
  92513. var innerDescriptor = getInnerHTMLDescriptor(tech);
  92514. var appendWrapper = function appendWrapper2(appendFn) {
  92515. return function() {
  92516. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  92517. args[_key] = arguments[_key];
  92518. }
  92519. var retval = appendFn.apply(el, args);
  92520. sourcesetLoad(tech);
  92521. return retval;
  92522. };
  92523. };
  92524. ["append", "appendChild", "insertAdjacentHTML"].forEach(function(k) {
  92525. if (!el[k]) {
  92526. return;
  92527. }
  92528. old[k] = el[k];
  92529. el[k] = appendWrapper(old[k]);
  92530. });
  92531. Object.defineProperty(el, "innerHTML", mergeOptions$3(innerDescriptor, {
  92532. set: appendWrapper(innerDescriptor.set)
  92533. }));
  92534. el.resetSourceWatch_ = function() {
  92535. el.resetSourceWatch_ = null;
  92536. Object.keys(old).forEach(function(k) {
  92537. el[k] = old[k];
  92538. });
  92539. Object.defineProperty(el, "innerHTML", innerDescriptor);
  92540. };
  92541. tech.one("sourceset", el.resetSourceWatch_);
  92542. };
  92543. var srcDescriptorPolyfill = Object.defineProperty({}, "src", {
  92544. get: function get3() {
  92545. if (this.hasAttribute("src")) {
  92546. return getAbsoluteURL(window_1.Element.prototype.getAttribute.call(this, "src"));
  92547. }
  92548. return "";
  92549. },
  92550. set: function set3(v) {
  92551. window_1.Element.prototype.setAttribute.call(this, "src", v);
  92552. return v;
  92553. }
  92554. });
  92555. var getSrcDescriptor = function getSrcDescriptor2(tech) {
  92556. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill], "src");
  92557. };
  92558. var setupSourceset = function setupSourceset2(tech) {
  92559. if (!tech.featuresSourceset) {
  92560. return;
  92561. }
  92562. var el = tech.el();
  92563. if (el.resetSourceset_) {
  92564. return;
  92565. }
  92566. var srcDescriptor = getSrcDescriptor(tech);
  92567. var oldSetAttribute = el.setAttribute;
  92568. var oldLoad = el.load;
  92569. Object.defineProperty(el, "src", mergeOptions$3(srcDescriptor, {
  92570. set: function set4(v) {
  92571. var retval = srcDescriptor.set.call(el, v);
  92572. tech.triggerSourceset(el.src);
  92573. return retval;
  92574. }
  92575. }));
  92576. el.setAttribute = function(n, v) {
  92577. var retval = oldSetAttribute.call(el, n, v);
  92578. if (/src/i.test(n)) {
  92579. tech.triggerSourceset(el.src);
  92580. }
  92581. return retval;
  92582. };
  92583. el.load = function() {
  92584. var retval = oldLoad.call(el);
  92585. if (!sourcesetLoad(tech)) {
  92586. tech.triggerSourceset("");
  92587. firstSourceWatch(tech);
  92588. }
  92589. return retval;
  92590. };
  92591. if (el.currentSrc) {
  92592. tech.triggerSourceset(el.currentSrc);
  92593. } else if (!sourcesetLoad(tech)) {
  92594. firstSourceWatch(tech);
  92595. }
  92596. el.resetSourceset_ = function() {
  92597. el.resetSourceset_ = null;
  92598. el.load = oldLoad;
  92599. el.setAttribute = oldSetAttribute;
  92600. Object.defineProperty(el, "src", srcDescriptor);
  92601. if (el.resetSourceWatch_) {
  92602. el.resetSourceWatch_();
  92603. }
  92604. };
  92605. };
  92606. var defineLazyProperty = function defineLazyProperty2(obj, key, getValue2, setter) {
  92607. if (setter === void 0) {
  92608. setter = true;
  92609. }
  92610. var set4 = function set5(value) {
  92611. return Object.defineProperty(obj, key, {
  92612. value,
  92613. enumerable: true,
  92614. writable: true
  92615. });
  92616. };
  92617. var options2 = {
  92618. configurable: true,
  92619. enumerable: true,
  92620. get: function get7() {
  92621. var value = getValue2();
  92622. set4(value);
  92623. return value;
  92624. }
  92625. };
  92626. if (setter) {
  92627. options2.set = set4;
  92628. }
  92629. return Object.defineProperty(obj, key, options2);
  92630. };
  92631. var Html5$1 = /* @__PURE__ */ function(_Tech) {
  92632. _inheritsLoose(Html52, _Tech);
  92633. function Html52(options2, ready) {
  92634. var _this;
  92635. _this = _Tech.call(this, options2, ready) || this;
  92636. var source = options2.source;
  92637. var crossoriginTracks = false;
  92638. _this.featuresVideoFrameCallback = _this.featuresVideoFrameCallback && _this.el_.tagName === "VIDEO";
  92639. if (source && (_this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  92640. _this.setSource(source);
  92641. } else {
  92642. _this.handleLateInit_(_this.el_);
  92643. }
  92644. if (options2.enableSourceset) {
  92645. _this.setupSourcesetHandling_();
  92646. }
  92647. _this.isScrubbing_ = false;
  92648. if (_this.el_.hasChildNodes()) {
  92649. var nodes = _this.el_.childNodes;
  92650. var nodesLength = nodes.length;
  92651. var removeNodes = [];
  92652. while (nodesLength--) {
  92653. var node = nodes[nodesLength];
  92654. var nodeName = node.nodeName.toLowerCase();
  92655. if (nodeName === "track") {
  92656. if (!_this.featuresNativeTextTracks) {
  92657. removeNodes.push(node);
  92658. } else {
  92659. _this.remoteTextTrackEls().addTrackElement_(node);
  92660. _this.remoteTextTracks().addTrack(node.track);
  92661. _this.textTracks().addTrack(node.track);
  92662. if (!crossoriginTracks && !_this.el_.hasAttribute("crossorigin") && isCrossOrigin(node.src)) {
  92663. crossoriginTracks = true;
  92664. }
  92665. }
  92666. }
  92667. }
  92668. for (var i2 = 0; i2 < removeNodes.length; i2++) {
  92669. _this.el_.removeChild(removeNodes[i2]);
  92670. }
  92671. }
  92672. _this.proxyNativeTracks_();
  92673. if (_this.featuresNativeTextTracks && crossoriginTracks) {
  92674. log$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  92675. }
  92676. _this.restoreMetadataTracksInIOSNativePlayer_();
  92677. if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options2.nativeControlsForTouch === true) {
  92678. _this.setControls(true);
  92679. }
  92680. _this.proxyWebkitFullscreen_();
  92681. _this.triggerReady();
  92682. return _this;
  92683. }
  92684. var _proto = Html52.prototype;
  92685. _proto.dispose = function dispose() {
  92686. if (this.el_ && this.el_.resetSourceset_) {
  92687. this.el_.resetSourceset_();
  92688. }
  92689. Html52.disposeMediaElement(this.el_);
  92690. this.options_ = null;
  92691. _Tech.prototype.dispose.call(this);
  92692. };
  92693. _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {
  92694. setupSourceset(this);
  92695. };
  92696. _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {
  92697. var textTracks = this.textTracks();
  92698. var metadataTracksPreFullscreenState;
  92699. var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot2() {
  92700. metadataTracksPreFullscreenState = [];
  92701. for (var i2 = 0; i2 < textTracks.length; i2++) {
  92702. var track = textTracks[i2];
  92703. if (track.kind === "metadata") {
  92704. metadataTracksPreFullscreenState.push({
  92705. track,
  92706. storedMode: track.mode
  92707. });
  92708. }
  92709. }
  92710. };
  92711. takeMetadataTrackSnapshot();
  92712. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92713. this.on("dispose", function() {
  92714. return textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92715. });
  92716. var restoreTrackMode = function restoreTrackMode2() {
  92717. for (var i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  92718. var storedTrack = metadataTracksPreFullscreenState[i2];
  92719. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  92720. storedTrack.track.mode = storedTrack.storedMode;
  92721. }
  92722. }
  92723. textTracks.removeEventListener("change", restoreTrackMode2);
  92724. };
  92725. this.on("webkitbeginfullscreen", function() {
  92726. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92727. textTracks.removeEventListener("change", restoreTrackMode);
  92728. textTracks.addEventListener("change", restoreTrackMode);
  92729. });
  92730. this.on("webkitendfullscreen", function() {
  92731. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92732. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92733. textTracks.removeEventListener("change", restoreTrackMode);
  92734. });
  92735. };
  92736. _proto.overrideNative_ = function overrideNative_(type2, override) {
  92737. var _this2 = this;
  92738. if (override !== this["featuresNative" + type2 + "Tracks"]) {
  92739. return;
  92740. }
  92741. var lowerCaseType = type2.toLowerCase();
  92742. if (this[lowerCaseType + "TracksListeners_"]) {
  92743. Object.keys(this[lowerCaseType + "TracksListeners_"]).forEach(function(eventName) {
  92744. var elTracks = _this2.el()[lowerCaseType + "Tracks"];
  92745. elTracks.removeEventListener(eventName, _this2[lowerCaseType + "TracksListeners_"][eventName]);
  92746. });
  92747. }
  92748. this["featuresNative" + type2 + "Tracks"] = !override;
  92749. this[lowerCaseType + "TracksListeners_"] = null;
  92750. this.proxyNativeTracksForType_(lowerCaseType);
  92751. };
  92752. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {
  92753. this.overrideNative_("Audio", override);
  92754. };
  92755. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {
  92756. this.overrideNative_("Video", override);
  92757. };
  92758. _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {
  92759. var _this3 = this;
  92760. var props = NORMAL[name];
  92761. var elTracks = this.el()[props.getterName];
  92762. var techTracks = this[props.getterName]();
  92763. if (!this["featuresNative" + props.capitalName + "Tracks"] || !elTracks || !elTracks.addEventListener) {
  92764. return;
  92765. }
  92766. var listeners = {
  92767. change: function change(e) {
  92768. var event2 = {
  92769. type: "change",
  92770. target: techTracks,
  92771. currentTarget: techTracks,
  92772. srcElement: techTracks
  92773. };
  92774. techTracks.trigger(event2);
  92775. if (name === "text") {
  92776. _this3[REMOTE.remoteText.getterName]().trigger(event2);
  92777. }
  92778. },
  92779. addtrack: function addtrack(e) {
  92780. techTracks.addTrack(e.track);
  92781. },
  92782. removetrack: function removetrack(e) {
  92783. techTracks.removeTrack(e.track);
  92784. }
  92785. };
  92786. var removeOldTracks = function removeOldTracks2() {
  92787. var removeTracks = [];
  92788. for (var i2 = 0; i2 < techTracks.length; i2++) {
  92789. var found = false;
  92790. for (var j = 0; j < elTracks.length; j++) {
  92791. if (elTracks[j] === techTracks[i2]) {
  92792. found = true;
  92793. break;
  92794. }
  92795. }
  92796. if (!found) {
  92797. removeTracks.push(techTracks[i2]);
  92798. }
  92799. }
  92800. while (removeTracks.length) {
  92801. techTracks.removeTrack(removeTracks.shift());
  92802. }
  92803. };
  92804. this[props.getterName + "Listeners_"] = listeners;
  92805. Object.keys(listeners).forEach(function(eventName) {
  92806. var listener = listeners[eventName];
  92807. elTracks.addEventListener(eventName, listener);
  92808. _this3.on("dispose", function(e) {
  92809. return elTracks.removeEventListener(eventName, listener);
  92810. });
  92811. });
  92812. this.on("loadstart", removeOldTracks);
  92813. this.on("dispose", function(e) {
  92814. return _this3.off("loadstart", removeOldTracks);
  92815. });
  92816. };
  92817. _proto.proxyNativeTracks_ = function proxyNativeTracks_() {
  92818. var _this4 = this;
  92819. NORMAL.names.forEach(function(name) {
  92820. _this4.proxyNativeTracksForType_(name);
  92821. });
  92822. };
  92823. _proto.createEl = function createEl2() {
  92824. var el = this.options_.tag;
  92825. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  92826. if (el) {
  92827. var clone = el.cloneNode(true);
  92828. if (el.parentNode) {
  92829. el.parentNode.insertBefore(clone, el);
  92830. }
  92831. Html52.disposeMediaElement(el);
  92832. el = clone;
  92833. } else {
  92834. el = document_1.createElement("video");
  92835. var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);
  92836. var attributes = mergeOptions$3({}, tagAttributes);
  92837. if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {
  92838. delete attributes.controls;
  92839. }
  92840. setAttributes(el, assign(attributes, {
  92841. id: this.options_.techId,
  92842. "class": "vjs-tech"
  92843. }));
  92844. }
  92845. el.playerId = this.options_.playerId;
  92846. }
  92847. if (typeof this.options_.preload !== "undefined") {
  92848. setAttribute(el, "preload", this.options_.preload);
  92849. }
  92850. if (this.options_.disablePictureInPicture !== void 0) {
  92851. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  92852. }
  92853. var settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  92854. for (var i2 = 0; i2 < settingsAttrs.length; i2++) {
  92855. var attr = settingsAttrs[i2];
  92856. var value = this.options_[attr];
  92857. if (typeof value !== "undefined") {
  92858. if (value) {
  92859. setAttribute(el, attr, attr);
  92860. } else {
  92861. removeAttribute(el, attr);
  92862. }
  92863. el[attr] = value;
  92864. }
  92865. }
  92866. return el;
  92867. };
  92868. _proto.handleLateInit_ = function handleLateInit_(el) {
  92869. if (el.networkState === 0 || el.networkState === 3) {
  92870. return;
  92871. }
  92872. if (el.readyState === 0) {
  92873. var loadstartFired = false;
  92874. var setLoadstartFired = function setLoadstartFired2() {
  92875. loadstartFired = true;
  92876. };
  92877. this.on("loadstart", setLoadstartFired);
  92878. var triggerLoadstart = function triggerLoadstart2() {
  92879. if (!loadstartFired) {
  92880. this.trigger("loadstart");
  92881. }
  92882. };
  92883. this.on("loadedmetadata", triggerLoadstart);
  92884. this.ready(function() {
  92885. this.off("loadstart", setLoadstartFired);
  92886. this.off("loadedmetadata", triggerLoadstart);
  92887. if (!loadstartFired) {
  92888. this.trigger("loadstart");
  92889. }
  92890. });
  92891. return;
  92892. }
  92893. var eventsToTrigger = ["loadstart"];
  92894. eventsToTrigger.push("loadedmetadata");
  92895. if (el.readyState >= 2) {
  92896. eventsToTrigger.push("loadeddata");
  92897. }
  92898. if (el.readyState >= 3) {
  92899. eventsToTrigger.push("canplay");
  92900. }
  92901. if (el.readyState >= 4) {
  92902. eventsToTrigger.push("canplaythrough");
  92903. }
  92904. this.ready(function() {
  92905. eventsToTrigger.forEach(function(type2) {
  92906. this.trigger(type2);
  92907. }, this);
  92908. });
  92909. };
  92910. _proto.setScrubbing = function setScrubbing(isScrubbing) {
  92911. this.isScrubbing_ = isScrubbing;
  92912. };
  92913. _proto.scrubbing = function scrubbing() {
  92914. return this.isScrubbing_;
  92915. };
  92916. _proto.setCurrentTime = function setCurrentTime(seconds) {
  92917. try {
  92918. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {
  92919. this.el_.fastSeek(seconds);
  92920. } else {
  92921. this.el_.currentTime = seconds;
  92922. }
  92923. } catch (e) {
  92924. log$1(e, "Video is not ready. (Video.js)");
  92925. }
  92926. };
  92927. _proto.duration = function duration5() {
  92928. var _this5 = this;
  92929. if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {
  92930. var checkProgress = function checkProgress2() {
  92931. if (_this5.el_.currentTime > 0) {
  92932. if (_this5.el_.duration === Infinity) {
  92933. _this5.trigger("durationchange");
  92934. }
  92935. _this5.off("timeupdate", checkProgress2);
  92936. }
  92937. };
  92938. this.on("timeupdate", checkProgress);
  92939. return NaN;
  92940. }
  92941. return this.el_.duration || NaN;
  92942. };
  92943. _proto.width = function width2() {
  92944. return this.el_.offsetWidth;
  92945. };
  92946. _proto.height = function height2() {
  92947. return this.el_.offsetHeight;
  92948. };
  92949. _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {
  92950. var _this6 = this;
  92951. if (!("webkitDisplayingFullscreen" in this.el_)) {
  92952. return;
  92953. }
  92954. var endFn = function endFn2() {
  92955. this.trigger("fullscreenchange", {
  92956. isFullscreen: false
  92957. });
  92958. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  92959. this.el_.controls = false;
  92960. }
  92961. };
  92962. var beginFn = function beginFn2() {
  92963. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  92964. this.one("webkitendfullscreen", endFn);
  92965. this.trigger("fullscreenchange", {
  92966. isFullscreen: true,
  92967. nativeIOSFullscreen: true
  92968. });
  92969. }
  92970. };
  92971. this.on("webkitbeginfullscreen", beginFn);
  92972. this.on("dispose", function() {
  92973. _this6.off("webkitbeginfullscreen", beginFn);
  92974. _this6.off("webkitendfullscreen", endFn);
  92975. });
  92976. };
  92977. _proto.supportsFullScreen = function supportsFullScreen() {
  92978. if (typeof this.el_.webkitEnterFullScreen === "function") {
  92979. var userAgent = window_1.navigator && window_1.navigator.userAgent || "";
  92980. if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {
  92981. return true;
  92982. }
  92983. }
  92984. return false;
  92985. };
  92986. _proto.enterFullScreen = function enterFullScreen() {
  92987. var video = this.el_;
  92988. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  92989. silencePromise(this.el_.play());
  92990. this.setTimeout(function() {
  92991. video.pause();
  92992. try {
  92993. video.webkitEnterFullScreen();
  92994. } catch (e) {
  92995. this.trigger("fullscreenerror", e);
  92996. }
  92997. }, 0);
  92998. } else {
  92999. try {
  93000. video.webkitEnterFullScreen();
  93001. } catch (e) {
  93002. this.trigger("fullscreenerror", e);
  93003. }
  93004. }
  93005. };
  93006. _proto.exitFullScreen = function exitFullScreen() {
  93007. if (!this.el_.webkitDisplayingFullscreen) {
  93008. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  93009. return;
  93010. }
  93011. this.el_.webkitExitFullScreen();
  93012. };
  93013. _proto.requestPictureInPicture = function requestPictureInPicture() {
  93014. return this.el_.requestPictureInPicture();
  93015. };
  93016. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  93017. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  93018. return this.el_.requestVideoFrameCallback(cb);
  93019. }
  93020. return _Tech.prototype.requestVideoFrameCallback.call(this, cb);
  93021. };
  93022. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  93023. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  93024. this.el_.cancelVideoFrameCallback(id);
  93025. } else {
  93026. _Tech.prototype.cancelVideoFrameCallback.call(this, id);
  93027. }
  93028. };
  93029. _proto.src = function src(_src) {
  93030. if (_src === void 0) {
  93031. return this.el_.src;
  93032. }
  93033. this.setSrc(_src);
  93034. };
  93035. _proto.reset = function reset3() {
  93036. Html52.resetMediaElement(this.el_);
  93037. };
  93038. _proto.currentSrc = function currentSrc() {
  93039. if (this.currentSource_) {
  93040. return this.currentSource_.src;
  93041. }
  93042. return this.el_.currentSrc;
  93043. };
  93044. _proto.setControls = function setControls(val) {
  93045. this.el_.controls = !!val;
  93046. };
  93047. _proto.addTextTrack = function addTextTrack(kind, label2, language) {
  93048. if (!this.featuresNativeTextTracks) {
  93049. return _Tech.prototype.addTextTrack.call(this, kind, label2, language);
  93050. }
  93051. return this.el_.addTextTrack(kind, label2, language);
  93052. };
  93053. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  93054. if (!this.featuresNativeTextTracks) {
  93055. return _Tech.prototype.createRemoteTextTrack.call(this, options2);
  93056. }
  93057. var htmlTrackElement = document_1.createElement("track");
  93058. if (options2.kind) {
  93059. htmlTrackElement.kind = options2.kind;
  93060. }
  93061. if (options2.label) {
  93062. htmlTrackElement.label = options2.label;
  93063. }
  93064. if (options2.language || options2.srclang) {
  93065. htmlTrackElement.srclang = options2.language || options2.srclang;
  93066. }
  93067. if (options2["default"]) {
  93068. htmlTrackElement["default"] = options2["default"];
  93069. }
  93070. if (options2.id) {
  93071. htmlTrackElement.id = options2.id;
  93072. }
  93073. if (options2.src) {
  93074. htmlTrackElement.src = options2.src;
  93075. }
  93076. return htmlTrackElement;
  93077. };
  93078. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  93079. var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options2, manualCleanup);
  93080. if (this.featuresNativeTextTracks) {
  93081. this.el().appendChild(htmlTrackElement);
  93082. }
  93083. return htmlTrackElement;
  93084. };
  93085. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  93086. _Tech.prototype.removeRemoteTextTrack.call(this, track);
  93087. if (this.featuresNativeTextTracks) {
  93088. var tracks = this.$$("track");
  93089. var i2 = tracks.length;
  93090. while (i2--) {
  93091. if (track === tracks[i2] || track === tracks[i2].track) {
  93092. this.el().removeChild(tracks[i2]);
  93093. }
  93094. }
  93095. }
  93096. };
  93097. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  93098. if (typeof this.el().getVideoPlaybackQuality === "function") {
  93099. return this.el().getVideoPlaybackQuality();
  93100. }
  93101. var videoPlaybackQuality = {};
  93102. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  93103. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  93104. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  93105. }
  93106. if (window_1.performance && typeof window_1.performance.now === "function") {
  93107. videoPlaybackQuality.creationTime = window_1.performance.now();
  93108. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  93109. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  93110. }
  93111. return videoPlaybackQuality;
  93112. };
  93113. return Html52;
  93114. }(Tech$1);
  93115. defineLazyProperty(Html5$1, "TEST_VID", function() {
  93116. if (!isReal()) {
  93117. return;
  93118. }
  93119. var video = document_1.createElement("video");
  93120. var track = document_1.createElement("track");
  93121. track.kind = "captions";
  93122. track.srclang = "en";
  93123. track.label = "English";
  93124. video.appendChild(track);
  93125. return video;
  93126. });
  93127. Html5$1.isSupported = function() {
  93128. try {
  93129. Html5$1.TEST_VID.volume = 0.5;
  93130. } catch (e) {
  93131. return false;
  93132. }
  93133. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.canPlayType);
  93134. };
  93135. Html5$1.canPlayType = function(type2) {
  93136. return Html5$1.TEST_VID.canPlayType(type2);
  93137. };
  93138. Html5$1.canPlaySource = function(srcObj, options2) {
  93139. return Html5$1.canPlayType(srcObj.type);
  93140. };
  93141. Html5$1.canControlVolume = function() {
  93142. try {
  93143. var volume = Html5$1.TEST_VID.volume;
  93144. Html5$1.TEST_VID.volume = volume / 2 + 0.1;
  93145. var canControl = volume !== Html5$1.TEST_VID.volume;
  93146. if (canControl && IS_IOS) {
  93147. window_1.setTimeout(function() {
  93148. if (Html5$1 && Html5$1.prototype) {
  93149. Html5$1.prototype.featuresVolumeControl = volume !== Html5$1.TEST_VID.volume;
  93150. }
  93151. });
  93152. return false;
  93153. }
  93154. return canControl;
  93155. } catch (e) {
  93156. return false;
  93157. }
  93158. };
  93159. Html5$1.canMuteVolume = function() {
  93160. try {
  93161. var muted = Html5$1.TEST_VID.muted;
  93162. Html5$1.TEST_VID.muted = !muted;
  93163. if (Html5$1.TEST_VID.muted) {
  93164. setAttribute(Html5$1.TEST_VID, "muted", "muted");
  93165. } else {
  93166. removeAttribute(Html5$1.TEST_VID, "muted", "muted");
  93167. }
  93168. return muted !== Html5$1.TEST_VID.muted;
  93169. } catch (e) {
  93170. return false;
  93171. }
  93172. };
  93173. Html5$1.canControlPlaybackRate = function() {
  93174. if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {
  93175. return false;
  93176. }
  93177. try {
  93178. var playbackRate = Html5$1.TEST_VID.playbackRate;
  93179. Html5$1.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  93180. return playbackRate !== Html5$1.TEST_VID.playbackRate;
  93181. } catch (e) {
  93182. return false;
  93183. }
  93184. };
  93185. Html5$1.canOverrideAttributes = function() {
  93186. try {
  93187. var noop2 = function noop3() {
  93188. };
  93189. Object.defineProperty(document_1.createElement("video"), "src", {
  93190. get: noop2,
  93191. set: noop2
  93192. });
  93193. Object.defineProperty(document_1.createElement("audio"), "src", {
  93194. get: noop2,
  93195. set: noop2
  93196. });
  93197. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  93198. get: noop2,
  93199. set: noop2
  93200. });
  93201. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  93202. get: noop2,
  93203. set: noop2
  93204. });
  93205. } catch (e) {
  93206. return false;
  93207. }
  93208. return true;
  93209. };
  93210. Html5$1.supportsNativeTextTracks = function() {
  93211. return IS_ANY_SAFARI || IS_IOS && IS_CHROME;
  93212. };
  93213. Html5$1.supportsNativeVideoTracks = function() {
  93214. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.videoTracks);
  93215. };
  93216. Html5$1.supportsNativeAudioTracks = function() {
  93217. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.audioTracks);
  93218. };
  93219. Html5$1.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  93220. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(_ref) {
  93221. var key = _ref[0], fn2 = _ref[1];
  93222. defineLazyProperty(Html5$1.prototype, key, function() {
  93223. return Html5$1[fn2]();
  93224. }, true);
  93225. });
  93226. Html5$1.prototype.featuresVolumeControl = Html5$1.canControlVolume();
  93227. Html5$1.prototype.movingMediaElementInDOM = !IS_IOS;
  93228. Html5$1.prototype.featuresFullscreenResize = true;
  93229. Html5$1.prototype.featuresProgressEvents = true;
  93230. Html5$1.prototype.featuresTimeupdateEvents = true;
  93231. Html5$1.prototype.featuresVideoFrameCallback = !!(Html5$1.TEST_VID && Html5$1.TEST_VID.requestVideoFrameCallback);
  93232. var canPlayType;
  93233. Html5$1.patchCanPlayType = function() {
  93234. if (ANDROID_VERSION >= 4 && !IS_FIREFOX && !IS_CHROME) {
  93235. canPlayType = Html5$1.TEST_VID && Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93236. Html5$1.TEST_VID.constructor.prototype.canPlayType = function(type2) {
  93237. var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i;
  93238. if (type2 && mpegurlRE.test(type2)) {
  93239. return "maybe";
  93240. }
  93241. return canPlayType.call(this, type2);
  93242. };
  93243. }
  93244. };
  93245. Html5$1.unpatchCanPlayType = function() {
  93246. var r2 = Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93247. if (canPlayType) {
  93248. Html5$1.TEST_VID.constructor.prototype.canPlayType = canPlayType;
  93249. }
  93250. return r2;
  93251. };
  93252. Html5$1.patchCanPlayType();
  93253. Html5$1.disposeMediaElement = function(el) {
  93254. if (!el) {
  93255. return;
  93256. }
  93257. if (el.parentNode) {
  93258. el.parentNode.removeChild(el);
  93259. }
  93260. while (el.hasChildNodes()) {
  93261. el.removeChild(el.firstChild);
  93262. }
  93263. el.removeAttribute("src");
  93264. if (typeof el.load === "function") {
  93265. (function() {
  93266. try {
  93267. el.load();
  93268. } catch (e) {
  93269. }
  93270. })();
  93271. }
  93272. };
  93273. Html5$1.resetMediaElement = function(el) {
  93274. if (!el) {
  93275. return;
  93276. }
  93277. var sources = el.querySelectorAll("source");
  93278. var i2 = sources.length;
  93279. while (i2--) {
  93280. el.removeChild(sources[i2]);
  93281. }
  93282. el.removeAttribute("src");
  93283. if (typeof el.load === "function") {
  93284. (function() {
  93285. try {
  93286. el.load();
  93287. } catch (e) {
  93288. }
  93289. })();
  93290. }
  93291. };
  93292. [
  93293. "muted",
  93294. "defaultMuted",
  93295. "autoplay",
  93296. "controls",
  93297. "loop",
  93298. "playsinline"
  93299. ].forEach(function(prop) {
  93300. Html5$1.prototype[prop] = function() {
  93301. return this.el_[prop] || this.el_.hasAttribute(prop);
  93302. };
  93303. });
  93304. [
  93305. "muted",
  93306. "defaultMuted",
  93307. "autoplay",
  93308. "loop",
  93309. "playsinline"
  93310. ].forEach(function(prop) {
  93311. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93312. this.el_[prop] = v;
  93313. if (v) {
  93314. this.el_.setAttribute(prop, prop);
  93315. } else {
  93316. this.el_.removeAttribute(prop);
  93317. }
  93318. };
  93319. });
  93320. [
  93321. "paused",
  93322. "currentTime",
  93323. "buffered",
  93324. "volume",
  93325. "poster",
  93326. "preload",
  93327. "error",
  93328. "seeking",
  93329. "seekable",
  93330. "ended",
  93331. "playbackRate",
  93332. "defaultPlaybackRate",
  93333. "disablePictureInPicture",
  93334. "played",
  93335. "networkState",
  93336. "readyState",
  93337. "videoWidth",
  93338. "videoHeight",
  93339. "crossOrigin"
  93340. ].forEach(function(prop) {
  93341. Html5$1.prototype[prop] = function() {
  93342. return this.el_[prop];
  93343. };
  93344. });
  93345. [
  93346. "volume",
  93347. "src",
  93348. "poster",
  93349. "preload",
  93350. "playbackRate",
  93351. "defaultPlaybackRate",
  93352. "disablePictureInPicture",
  93353. "crossOrigin"
  93354. ].forEach(function(prop) {
  93355. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93356. this.el_[prop] = v;
  93357. };
  93358. });
  93359. [
  93360. "pause",
  93361. "load",
  93362. "play"
  93363. ].forEach(function(prop) {
  93364. Html5$1.prototype[prop] = function() {
  93365. return this.el_[prop]();
  93366. };
  93367. });
  93368. Tech$1.withSourceHandlers(Html5$1);
  93369. Html5$1.nativeSourceHandler = {};
  93370. Html5$1.nativeSourceHandler.canPlayType = function(type2) {
  93371. try {
  93372. return Html5$1.TEST_VID.canPlayType(type2);
  93373. } catch (e) {
  93374. return "";
  93375. }
  93376. };
  93377. Html5$1.nativeSourceHandler.canHandleSource = function(source, options2) {
  93378. if (source.type) {
  93379. return Html5$1.nativeSourceHandler.canPlayType(source.type);
  93380. } else if (source.src) {
  93381. var ext = getFileExtension(source.src);
  93382. return Html5$1.nativeSourceHandler.canPlayType("video/" + ext);
  93383. }
  93384. return "";
  93385. };
  93386. Html5$1.nativeSourceHandler.handleSource = function(source, tech, options2) {
  93387. tech.setSrc(source.src);
  93388. };
  93389. Html5$1.nativeSourceHandler.dispose = function() {
  93390. };
  93391. Html5$1.registerSourceHandler(Html5$1.nativeSourceHandler);
  93392. Tech$1.registerTech("Html5", Html5$1);
  93393. var TECH_EVENTS_RETRIGGER = [
  93394. "progress",
  93395. "abort",
  93396. "suspend",
  93397. "emptied",
  93398. "stalled",
  93399. "loadedmetadata",
  93400. "loadeddata",
  93401. "timeupdate",
  93402. "resize",
  93403. "volumechange",
  93404. "texttrackchange"
  93405. ];
  93406. var TECH_EVENTS_QUEUE = {
  93407. canplay: "CanPlay",
  93408. canplaythrough: "CanPlayThrough",
  93409. playing: "Playing",
  93410. seeked: "Seeked"
  93411. };
  93412. var BREAKPOINT_ORDER = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  93413. var BREAKPOINT_CLASSES = {};
  93414. BREAKPOINT_ORDER.forEach(function(k) {
  93415. var v = k.charAt(0) === "x" ? "x-" + k.substring(1) : k;
  93416. BREAKPOINT_CLASSES[k] = "vjs-layout-" + v;
  93417. });
  93418. var DEFAULT_BREAKPOINTS = {
  93419. tiny: 210,
  93420. xsmall: 320,
  93421. small: 425,
  93422. medium: 768,
  93423. large: 1440,
  93424. xlarge: 2560,
  93425. huge: Infinity
  93426. };
  93427. var Player = /* @__PURE__ */ function(_Component) {
  93428. _inheritsLoose(Player2, _Component);
  93429. function Player2(tag, options2, ready) {
  93430. var _this;
  93431. tag.id = tag.id || options2.id || "vjs_video_" + newGUID();
  93432. options2 = assign(Player2.getTagSettings(tag), options2);
  93433. options2.initChildren = false;
  93434. options2.createEl = false;
  93435. options2.evented = false;
  93436. options2.reportTouchActivity = false;
  93437. if (!options2.language) {
  93438. if (typeof tag.closest === "function") {
  93439. var closest = tag.closest("[lang]");
  93440. if (closest && closest.getAttribute) {
  93441. options2.language = closest.getAttribute("lang");
  93442. }
  93443. } else {
  93444. var element = tag;
  93445. while (element && element.nodeType === 1) {
  93446. if (getAttributes(element).hasOwnProperty("lang")) {
  93447. options2.language = element.getAttribute("lang");
  93448. break;
  93449. }
  93450. element = element.parentNode;
  93451. }
  93452. }
  93453. }
  93454. _this = _Component.call(this, null, options2, ready) || this;
  93455. _this.boundDocumentFullscreenChange_ = function(e) {
  93456. return _this.documentFullscreenChange_(e);
  93457. };
  93458. _this.boundFullWindowOnEscKey_ = function(e) {
  93459. return _this.fullWindowOnEscKey(e);
  93460. };
  93461. _this.boundUpdateStyleEl_ = function(e) {
  93462. return _this.updateStyleEl_(e);
  93463. };
  93464. _this.boundApplyInitTime_ = function(e) {
  93465. return _this.applyInitTime_(e);
  93466. };
  93467. _this.boundUpdateCurrentBreakpoint_ = function(e) {
  93468. return _this.updateCurrentBreakpoint_(e);
  93469. };
  93470. _this.boundHandleTechClick_ = function(e) {
  93471. return _this.handleTechClick_(e);
  93472. };
  93473. _this.boundHandleTechDoubleClick_ = function(e) {
  93474. return _this.handleTechDoubleClick_(e);
  93475. };
  93476. _this.boundHandleTechTouchStart_ = function(e) {
  93477. return _this.handleTechTouchStart_(e);
  93478. };
  93479. _this.boundHandleTechTouchMove_ = function(e) {
  93480. return _this.handleTechTouchMove_(e);
  93481. };
  93482. _this.boundHandleTechTouchEnd_ = function(e) {
  93483. return _this.handleTechTouchEnd_(e);
  93484. };
  93485. _this.boundHandleTechTap_ = function(e) {
  93486. return _this.handleTechTap_(e);
  93487. };
  93488. _this.isFullscreen_ = false;
  93489. _this.log = createLogger(_this.id_);
  93490. _this.fsApi_ = FullscreenApi;
  93491. _this.isPosterFromTech_ = false;
  93492. _this.queuedCallbacks_ = [];
  93493. _this.isReady_ = false;
  93494. _this.hasStarted_ = false;
  93495. _this.userActive_ = false;
  93496. _this.debugEnabled_ = false;
  93497. _this.audioOnlyMode_ = false;
  93498. _this.audioPosterMode_ = false;
  93499. _this.audioOnlyCache_ = {
  93500. playerHeight: null,
  93501. hiddenChildren: []
  93502. };
  93503. if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {
  93504. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  93505. }
  93506. _this.tag = tag;
  93507. _this.tagAttributes = tag && getAttributes(tag);
  93508. _this.language(_this.options_.language);
  93509. if (options2.languages) {
  93510. var languagesToLower = {};
  93511. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  93512. languagesToLower[name.toLowerCase()] = options2.languages[name];
  93513. });
  93514. _this.languages_ = languagesToLower;
  93515. } else {
  93516. _this.languages_ = Player2.prototype.options_.languages;
  93517. }
  93518. _this.resetCache_();
  93519. _this.poster_ = options2.poster || "";
  93520. _this.controls_ = !!options2.controls;
  93521. tag.controls = false;
  93522. tag.removeAttribute("controls");
  93523. _this.changingSrc_ = false;
  93524. _this.playCallbacks_ = [];
  93525. _this.playTerminatedQueue_ = [];
  93526. if (tag.hasAttribute("autoplay")) {
  93527. _this.autoplay(true);
  93528. } else {
  93529. _this.autoplay(_this.options_.autoplay);
  93530. }
  93531. if (options2.plugins) {
  93532. Object.keys(options2.plugins).forEach(function(name) {
  93533. if (typeof _this[name] !== "function") {
  93534. throw new Error('plugin "' + name + '" does not exist');
  93535. }
  93536. });
  93537. }
  93538. _this.scrubbing_ = false;
  93539. _this.el_ = _this.createEl();
  93540. evented(_assertThisInitialized(_this), {
  93541. eventBusKey: "el_"
  93542. });
  93543. if (_this.fsApi_.requestFullscreen) {
  93544. on(document_1, _this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93545. _this.on(_this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93546. }
  93547. if (_this.fluid_) {
  93548. _this.on(["playerreset", "resize"], _this.boundUpdateStyleEl_);
  93549. }
  93550. var playerOptionsCopy = mergeOptions$3(_this.options_);
  93551. if (options2.plugins) {
  93552. Object.keys(options2.plugins).forEach(function(name) {
  93553. _this[name](options2.plugins[name]);
  93554. });
  93555. }
  93556. if (options2.debug) {
  93557. _this.debug(true);
  93558. }
  93559. _this.options_.playerOptions = playerOptionsCopy;
  93560. _this.middleware_ = [];
  93561. _this.playbackRates(options2.playbackRates);
  93562. _this.initChildren();
  93563. _this.isAudio(tag.nodeName.toLowerCase() === "audio");
  93564. if (_this.controls()) {
  93565. _this.addClass("vjs-controls-enabled");
  93566. } else {
  93567. _this.addClass("vjs-controls-disabled");
  93568. }
  93569. _this.el_.setAttribute("role", "region");
  93570. if (_this.isAudio()) {
  93571. _this.el_.setAttribute("aria-label", _this.localize("Audio Player"));
  93572. } else {
  93573. _this.el_.setAttribute("aria-label", _this.localize("Video Player"));
  93574. }
  93575. if (_this.isAudio()) {
  93576. _this.addClass("vjs-audio");
  93577. }
  93578. if (_this.flexNotSupported_()) {
  93579. _this.addClass("vjs-no-flex");
  93580. }
  93581. if (TOUCH_ENABLED) {
  93582. _this.addClass("vjs-touch-enabled");
  93583. }
  93584. if (!IS_IOS) {
  93585. _this.addClass("vjs-workinghover");
  93586. }
  93587. Player2.players[_this.id_] = _assertThisInitialized(_this);
  93588. var majorVersion = version$5.split(".")[0];
  93589. _this.addClass("vjs-v" + majorVersion);
  93590. _this.userActive(true);
  93591. _this.reportUserActivity();
  93592. _this.one("play", function(e) {
  93593. return _this.listenForUserActivity_(e);
  93594. });
  93595. _this.on("stageclick", function(e) {
  93596. return _this.handleStageClick_(e);
  93597. });
  93598. _this.on("keydown", function(e) {
  93599. return _this.handleKeyDown(e);
  93600. });
  93601. _this.on("languagechange", function(e) {
  93602. return _this.handleLanguagechange(e);
  93603. });
  93604. _this.breakpoints(_this.options_.breakpoints);
  93605. _this.responsive(_this.options_.responsive);
  93606. _this.on("ready", function() {
  93607. _this.audioPosterMode(_this.options_.audioPosterMode);
  93608. _this.audioOnlyMode(_this.options_.audioOnlyMode);
  93609. });
  93610. return _this;
  93611. }
  93612. var _proto = Player2.prototype;
  93613. _proto.dispose = function dispose() {
  93614. var _this2 = this;
  93615. this.trigger("dispose");
  93616. this.off("dispose");
  93617. off(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  93618. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  93619. if (this.styleEl_ && this.styleEl_.parentNode) {
  93620. this.styleEl_.parentNode.removeChild(this.styleEl_);
  93621. this.styleEl_ = null;
  93622. }
  93623. Player2.players[this.id_] = null;
  93624. if (this.tag && this.tag.player) {
  93625. this.tag.player = null;
  93626. }
  93627. if (this.el_ && this.el_.player) {
  93628. this.el_.player = null;
  93629. }
  93630. if (this.tech_) {
  93631. this.tech_.dispose();
  93632. this.isPosterFromTech_ = false;
  93633. this.poster_ = "";
  93634. }
  93635. if (this.playerElIngest_) {
  93636. this.playerElIngest_ = null;
  93637. }
  93638. if (this.tag) {
  93639. this.tag = null;
  93640. }
  93641. clearCacheForPlayer(this);
  93642. ALL.names.forEach(function(name) {
  93643. var props = ALL[name];
  93644. var list = _this2[props.getterName]();
  93645. if (list && list.off) {
  93646. list.off();
  93647. }
  93648. });
  93649. _Component.prototype.dispose.call(this, {
  93650. restoreEl: this.options_.restoreEl
  93651. });
  93652. };
  93653. _proto.createEl = function createEl2() {
  93654. var tag = this.tag;
  93655. var el;
  93656. var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  93657. var divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  93658. if (playerElIngest) {
  93659. el = this.el_ = tag.parentNode;
  93660. } else if (!divEmbed) {
  93661. el = this.el_ = _Component.prototype.createEl.call(this, "div");
  93662. }
  93663. var attrs = getAttributes(tag);
  93664. if (divEmbed) {
  93665. el = this.el_ = tag;
  93666. tag = this.tag = document_1.createElement("video");
  93667. while (el.children.length) {
  93668. tag.appendChild(el.firstChild);
  93669. }
  93670. if (!hasClass(el, "video-js")) {
  93671. addClass(el, "video-js");
  93672. }
  93673. el.appendChild(tag);
  93674. playerElIngest = this.playerElIngest_ = el;
  93675. Object.keys(el).forEach(function(k) {
  93676. try {
  93677. tag[k] = el[k];
  93678. } catch (e) {
  93679. }
  93680. });
  93681. }
  93682. tag.setAttribute("tabindex", "-1");
  93683. attrs.tabindex = "-1";
  93684. if (IE_VERSION || IS_CHROME && IS_WINDOWS) {
  93685. tag.setAttribute("role", "application");
  93686. attrs.role = "application";
  93687. }
  93688. tag.removeAttribute("width");
  93689. tag.removeAttribute("height");
  93690. if ("width" in attrs) {
  93691. delete attrs.width;
  93692. }
  93693. if ("height" in attrs) {
  93694. delete attrs.height;
  93695. }
  93696. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  93697. if (!(divEmbed && attr === "class")) {
  93698. el.setAttribute(attr, attrs[attr]);
  93699. }
  93700. if (divEmbed) {
  93701. tag.setAttribute(attr, attrs[attr]);
  93702. }
  93703. });
  93704. tag.playerId = tag.id;
  93705. tag.id += "_html5_api";
  93706. tag.className = "vjs-tech";
  93707. tag.player = el.player = this;
  93708. this.addClass("vjs-paused");
  93709. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  93710. this.styleEl_ = createStyleElement("vjs-styles-dimensions");
  93711. var defaultsStyleEl = $(".vjs-styles-defaults");
  93712. var head = $("head");
  93713. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  93714. }
  93715. this.fill_ = false;
  93716. this.fluid_ = false;
  93717. this.width(this.options_.width);
  93718. this.height(this.options_.height);
  93719. this.fill(this.options_.fill);
  93720. this.fluid(this.options_.fluid);
  93721. this.aspectRatio(this.options_.aspectRatio);
  93722. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  93723. var links = tag.getElementsByTagName("a");
  93724. for (var i2 = 0; i2 < links.length; i2++) {
  93725. var linkEl = links.item(i2);
  93726. addClass(linkEl, "vjs-hidden");
  93727. linkEl.setAttribute("hidden", "hidden");
  93728. }
  93729. tag.initNetworkState_ = tag.networkState;
  93730. if (tag.parentNode && !playerElIngest) {
  93731. tag.parentNode.insertBefore(el, tag);
  93732. }
  93733. prependTo(tag, el);
  93734. this.children_.unshift(tag);
  93735. this.el_.setAttribute("lang", this.language_);
  93736. this.el_.setAttribute("translate", "no");
  93737. this.el_ = el;
  93738. return el;
  93739. };
  93740. _proto.crossOrigin = function crossOrigin(value) {
  93741. if (!value) {
  93742. return this.techGet_("crossOrigin");
  93743. }
  93744. if (value !== "anonymous" && value !== "use-credentials") {
  93745. log$1.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + value + '"');
  93746. return;
  93747. }
  93748. this.techCall_("setCrossOrigin", value);
  93749. return;
  93750. };
  93751. _proto.width = function width2(value) {
  93752. return this.dimension("width", value);
  93753. };
  93754. _proto.height = function height2(value) {
  93755. return this.dimension("height", value);
  93756. };
  93757. _proto.dimension = function dimension(_dimension, value) {
  93758. var privDimension = _dimension + "_";
  93759. if (value === void 0) {
  93760. return this[privDimension] || 0;
  93761. }
  93762. if (value === "" || value === "auto") {
  93763. this[privDimension] = void 0;
  93764. this.updateStyleEl_();
  93765. return;
  93766. }
  93767. var parsedVal = parseFloat(value);
  93768. if (isNaN(parsedVal)) {
  93769. log$1.error('Improper value "' + value + '" supplied for for ' + _dimension);
  93770. return;
  93771. }
  93772. this[privDimension] = parsedVal;
  93773. this.updateStyleEl_();
  93774. };
  93775. _proto.fluid = function fluid(bool) {
  93776. var _this3 = this;
  93777. if (bool === void 0) {
  93778. return !!this.fluid_;
  93779. }
  93780. this.fluid_ = !!bool;
  93781. if (isEvented(this)) {
  93782. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  93783. }
  93784. if (bool) {
  93785. this.addClass("vjs-fluid");
  93786. this.fill(false);
  93787. addEventedCallback(this, function() {
  93788. _this3.on(["playerreset", "resize"], _this3.boundUpdateStyleEl_);
  93789. });
  93790. } else {
  93791. this.removeClass("vjs-fluid");
  93792. }
  93793. this.updateStyleEl_();
  93794. };
  93795. _proto.fill = function fill(bool) {
  93796. if (bool === void 0) {
  93797. return !!this.fill_;
  93798. }
  93799. this.fill_ = !!bool;
  93800. if (bool) {
  93801. this.addClass("vjs-fill");
  93802. this.fluid(false);
  93803. } else {
  93804. this.removeClass("vjs-fill");
  93805. }
  93806. };
  93807. _proto.aspectRatio = function aspectRatio(ratio) {
  93808. if (ratio === void 0) {
  93809. return this.aspectRatio_;
  93810. }
  93811. if (!/^\d+\:\d+$/.test(ratio)) {
  93812. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  93813. }
  93814. this.aspectRatio_ = ratio;
  93815. this.fluid(true);
  93816. this.updateStyleEl_();
  93817. };
  93818. _proto.updateStyleEl_ = function updateStyleEl_() {
  93819. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  93820. var _width = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  93821. var _height = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  93822. var techEl = this.tech_ && this.tech_.el();
  93823. if (techEl) {
  93824. if (_width >= 0) {
  93825. techEl.width = _width;
  93826. }
  93827. if (_height >= 0) {
  93828. techEl.height = _height;
  93829. }
  93830. }
  93831. return;
  93832. }
  93833. var width2;
  93834. var height2;
  93835. var aspectRatio;
  93836. var idClass;
  93837. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  93838. aspectRatio = this.aspectRatio_;
  93839. } else if (this.videoWidth() > 0) {
  93840. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  93841. } else {
  93842. aspectRatio = "16:9";
  93843. }
  93844. var ratioParts = aspectRatio.split(":");
  93845. var ratioMultiplier = ratioParts[1] / ratioParts[0];
  93846. if (this.width_ !== void 0) {
  93847. width2 = this.width_;
  93848. } else if (this.height_ !== void 0) {
  93849. width2 = this.height_ / ratioMultiplier;
  93850. } else {
  93851. width2 = this.videoWidth() || 300;
  93852. }
  93853. if (this.height_ !== void 0) {
  93854. height2 = this.height_;
  93855. } else {
  93856. height2 = width2 * ratioMultiplier;
  93857. }
  93858. if (/^[^a-zA-Z]/.test(this.id())) {
  93859. idClass = "dimensions-" + this.id();
  93860. } else {
  93861. idClass = this.id() + "-dimensions";
  93862. }
  93863. this.addClass(idClass);
  93864. setTextContent(this.styleEl_, "\n ." + idClass + " {\n width: " + width2 + "px;\n height: " + height2 + "px;\n }\n\n ." + idClass + ".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: " + ratioMultiplier * 100 + "%;\n }\n ");
  93865. };
  93866. _proto.loadTech_ = function loadTech_(techName, source) {
  93867. var _this4 = this;
  93868. if (this.tech_) {
  93869. this.unloadTech_();
  93870. }
  93871. var titleTechName = toTitleCase$1(techName);
  93872. var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  93873. if (titleTechName !== "Html5" && this.tag) {
  93874. Tech$1.getTech("Html5").disposeMediaElement(this.tag);
  93875. this.tag.player = null;
  93876. this.tag = null;
  93877. }
  93878. this.techName_ = titleTechName;
  93879. this.isReady_ = false;
  93880. var autoplay = this.autoplay();
  93881. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  93882. autoplay = false;
  93883. }
  93884. var techOptions = {
  93885. source,
  93886. autoplay,
  93887. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  93888. "playerId": this.id(),
  93889. "techId": this.id() + "_" + camelTechName + "_api",
  93890. "playsinline": this.options_.playsinline,
  93891. "preload": this.options_.preload,
  93892. "loop": this.options_.loop,
  93893. "disablePictureInPicture": this.options_.disablePictureInPicture,
  93894. "muted": this.options_.muted,
  93895. "poster": this.poster(),
  93896. "language": this.language(),
  93897. "playerElIngest": this.playerElIngest_ || false,
  93898. "vtt.js": this.options_["vtt.js"],
  93899. "canOverridePoster": !!this.options_.techCanOverridePoster,
  93900. "enableSourceset": this.options_.enableSourceset,
  93901. "Promise": this.options_.Promise
  93902. };
  93903. ALL.names.forEach(function(name) {
  93904. var props = ALL[name];
  93905. techOptions[props.getterName] = _this4[props.privateName];
  93906. });
  93907. assign(techOptions, this.options_[titleTechName]);
  93908. assign(techOptions, this.options_[camelTechName]);
  93909. assign(techOptions, this.options_[techName.toLowerCase()]);
  93910. if (this.tag) {
  93911. techOptions.tag = this.tag;
  93912. }
  93913. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  93914. techOptions.startTime = this.cache_.currentTime;
  93915. }
  93916. var TechClass = Tech$1.getTech(techName);
  93917. if (!TechClass) {
  93918. throw new Error("No Tech named '" + titleTechName + "' exists! '" + titleTechName + "' should be registered using videojs.registerTech()'");
  93919. }
  93920. this.tech_ = new TechClass(techOptions);
  93921. this.tech_.ready(bind(this, this.handleTechReady_), true);
  93922. textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  93923. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  93924. _this4.on(_this4.tech_, event2, function(e) {
  93925. return _this4["handleTech" + toTitleCase$1(event2) + "_"](e);
  93926. });
  93927. });
  93928. Object.keys(TECH_EVENTS_QUEUE).forEach(function(event2) {
  93929. _this4.on(_this4.tech_, event2, function(eventObj) {
  93930. if (_this4.tech_.playbackRate() === 0 && _this4.tech_.seeking()) {
  93931. _this4.queuedCallbacks_.push({
  93932. callback: _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"].bind(_this4),
  93933. event: eventObj
  93934. });
  93935. return;
  93936. }
  93937. _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"](eventObj);
  93938. });
  93939. });
  93940. this.on(this.tech_, "loadstart", function(e) {
  93941. return _this4.handleTechLoadStart_(e);
  93942. });
  93943. this.on(this.tech_, "sourceset", function(e) {
  93944. return _this4.handleTechSourceset_(e);
  93945. });
  93946. this.on(this.tech_, "waiting", function(e) {
  93947. return _this4.handleTechWaiting_(e);
  93948. });
  93949. this.on(this.tech_, "ended", function(e) {
  93950. return _this4.handleTechEnded_(e);
  93951. });
  93952. this.on(this.tech_, "seeking", function(e) {
  93953. return _this4.handleTechSeeking_(e);
  93954. });
  93955. this.on(this.tech_, "play", function(e) {
  93956. return _this4.handleTechPlay_(e);
  93957. });
  93958. this.on(this.tech_, "firstplay", function(e) {
  93959. return _this4.handleTechFirstPlay_(e);
  93960. });
  93961. this.on(this.tech_, "pause", function(e) {
  93962. return _this4.handleTechPause_(e);
  93963. });
  93964. this.on(this.tech_, "durationchange", function(e) {
  93965. return _this4.handleTechDurationChange_(e);
  93966. });
  93967. this.on(this.tech_, "fullscreenchange", function(e, data) {
  93968. return _this4.handleTechFullscreenChange_(e, data);
  93969. });
  93970. this.on(this.tech_, "fullscreenerror", function(e, err) {
  93971. return _this4.handleTechFullscreenError_(e, err);
  93972. });
  93973. this.on(this.tech_, "enterpictureinpicture", function(e) {
  93974. return _this4.handleTechEnterPictureInPicture_(e);
  93975. });
  93976. this.on(this.tech_, "leavepictureinpicture", function(e) {
  93977. return _this4.handleTechLeavePictureInPicture_(e);
  93978. });
  93979. this.on(this.tech_, "error", function(e) {
  93980. return _this4.handleTechError_(e);
  93981. });
  93982. this.on(this.tech_, "posterchange", function(e) {
  93983. return _this4.handleTechPosterChange_(e);
  93984. });
  93985. this.on(this.tech_, "textdata", function(e) {
  93986. return _this4.handleTechTextData_(e);
  93987. });
  93988. this.on(this.tech_, "ratechange", function(e) {
  93989. return _this4.handleTechRateChange_(e);
  93990. });
  93991. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  93992. this.usingNativeControls(this.techGet_("controls"));
  93993. if (this.controls() && !this.usingNativeControls()) {
  93994. this.addTechControlsListeners_();
  93995. }
  93996. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  93997. prependTo(this.tech_.el(), this.el());
  93998. }
  93999. if (this.tag) {
  94000. this.tag.player = null;
  94001. this.tag = null;
  94002. }
  94003. };
  94004. _proto.unloadTech_ = function unloadTech_() {
  94005. var _this5 = this;
  94006. ALL.names.forEach(function(name) {
  94007. var props = ALL[name];
  94008. _this5[props.privateName] = _this5[props.getterName]();
  94009. });
  94010. this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);
  94011. this.isReady_ = false;
  94012. this.tech_.dispose();
  94013. this.tech_ = false;
  94014. if (this.isPosterFromTech_) {
  94015. this.poster_ = "";
  94016. this.trigger("posterchange");
  94017. }
  94018. this.isPosterFromTech_ = false;
  94019. };
  94020. _proto.tech = function tech(safety) {
  94021. if (safety === void 0) {
  94022. log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  94023. }
  94024. return this.tech_;
  94025. };
  94026. _proto.addTechControlsListeners_ = function addTechControlsListeners_() {
  94027. this.removeTechControlsListeners_();
  94028. this.on(this.tech_, "click", this.boundHandleTechClick_);
  94029. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  94030. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  94031. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  94032. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  94033. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  94034. };
  94035. _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {
  94036. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  94037. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  94038. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  94039. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  94040. this.off(this.tech_, "click", this.boundHandleTechClick_);
  94041. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  94042. };
  94043. _proto.handleTechReady_ = function handleTechReady_() {
  94044. this.triggerReady();
  94045. if (this.cache_.volume) {
  94046. this.techCall_("setVolume", this.cache_.volume);
  94047. }
  94048. this.handleTechPosterChange_();
  94049. this.handleTechDurationChange_();
  94050. };
  94051. _proto.handleTechLoadStart_ = function handleTechLoadStart_() {
  94052. this.removeClass("vjs-ended");
  94053. this.removeClass("vjs-seeking");
  94054. this.error(null);
  94055. this.handleTechDurationChange_();
  94056. if (!this.paused()) {
  94057. this.trigger("loadstart");
  94058. this.trigger("firstplay");
  94059. } else {
  94060. this.hasStarted(false);
  94061. this.trigger("loadstart");
  94062. }
  94063. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  94064. };
  94065. _proto.manualAutoplay_ = function manualAutoplay_(type2) {
  94066. var _this6 = this;
  94067. if (!this.tech_ || typeof type2 !== "string") {
  94068. return;
  94069. }
  94070. var resolveMuted = function resolveMuted2() {
  94071. var previouslyMuted = _this6.muted();
  94072. _this6.muted(true);
  94073. var restoreMuted = function restoreMuted2() {
  94074. _this6.muted(previouslyMuted);
  94075. };
  94076. _this6.playTerminatedQueue_.push(restoreMuted);
  94077. var mutedPromise = _this6.play();
  94078. if (!isPromise(mutedPromise)) {
  94079. return;
  94080. }
  94081. return mutedPromise["catch"](function(err) {
  94082. restoreMuted();
  94083. throw new Error("Rejection at manualAutoplay. Restoring muted value. " + (err ? err : ""));
  94084. });
  94085. };
  94086. var promise;
  94087. if (type2 === "any" && !this.muted()) {
  94088. promise = this.play();
  94089. if (isPromise(promise)) {
  94090. promise = promise["catch"](resolveMuted);
  94091. }
  94092. } else if (type2 === "muted" && !this.muted()) {
  94093. promise = resolveMuted();
  94094. } else {
  94095. promise = this.play();
  94096. }
  94097. if (!isPromise(promise)) {
  94098. return;
  94099. }
  94100. return promise.then(function() {
  94101. _this6.trigger({
  94102. type: "autoplay-success",
  94103. autoplay: type2
  94104. });
  94105. })["catch"](function() {
  94106. _this6.trigger({
  94107. type: "autoplay-failure",
  94108. autoplay: type2
  94109. });
  94110. });
  94111. };
  94112. _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {
  94113. if (srcObj === void 0) {
  94114. srcObj = "";
  94115. }
  94116. var src = srcObj;
  94117. var type2 = "";
  94118. if (typeof src !== "string") {
  94119. src = srcObj.src;
  94120. type2 = srcObj.type;
  94121. }
  94122. this.cache_.source = this.cache_.source || {};
  94123. this.cache_.sources = this.cache_.sources || [];
  94124. if (src && !type2) {
  94125. type2 = findMimetype(this, src);
  94126. }
  94127. this.cache_.source = mergeOptions$3({}, srcObj, {
  94128. src,
  94129. type: type2
  94130. });
  94131. var matchingSources = this.cache_.sources.filter(function(s) {
  94132. return s.src && s.src === src;
  94133. });
  94134. var sourceElSources = [];
  94135. var sourceEls = this.$$("source");
  94136. var matchingSourceEls = [];
  94137. for (var i2 = 0; i2 < sourceEls.length; i2++) {
  94138. var sourceObj = getAttributes(sourceEls[i2]);
  94139. sourceElSources.push(sourceObj);
  94140. if (sourceObj.src && sourceObj.src === src) {
  94141. matchingSourceEls.push(sourceObj.src);
  94142. }
  94143. }
  94144. if (matchingSourceEls.length && !matchingSources.length) {
  94145. this.cache_.sources = sourceElSources;
  94146. } else if (!matchingSources.length) {
  94147. this.cache_.sources = [this.cache_.source];
  94148. }
  94149. this.cache_.src = src;
  94150. };
  94151. _proto.handleTechSourceset_ = function handleTechSourceset_(event2) {
  94152. var _this7 = this;
  94153. if (!this.changingSrc_) {
  94154. var updateSourceCaches = function updateSourceCaches2(src) {
  94155. return _this7.updateSourceCaches_(src);
  94156. };
  94157. var playerSrc = this.currentSource().src;
  94158. var eventSrc = event2.src;
  94159. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  94160. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  94161. updateSourceCaches = function updateSourceCaches2() {
  94162. };
  94163. }
  94164. }
  94165. updateSourceCaches(eventSrc);
  94166. if (!event2.src) {
  94167. this.tech_.any(["sourceset", "loadstart"], function(e) {
  94168. if (e.type === "sourceset") {
  94169. return;
  94170. }
  94171. var techSrc = _this7.techGet("currentSrc");
  94172. _this7.lastSource_.tech = techSrc;
  94173. _this7.updateSourceCaches_(techSrc);
  94174. });
  94175. }
  94176. }
  94177. this.lastSource_ = {
  94178. player: this.currentSource().src,
  94179. tech: event2.src
  94180. };
  94181. this.trigger({
  94182. src: event2.src,
  94183. type: "sourceset"
  94184. });
  94185. };
  94186. _proto.hasStarted = function hasStarted(request) {
  94187. if (request === void 0) {
  94188. return this.hasStarted_;
  94189. }
  94190. if (request === this.hasStarted_) {
  94191. return;
  94192. }
  94193. this.hasStarted_ = request;
  94194. if (this.hasStarted_) {
  94195. this.addClass("vjs-has-started");
  94196. this.trigger("firstplay");
  94197. } else {
  94198. this.removeClass("vjs-has-started");
  94199. }
  94200. };
  94201. _proto.handleTechPlay_ = function handleTechPlay_() {
  94202. this.removeClass("vjs-ended");
  94203. this.removeClass("vjs-paused");
  94204. this.addClass("vjs-playing");
  94205. this.hasStarted(true);
  94206. this.trigger("play");
  94207. };
  94208. _proto.handleTechRateChange_ = function handleTechRateChange_() {
  94209. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  94210. this.queuedCallbacks_.forEach(function(queued) {
  94211. return queued.callback(queued.event);
  94212. });
  94213. this.queuedCallbacks_ = [];
  94214. }
  94215. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  94216. this.trigger("ratechange");
  94217. };
  94218. _proto.handleTechWaiting_ = function handleTechWaiting_() {
  94219. var _this8 = this;
  94220. this.addClass("vjs-waiting");
  94221. this.trigger("waiting");
  94222. var timeWhenWaiting = this.currentTime();
  94223. var timeUpdateListener = function timeUpdateListener2() {
  94224. if (timeWhenWaiting !== _this8.currentTime()) {
  94225. _this8.removeClass("vjs-waiting");
  94226. _this8.off("timeupdate", timeUpdateListener2);
  94227. }
  94228. };
  94229. this.on("timeupdate", timeUpdateListener);
  94230. };
  94231. _proto.handleTechCanPlay_ = function handleTechCanPlay_() {
  94232. this.removeClass("vjs-waiting");
  94233. this.trigger("canplay");
  94234. };
  94235. _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {
  94236. this.removeClass("vjs-waiting");
  94237. this.trigger("canplaythrough");
  94238. };
  94239. _proto.handleTechPlaying_ = function handleTechPlaying_() {
  94240. this.removeClass("vjs-waiting");
  94241. this.trigger("playing");
  94242. };
  94243. _proto.handleTechSeeking_ = function handleTechSeeking_() {
  94244. this.addClass("vjs-seeking");
  94245. this.trigger("seeking");
  94246. };
  94247. _proto.handleTechSeeked_ = function handleTechSeeked_() {
  94248. this.removeClass("vjs-seeking");
  94249. this.removeClass("vjs-ended");
  94250. this.trigger("seeked");
  94251. };
  94252. _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {
  94253. if (this.options_.starttime) {
  94254. log$1.warn("Passing the `starttime` option to the player will be deprecated in 6.0");
  94255. this.currentTime(this.options_.starttime);
  94256. }
  94257. this.addClass("vjs-has-started");
  94258. this.trigger("firstplay");
  94259. };
  94260. _proto.handleTechPause_ = function handleTechPause_() {
  94261. this.removeClass("vjs-playing");
  94262. this.addClass("vjs-paused");
  94263. this.trigger("pause");
  94264. };
  94265. _proto.handleTechEnded_ = function handleTechEnded_() {
  94266. this.addClass("vjs-ended");
  94267. this.removeClass("vjs-waiting");
  94268. if (this.options_.loop) {
  94269. this.currentTime(0);
  94270. this.play();
  94271. } else if (!this.paused()) {
  94272. this.pause();
  94273. }
  94274. this.trigger("ended");
  94275. };
  94276. _proto.handleTechDurationChange_ = function handleTechDurationChange_() {
  94277. this.duration(this.techGet_("duration"));
  94278. };
  94279. _proto.handleTechClick_ = function handleTechClick_(event2) {
  94280. if (!this.controls_) {
  94281. return;
  94282. }
  94283. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  94284. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  94285. this.options_.userActions.click.call(this, event2);
  94286. } else if (this.paused()) {
  94287. silencePromise(this.play());
  94288. } else {
  94289. this.pause();
  94290. }
  94291. }
  94292. };
  94293. _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event2) {
  94294. if (!this.controls_) {
  94295. return;
  94296. }
  94297. var inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(el) {
  94298. return el.contains(event2.target);
  94299. });
  94300. if (!inAllowedEls) {
  94301. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  94302. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  94303. this.options_.userActions.doubleClick.call(this, event2);
  94304. } else if (this.isFullscreen()) {
  94305. this.exitFullscreen();
  94306. } else {
  94307. this.requestFullscreen();
  94308. }
  94309. }
  94310. }
  94311. };
  94312. _proto.handleTechTap_ = function handleTechTap_() {
  94313. this.userActive(!this.userActive());
  94314. };
  94315. _proto.handleTechTouchStart_ = function handleTechTouchStart_() {
  94316. this.userWasActive = this.userActive();
  94317. };
  94318. _proto.handleTechTouchMove_ = function handleTechTouchMove_() {
  94319. if (this.userWasActive) {
  94320. this.reportUserActivity();
  94321. }
  94322. };
  94323. _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event2) {
  94324. if (event2.cancelable) {
  94325. event2.preventDefault();
  94326. }
  94327. };
  94328. _proto.handleStageClick_ = function handleStageClick_() {
  94329. this.reportUserActivity();
  94330. };
  94331. _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() {
  94332. if (this.isFullscreen()) {
  94333. this.addClass("vjs-fullscreen");
  94334. } else {
  94335. this.removeClass("vjs-fullscreen");
  94336. }
  94337. };
  94338. _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) {
  94339. var targetPlayer = e.target.player;
  94340. if (targetPlayer && targetPlayer !== this) {
  94341. return;
  94342. }
  94343. var el = this.el();
  94344. var isFs = document_1[this.fsApi_.fullscreenElement] === el;
  94345. if (!isFs && el.matches) {
  94346. isFs = el.matches(":" + this.fsApi_.fullscreen);
  94347. } else if (!isFs && el.msMatchesSelector) {
  94348. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  94349. }
  94350. this.isFullscreen(isFs);
  94351. };
  94352. _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event2, data) {
  94353. var _this9 = this;
  94354. if (data) {
  94355. if (data.nativeIOSFullscreen) {
  94356. this.addClass("vjs-ios-native-fs");
  94357. this.tech_.one("webkitendfullscreen", function() {
  94358. _this9.removeClass("vjs-ios-native-fs");
  94359. });
  94360. }
  94361. this.isFullscreen(data.isFullscreen);
  94362. }
  94363. };
  94364. _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event2, err) {
  94365. this.trigger("fullscreenerror", err);
  94366. };
  94367. _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() {
  94368. if (this.isInPictureInPicture()) {
  94369. this.addClass("vjs-picture-in-picture");
  94370. } else {
  94371. this.removeClass("vjs-picture-in-picture");
  94372. }
  94373. };
  94374. _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event2) {
  94375. this.isInPictureInPicture(true);
  94376. };
  94377. _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event2) {
  94378. this.isInPictureInPicture(false);
  94379. };
  94380. _proto.handleTechError_ = function handleTechError_() {
  94381. var error = this.tech_.error();
  94382. this.error(error);
  94383. };
  94384. _proto.handleTechTextData_ = function handleTechTextData_() {
  94385. var data = null;
  94386. if (arguments.length > 1) {
  94387. data = arguments[1];
  94388. }
  94389. this.trigger("textdata", data);
  94390. };
  94391. _proto.getCache = function getCache() {
  94392. return this.cache_;
  94393. };
  94394. _proto.resetCache_ = function resetCache_() {
  94395. this.cache_ = {
  94396. currentTime: 0,
  94397. initTime: 0,
  94398. inactivityTimeout: this.options_.inactivityTimeout,
  94399. duration: NaN,
  94400. lastVolume: 1,
  94401. lastPlaybackRate: this.defaultPlaybackRate(),
  94402. media: null,
  94403. src: "",
  94404. source: {},
  94405. sources: [],
  94406. playbackRates: [],
  94407. volume: 1
  94408. };
  94409. };
  94410. _proto.techCall_ = function techCall_(method, arg) {
  94411. this.ready(function() {
  94412. if (method in allowedSetters) {
  94413. return set(this.middleware_, this.tech_, method, arg);
  94414. } else if (method in allowedMediators) {
  94415. return mediate(this.middleware_, this.tech_, method, arg);
  94416. }
  94417. try {
  94418. if (this.tech_) {
  94419. this.tech_[method](arg);
  94420. }
  94421. } catch (e) {
  94422. log$1(e);
  94423. throw e;
  94424. }
  94425. }, true);
  94426. };
  94427. _proto.techGet_ = function techGet_(method) {
  94428. if (!this.tech_ || !this.tech_.isReady_) {
  94429. return;
  94430. }
  94431. if (method in allowedGetters) {
  94432. return get(this.middleware_, this.tech_, method);
  94433. } else if (method in allowedMediators) {
  94434. return mediate(this.middleware_, this.tech_, method);
  94435. }
  94436. try {
  94437. return this.tech_[method]();
  94438. } catch (e) {
  94439. if (this.tech_[method] === void 0) {
  94440. log$1("Video.js: " + method + " method not defined for " + this.techName_ + " playback technology.", e);
  94441. throw e;
  94442. }
  94443. if (e.name === "TypeError") {
  94444. log$1("Video.js: " + method + " unavailable on " + this.techName_ + " playback technology element.", e);
  94445. this.tech_.isReady_ = false;
  94446. throw e;
  94447. }
  94448. log$1(e);
  94449. throw e;
  94450. }
  94451. };
  94452. _proto.play = function play() {
  94453. var _this10 = this;
  94454. var PromiseClass = this.options_.Promise || window_1.Promise;
  94455. if (PromiseClass) {
  94456. return new PromiseClass(function(resolve2) {
  94457. _this10.play_(resolve2);
  94458. });
  94459. }
  94460. return this.play_();
  94461. };
  94462. _proto.play_ = function play_(callback2) {
  94463. var _this11 = this;
  94464. if (callback2 === void 0) {
  94465. callback2 = silencePromise;
  94466. }
  94467. this.playCallbacks_.push(callback2);
  94468. var isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  94469. var isSafariOrIOS = Boolean(IS_ANY_SAFARI || IS_IOS);
  94470. if (this.waitToPlay_) {
  94471. this.off(["ready", "loadstart"], this.waitToPlay_);
  94472. this.waitToPlay_ = null;
  94473. }
  94474. if (!this.isReady_ || !isSrcReady) {
  94475. this.waitToPlay_ = function(e) {
  94476. _this11.play_();
  94477. };
  94478. this.one(["ready", "loadstart"], this.waitToPlay_);
  94479. if (!isSrcReady && isSafariOrIOS) {
  94480. this.load();
  94481. }
  94482. return;
  94483. }
  94484. var val = this.techGet_("play");
  94485. var isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  94486. if (isNativeReplay) {
  94487. this.resetProgressBar_();
  94488. }
  94489. if (val === null) {
  94490. this.runPlayTerminatedQueue_();
  94491. } else {
  94492. this.runPlayCallbacks_(val);
  94493. }
  94494. };
  94495. _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() {
  94496. var queue = this.playTerminatedQueue_.slice(0);
  94497. this.playTerminatedQueue_ = [];
  94498. queue.forEach(function(q2) {
  94499. q2();
  94500. });
  94501. };
  94502. _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) {
  94503. var callbacks = this.playCallbacks_.slice(0);
  94504. this.playCallbacks_ = [];
  94505. this.playTerminatedQueue_ = [];
  94506. callbacks.forEach(function(cb) {
  94507. cb(val);
  94508. });
  94509. };
  94510. _proto.pause = function pause() {
  94511. this.techCall_("pause");
  94512. };
  94513. _proto.paused = function paused() {
  94514. return this.techGet_("paused") === false ? false : true;
  94515. };
  94516. _proto.played = function played() {
  94517. return this.techGet_("played") || createTimeRanges(0, 0);
  94518. };
  94519. _proto.scrubbing = function scrubbing(isScrubbing) {
  94520. if (typeof isScrubbing === "undefined") {
  94521. return this.scrubbing_;
  94522. }
  94523. this.scrubbing_ = !!isScrubbing;
  94524. this.techCall_("setScrubbing", this.scrubbing_);
  94525. if (isScrubbing) {
  94526. this.addClass("vjs-scrubbing");
  94527. } else {
  94528. this.removeClass("vjs-scrubbing");
  94529. }
  94530. };
  94531. _proto.currentTime = function currentTime(seconds) {
  94532. if (typeof seconds !== "undefined") {
  94533. if (seconds < 0) {
  94534. seconds = 0;
  94535. }
  94536. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  94537. this.cache_.initTime = seconds;
  94538. this.off("canplay", this.boundApplyInitTime_);
  94539. this.one("canplay", this.boundApplyInitTime_);
  94540. return;
  94541. }
  94542. this.techCall_("setCurrentTime", seconds);
  94543. this.cache_.initTime = 0;
  94544. return;
  94545. }
  94546. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  94547. return this.cache_.currentTime;
  94548. };
  94549. _proto.applyInitTime_ = function applyInitTime_() {
  94550. this.currentTime(this.cache_.initTime);
  94551. };
  94552. _proto.duration = function duration5(seconds) {
  94553. if (seconds === void 0) {
  94554. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  94555. }
  94556. seconds = parseFloat(seconds);
  94557. if (seconds < 0) {
  94558. seconds = Infinity;
  94559. }
  94560. if (seconds !== this.cache_.duration) {
  94561. this.cache_.duration = seconds;
  94562. if (seconds === Infinity) {
  94563. this.addClass("vjs-live");
  94564. } else {
  94565. this.removeClass("vjs-live");
  94566. }
  94567. if (!isNaN(seconds)) {
  94568. this.trigger("durationchange");
  94569. }
  94570. }
  94571. };
  94572. _proto.remainingTime = function remainingTime() {
  94573. return this.duration() - this.currentTime();
  94574. };
  94575. _proto.remainingTimeDisplay = function remainingTimeDisplay() {
  94576. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  94577. };
  94578. _proto.buffered = function buffered() {
  94579. var buffered2 = this.techGet_("buffered");
  94580. if (!buffered2 || !buffered2.length) {
  94581. buffered2 = createTimeRanges(0, 0);
  94582. }
  94583. return buffered2;
  94584. };
  94585. _proto.bufferedPercent = function bufferedPercent$12() {
  94586. return bufferedPercent(this.buffered(), this.duration());
  94587. };
  94588. _proto.bufferedEnd = function bufferedEnd() {
  94589. var buffered = this.buffered();
  94590. var duration5 = this.duration();
  94591. var end = buffered.end(buffered.length - 1);
  94592. if (end > duration5) {
  94593. end = duration5;
  94594. }
  94595. return end;
  94596. };
  94597. _proto.volume = function volume(percentAsDecimal) {
  94598. var vol;
  94599. if (percentAsDecimal !== void 0) {
  94600. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  94601. this.cache_.volume = vol;
  94602. this.techCall_("setVolume", vol);
  94603. if (vol > 0) {
  94604. this.lastVolume_(vol);
  94605. }
  94606. return;
  94607. }
  94608. vol = parseFloat(this.techGet_("volume"));
  94609. return isNaN(vol) ? 1 : vol;
  94610. };
  94611. _proto.muted = function muted(_muted) {
  94612. if (_muted !== void 0) {
  94613. this.techCall_("setMuted", _muted);
  94614. return;
  94615. }
  94616. return this.techGet_("muted") || false;
  94617. };
  94618. _proto.defaultMuted = function defaultMuted(_defaultMuted) {
  94619. if (_defaultMuted !== void 0) {
  94620. return this.techCall_("setDefaultMuted", _defaultMuted);
  94621. }
  94622. return this.techGet_("defaultMuted") || false;
  94623. };
  94624. _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {
  94625. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  94626. this.cache_.lastVolume = percentAsDecimal;
  94627. return;
  94628. }
  94629. return this.cache_.lastVolume;
  94630. };
  94631. _proto.supportsFullScreen = function supportsFullScreen() {
  94632. return this.techGet_("supportsFullScreen") || false;
  94633. };
  94634. _proto.isFullscreen = function isFullscreen(isFS) {
  94635. if (isFS !== void 0) {
  94636. var oldValue = this.isFullscreen_;
  94637. this.isFullscreen_ = Boolean(isFS);
  94638. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  94639. this.trigger("fullscreenchange");
  94640. }
  94641. this.toggleFullscreenClass_();
  94642. return;
  94643. }
  94644. return this.isFullscreen_;
  94645. };
  94646. _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) {
  94647. var PromiseClass = this.options_.Promise || window_1.Promise;
  94648. if (PromiseClass) {
  94649. var self2 = this;
  94650. return new PromiseClass(function(resolve2, reject2) {
  94651. function offHandler() {
  94652. self2.off("fullscreenerror", errorHandler);
  94653. self2.off("fullscreenchange", changeHandler);
  94654. }
  94655. function changeHandler() {
  94656. offHandler();
  94657. resolve2();
  94658. }
  94659. function errorHandler(e, err) {
  94660. offHandler();
  94661. reject2(err);
  94662. }
  94663. self2.one("fullscreenchange", changeHandler);
  94664. self2.one("fullscreenerror", errorHandler);
  94665. var promise = self2.requestFullscreenHelper_(fullscreenOptions);
  94666. if (promise) {
  94667. promise.then(offHandler, offHandler);
  94668. promise.then(resolve2, reject2);
  94669. }
  94670. });
  94671. }
  94672. return this.requestFullscreenHelper_();
  94673. };
  94674. _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) {
  94675. var _this12 = this;
  94676. var fsOptions;
  94677. if (!this.fsApi_.prefixed) {
  94678. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  94679. if (fullscreenOptions !== void 0) {
  94680. fsOptions = fullscreenOptions;
  94681. }
  94682. }
  94683. if (this.fsApi_.requestFullscreen) {
  94684. var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  94685. if (promise) {
  94686. promise.then(function() {
  94687. return _this12.isFullscreen(true);
  94688. }, function() {
  94689. return _this12.isFullscreen(false);
  94690. });
  94691. }
  94692. return promise;
  94693. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94694. this.techCall_("enterFullScreen");
  94695. } else {
  94696. this.enterFullWindow();
  94697. }
  94698. };
  94699. _proto.exitFullscreen = function exitFullscreen() {
  94700. var PromiseClass = this.options_.Promise || window_1.Promise;
  94701. if (PromiseClass) {
  94702. var self2 = this;
  94703. return new PromiseClass(function(resolve2, reject2) {
  94704. function offHandler() {
  94705. self2.off("fullscreenerror", errorHandler);
  94706. self2.off("fullscreenchange", changeHandler);
  94707. }
  94708. function changeHandler() {
  94709. offHandler();
  94710. resolve2();
  94711. }
  94712. function errorHandler(e, err) {
  94713. offHandler();
  94714. reject2(err);
  94715. }
  94716. self2.one("fullscreenchange", changeHandler);
  94717. self2.one("fullscreenerror", errorHandler);
  94718. var promise = self2.exitFullscreenHelper_();
  94719. if (promise) {
  94720. promise.then(offHandler, offHandler);
  94721. promise.then(resolve2, reject2);
  94722. }
  94723. });
  94724. }
  94725. return this.exitFullscreenHelper_();
  94726. };
  94727. _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() {
  94728. var _this13 = this;
  94729. if (this.fsApi_.requestFullscreen) {
  94730. var promise = document_1[this.fsApi_.exitFullscreen]();
  94731. if (promise) {
  94732. silencePromise(promise.then(function() {
  94733. return _this13.isFullscreen(false);
  94734. }));
  94735. }
  94736. return promise;
  94737. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94738. this.techCall_("exitFullScreen");
  94739. } else {
  94740. this.exitFullWindow();
  94741. }
  94742. };
  94743. _proto.enterFullWindow = function enterFullWindow() {
  94744. this.isFullscreen(true);
  94745. this.isFullWindow = true;
  94746. this.docOrigOverflow = document_1.documentElement.style.overflow;
  94747. on(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94748. document_1.documentElement.style.overflow = "hidden";
  94749. addClass(document_1.body, "vjs-full-window");
  94750. this.trigger("enterFullWindow");
  94751. };
  94752. _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event2) {
  94753. if (keycode.isEventKey(event2, "Esc")) {
  94754. if (this.isFullscreen() === true) {
  94755. if (!this.isFullWindow) {
  94756. this.exitFullscreen();
  94757. } else {
  94758. this.exitFullWindow();
  94759. }
  94760. }
  94761. }
  94762. };
  94763. _proto.exitFullWindow = function exitFullWindow() {
  94764. this.isFullscreen(false);
  94765. this.isFullWindow = false;
  94766. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94767. document_1.documentElement.style.overflow = this.docOrigOverflow;
  94768. removeClass(document_1.body, "vjs-full-window");
  94769. this.trigger("exitFullWindow");
  94770. };
  94771. _proto.disablePictureInPicture = function disablePictureInPicture(value) {
  94772. if (value === void 0) {
  94773. return this.techGet_("disablePictureInPicture");
  94774. }
  94775. this.techCall_("setDisablePictureInPicture", value);
  94776. this.options_.disablePictureInPicture = value;
  94777. this.trigger("disablepictureinpicturechanged");
  94778. };
  94779. _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) {
  94780. if (isPiP !== void 0) {
  94781. this.isInPictureInPicture_ = !!isPiP;
  94782. this.togglePictureInPictureClass_();
  94783. return;
  94784. }
  94785. return !!this.isInPictureInPicture_;
  94786. };
  94787. _proto.requestPictureInPicture = function requestPictureInPicture() {
  94788. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  94789. return this.techGet_("requestPictureInPicture");
  94790. }
  94791. };
  94792. _proto.exitPictureInPicture = function exitPictureInPicture() {
  94793. if ("pictureInPictureEnabled" in document_1) {
  94794. return document_1.exitPictureInPicture();
  94795. }
  94796. };
  94797. _proto.handleKeyDown = function handleKeyDown(event2) {
  94798. var userActions = this.options_.userActions;
  94799. if (!userActions || !userActions.hotkeys) {
  94800. return;
  94801. }
  94802. var excludeElement = function excludeElement2(el) {
  94803. var tagName = el.tagName.toLowerCase();
  94804. if (el.isContentEditable) {
  94805. return true;
  94806. }
  94807. var allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  94808. if (tagName === "input") {
  94809. return allowedInputTypes.indexOf(el.type) === -1;
  94810. }
  94811. var excludedTags = ["textarea"];
  94812. return excludedTags.indexOf(tagName) !== -1;
  94813. };
  94814. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  94815. return;
  94816. }
  94817. if (typeof userActions.hotkeys === "function") {
  94818. userActions.hotkeys.call(this, event2);
  94819. } else {
  94820. this.handleHotkeys(event2);
  94821. }
  94822. };
  94823. _proto.handleHotkeys = function handleHotkeys(event2) {
  94824. var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  94825. var _hotkeys$fullscreenKe = hotkeys.fullscreenKey, fullscreenKey = _hotkeys$fullscreenKe === void 0 ? function(keydownEvent) {
  94826. return keycode.isEventKey(keydownEvent, "f");
  94827. } : _hotkeys$fullscreenKe, _hotkeys$muteKey = hotkeys.muteKey, muteKey = _hotkeys$muteKey === void 0 ? function(keydownEvent) {
  94828. return keycode.isEventKey(keydownEvent, "m");
  94829. } : _hotkeys$muteKey, _hotkeys$playPauseKey = hotkeys.playPauseKey, playPauseKey = _hotkeys$playPauseKey === void 0 ? function(keydownEvent) {
  94830. return keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space");
  94831. } : _hotkeys$playPauseKey;
  94832. if (fullscreenKey.call(this, event2)) {
  94833. event2.preventDefault();
  94834. event2.stopPropagation();
  94835. var FSToggle = Component$1.getComponent("FullscreenToggle");
  94836. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  94837. FSToggle.prototype.handleClick.call(this, event2);
  94838. }
  94839. } else if (muteKey.call(this, event2)) {
  94840. event2.preventDefault();
  94841. event2.stopPropagation();
  94842. var MuteToggle2 = Component$1.getComponent("MuteToggle");
  94843. MuteToggle2.prototype.handleClick.call(this, event2);
  94844. } else if (playPauseKey.call(this, event2)) {
  94845. event2.preventDefault();
  94846. event2.stopPropagation();
  94847. var PlayToggle2 = Component$1.getComponent("PlayToggle");
  94848. PlayToggle2.prototype.handleClick.call(this, event2);
  94849. }
  94850. };
  94851. _proto.canPlayType = function canPlayType3(type2) {
  94852. var can;
  94853. for (var i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  94854. var techName = j[i2];
  94855. var tech = Tech$1.getTech(techName);
  94856. if (!tech) {
  94857. tech = Component$1.getComponent(techName);
  94858. }
  94859. if (!tech) {
  94860. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94861. continue;
  94862. }
  94863. if (tech.isSupported()) {
  94864. can = tech.canPlayType(type2);
  94865. if (can) {
  94866. return can;
  94867. }
  94868. }
  94869. }
  94870. return "";
  94871. };
  94872. _proto.selectSource = function selectSource(sources) {
  94873. var _this14 = this;
  94874. var techs = this.options_.techOrder.map(function(techName) {
  94875. return [techName, Tech$1.getTech(techName)];
  94876. }).filter(function(_ref) {
  94877. var techName = _ref[0], tech = _ref[1];
  94878. if (tech) {
  94879. return tech.isSupported();
  94880. }
  94881. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94882. return false;
  94883. });
  94884. var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair2(outerArray, innerArray, tester) {
  94885. var found;
  94886. outerArray.some(function(outerChoice) {
  94887. return innerArray.some(function(innerChoice) {
  94888. found = tester(outerChoice, innerChoice);
  94889. if (found) {
  94890. return true;
  94891. }
  94892. });
  94893. });
  94894. return found;
  94895. };
  94896. var foundSourceAndTech;
  94897. var flip = function flip2(fn2) {
  94898. return function(a, b) {
  94899. return fn2(b, a);
  94900. };
  94901. };
  94902. var finder = function finder2(_ref2, source) {
  94903. var techName = _ref2[0], tech = _ref2[1];
  94904. if (tech.canPlaySource(source, _this14.options_[techName.toLowerCase()])) {
  94905. return {
  94906. source,
  94907. tech: techName
  94908. };
  94909. }
  94910. };
  94911. if (this.options_.sourceOrder) {
  94912. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  94913. } else {
  94914. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  94915. }
  94916. return foundSourceAndTech || false;
  94917. };
  94918. _proto.handleSrc_ = function handleSrc_(source, isRetry) {
  94919. var _this15 = this;
  94920. if (typeof source === "undefined") {
  94921. return this.cache_.src || "";
  94922. }
  94923. if (this.resetRetryOnError_) {
  94924. this.resetRetryOnError_();
  94925. }
  94926. var sources = filterSource(source);
  94927. if (!sources.length) {
  94928. this.setTimeout(function() {
  94929. this.error({
  94930. code: 4,
  94931. message: this.options_.notSupportedMessage
  94932. });
  94933. }, 0);
  94934. return;
  94935. }
  94936. this.changingSrc_ = true;
  94937. if (!isRetry) {
  94938. this.cache_.sources = sources;
  94939. }
  94940. this.updateSourceCaches_(sources[0]);
  94941. setSource(this, sources[0], function(middlewareSource, mws) {
  94942. _this15.middleware_ = mws;
  94943. if (!isRetry) {
  94944. _this15.cache_.sources = sources;
  94945. }
  94946. _this15.updateSourceCaches_(middlewareSource);
  94947. var err = _this15.src_(middlewareSource);
  94948. if (err) {
  94949. if (sources.length > 1) {
  94950. return _this15.handleSrc_(sources.slice(1));
  94951. }
  94952. _this15.changingSrc_ = false;
  94953. _this15.setTimeout(function() {
  94954. this.error({
  94955. code: 4,
  94956. message: this.options_.notSupportedMessage
  94957. });
  94958. }, 0);
  94959. _this15.triggerReady();
  94960. return;
  94961. }
  94962. setTech(mws, _this15.tech_);
  94963. });
  94964. if (this.options_.retryOnError && sources.length > 1) {
  94965. var retry = function retry2() {
  94966. _this15.error(null);
  94967. _this15.handleSrc_(sources.slice(1), true);
  94968. };
  94969. var stopListeningForErrors = function stopListeningForErrors2() {
  94970. _this15.off("error", retry);
  94971. };
  94972. this.one("error", retry);
  94973. this.one("playing", stopListeningForErrors);
  94974. this.resetRetryOnError_ = function() {
  94975. _this15.off("error", retry);
  94976. _this15.off("playing", stopListeningForErrors);
  94977. };
  94978. }
  94979. };
  94980. _proto.src = function src(source) {
  94981. return this.handleSrc_(source, false);
  94982. };
  94983. _proto.src_ = function src_(source) {
  94984. var _this16 = this;
  94985. var sourceTech = this.selectSource([source]);
  94986. if (!sourceTech) {
  94987. return true;
  94988. }
  94989. if (!titleCaseEquals(sourceTech.tech, this.techName_)) {
  94990. this.changingSrc_ = true;
  94991. this.loadTech_(sourceTech.tech, sourceTech.source);
  94992. this.tech_.ready(function() {
  94993. _this16.changingSrc_ = false;
  94994. });
  94995. return false;
  94996. }
  94997. this.ready(function() {
  94998. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  94999. this.techCall_("setSource", source);
  95000. } else {
  95001. this.techCall_("src", source.src);
  95002. }
  95003. this.changingSrc_ = false;
  95004. }, true);
  95005. return false;
  95006. };
  95007. _proto.load = function load() {
  95008. this.techCall_("load");
  95009. };
  95010. _proto.reset = function reset3() {
  95011. var _this17 = this;
  95012. var PromiseClass = this.options_.Promise || window_1.Promise;
  95013. if (this.paused() || !PromiseClass) {
  95014. this.doReset_();
  95015. } else {
  95016. var playPromise = this.play();
  95017. silencePromise(playPromise.then(function() {
  95018. return _this17.doReset_();
  95019. }));
  95020. }
  95021. };
  95022. _proto.doReset_ = function doReset_() {
  95023. if (this.tech_) {
  95024. this.tech_.clearTracks("text");
  95025. }
  95026. this.resetCache_();
  95027. this.poster("");
  95028. this.loadTech_(this.options_.techOrder[0], null);
  95029. this.techCall_("reset");
  95030. this.resetControlBarUI_();
  95031. if (isEvented(this)) {
  95032. this.trigger("playerreset");
  95033. }
  95034. };
  95035. _proto.resetControlBarUI_ = function resetControlBarUI_() {
  95036. this.resetProgressBar_();
  95037. this.resetPlaybackRate_();
  95038. this.resetVolumeBar_();
  95039. };
  95040. _proto.resetProgressBar_ = function resetProgressBar_() {
  95041. this.currentTime(0);
  95042. var _ref3 = this.controlBar || {}, durationDisplay = _ref3.durationDisplay, remainingTimeDisplay = _ref3.remainingTimeDisplay;
  95043. if (durationDisplay) {
  95044. durationDisplay.updateContent();
  95045. }
  95046. if (remainingTimeDisplay) {
  95047. remainingTimeDisplay.updateContent();
  95048. }
  95049. };
  95050. _proto.resetPlaybackRate_ = function resetPlaybackRate_() {
  95051. this.playbackRate(this.defaultPlaybackRate());
  95052. this.handleTechRateChange_();
  95053. };
  95054. _proto.resetVolumeBar_ = function resetVolumeBar_() {
  95055. this.volume(1);
  95056. this.trigger("volumechange");
  95057. };
  95058. _proto.currentSources = function currentSources() {
  95059. var source = this.currentSource();
  95060. var sources = [];
  95061. if (Object.keys(source).length !== 0) {
  95062. sources.push(source);
  95063. }
  95064. return this.cache_.sources || sources;
  95065. };
  95066. _proto.currentSource = function currentSource() {
  95067. return this.cache_.source || {};
  95068. };
  95069. _proto.currentSrc = function currentSrc() {
  95070. return this.currentSource() && this.currentSource().src || "";
  95071. };
  95072. _proto.currentType = function currentType() {
  95073. return this.currentSource() && this.currentSource().type || "";
  95074. };
  95075. _proto.preload = function preload(value) {
  95076. if (value !== void 0) {
  95077. this.techCall_("setPreload", value);
  95078. this.options_.preload = value;
  95079. return;
  95080. }
  95081. return this.techGet_("preload");
  95082. };
  95083. _proto.autoplay = function autoplay(value) {
  95084. if (value === void 0) {
  95085. return this.options_.autoplay || false;
  95086. }
  95087. var techAutoplay;
  95088. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  95089. this.options_.autoplay = value;
  95090. this.manualAutoplay_(typeof value === "string" ? value : "play");
  95091. techAutoplay = false;
  95092. } else if (!value) {
  95093. this.options_.autoplay = false;
  95094. } else {
  95095. this.options_.autoplay = true;
  95096. }
  95097. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  95098. if (this.tech_) {
  95099. this.techCall_("setAutoplay", techAutoplay);
  95100. }
  95101. };
  95102. _proto.playsinline = function playsinline(value) {
  95103. if (value !== void 0) {
  95104. this.techCall_("setPlaysinline", value);
  95105. this.options_.playsinline = value;
  95106. return this;
  95107. }
  95108. return this.techGet_("playsinline");
  95109. };
  95110. _proto.loop = function loop(value) {
  95111. if (value !== void 0) {
  95112. this.techCall_("setLoop", value);
  95113. this.options_.loop = value;
  95114. return;
  95115. }
  95116. return this.techGet_("loop");
  95117. };
  95118. _proto.poster = function poster(src) {
  95119. if (src === void 0) {
  95120. return this.poster_;
  95121. }
  95122. if (!src) {
  95123. src = "";
  95124. }
  95125. if (src === this.poster_) {
  95126. return;
  95127. }
  95128. this.poster_ = src;
  95129. this.techCall_("setPoster", src);
  95130. this.isPosterFromTech_ = false;
  95131. this.trigger("posterchange");
  95132. };
  95133. _proto.handleTechPosterChange_ = function handleTechPosterChange_() {
  95134. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  95135. var newPoster = this.tech_.poster() || "";
  95136. if (newPoster !== this.poster_) {
  95137. this.poster_ = newPoster;
  95138. this.isPosterFromTech_ = true;
  95139. this.trigger("posterchange");
  95140. }
  95141. }
  95142. };
  95143. _proto.controls = function controls(bool) {
  95144. if (bool === void 0) {
  95145. return !!this.controls_;
  95146. }
  95147. bool = !!bool;
  95148. if (this.controls_ === bool) {
  95149. return;
  95150. }
  95151. this.controls_ = bool;
  95152. if (this.usingNativeControls()) {
  95153. this.techCall_("setControls", bool);
  95154. }
  95155. if (this.controls_) {
  95156. this.removeClass("vjs-controls-disabled");
  95157. this.addClass("vjs-controls-enabled");
  95158. this.trigger("controlsenabled");
  95159. if (!this.usingNativeControls()) {
  95160. this.addTechControlsListeners_();
  95161. }
  95162. } else {
  95163. this.removeClass("vjs-controls-enabled");
  95164. this.addClass("vjs-controls-disabled");
  95165. this.trigger("controlsdisabled");
  95166. if (!this.usingNativeControls()) {
  95167. this.removeTechControlsListeners_();
  95168. }
  95169. }
  95170. };
  95171. _proto.usingNativeControls = function usingNativeControls(bool) {
  95172. if (bool === void 0) {
  95173. return !!this.usingNativeControls_;
  95174. }
  95175. bool = !!bool;
  95176. if (this.usingNativeControls_ === bool) {
  95177. return;
  95178. }
  95179. this.usingNativeControls_ = bool;
  95180. if (this.usingNativeControls_) {
  95181. this.addClass("vjs-using-native-controls");
  95182. this.trigger("usingnativecontrols");
  95183. } else {
  95184. this.removeClass("vjs-using-native-controls");
  95185. this.trigger("usingcustomcontrols");
  95186. }
  95187. };
  95188. _proto.error = function error(err) {
  95189. var _this18 = this;
  95190. if (err === void 0) {
  95191. return this.error_ || null;
  95192. }
  95193. hooks("beforeerror").forEach(function(hookFunction) {
  95194. var newErr = hookFunction(_this18, err);
  95195. if (!(isObject2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  95196. _this18.log.error("please return a value that MediaError expects in beforeerror hooks");
  95197. return;
  95198. }
  95199. err = newErr;
  95200. });
  95201. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  95202. var triggerSuppressedError = function triggerSuppressedError2() {
  95203. this.error(err);
  95204. };
  95205. this.options_.suppressNotSupportedError = false;
  95206. this.any(["click", "touchstart"], triggerSuppressedError);
  95207. this.one("loadstart", function() {
  95208. this.off(["click", "touchstart"], triggerSuppressedError);
  95209. });
  95210. return;
  95211. }
  95212. if (err === null) {
  95213. this.error_ = err;
  95214. this.removeClass("vjs-error");
  95215. if (this.errorDisplay) {
  95216. this.errorDisplay.close();
  95217. }
  95218. return;
  95219. }
  95220. this.error_ = new MediaError(err);
  95221. this.addClass("vjs-error");
  95222. log$1.error("(CODE:" + this.error_.code + " " + MediaError.errorTypes[this.error_.code] + ")", this.error_.message, this.error_);
  95223. this.trigger("error");
  95224. hooks("error").forEach(function(hookFunction) {
  95225. return hookFunction(_this18, _this18.error_);
  95226. });
  95227. return;
  95228. };
  95229. _proto.reportUserActivity = function reportUserActivity(event2) {
  95230. this.userActivity_ = true;
  95231. };
  95232. _proto.userActive = function userActive(bool) {
  95233. if (bool === void 0) {
  95234. return this.userActive_;
  95235. }
  95236. bool = !!bool;
  95237. if (bool === this.userActive_) {
  95238. return;
  95239. }
  95240. this.userActive_ = bool;
  95241. if (this.userActive_) {
  95242. this.userActivity_ = true;
  95243. this.removeClass("vjs-user-inactive");
  95244. this.addClass("vjs-user-active");
  95245. this.trigger("useractive");
  95246. return;
  95247. }
  95248. if (this.tech_) {
  95249. this.tech_.one("mousemove", function(e) {
  95250. e.stopPropagation();
  95251. e.preventDefault();
  95252. });
  95253. }
  95254. this.userActivity_ = false;
  95255. this.removeClass("vjs-user-active");
  95256. this.addClass("vjs-user-inactive");
  95257. this.trigger("userinactive");
  95258. };
  95259. _proto.listenForUserActivity_ = function listenForUserActivity_() {
  95260. var mouseInProgress;
  95261. var lastMoveX;
  95262. var lastMoveY;
  95263. var handleActivity = bind(this, this.reportUserActivity);
  95264. var handleMouseMove = function handleMouseMove2(e) {
  95265. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  95266. lastMoveX = e.screenX;
  95267. lastMoveY = e.screenY;
  95268. handleActivity();
  95269. }
  95270. };
  95271. var handleMouseDown = function handleMouseDown2() {
  95272. handleActivity();
  95273. this.clearInterval(mouseInProgress);
  95274. mouseInProgress = this.setInterval(handleActivity, 250);
  95275. };
  95276. var handleMouseUpAndMouseLeave = function handleMouseUpAndMouseLeave2(event2) {
  95277. handleActivity();
  95278. this.clearInterval(mouseInProgress);
  95279. };
  95280. this.on("mousedown", handleMouseDown);
  95281. this.on("mousemove", handleMouseMove);
  95282. this.on("mouseup", handleMouseUpAndMouseLeave);
  95283. this.on("mouseleave", handleMouseUpAndMouseLeave);
  95284. var controlBar = this.getChild("controlBar");
  95285. if (controlBar && !IS_IOS && !IS_ANDROID) {
  95286. controlBar.on("mouseenter", function(event2) {
  95287. if (this.player().options_.inactivityTimeout !== 0) {
  95288. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  95289. }
  95290. this.player().options_.inactivityTimeout = 0;
  95291. });
  95292. controlBar.on("mouseleave", function(event2) {
  95293. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  95294. });
  95295. }
  95296. this.on("keydown", handleActivity);
  95297. this.on("keyup", handleActivity);
  95298. var inactivityTimeout;
  95299. this.setInterval(function() {
  95300. if (!this.userActivity_) {
  95301. return;
  95302. }
  95303. this.userActivity_ = false;
  95304. this.userActive(true);
  95305. this.clearTimeout(inactivityTimeout);
  95306. var timeout = this.options_.inactivityTimeout;
  95307. if (timeout <= 0) {
  95308. return;
  95309. }
  95310. inactivityTimeout = this.setTimeout(function() {
  95311. if (!this.userActivity_) {
  95312. this.userActive(false);
  95313. }
  95314. }, timeout);
  95315. }, 250);
  95316. };
  95317. _proto.playbackRate = function playbackRate(rate) {
  95318. if (rate !== void 0) {
  95319. this.techCall_("setPlaybackRate", rate);
  95320. return;
  95321. }
  95322. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95323. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  95324. }
  95325. return 1;
  95326. };
  95327. _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {
  95328. if (rate !== void 0) {
  95329. return this.techCall_("setDefaultPlaybackRate", rate);
  95330. }
  95331. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95332. return this.techGet_("defaultPlaybackRate");
  95333. }
  95334. return 1;
  95335. };
  95336. _proto.isAudio = function isAudio(bool) {
  95337. if (bool !== void 0) {
  95338. this.isAudio_ = !!bool;
  95339. return;
  95340. }
  95341. return !!this.isAudio_;
  95342. };
  95343. _proto.enableAudioOnlyUI_ = function enableAudioOnlyUI_() {
  95344. var _this19 = this;
  95345. this.addClass("vjs-audio-only-mode");
  95346. var playerChildren = this.children();
  95347. var controlBar = this.getChild("ControlBar");
  95348. var controlBarHeight = controlBar && controlBar.currentHeight();
  95349. playerChildren.forEach(function(child) {
  95350. if (child === controlBar) {
  95351. return;
  95352. }
  95353. if (child.el_ && !child.hasClass("vjs-hidden")) {
  95354. child.hide();
  95355. _this19.audioOnlyCache_.hiddenChildren.push(child);
  95356. }
  95357. });
  95358. this.audioOnlyCache_.playerHeight = this.currentHeight();
  95359. this.height(controlBarHeight);
  95360. this.trigger("audioonlymodechange");
  95361. };
  95362. _proto.disableAudioOnlyUI_ = function disableAudioOnlyUI_() {
  95363. this.removeClass("vjs-audio-only-mode");
  95364. this.audioOnlyCache_.hiddenChildren.forEach(function(child) {
  95365. return child.show();
  95366. });
  95367. this.height(this.audioOnlyCache_.playerHeight);
  95368. this.trigger("audioonlymodechange");
  95369. };
  95370. _proto.audioOnlyMode = function audioOnlyMode(value) {
  95371. var _this20 = this;
  95372. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  95373. return this.audioOnlyMode_;
  95374. }
  95375. this.audioOnlyMode_ = value;
  95376. var PromiseClass = this.options_.Promise || window_1.Promise;
  95377. if (PromiseClass) {
  95378. if (value) {
  95379. var exitPromises = [];
  95380. if (this.isInPictureInPicture()) {
  95381. exitPromises.push(this.exitPictureInPicture());
  95382. }
  95383. if (this.isFullscreen()) {
  95384. exitPromises.push(this.exitFullscreen());
  95385. }
  95386. if (this.audioPosterMode()) {
  95387. exitPromises.push(this.audioPosterMode(false));
  95388. }
  95389. return PromiseClass.all(exitPromises).then(function() {
  95390. return _this20.enableAudioOnlyUI_();
  95391. });
  95392. }
  95393. return PromiseClass.resolve().then(function() {
  95394. return _this20.disableAudioOnlyUI_();
  95395. });
  95396. }
  95397. if (value) {
  95398. if (this.isInPictureInPicture()) {
  95399. this.exitPictureInPicture();
  95400. }
  95401. if (this.isFullscreen()) {
  95402. this.exitFullscreen();
  95403. }
  95404. this.enableAudioOnlyUI_();
  95405. } else {
  95406. this.disableAudioOnlyUI_();
  95407. }
  95408. };
  95409. _proto.enablePosterModeUI_ = function enablePosterModeUI_() {
  95410. var tech = this.tech_ && this.tech_;
  95411. tech.hide();
  95412. this.addClass("vjs-audio-poster-mode");
  95413. this.trigger("audiopostermodechange");
  95414. };
  95415. _proto.disablePosterModeUI_ = function disablePosterModeUI_() {
  95416. var tech = this.tech_ && this.tech_;
  95417. tech.show();
  95418. this.removeClass("vjs-audio-poster-mode");
  95419. this.trigger("audiopostermodechange");
  95420. };
  95421. _proto.audioPosterMode = function audioPosterMode(value) {
  95422. var _this21 = this;
  95423. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  95424. return this.audioPosterMode_;
  95425. }
  95426. this.audioPosterMode_ = value;
  95427. var PromiseClass = this.options_.Promise || window_1.Promise;
  95428. if (PromiseClass) {
  95429. if (value) {
  95430. if (this.audioOnlyMode()) {
  95431. var audioOnlyModePromise = this.audioOnlyMode(false);
  95432. return audioOnlyModePromise.then(function() {
  95433. _this21.enablePosterModeUI_();
  95434. });
  95435. }
  95436. return PromiseClass.resolve().then(function() {
  95437. _this21.enablePosterModeUI_();
  95438. });
  95439. }
  95440. return PromiseClass.resolve().then(function() {
  95441. _this21.disablePosterModeUI_();
  95442. });
  95443. }
  95444. if (value) {
  95445. if (this.audioOnlyMode()) {
  95446. this.audioOnlyMode(false);
  95447. }
  95448. this.enablePosterModeUI_();
  95449. return;
  95450. }
  95451. this.disablePosterModeUI_();
  95452. };
  95453. _proto.addTextTrack = function addTextTrack(kind, label2, language) {
  95454. if (this.tech_) {
  95455. return this.tech_.addTextTrack(kind, label2, language);
  95456. }
  95457. };
  95458. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  95459. if (this.tech_) {
  95460. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  95461. }
  95462. };
  95463. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {
  95464. if (obj === void 0) {
  95465. obj = {};
  95466. }
  95467. var _obj = obj, track = _obj.track;
  95468. if (!track) {
  95469. track = obj;
  95470. }
  95471. if (this.tech_) {
  95472. return this.tech_.removeRemoteTextTrack(track);
  95473. }
  95474. };
  95475. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  95476. return this.techGet_("getVideoPlaybackQuality");
  95477. };
  95478. _proto.videoWidth = function videoWidth() {
  95479. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  95480. };
  95481. _proto.videoHeight = function videoHeight() {
  95482. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  95483. };
  95484. _proto.language = function language(code) {
  95485. if (code === void 0) {
  95486. return this.language_;
  95487. }
  95488. if (this.language_ !== String(code).toLowerCase()) {
  95489. this.language_ = String(code).toLowerCase();
  95490. if (isEvented(this)) {
  95491. this.trigger("languagechange");
  95492. }
  95493. }
  95494. };
  95495. _proto.languages = function languages() {
  95496. return mergeOptions$3(Player2.prototype.options_.languages, this.languages_);
  95497. };
  95498. _proto.toJSON = function toJSON() {
  95499. var options2 = mergeOptions$3(this.options_);
  95500. var tracks = options2.tracks;
  95501. options2.tracks = [];
  95502. for (var i2 = 0; i2 < tracks.length; i2++) {
  95503. var track = tracks[i2];
  95504. track = mergeOptions$3(track);
  95505. track.player = void 0;
  95506. options2.tracks[i2] = track;
  95507. }
  95508. return options2;
  95509. };
  95510. _proto.createModal = function createModal(content, options2) {
  95511. var _this22 = this;
  95512. options2 = options2 || {};
  95513. options2.content = content || "";
  95514. var modal = new ModalDialog(this, options2);
  95515. this.addChild(modal);
  95516. modal.on("dispose", function() {
  95517. _this22.removeChild(modal);
  95518. });
  95519. modal.open();
  95520. return modal;
  95521. };
  95522. _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {
  95523. if (!this.responsive()) {
  95524. return;
  95525. }
  95526. var currentBreakpoint = this.currentBreakpoint();
  95527. var currentWidth = this.currentWidth();
  95528. for (var i2 = 0; i2 < BREAKPOINT_ORDER.length; i2++) {
  95529. var candidateBreakpoint = BREAKPOINT_ORDER[i2];
  95530. var maxWidth = this.breakpoints_[candidateBreakpoint];
  95531. if (currentWidth <= maxWidth) {
  95532. if (currentBreakpoint === candidateBreakpoint) {
  95533. return;
  95534. }
  95535. if (currentBreakpoint) {
  95536. this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);
  95537. }
  95538. this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);
  95539. this.breakpoint_ = candidateBreakpoint;
  95540. break;
  95541. }
  95542. }
  95543. };
  95544. _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {
  95545. var className = this.currentBreakpointClass();
  95546. this.breakpoint_ = "";
  95547. if (className) {
  95548. this.removeClass(className);
  95549. }
  95550. };
  95551. _proto.breakpoints = function breakpoints(_breakpoints) {
  95552. if (_breakpoints === void 0) {
  95553. return assign(this.breakpoints_);
  95554. }
  95555. this.breakpoint_ = "";
  95556. this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints);
  95557. this.updateCurrentBreakpoint_();
  95558. return assign(this.breakpoints_);
  95559. };
  95560. _proto.responsive = function responsive(value) {
  95561. if (value === void 0) {
  95562. return this.responsive_;
  95563. }
  95564. value = Boolean(value);
  95565. var current = this.responsive_;
  95566. if (value === current) {
  95567. return;
  95568. }
  95569. this.responsive_ = value;
  95570. if (value) {
  95571. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  95572. this.updateCurrentBreakpoint_();
  95573. } else {
  95574. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  95575. this.removeCurrentBreakpoint_();
  95576. }
  95577. return value;
  95578. };
  95579. _proto.currentBreakpoint = function currentBreakpoint() {
  95580. return this.breakpoint_;
  95581. };
  95582. _proto.currentBreakpointClass = function currentBreakpointClass() {
  95583. return BREAKPOINT_CLASSES[this.breakpoint_] || "";
  95584. };
  95585. _proto.loadMedia = function loadMedia(media, ready) {
  95586. var _this23 = this;
  95587. if (!media || typeof media !== "object") {
  95588. return;
  95589. }
  95590. this.reset();
  95591. this.cache_.media = mergeOptions$3(media);
  95592. var _this$cache_$media = this.cache_.media, artwork = _this$cache_$media.artwork, poster = _this$cache_$media.poster, src = _this$cache_$media.src, textTracks = _this$cache_$media.textTracks;
  95593. if (!artwork && poster) {
  95594. this.cache_.media.artwork = [{
  95595. src: poster,
  95596. type: getMimetype(poster)
  95597. }];
  95598. }
  95599. if (src) {
  95600. this.src(src);
  95601. }
  95602. if (poster) {
  95603. this.poster(poster);
  95604. }
  95605. if (Array.isArray(textTracks)) {
  95606. textTracks.forEach(function(tt2) {
  95607. return _this23.addRemoteTextTrack(tt2, false);
  95608. });
  95609. }
  95610. this.ready(ready);
  95611. };
  95612. _proto.getMedia = function getMedia() {
  95613. if (!this.cache_.media) {
  95614. var poster = this.poster();
  95615. var src = this.currentSources();
  95616. var textTracks = Array.prototype.map.call(this.remoteTextTracks(), function(tt2) {
  95617. return {
  95618. kind: tt2.kind,
  95619. label: tt2.label,
  95620. language: tt2.language,
  95621. src: tt2.src
  95622. };
  95623. });
  95624. var media = {
  95625. src,
  95626. textTracks
  95627. };
  95628. if (poster) {
  95629. media.poster = poster;
  95630. media.artwork = [{
  95631. src: media.poster,
  95632. type: getMimetype(media.poster)
  95633. }];
  95634. }
  95635. return media;
  95636. }
  95637. return mergeOptions$3(this.cache_.media);
  95638. };
  95639. Player2.getTagSettings = function getTagSettings(tag) {
  95640. var baseOptions = {
  95641. sources: [],
  95642. tracks: []
  95643. };
  95644. var tagOptions = getAttributes(tag);
  95645. var dataSetup = tagOptions["data-setup"];
  95646. if (hasClass(tag, "vjs-fill")) {
  95647. tagOptions.fill = true;
  95648. }
  95649. if (hasClass(tag, "vjs-fluid")) {
  95650. tagOptions.fluid = true;
  95651. }
  95652. if (dataSetup !== null) {
  95653. var _safeParseTuple = tuple(dataSetup || "{}"), err = _safeParseTuple[0], data = _safeParseTuple[1];
  95654. if (err) {
  95655. log$1.error(err);
  95656. }
  95657. assign(tagOptions, data);
  95658. }
  95659. assign(baseOptions, tagOptions);
  95660. if (tag.hasChildNodes()) {
  95661. var children = tag.childNodes;
  95662. for (var i2 = 0, j = children.length; i2 < j; i2++) {
  95663. var child = children[i2];
  95664. var childName = child.nodeName.toLowerCase();
  95665. if (childName === "source") {
  95666. baseOptions.sources.push(getAttributes(child));
  95667. } else if (childName === "track") {
  95668. baseOptions.tracks.push(getAttributes(child));
  95669. }
  95670. }
  95671. }
  95672. return baseOptions;
  95673. };
  95674. _proto.flexNotSupported_ = function flexNotSupported_() {
  95675. var elem = document_1.createElement("i");
  95676. return !("flexBasis" in elem.style || "webkitFlexBasis" in elem.style || "mozFlexBasis" in elem.style || "msFlexBasis" in elem.style || "msFlexOrder" in elem.style);
  95677. };
  95678. _proto.debug = function debug(enabled) {
  95679. if (enabled === void 0) {
  95680. return this.debugEnabled_;
  95681. }
  95682. if (enabled) {
  95683. this.trigger("debugon");
  95684. this.previousLogLevel_ = this.log.level;
  95685. this.log.level("debug");
  95686. this.debugEnabled_ = true;
  95687. } else {
  95688. this.trigger("debugoff");
  95689. this.log.level(this.previousLogLevel_);
  95690. this.previousLogLevel_ = void 0;
  95691. this.debugEnabled_ = false;
  95692. }
  95693. };
  95694. _proto.playbackRates = function playbackRates(newRates) {
  95695. if (newRates === void 0) {
  95696. return this.cache_.playbackRates;
  95697. }
  95698. if (!Array.isArray(newRates)) {
  95699. return;
  95700. }
  95701. if (!newRates.every(function(rate) {
  95702. return typeof rate === "number";
  95703. })) {
  95704. return;
  95705. }
  95706. this.cache_.playbackRates = newRates;
  95707. this.trigger("playbackrateschange");
  95708. };
  95709. return Player2;
  95710. }(Component$1);
  95711. ALL.names.forEach(function(name) {
  95712. var props = ALL[name];
  95713. Player.prototype[props.getterName] = function() {
  95714. if (this.tech_) {
  95715. return this.tech_[props.getterName]();
  95716. }
  95717. this[props.privateName] = this[props.privateName] || new props.ListClass();
  95718. return this[props.privateName];
  95719. };
  95720. });
  95721. Player.prototype.crossorigin = Player.prototype.crossOrigin;
  95722. Player.players = {};
  95723. var navigator$2 = window_1.navigator;
  95724. Player.prototype.options_ = {
  95725. techOrder: Tech$1.defaultTechOrder_,
  95726. html5: {},
  95727. inactivityTimeout: 2e3,
  95728. playbackRates: [],
  95729. liveui: false,
  95730. children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  95731. language: navigator$2 && (navigator$2.languages && navigator$2.languages[0] || navigator$2.userLanguage || navigator$2.language) || "en",
  95732. languages: {},
  95733. notSupportedMessage: "No compatible source was found for this media.",
  95734. normalizeAutoplay: false,
  95735. fullscreen: {
  95736. options: {
  95737. navigationUI: "hide"
  95738. }
  95739. },
  95740. breakpoints: {},
  95741. responsive: false,
  95742. audioOnlyMode: false,
  95743. audioPosterMode: false
  95744. };
  95745. [
  95746. "ended",
  95747. "seeking",
  95748. "seekable",
  95749. "networkState",
  95750. "readyState"
  95751. ].forEach(function(fn2) {
  95752. Player.prototype[fn2] = function() {
  95753. return this.techGet_(fn2);
  95754. };
  95755. });
  95756. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  95757. Player.prototype["handleTech" + toTitleCase$1(event2) + "_"] = function() {
  95758. return this.trigger(event2);
  95759. };
  95760. });
  95761. Component$1.registerComponent("Player", Player);
  95762. var BASE_PLUGIN_NAME = "plugin";
  95763. var PLUGIN_CACHE_KEY = "activePlugins_";
  95764. var pluginStorage = {};
  95765. var pluginExists = function pluginExists2(name) {
  95766. return pluginStorage.hasOwnProperty(name);
  95767. };
  95768. var getPlugin = function getPlugin2(name) {
  95769. return pluginExists(name) ? pluginStorage[name] : void 0;
  95770. };
  95771. var markPluginAsActive = function markPluginAsActive2(player, name) {
  95772. player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};
  95773. player[PLUGIN_CACHE_KEY][name] = true;
  95774. };
  95775. var triggerSetupEvent = function triggerSetupEvent2(player, hash, before) {
  95776. var eventName = (before ? "before" : "") + "pluginsetup";
  95777. player.trigger(eventName, hash);
  95778. player.trigger(eventName + ":" + hash.name, hash);
  95779. };
  95780. var createBasicPlugin = function createBasicPlugin2(name, plugin) {
  95781. var basicPluginWrapper = function basicPluginWrapper2() {
  95782. triggerSetupEvent(this, {
  95783. name,
  95784. plugin,
  95785. instance: null
  95786. }, true);
  95787. var instance = plugin.apply(this, arguments);
  95788. markPluginAsActive(this, name);
  95789. triggerSetupEvent(this, {
  95790. name,
  95791. plugin,
  95792. instance
  95793. });
  95794. return instance;
  95795. };
  95796. Object.keys(plugin).forEach(function(prop) {
  95797. basicPluginWrapper[prop] = plugin[prop];
  95798. });
  95799. return basicPluginWrapper;
  95800. };
  95801. var createPluginFactory = function createPluginFactory2(name, PluginSubClass) {
  95802. PluginSubClass.prototype.name = name;
  95803. return function() {
  95804. triggerSetupEvent(this, {
  95805. name,
  95806. plugin: PluginSubClass,
  95807. instance: null
  95808. }, true);
  95809. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  95810. args[_key] = arguments[_key];
  95811. }
  95812. var instance = _construct(PluginSubClass, [this].concat(args));
  95813. this[name] = function() {
  95814. return instance;
  95815. };
  95816. triggerSetupEvent(this, instance.getEventHash());
  95817. return instance;
  95818. };
  95819. };
  95820. var Plugin = /* @__PURE__ */ function() {
  95821. function Plugin2(player) {
  95822. if (this.constructor === Plugin2) {
  95823. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  95824. }
  95825. this.player = player;
  95826. if (!this.log) {
  95827. this.log = this.player.log.createLogger(this.name);
  95828. }
  95829. evented(this);
  95830. delete this.trigger;
  95831. stateful(this, this.constructor.defaultState);
  95832. markPluginAsActive(player, this.name);
  95833. this.dispose = this.dispose.bind(this);
  95834. player.on("dispose", this.dispose);
  95835. }
  95836. var _proto = Plugin2.prototype;
  95837. _proto.version = function version2() {
  95838. return this.constructor.VERSION;
  95839. };
  95840. _proto.getEventHash = function getEventHash(hash) {
  95841. if (hash === void 0) {
  95842. hash = {};
  95843. }
  95844. hash.name = this.name;
  95845. hash.plugin = this.constructor;
  95846. hash.instance = this;
  95847. return hash;
  95848. };
  95849. _proto.trigger = function trigger$13(event2, hash) {
  95850. if (hash === void 0) {
  95851. hash = {};
  95852. }
  95853. return trigger(this.eventBusEl_, event2, this.getEventHash(hash));
  95854. };
  95855. _proto.handleStateChanged = function handleStateChanged(e) {
  95856. };
  95857. _proto.dispose = function dispose() {
  95858. var name = this.name, player = this.player;
  95859. this.trigger("dispose");
  95860. this.off();
  95861. player.off("dispose", this.dispose);
  95862. player[PLUGIN_CACHE_KEY][name] = false;
  95863. this.player = this.state = null;
  95864. player[name] = createPluginFactory(name, pluginStorage[name]);
  95865. };
  95866. Plugin2.isBasic = function isBasic(plugin) {
  95867. var p = typeof plugin === "string" ? getPlugin(plugin) : plugin;
  95868. return typeof p === "function" && !Plugin2.prototype.isPrototypeOf(p.prototype);
  95869. };
  95870. Plugin2.registerPlugin = function registerPlugin(name, plugin) {
  95871. if (typeof name !== "string") {
  95872. throw new Error('Illegal plugin name, "' + name + '", must be a string, was ' + typeof name + ".");
  95873. }
  95874. if (pluginExists(name)) {
  95875. log$1.warn('A plugin named "' + name + '" already exists. You may want to avoid re-registering plugins!');
  95876. } else if (Player.prototype.hasOwnProperty(name)) {
  95877. throw new Error('Illegal plugin name, "' + name + '", cannot share a name with an existing player method!');
  95878. }
  95879. if (typeof plugin !== "function") {
  95880. throw new Error('Illegal plugin for "' + name + '", must be a function, was ' + typeof plugin + ".");
  95881. }
  95882. pluginStorage[name] = plugin;
  95883. if (name !== BASE_PLUGIN_NAME) {
  95884. if (Plugin2.isBasic(plugin)) {
  95885. Player.prototype[name] = createBasicPlugin(name, plugin);
  95886. } else {
  95887. Player.prototype[name] = createPluginFactory(name, plugin);
  95888. }
  95889. }
  95890. return plugin;
  95891. };
  95892. Plugin2.deregisterPlugin = function deregisterPlugin(name) {
  95893. if (name === BASE_PLUGIN_NAME) {
  95894. throw new Error("Cannot de-register base plugin.");
  95895. }
  95896. if (pluginExists(name)) {
  95897. delete pluginStorage[name];
  95898. delete Player.prototype[name];
  95899. }
  95900. };
  95901. Plugin2.getPlugins = function getPlugins(names2) {
  95902. if (names2 === void 0) {
  95903. names2 = Object.keys(pluginStorage);
  95904. }
  95905. var result;
  95906. names2.forEach(function(name) {
  95907. var plugin = getPlugin(name);
  95908. if (plugin) {
  95909. result = result || {};
  95910. result[name] = plugin;
  95911. }
  95912. });
  95913. return result;
  95914. };
  95915. Plugin2.getPluginVersion = function getPluginVersion(name) {
  95916. var plugin = getPlugin(name);
  95917. return plugin && plugin.VERSION || "";
  95918. };
  95919. return Plugin2;
  95920. }();
  95921. Plugin.getPlugin = getPlugin;
  95922. Plugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;
  95923. Plugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);
  95924. Player.prototype.usingPlugin = function(name) {
  95925. return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;
  95926. };
  95927. Player.prototype.hasPlugin = function(name) {
  95928. return !!pluginExists(name);
  95929. };
  95930. var hasLogged = false;
  95931. var extend = function extend2(superClass, subClassMethods) {
  95932. if (subClassMethods === void 0) {
  95933. subClassMethods = {};
  95934. }
  95935. if (!hasLogged) {
  95936. log$1.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0");
  95937. hasLogged = true;
  95938. }
  95939. var subClass = function subClass2() {
  95940. superClass.apply(this, arguments);
  95941. };
  95942. var methods = {};
  95943. if (typeof subClassMethods === "object") {
  95944. if (subClassMethods.constructor !== Object.prototype.constructor) {
  95945. subClass = subClassMethods.constructor;
  95946. }
  95947. methods = subClassMethods;
  95948. } else if (typeof subClassMethods === "function") {
  95949. subClass = subClassMethods;
  95950. }
  95951. _inherits(subClass, superClass);
  95952. if (superClass) {
  95953. subClass.super_ = superClass;
  95954. }
  95955. for (var name in methods) {
  95956. if (methods.hasOwnProperty(name)) {
  95957. subClass.prototype[name] = methods[name];
  95958. }
  95959. }
  95960. return subClass;
  95961. };
  95962. var normalizeId = function normalizeId2(id) {
  95963. return id.indexOf("#") === 0 ? id.slice(1) : id;
  95964. };
  95965. function videojs(id, options2, ready) {
  95966. var player = videojs.getPlayer(id);
  95967. if (player) {
  95968. if (options2) {
  95969. log$1.warn('Player "' + id + '" is already initialised. Options will not be applied.');
  95970. }
  95971. if (ready) {
  95972. player.ready(ready);
  95973. }
  95974. return player;
  95975. }
  95976. var el = typeof id === "string" ? $("#" + normalizeId(id)) : id;
  95977. if (!isEl(el)) {
  95978. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  95979. }
  95980. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  95981. log$1.warn("The element supplied is not included in the DOM");
  95982. }
  95983. options2 = options2 || {};
  95984. if (options2.restoreEl === true) {
  95985. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  95986. }
  95987. hooks("beforesetup").forEach(function(hookFunction) {
  95988. var opts = hookFunction(el, mergeOptions$3(options2));
  95989. if (!isObject2(opts) || Array.isArray(opts)) {
  95990. log$1.error("please return an object in beforesetup hooks");
  95991. return;
  95992. }
  95993. options2 = mergeOptions$3(options2, opts);
  95994. });
  95995. var PlayerComponent = Component$1.getComponent("Player");
  95996. player = new PlayerComponent(el, options2, ready);
  95997. hooks("setup").forEach(function(hookFunction) {
  95998. return hookFunction(player);
  95999. });
  96000. return player;
  96001. }
  96002. videojs.hooks_ = hooks_;
  96003. videojs.hooks = hooks;
  96004. videojs.hook = hook;
  96005. videojs.hookOnce = hookOnce;
  96006. videojs.removeHook = removeHook;
  96007. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {
  96008. var style = $(".vjs-styles-defaults");
  96009. if (!style) {
  96010. style = createStyleElement("vjs-styles-defaults");
  96011. var head = $("head");
  96012. if (head) {
  96013. head.insertBefore(style, head.firstChild);
  96014. }
  96015. setTextContent(style, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ");
  96016. }
  96017. }
  96018. autoSetupTimeout(1, videojs);
  96019. videojs.VERSION = version$5;
  96020. videojs.options = Player.prototype.options_;
  96021. videojs.getPlayers = function() {
  96022. return Player.players;
  96023. };
  96024. videojs.getPlayer = function(id) {
  96025. var players = Player.players;
  96026. var tag;
  96027. if (typeof id === "string") {
  96028. var nId = normalizeId(id);
  96029. var player = players[nId];
  96030. if (player) {
  96031. return player;
  96032. }
  96033. tag = $("#" + nId);
  96034. } else {
  96035. tag = id;
  96036. }
  96037. if (isEl(tag)) {
  96038. var _tag = tag, _player = _tag.player, playerId = _tag.playerId;
  96039. if (_player || players[playerId]) {
  96040. return _player || players[playerId];
  96041. }
  96042. }
  96043. };
  96044. videojs.getAllPlayers = function() {
  96045. return Object.keys(Player.players).map(function(k) {
  96046. return Player.players[k];
  96047. }).filter(Boolean);
  96048. };
  96049. videojs.players = Player.players;
  96050. videojs.getComponent = Component$1.getComponent;
  96051. videojs.registerComponent = function(name, comp) {
  96052. if (Tech$1.isTech(comp)) {
  96053. log$1.warn("The " + name + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)");
  96054. }
  96055. Component$1.registerComponent.call(Component$1, name, comp);
  96056. };
  96057. videojs.getTech = Tech$1.getTech;
  96058. videojs.registerTech = Tech$1.registerTech;
  96059. videojs.use = use;
  96060. Object.defineProperty(videojs, "middleware", {
  96061. value: {},
  96062. writeable: false,
  96063. enumerable: true
  96064. });
  96065. Object.defineProperty(videojs.middleware, "TERMINATOR", {
  96066. value: TERMINATOR,
  96067. writeable: false,
  96068. enumerable: true
  96069. });
  96070. videojs.browser = browser;
  96071. videojs.TOUCH_ENABLED = TOUCH_ENABLED;
  96072. videojs.extend = extend;
  96073. videojs.mergeOptions = mergeOptions$3;
  96074. videojs.bind = bind;
  96075. videojs.registerPlugin = Plugin.registerPlugin;
  96076. videojs.deregisterPlugin = Plugin.deregisterPlugin;
  96077. videojs.plugin = function(name, plugin) {
  96078. log$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  96079. return Plugin.registerPlugin(name, plugin);
  96080. };
  96081. videojs.getPlugins = Plugin.getPlugins;
  96082. videojs.getPlugin = Plugin.getPlugin;
  96083. videojs.getPluginVersion = Plugin.getPluginVersion;
  96084. videojs.addLanguage = function(code, data) {
  96085. var _mergeOptions;
  96086. code = ("" + code).toLowerCase();
  96087. videojs.options.languages = mergeOptions$3(videojs.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));
  96088. return videojs.options.languages[code];
  96089. };
  96090. videojs.log = log$1;
  96091. videojs.createLogger = createLogger;
  96092. videojs.createTimeRange = videojs.createTimeRanges = createTimeRanges;
  96093. videojs.formatTime = formatTime;
  96094. videojs.setFormatTime = setFormatTime;
  96095. videojs.resetFormatTime = resetFormatTime;
  96096. videojs.parseUrl = parseUrl;
  96097. videojs.isCrossOrigin = isCrossOrigin;
  96098. videojs.EventTarget = EventTarget$2;
  96099. videojs.on = on;
  96100. videojs.one = one;
  96101. videojs.off = off;
  96102. videojs.trigger = trigger;
  96103. videojs.xhr = XHR;
  96104. videojs.TextTrack = TextTrack;
  96105. videojs.AudioTrack = AudioTrack;
  96106. videojs.VideoTrack = VideoTrack;
  96107. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(k) {
  96108. videojs[k] = function() {
  96109. log$1.warn("videojs." + k + "() is deprecated; use videojs.dom." + k + "() instead");
  96110. return Dom$1[k].apply(null, arguments);
  96111. };
  96112. });
  96113. videojs.computedStyle = computedStyle;
  96114. videojs.dom = Dom$1;
  96115. videojs.url = Url$1;
  96116. videojs.defineLazyProperty = defineLazyProperty;
  96117. videojs.addLanguage("en", {
  96118. "Non-Fullscreen": "Exit Fullscreen"
  96119. });
  96120. /*! @name @videojs/http-streaming @version 2.16.2 @license Apache-2.0 */
  96121. var resolveUrl4 = resolveUrl$1;
  96122. var resolveManifestRedirect = function resolveManifestRedirect2(handleManifestRedirect, url, req) {
  96123. if (handleManifestRedirect && req && req.responseURL && url !== req.responseURL) {
  96124. return req.responseURL;
  96125. }
  96126. return url;
  96127. };
  96128. var logger = function logger2(source) {
  96129. if (videojs.log.debug) {
  96130. return videojs.log.debug.bind(videojs, "VHS:", source + " >");
  96131. }
  96132. return function() {
  96133. };
  96134. };
  96135. var TIME_FUDGE_FACTOR = 1 / 30;
  96136. var SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;
  96137. var filterRanges = function filterRanges2(timeRanges, predicate) {
  96138. var results = [];
  96139. var i2;
  96140. if (timeRanges && timeRanges.length) {
  96141. for (i2 = 0; i2 < timeRanges.length; i2++) {
  96142. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  96143. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  96144. }
  96145. }
  96146. }
  96147. return videojs.createTimeRanges(results);
  96148. };
  96149. var findRange = function findRange2(buffered, time) {
  96150. return filterRanges(buffered, function(start2, end) {
  96151. return start2 - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;
  96152. });
  96153. };
  96154. var findNextRange = function findNextRange2(timeRanges, time) {
  96155. return filterRanges(timeRanges, function(start2) {
  96156. return start2 - TIME_FUDGE_FACTOR >= time;
  96157. });
  96158. };
  96159. var findGaps = function findGaps2(buffered) {
  96160. if (buffered.length < 2) {
  96161. return videojs.createTimeRanges();
  96162. }
  96163. var ranges = [];
  96164. for (var i2 = 1; i2 < buffered.length; i2++) {
  96165. var start2 = buffered.end(i2 - 1);
  96166. var end = buffered.start(i2);
  96167. ranges.push([start2, end]);
  96168. }
  96169. return videojs.createTimeRanges(ranges);
  96170. };
  96171. var bufferIntersection = function bufferIntersection2(bufferA, bufferB) {
  96172. var start2 = null;
  96173. var end = null;
  96174. var arity = 0;
  96175. var extents = [];
  96176. var ranges = [];
  96177. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  96178. return videojs.createTimeRange();
  96179. }
  96180. var count = bufferA.length;
  96181. while (count--) {
  96182. extents.push({
  96183. time: bufferA.start(count),
  96184. type: "start"
  96185. });
  96186. extents.push({
  96187. time: bufferA.end(count),
  96188. type: "end"
  96189. });
  96190. }
  96191. count = bufferB.length;
  96192. while (count--) {
  96193. extents.push({
  96194. time: bufferB.start(count),
  96195. type: "start"
  96196. });
  96197. extents.push({
  96198. time: bufferB.end(count),
  96199. type: "end"
  96200. });
  96201. }
  96202. extents.sort(function(a, b) {
  96203. return a.time - b.time;
  96204. });
  96205. for (count = 0; count < extents.length; count++) {
  96206. if (extents[count].type === "start") {
  96207. arity++;
  96208. if (arity === 2) {
  96209. start2 = extents[count].time;
  96210. }
  96211. } else if (extents[count].type === "end") {
  96212. arity--;
  96213. if (arity === 1) {
  96214. end = extents[count].time;
  96215. }
  96216. }
  96217. if (start2 !== null && end !== null) {
  96218. ranges.push([start2, end]);
  96219. start2 = null;
  96220. end = null;
  96221. }
  96222. }
  96223. return videojs.createTimeRanges(ranges);
  96224. };
  96225. var printableRange = function printableRange2(range3) {
  96226. var strArr = [];
  96227. if (!range3 || !range3.length) {
  96228. return "";
  96229. }
  96230. for (var i2 = 0; i2 < range3.length; i2++) {
  96231. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  96232. }
  96233. return strArr.join(", ");
  96234. };
  96235. var timeUntilRebuffer = function timeUntilRebuffer2(buffered, currentTime, playbackRate) {
  96236. if (playbackRate === void 0) {
  96237. playbackRate = 1;
  96238. }
  96239. var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  96240. return (bufferedEnd - currentTime) / playbackRate;
  96241. };
  96242. var timeRangesToArray = function timeRangesToArray2(timeRanges) {
  96243. var timeRangesList = [];
  96244. for (var i2 = 0; i2 < timeRanges.length; i2++) {
  96245. timeRangesList.push({
  96246. start: timeRanges.start(i2),
  96247. end: timeRanges.end(i2)
  96248. });
  96249. }
  96250. return timeRangesList;
  96251. };
  96252. var isRangeDifferent = function isRangeDifferent2(a, b) {
  96253. if (a === b) {
  96254. return false;
  96255. }
  96256. if (!a && b || !b && a) {
  96257. return true;
  96258. }
  96259. if (a.length !== b.length) {
  96260. return true;
  96261. }
  96262. for (var i2 = 0; i2 < a.length; i2++) {
  96263. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  96264. return true;
  96265. }
  96266. }
  96267. return false;
  96268. };
  96269. var lastBufferedEnd = function lastBufferedEnd2(a) {
  96270. if (!a || !a.length || !a.end) {
  96271. return;
  96272. }
  96273. return a.end(a.length - 1);
  96274. };
  96275. var timeAheadOf = function timeAheadOf2(range3, startTime) {
  96276. var time = 0;
  96277. if (!range3 || !range3.length) {
  96278. return time;
  96279. }
  96280. for (var i2 = 0; i2 < range3.length; i2++) {
  96281. var start2 = range3.start(i2);
  96282. var end = range3.end(i2);
  96283. if (startTime > end) {
  96284. continue;
  96285. }
  96286. if (startTime > start2 && startTime <= end) {
  96287. time += end - startTime;
  96288. continue;
  96289. }
  96290. time += end - start2;
  96291. }
  96292. return time;
  96293. };
  96294. var createTimeRange$1 = videojs.createTimeRange;
  96295. var segmentDurationWithParts = function segmentDurationWithParts2(playlist, segment) {
  96296. if (!segment.preload) {
  96297. return segment.duration;
  96298. }
  96299. var result = 0;
  96300. (segment.parts || []).forEach(function(p) {
  96301. result += p.duration;
  96302. });
  96303. (segment.preloadHints || []).forEach(function(p) {
  96304. if (p.type === "PART") {
  96305. result += playlist.partTargetDuration;
  96306. }
  96307. });
  96308. return result;
  96309. };
  96310. var getPartsAndSegments = function getPartsAndSegments2(playlist) {
  96311. return (playlist.segments || []).reduce(function(acc, segment, si) {
  96312. if (segment.parts) {
  96313. segment.parts.forEach(function(part, pi) {
  96314. acc.push({
  96315. duration: part.duration,
  96316. segmentIndex: si,
  96317. partIndex: pi,
  96318. part,
  96319. segment
  96320. });
  96321. });
  96322. } else {
  96323. acc.push({
  96324. duration: segment.duration,
  96325. segmentIndex: si,
  96326. partIndex: null,
  96327. segment,
  96328. part: null
  96329. });
  96330. }
  96331. return acc;
  96332. }, []);
  96333. };
  96334. var getLastParts = function getLastParts2(media) {
  96335. var lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  96336. return lastSegment && lastSegment.parts || [];
  96337. };
  96338. var getKnownPartCount = function getKnownPartCount2(_ref) {
  96339. var preloadSegment = _ref.preloadSegment;
  96340. if (!preloadSegment) {
  96341. return;
  96342. }
  96343. var parts = preloadSegment.parts, preloadHints = preloadSegment.preloadHints;
  96344. var partCount = (preloadHints || []).reduce(function(count, hint) {
  96345. return count + (hint.type === "PART" ? 1 : 0);
  96346. }, 0);
  96347. partCount += parts && parts.length ? parts.length : 0;
  96348. return partCount;
  96349. };
  96350. var liveEdgeDelay = function liveEdgeDelay2(master, media) {
  96351. if (media.endList) {
  96352. return 0;
  96353. }
  96354. if (master && master.suggestedPresentationDelay) {
  96355. return master.suggestedPresentationDelay;
  96356. }
  96357. var hasParts = getLastParts(media).length > 0;
  96358. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  96359. return media.serverControl.partHoldBack;
  96360. } else if (hasParts && media.partTargetDuration) {
  96361. return media.partTargetDuration * 3;
  96362. } else if (media.serverControl && media.serverControl.holdBack) {
  96363. return media.serverControl.holdBack;
  96364. } else if (media.targetDuration) {
  96365. return media.targetDuration * 3;
  96366. }
  96367. return 0;
  96368. };
  96369. var backwardDuration = function backwardDuration2(playlist, endSequence) {
  96370. var result = 0;
  96371. var i2 = endSequence - playlist.mediaSequence;
  96372. var segment = playlist.segments[i2];
  96373. if (segment) {
  96374. if (typeof segment.start !== "undefined") {
  96375. return {
  96376. result: segment.start,
  96377. precise: true
  96378. };
  96379. }
  96380. if (typeof segment.end !== "undefined") {
  96381. return {
  96382. result: segment.end - segment.duration,
  96383. precise: true
  96384. };
  96385. }
  96386. }
  96387. while (i2--) {
  96388. segment = playlist.segments[i2];
  96389. if (typeof segment.end !== "undefined") {
  96390. return {
  96391. result: result + segment.end,
  96392. precise: true
  96393. };
  96394. }
  96395. result += segmentDurationWithParts(playlist, segment);
  96396. if (typeof segment.start !== "undefined") {
  96397. return {
  96398. result: result + segment.start,
  96399. precise: true
  96400. };
  96401. }
  96402. }
  96403. return {
  96404. result,
  96405. precise: false
  96406. };
  96407. };
  96408. var forwardDuration = function forwardDuration2(playlist, endSequence) {
  96409. var result = 0;
  96410. var segment;
  96411. var i2 = endSequence - playlist.mediaSequence;
  96412. for (; i2 < playlist.segments.length; i2++) {
  96413. segment = playlist.segments[i2];
  96414. if (typeof segment.start !== "undefined") {
  96415. return {
  96416. result: segment.start - result,
  96417. precise: true
  96418. };
  96419. }
  96420. result += segmentDurationWithParts(playlist, segment);
  96421. if (typeof segment.end !== "undefined") {
  96422. return {
  96423. result: segment.end - result,
  96424. precise: true
  96425. };
  96426. }
  96427. }
  96428. return {
  96429. result: -1,
  96430. precise: false
  96431. };
  96432. };
  96433. var intervalDuration = function intervalDuration2(playlist, endSequence, expired) {
  96434. if (typeof endSequence === "undefined") {
  96435. endSequence = playlist.mediaSequence + playlist.segments.length;
  96436. }
  96437. if (endSequence < playlist.mediaSequence) {
  96438. return 0;
  96439. }
  96440. var backward = backwardDuration(playlist, endSequence);
  96441. if (backward.precise) {
  96442. return backward.result;
  96443. }
  96444. var forward = forwardDuration(playlist, endSequence);
  96445. if (forward.precise) {
  96446. return forward.result;
  96447. }
  96448. return backward.result + expired;
  96449. };
  96450. var duration2 = function duration3(playlist, endSequence, expired) {
  96451. if (!playlist) {
  96452. return 0;
  96453. }
  96454. if (typeof expired !== "number") {
  96455. expired = 0;
  96456. }
  96457. if (typeof endSequence === "undefined") {
  96458. if (playlist.totalDuration) {
  96459. return playlist.totalDuration;
  96460. }
  96461. if (!playlist.endList) {
  96462. return window_1.Infinity;
  96463. }
  96464. }
  96465. return intervalDuration(playlist, endSequence, expired);
  96466. };
  96467. var sumDurations = function sumDurations2(_ref2) {
  96468. var defaultDuration = _ref2.defaultDuration, durationList = _ref2.durationList, startIndex = _ref2.startIndex, endIndex = _ref2.endIndex;
  96469. var durations = 0;
  96470. if (startIndex > endIndex) {
  96471. var _ref3 = [endIndex, startIndex];
  96472. startIndex = _ref3[0];
  96473. endIndex = _ref3[1];
  96474. }
  96475. if (startIndex < 0) {
  96476. for (var i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  96477. durations += defaultDuration;
  96478. }
  96479. startIndex = 0;
  96480. }
  96481. for (var _i = startIndex; _i < endIndex; _i++) {
  96482. durations += durationList[_i].duration;
  96483. }
  96484. return durations;
  96485. };
  96486. var playlistEnd = function playlistEnd2(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  96487. if (!playlist || !playlist.segments) {
  96488. return null;
  96489. }
  96490. if (playlist.endList) {
  96491. return duration2(playlist);
  96492. }
  96493. if (expired === null) {
  96494. return null;
  96495. }
  96496. expired = expired || 0;
  96497. var lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  96498. if (useSafeLiveEnd) {
  96499. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay(null, playlist);
  96500. lastSegmentEndTime -= liveEdgePadding;
  96501. }
  96502. return Math.max(0, lastSegmentEndTime);
  96503. };
  96504. var seekable = function seekable2(playlist, expired, liveEdgePadding) {
  96505. var useSafeLiveEnd = true;
  96506. var seekableStart = expired || 0;
  96507. var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  96508. if (seekableEnd === null) {
  96509. return createTimeRange$1();
  96510. }
  96511. return createTimeRange$1(seekableStart, seekableEnd);
  96512. };
  96513. var getMediaInfoForTime = function getMediaInfoForTime2(_ref4) {
  96514. var playlist = _ref4.playlist, currentTime = _ref4.currentTime, startingSegmentIndex = _ref4.startingSegmentIndex, startingPartIndex = _ref4.startingPartIndex, startTime = _ref4.startTime, experimentalExactManifestTimings = _ref4.experimentalExactManifestTimings;
  96515. var time = currentTime - startTime;
  96516. var partsAndSegments = getPartsAndSegments(playlist);
  96517. var startIndex = 0;
  96518. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  96519. var partAndSegment = partsAndSegments[i2];
  96520. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  96521. continue;
  96522. }
  96523. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  96524. continue;
  96525. }
  96526. startIndex = i2;
  96527. break;
  96528. }
  96529. if (time < 0) {
  96530. if (startIndex > 0) {
  96531. for (var _i2 = startIndex - 1; _i2 >= 0; _i2--) {
  96532. var _partAndSegment = partsAndSegments[_i2];
  96533. time += _partAndSegment.duration;
  96534. if (experimentalExactManifestTimings) {
  96535. if (time < 0) {
  96536. continue;
  96537. }
  96538. } else if (time + TIME_FUDGE_FACTOR <= 0) {
  96539. continue;
  96540. }
  96541. return {
  96542. partIndex: _partAndSegment.partIndex,
  96543. segmentIndex: _partAndSegment.segmentIndex,
  96544. startTime: startTime - sumDurations({
  96545. defaultDuration: playlist.targetDuration,
  96546. durationList: partsAndSegments,
  96547. startIndex,
  96548. endIndex: _i2
  96549. })
  96550. };
  96551. }
  96552. }
  96553. return {
  96554. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96555. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96556. startTime: currentTime
  96557. };
  96558. }
  96559. if (startIndex < 0) {
  96560. for (var _i3 = startIndex; _i3 < 0; _i3++) {
  96561. time -= playlist.targetDuration;
  96562. if (time < 0) {
  96563. return {
  96564. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96565. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96566. startTime: currentTime
  96567. };
  96568. }
  96569. }
  96570. startIndex = 0;
  96571. }
  96572. for (var _i4 = startIndex; _i4 < partsAndSegments.length; _i4++) {
  96573. var _partAndSegment2 = partsAndSegments[_i4];
  96574. time -= _partAndSegment2.duration;
  96575. if (experimentalExactManifestTimings) {
  96576. if (time > 0) {
  96577. continue;
  96578. }
  96579. } else if (time - TIME_FUDGE_FACTOR >= 0) {
  96580. continue;
  96581. }
  96582. return {
  96583. partIndex: _partAndSegment2.partIndex,
  96584. segmentIndex: _partAndSegment2.segmentIndex,
  96585. startTime: startTime + sumDurations({
  96586. defaultDuration: playlist.targetDuration,
  96587. durationList: partsAndSegments,
  96588. startIndex,
  96589. endIndex: _i4
  96590. })
  96591. };
  96592. }
  96593. return {
  96594. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  96595. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  96596. startTime: currentTime
  96597. };
  96598. };
  96599. var isBlacklisted = function isBlacklisted2(playlist) {
  96600. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  96601. };
  96602. var isIncompatible = function isIncompatible2(playlist) {
  96603. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  96604. };
  96605. var isEnabled = function isEnabled2(playlist) {
  96606. var blacklisted = isBlacklisted(playlist);
  96607. return !playlist.disabled && !blacklisted;
  96608. };
  96609. var isDisabled = function isDisabled2(playlist) {
  96610. return playlist.disabled;
  96611. };
  96612. var isAes = function isAes2(media) {
  96613. for (var i2 = 0; i2 < media.segments.length; i2++) {
  96614. if (media.segments[i2].key) {
  96615. return true;
  96616. }
  96617. }
  96618. return false;
  96619. };
  96620. var hasAttribute = function hasAttribute2(attr, playlist) {
  96621. return playlist.attributes && playlist.attributes[attr];
  96622. };
  96623. var estimateSegmentRequestTime = function estimateSegmentRequestTime2(segmentDuration, bandwidth2, playlist, bytesReceived) {
  96624. if (bytesReceived === void 0) {
  96625. bytesReceived = 0;
  96626. }
  96627. if (!hasAttribute("BANDWIDTH", playlist)) {
  96628. return NaN;
  96629. }
  96630. var size = segmentDuration * playlist.attributes.BANDWIDTH;
  96631. return (size - bytesReceived * 8) / bandwidth2;
  96632. };
  96633. var isLowestEnabledRendition = function isLowestEnabledRendition2(master, media) {
  96634. if (master.playlists.length === 1) {
  96635. return true;
  96636. }
  96637. var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  96638. return master.playlists.filter(function(playlist) {
  96639. if (!isEnabled(playlist)) {
  96640. return false;
  96641. }
  96642. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  96643. }).length === 0;
  96644. };
  96645. var playlistMatch = function playlistMatch2(a, b) {
  96646. if (!a && !b || !a && b || a && !b) {
  96647. return false;
  96648. }
  96649. if (a === b) {
  96650. return true;
  96651. }
  96652. if (a.id && b.id && a.id === b.id) {
  96653. return true;
  96654. }
  96655. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  96656. return true;
  96657. }
  96658. if (a.uri && b.uri && a.uri === b.uri) {
  96659. return true;
  96660. }
  96661. return false;
  96662. };
  96663. var someAudioVariant = function someAudioVariant2(master, callback2) {
  96664. var AUDIO5 = master && master.mediaGroups && master.mediaGroups.AUDIO || {};
  96665. var found = false;
  96666. for (var groupName in AUDIO5) {
  96667. for (var label2 in AUDIO5[groupName]) {
  96668. found = callback2(AUDIO5[groupName][label2]);
  96669. if (found) {
  96670. break;
  96671. }
  96672. }
  96673. if (found) {
  96674. break;
  96675. }
  96676. }
  96677. return !!found;
  96678. };
  96679. var isAudioOnly = function isAudioOnly2(master) {
  96680. if (!master || !master.playlists || !master.playlists.length) {
  96681. var found = someAudioVariant(master, function(variant) {
  96682. return variant.playlists && variant.playlists.length || variant.uri;
  96683. });
  96684. return found;
  96685. }
  96686. var _loop = function _loop2(i3) {
  96687. var playlist = master.playlists[i3];
  96688. var CODECS = playlist.attributes && playlist.attributes.CODECS;
  96689. if (CODECS && CODECS.split(",").every(function(c) {
  96690. return isAudioCodec2(c);
  96691. })) {
  96692. return "continue";
  96693. }
  96694. var found2 = someAudioVariant(master, function(variant) {
  96695. return playlistMatch(playlist, variant);
  96696. });
  96697. if (found2) {
  96698. return "continue";
  96699. }
  96700. return {
  96701. v: false
  96702. };
  96703. };
  96704. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96705. var _ret = _loop(i2);
  96706. if (_ret === "continue")
  96707. continue;
  96708. if (typeof _ret === "object")
  96709. return _ret.v;
  96710. }
  96711. return true;
  96712. };
  96713. var Playlist = {
  96714. liveEdgeDelay,
  96715. duration: duration2,
  96716. seekable,
  96717. getMediaInfoForTime,
  96718. isEnabled,
  96719. isDisabled,
  96720. isBlacklisted,
  96721. isIncompatible,
  96722. playlistEnd,
  96723. isAes,
  96724. hasAttribute,
  96725. estimateSegmentRequestTime,
  96726. isLowestEnabledRendition,
  96727. isAudioOnly,
  96728. playlistMatch,
  96729. segmentDurationWithParts
  96730. };
  96731. var log = videojs.log;
  96732. var createPlaylistID = function createPlaylistID2(index2, uri) {
  96733. return index2 + "-" + uri;
  96734. };
  96735. var groupID = function groupID2(type2, group, label2) {
  96736. return "placeholder-uri-" + type2 + "-" + group + "-" + label2;
  96737. };
  96738. var parseManifest = function parseManifest2(_ref) {
  96739. var onwarn = _ref.onwarn, oninfo = _ref.oninfo, manifestString = _ref.manifestString, _ref$customTagParsers = _ref.customTagParsers, customTagParsers = _ref$customTagParsers === void 0 ? [] : _ref$customTagParsers, _ref$customTagMappers = _ref.customTagMappers, customTagMappers = _ref$customTagMappers === void 0 ? [] : _ref$customTagMappers, experimentalLLHLS = _ref.experimentalLLHLS;
  96740. var parser2 = new Parser();
  96741. if (onwarn) {
  96742. parser2.on("warn", onwarn);
  96743. }
  96744. if (oninfo) {
  96745. parser2.on("info", oninfo);
  96746. }
  96747. customTagParsers.forEach(function(customParser) {
  96748. return parser2.addParser(customParser);
  96749. });
  96750. customTagMappers.forEach(function(mapper) {
  96751. return parser2.addTagMapper(mapper);
  96752. });
  96753. parser2.push(manifestString);
  96754. parser2.end();
  96755. var manifest = parser2.manifest;
  96756. if (!experimentalLLHLS) {
  96757. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  96758. if (manifest.hasOwnProperty(k)) {
  96759. delete manifest[k];
  96760. }
  96761. });
  96762. if (manifest.segments) {
  96763. manifest.segments.forEach(function(segment) {
  96764. ["parts", "preloadHints"].forEach(function(k) {
  96765. if (segment.hasOwnProperty(k)) {
  96766. delete segment[k];
  96767. }
  96768. });
  96769. });
  96770. }
  96771. }
  96772. if (!manifest.targetDuration) {
  96773. var targetDuration = 10;
  96774. if (manifest.segments && manifest.segments.length) {
  96775. targetDuration = manifest.segments.reduce(function(acc, s) {
  96776. return Math.max(acc, s.duration);
  96777. }, 0);
  96778. }
  96779. if (onwarn) {
  96780. onwarn("manifest has no targetDuration defaulting to " + targetDuration);
  96781. }
  96782. manifest.targetDuration = targetDuration;
  96783. }
  96784. var parts = getLastParts(manifest);
  96785. if (parts.length && !manifest.partTargetDuration) {
  96786. var partTargetDuration = parts.reduce(function(acc, p) {
  96787. return Math.max(acc, p.duration);
  96788. }, 0);
  96789. if (onwarn) {
  96790. onwarn("manifest has no partTargetDuration defaulting to " + partTargetDuration);
  96791. log.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  96792. }
  96793. manifest.partTargetDuration = partTargetDuration;
  96794. }
  96795. return manifest;
  96796. };
  96797. var forEachMediaGroup3 = function forEachMediaGroup4(master, callback2) {
  96798. if (!master.mediaGroups) {
  96799. return;
  96800. }
  96801. ["AUDIO", "SUBTITLES"].forEach(function(mediaType) {
  96802. if (!master.mediaGroups[mediaType]) {
  96803. return;
  96804. }
  96805. for (var groupKey in master.mediaGroups[mediaType]) {
  96806. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  96807. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  96808. callback2(mediaProperties, mediaType, groupKey, labelKey);
  96809. }
  96810. }
  96811. });
  96812. };
  96813. var setupMediaPlaylist = function setupMediaPlaylist2(_ref2) {
  96814. var playlist = _ref2.playlist, uri = _ref2.uri, id = _ref2.id;
  96815. playlist.id = id;
  96816. playlist.playlistErrors_ = 0;
  96817. if (uri) {
  96818. playlist.uri = uri;
  96819. }
  96820. playlist.attributes = playlist.attributes || {};
  96821. };
  96822. var setupMediaPlaylists = function setupMediaPlaylists2(master) {
  96823. var i2 = master.playlists.length;
  96824. while (i2--) {
  96825. var playlist = master.playlists[i2];
  96826. setupMediaPlaylist({
  96827. playlist,
  96828. id: createPlaylistID(i2, playlist.uri)
  96829. });
  96830. playlist.resolvedUri = resolveUrl4(master.uri, playlist.uri);
  96831. master.playlists[playlist.id] = playlist;
  96832. master.playlists[playlist.uri] = playlist;
  96833. if (!playlist.attributes.BANDWIDTH) {
  96834. log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  96835. }
  96836. }
  96837. };
  96838. var resolveMediaGroupUris = function resolveMediaGroupUris2(master) {
  96839. forEachMediaGroup3(master, function(properties) {
  96840. if (properties.uri) {
  96841. properties.resolvedUri = resolveUrl4(master.uri, properties.uri);
  96842. }
  96843. });
  96844. };
  96845. var masterForMedia = function masterForMedia2(media, uri) {
  96846. var id = createPlaylistID(0, uri);
  96847. var master = {
  96848. mediaGroups: {
  96849. "AUDIO": {},
  96850. "VIDEO": {},
  96851. "CLOSED-CAPTIONS": {},
  96852. "SUBTITLES": {}
  96853. },
  96854. uri: window_1.location.href,
  96855. resolvedUri: window_1.location.href,
  96856. playlists: [{
  96857. uri,
  96858. id,
  96859. resolvedUri: uri,
  96860. attributes: {}
  96861. }]
  96862. };
  96863. master.playlists[id] = master.playlists[0];
  96864. master.playlists[uri] = master.playlists[0];
  96865. return master;
  96866. };
  96867. var addPropertiesToMaster = function addPropertiesToMaster2(master, uri, createGroupID) {
  96868. if (createGroupID === void 0) {
  96869. createGroupID = groupID;
  96870. }
  96871. master.uri = uri;
  96872. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96873. if (!master.playlists[i2].uri) {
  96874. var phonyUri = "placeholder-uri-" + i2;
  96875. master.playlists[i2].uri = phonyUri;
  96876. }
  96877. }
  96878. var audioOnlyMaster = isAudioOnly(master);
  96879. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  96880. if (!properties.playlists || !properties.playlists.length) {
  96881. if (audioOnlyMaster && mediaType === "AUDIO" && !properties.uri) {
  96882. for (var _i = 0; _i < master.playlists.length; _i++) {
  96883. var p = master.playlists[_i];
  96884. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  96885. return;
  96886. }
  96887. }
  96888. }
  96889. properties.playlists = [_extends$2({}, properties)];
  96890. }
  96891. properties.playlists.forEach(function(p2, i3) {
  96892. var groupId = createGroupID(mediaType, groupKey, labelKey, p2);
  96893. var id = createPlaylistID(i3, groupId);
  96894. if (p2.uri) {
  96895. p2.resolvedUri = p2.resolvedUri || resolveUrl4(master.uri, p2.uri);
  96896. } else {
  96897. p2.uri = i3 === 0 ? groupId : id;
  96898. p2.resolvedUri = p2.uri;
  96899. }
  96900. p2.id = p2.id || id;
  96901. p2.attributes = p2.attributes || {};
  96902. master.playlists[p2.id] = p2;
  96903. master.playlists[p2.uri] = p2;
  96904. });
  96905. });
  96906. setupMediaPlaylists(master);
  96907. resolveMediaGroupUris(master);
  96908. };
  96909. var mergeOptions$2 = videojs.mergeOptions, EventTarget$1 = videojs.EventTarget;
  96910. var addLLHLSQueryDirectives = function addLLHLSQueryDirectives2(uri, media) {
  96911. if (media.endList || !media.serverControl) {
  96912. return uri;
  96913. }
  96914. var parameters = {};
  96915. if (media.serverControl.canBlockReload) {
  96916. var preloadSegment = media.preloadSegment;
  96917. var nextMSN = media.mediaSequence + media.segments.length;
  96918. if (preloadSegment) {
  96919. var parts = preloadSegment.parts || [];
  96920. var nextPart = getKnownPartCount(media) - 1;
  96921. if (nextPart > -1 && nextPart !== parts.length - 1) {
  96922. parameters._HLS_part = nextPart;
  96923. }
  96924. if (nextPart > -1 || parts.length) {
  96925. nextMSN--;
  96926. }
  96927. }
  96928. parameters._HLS_msn = nextMSN;
  96929. }
  96930. if (media.serverControl && media.serverControl.canSkipUntil) {
  96931. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  96932. }
  96933. if (Object.keys(parameters).length) {
  96934. var parsedUri = new window_1.URL(uri);
  96935. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  96936. if (!parameters.hasOwnProperty(name)) {
  96937. return;
  96938. }
  96939. parsedUri.searchParams.set(name, parameters[name]);
  96940. });
  96941. uri = parsedUri.toString();
  96942. }
  96943. return uri;
  96944. };
  96945. var updateSegment = function updateSegment2(a, b) {
  96946. if (!a) {
  96947. return b;
  96948. }
  96949. var result = mergeOptions$2(a, b);
  96950. if (a.preloadHints && !b.preloadHints) {
  96951. delete result.preloadHints;
  96952. }
  96953. if (a.parts && !b.parts) {
  96954. delete result.parts;
  96955. } else if (a.parts && b.parts) {
  96956. for (var i2 = 0; i2 < b.parts.length; i2++) {
  96957. if (a.parts && a.parts[i2]) {
  96958. result.parts[i2] = mergeOptions$2(a.parts[i2], b.parts[i2]);
  96959. }
  96960. }
  96961. }
  96962. if (!a.skipped && b.skipped) {
  96963. result.skipped = false;
  96964. }
  96965. if (a.preload && !b.preload) {
  96966. result.preload = false;
  96967. }
  96968. return result;
  96969. };
  96970. var updateSegments = function updateSegments2(original, update, offset) {
  96971. var oldSegments = original.slice();
  96972. var newSegments = update.slice();
  96973. offset = offset || 0;
  96974. var result = [];
  96975. var currentMap;
  96976. for (var newIndex = 0; newIndex < newSegments.length; newIndex++) {
  96977. var oldSegment = oldSegments[newIndex + offset];
  96978. var newSegment = newSegments[newIndex];
  96979. if (oldSegment) {
  96980. currentMap = oldSegment.map || currentMap;
  96981. result.push(updateSegment(oldSegment, newSegment));
  96982. } else {
  96983. if (currentMap && !newSegment.map) {
  96984. newSegment.map = currentMap;
  96985. }
  96986. result.push(newSegment);
  96987. }
  96988. }
  96989. return result;
  96990. };
  96991. var resolveSegmentUris = function resolveSegmentUris2(segment, baseUri) {
  96992. if (!segment.resolvedUri && segment.uri) {
  96993. segment.resolvedUri = resolveUrl4(baseUri, segment.uri);
  96994. }
  96995. if (segment.key && !segment.key.resolvedUri) {
  96996. segment.key.resolvedUri = resolveUrl4(baseUri, segment.key.uri);
  96997. }
  96998. if (segment.map && !segment.map.resolvedUri) {
  96999. segment.map.resolvedUri = resolveUrl4(baseUri, segment.map.uri);
  97000. }
  97001. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  97002. segment.map.key.resolvedUri = resolveUrl4(baseUri, segment.map.key.uri);
  97003. }
  97004. if (segment.parts && segment.parts.length) {
  97005. segment.parts.forEach(function(p) {
  97006. if (p.resolvedUri) {
  97007. return;
  97008. }
  97009. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  97010. });
  97011. }
  97012. if (segment.preloadHints && segment.preloadHints.length) {
  97013. segment.preloadHints.forEach(function(p) {
  97014. if (p.resolvedUri) {
  97015. return;
  97016. }
  97017. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  97018. });
  97019. }
  97020. };
  97021. var getAllSegments = function getAllSegments2(media) {
  97022. var segments = media.segments || [];
  97023. var preloadSegment = media.preloadSegment;
  97024. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  97025. if (preloadSegment.preloadHints) {
  97026. for (var i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  97027. if (preloadSegment.preloadHints[i2].type === "MAP") {
  97028. return segments;
  97029. }
  97030. }
  97031. }
  97032. preloadSegment.duration = media.targetDuration;
  97033. preloadSegment.preload = true;
  97034. segments.push(preloadSegment);
  97035. }
  97036. return segments;
  97037. };
  97038. var isPlaylistUnchanged = function isPlaylistUnchanged2(a, b) {
  97039. return a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  97040. };
  97041. var updateMaster$1 = function updateMaster(master, newMedia, unchangedCheck) {
  97042. if (unchangedCheck === void 0) {
  97043. unchangedCheck = isPlaylistUnchanged;
  97044. }
  97045. var result = mergeOptions$2(master, {});
  97046. var oldMedia = result.playlists[newMedia.id];
  97047. if (!oldMedia) {
  97048. return null;
  97049. }
  97050. if (unchangedCheck(oldMedia, newMedia)) {
  97051. return null;
  97052. }
  97053. newMedia.segments = getAllSegments(newMedia);
  97054. var mergedPlaylist = mergeOptions$2(oldMedia, newMedia);
  97055. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  97056. delete mergedPlaylist.preloadSegment;
  97057. }
  97058. if (oldMedia.segments) {
  97059. if (newMedia.skip) {
  97060. newMedia.segments = newMedia.segments || [];
  97061. for (var i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  97062. newMedia.segments.unshift({
  97063. skipped: true
  97064. });
  97065. }
  97066. }
  97067. mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  97068. }
  97069. mergedPlaylist.segments.forEach(function(segment) {
  97070. resolveSegmentUris(segment, mergedPlaylist.resolvedUri);
  97071. });
  97072. for (var _i = 0; _i < result.playlists.length; _i++) {
  97073. if (result.playlists[_i].id === newMedia.id) {
  97074. result.playlists[_i] = mergedPlaylist;
  97075. }
  97076. }
  97077. result.playlists[newMedia.id] = mergedPlaylist;
  97078. result.playlists[newMedia.uri] = mergedPlaylist;
  97079. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97080. if (!properties.playlists) {
  97081. return;
  97082. }
  97083. for (var _i2 = 0; _i2 < properties.playlists.length; _i2++) {
  97084. if (newMedia.id === properties.playlists[_i2].id) {
  97085. properties.playlists[_i2] = mergedPlaylist;
  97086. }
  97087. }
  97088. });
  97089. return result;
  97090. };
  97091. var refreshDelay = function refreshDelay2(media, update) {
  97092. var segments = media.segments || [];
  97093. var lastSegment = segments[segments.length - 1];
  97094. var lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  97095. var lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  97096. if (update && lastDuration) {
  97097. return lastDuration * 1e3;
  97098. }
  97099. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  97100. };
  97101. var PlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97102. _inheritsLoose(PlaylistLoader2, _EventTarget);
  97103. function PlaylistLoader2(src, vhs, options2) {
  97104. var _this;
  97105. if (options2 === void 0) {
  97106. options2 = {};
  97107. }
  97108. _this = _EventTarget.call(this) || this;
  97109. if (!src) {
  97110. throw new Error("A non-empty playlist URL or object is required");
  97111. }
  97112. _this.logger_ = logger("PlaylistLoader");
  97113. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97114. _this.src = src;
  97115. _this.vhs_ = vhs;
  97116. _this.withCredentials = withCredentials;
  97117. _this.handleManifestRedirects = handleManifestRedirects;
  97118. var vhsOptions = vhs.options_;
  97119. _this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  97120. _this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  97121. _this.experimentalLLHLS = vhsOptions && vhsOptions.experimentalLLHLS || false;
  97122. if (videojs.browser.IE_VERSION) {
  97123. _this.experimentalLLHLS = false;
  97124. }
  97125. _this.state = "HAVE_NOTHING";
  97126. _this.handleMediaupdatetimeout_ = _this.handleMediaupdatetimeout_.bind(_assertThisInitialized(_this));
  97127. _this.on("mediaupdatetimeout", _this.handleMediaupdatetimeout_);
  97128. return _this;
  97129. }
  97130. var _proto = PlaylistLoader2.prototype;
  97131. _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() {
  97132. var _this2 = this;
  97133. if (this.state !== "HAVE_METADATA") {
  97134. return;
  97135. }
  97136. var media = this.media();
  97137. var uri = resolveUrl4(this.master.uri, media.uri);
  97138. if (this.experimentalLLHLS) {
  97139. uri = addLLHLSQueryDirectives(uri, media);
  97140. }
  97141. this.state = "HAVE_CURRENT_METADATA";
  97142. this.request = this.vhs_.xhr({
  97143. uri,
  97144. withCredentials: this.withCredentials
  97145. }, function(error, req) {
  97146. if (!_this2.request) {
  97147. return;
  97148. }
  97149. if (error) {
  97150. return _this2.playlistRequestError(_this2.request, _this2.media(), "HAVE_METADATA");
  97151. }
  97152. _this2.haveMetadata({
  97153. playlistString: _this2.request.responseText,
  97154. url: _this2.media().uri,
  97155. id: _this2.media().id
  97156. });
  97157. });
  97158. };
  97159. _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) {
  97160. var uri = playlist.uri, id = playlist.id;
  97161. this.request = null;
  97162. if (startingState) {
  97163. this.state = startingState;
  97164. }
  97165. this.error = {
  97166. playlist: this.master.playlists[id],
  97167. status: xhr.status,
  97168. message: "HLS playlist request error at URL: " + uri + ".",
  97169. responseText: xhr.responseText,
  97170. code: xhr.status >= 500 ? 4 : 2
  97171. };
  97172. this.trigger("error");
  97173. };
  97174. _proto.parseManifest_ = function parseManifest_(_ref) {
  97175. var _this3 = this;
  97176. var url = _ref.url, manifestString = _ref.manifestString;
  97177. return parseManifest({
  97178. onwarn: function onwarn(_ref2) {
  97179. var message = _ref2.message;
  97180. return _this3.logger_("m3u8-parser warn for " + url + ": " + message);
  97181. },
  97182. oninfo: function oninfo(_ref3) {
  97183. var message = _ref3.message;
  97184. return _this3.logger_("m3u8-parser info for " + url + ": " + message);
  97185. },
  97186. manifestString,
  97187. customTagParsers: this.customTagParsers,
  97188. customTagMappers: this.customTagMappers,
  97189. experimentalLLHLS: this.experimentalLLHLS
  97190. });
  97191. };
  97192. _proto.haveMetadata = function haveMetadata(_ref4) {
  97193. var playlistString = _ref4.playlistString, playlistObject = _ref4.playlistObject, url = _ref4.url, id = _ref4.id;
  97194. this.request = null;
  97195. this.state = "HAVE_METADATA";
  97196. var playlist = playlistObject || this.parseManifest_({
  97197. url,
  97198. manifestString: playlistString
  97199. });
  97200. playlist.lastRequest = Date.now();
  97201. setupMediaPlaylist({
  97202. playlist,
  97203. uri: url,
  97204. id
  97205. });
  97206. var update = updateMaster$1(this.master, playlist);
  97207. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  97208. this.pendingMedia_ = null;
  97209. if (update) {
  97210. this.master = update;
  97211. this.media_ = this.master.playlists[id];
  97212. } else {
  97213. this.trigger("playlistunchanged");
  97214. }
  97215. this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));
  97216. this.trigger("loadedplaylist");
  97217. };
  97218. _proto.dispose = function dispose() {
  97219. this.trigger("dispose");
  97220. this.stopRequest();
  97221. window_1.clearTimeout(this.mediaUpdateTimeout);
  97222. window_1.clearTimeout(this.finalRenditionTimeout);
  97223. this.off();
  97224. };
  97225. _proto.stopRequest = function stopRequest() {
  97226. if (this.request) {
  97227. var oldRequest = this.request;
  97228. this.request = null;
  97229. oldRequest.onreadystatechange = null;
  97230. oldRequest.abort();
  97231. }
  97232. };
  97233. _proto.media = function media(playlist, shouldDelay) {
  97234. var _this4 = this;
  97235. if (!playlist) {
  97236. return this.media_;
  97237. }
  97238. if (this.state === "HAVE_NOTHING") {
  97239. throw new Error("Cannot switch media playlist from " + this.state);
  97240. }
  97241. if (typeof playlist === "string") {
  97242. if (!this.master.playlists[playlist]) {
  97243. throw new Error("Unknown playlist URI: " + playlist);
  97244. }
  97245. playlist = this.master.playlists[playlist];
  97246. }
  97247. window_1.clearTimeout(this.finalRenditionTimeout);
  97248. if (shouldDelay) {
  97249. var delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  97250. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  97251. return;
  97252. }
  97253. var startingState = this.state;
  97254. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  97255. var masterPlaylistRef = this.master.playlists[playlist.id];
  97256. if (masterPlaylistRef && masterPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  97257. if (this.request) {
  97258. this.request.onreadystatechange = null;
  97259. this.request.abort();
  97260. this.request = null;
  97261. }
  97262. this.state = "HAVE_METADATA";
  97263. this.media_ = playlist;
  97264. if (mediaChange) {
  97265. this.trigger("mediachanging");
  97266. if (startingState === "HAVE_MASTER") {
  97267. this.trigger("loadedmetadata");
  97268. } else {
  97269. this.trigger("mediachange");
  97270. }
  97271. }
  97272. return;
  97273. }
  97274. this.updateMediaUpdateTimeout_(refreshDelay(playlist, true));
  97275. if (!mediaChange) {
  97276. return;
  97277. }
  97278. this.state = "SWITCHING_MEDIA";
  97279. if (this.request) {
  97280. if (playlist.resolvedUri === this.request.url) {
  97281. return;
  97282. }
  97283. this.request.onreadystatechange = null;
  97284. this.request.abort();
  97285. this.request = null;
  97286. }
  97287. if (this.media_) {
  97288. this.trigger("mediachanging");
  97289. }
  97290. this.pendingMedia_ = playlist;
  97291. this.request = this.vhs_.xhr({
  97292. uri: playlist.resolvedUri,
  97293. withCredentials: this.withCredentials
  97294. }, function(error, req) {
  97295. if (!_this4.request) {
  97296. return;
  97297. }
  97298. playlist.lastRequest = Date.now();
  97299. playlist.resolvedUri = resolveManifestRedirect(_this4.handleManifestRedirects, playlist.resolvedUri, req);
  97300. if (error) {
  97301. return _this4.playlistRequestError(_this4.request, playlist, startingState);
  97302. }
  97303. _this4.haveMetadata({
  97304. playlistString: req.responseText,
  97305. url: playlist.uri,
  97306. id: playlist.id
  97307. });
  97308. if (startingState === "HAVE_MASTER") {
  97309. _this4.trigger("loadedmetadata");
  97310. } else {
  97311. _this4.trigger("mediachange");
  97312. }
  97313. });
  97314. };
  97315. _proto.pause = function pause() {
  97316. if (this.mediaUpdateTimeout) {
  97317. window_1.clearTimeout(this.mediaUpdateTimeout);
  97318. this.mediaUpdateTimeout = null;
  97319. }
  97320. this.stopRequest();
  97321. if (this.state === "HAVE_NOTHING") {
  97322. this.started = false;
  97323. }
  97324. if (this.state === "SWITCHING_MEDIA") {
  97325. if (this.media_) {
  97326. this.state = "HAVE_METADATA";
  97327. } else {
  97328. this.state = "HAVE_MASTER";
  97329. }
  97330. } else if (this.state === "HAVE_CURRENT_METADATA") {
  97331. this.state = "HAVE_METADATA";
  97332. }
  97333. };
  97334. _proto.load = function load(shouldDelay) {
  97335. var _this5 = this;
  97336. if (this.mediaUpdateTimeout) {
  97337. window_1.clearTimeout(this.mediaUpdateTimeout);
  97338. this.mediaUpdateTimeout = null;
  97339. }
  97340. var media = this.media();
  97341. if (shouldDelay) {
  97342. var delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  97343. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97344. _this5.mediaUpdateTimeout = null;
  97345. _this5.load();
  97346. }, delay);
  97347. return;
  97348. }
  97349. if (!this.started) {
  97350. this.start();
  97351. return;
  97352. }
  97353. if (media && !media.endList) {
  97354. this.trigger("mediaupdatetimeout");
  97355. } else {
  97356. this.trigger("loadedplaylist");
  97357. }
  97358. };
  97359. _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) {
  97360. var _this6 = this;
  97361. if (this.mediaUpdateTimeout) {
  97362. window_1.clearTimeout(this.mediaUpdateTimeout);
  97363. this.mediaUpdateTimeout = null;
  97364. }
  97365. if (!this.media() || this.media().endList) {
  97366. return;
  97367. }
  97368. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97369. _this6.mediaUpdateTimeout = null;
  97370. _this6.trigger("mediaupdatetimeout");
  97371. _this6.updateMediaUpdateTimeout_(delay);
  97372. }, delay);
  97373. };
  97374. _proto.start = function start2() {
  97375. var _this7 = this;
  97376. this.started = true;
  97377. if (typeof this.src === "object") {
  97378. if (!this.src.uri) {
  97379. this.src.uri = window_1.location.href;
  97380. }
  97381. this.src.resolvedUri = this.src.uri;
  97382. setTimeout(function() {
  97383. _this7.setupInitialPlaylist(_this7.src);
  97384. }, 0);
  97385. return;
  97386. }
  97387. this.request = this.vhs_.xhr({
  97388. uri: this.src,
  97389. withCredentials: this.withCredentials
  97390. }, function(error, req) {
  97391. if (!_this7.request) {
  97392. return;
  97393. }
  97394. _this7.request = null;
  97395. if (error) {
  97396. _this7.error = {
  97397. status: req.status,
  97398. message: "HLS playlist request error at URL: " + _this7.src + ".",
  97399. responseText: req.responseText,
  97400. code: 2
  97401. };
  97402. if (_this7.state === "HAVE_NOTHING") {
  97403. _this7.started = false;
  97404. }
  97405. return _this7.trigger("error");
  97406. }
  97407. _this7.src = resolveManifestRedirect(_this7.handleManifestRedirects, _this7.src, req);
  97408. var manifest = _this7.parseManifest_({
  97409. manifestString: req.responseText,
  97410. url: _this7.src
  97411. });
  97412. _this7.setupInitialPlaylist(manifest);
  97413. });
  97414. };
  97415. _proto.srcUri = function srcUri() {
  97416. return typeof this.src === "string" ? this.src : this.src.uri;
  97417. };
  97418. _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) {
  97419. this.state = "HAVE_MASTER";
  97420. if (manifest.playlists) {
  97421. this.master = manifest;
  97422. addPropertiesToMaster(this.master, this.srcUri());
  97423. manifest.playlists.forEach(function(playlist) {
  97424. playlist.segments = getAllSegments(playlist);
  97425. playlist.segments.forEach(function(segment) {
  97426. resolveSegmentUris(segment, playlist.resolvedUri);
  97427. });
  97428. });
  97429. this.trigger("loadedplaylist");
  97430. if (!this.request) {
  97431. this.media(this.master.playlists[0]);
  97432. }
  97433. return;
  97434. }
  97435. var uri = this.srcUri() || window_1.location.href;
  97436. this.master = masterForMedia(manifest, uri);
  97437. this.haveMetadata({
  97438. playlistObject: manifest,
  97439. url: uri,
  97440. id: this.master.playlists[0].id
  97441. });
  97442. this.trigger("loadedmetadata");
  97443. };
  97444. return PlaylistLoader2;
  97445. }(EventTarget$1);
  97446. var videojsXHR = videojs.xhr, mergeOptions$1$1 = videojs.mergeOptions;
  97447. var callbackWrapper = function callbackWrapper2(request, error, response, callback2) {
  97448. var reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  97449. if (!error && reqResponse) {
  97450. request.responseTime = Date.now();
  97451. request.roundTripTime = request.responseTime - request.requestTime;
  97452. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  97453. if (!request.bandwidth) {
  97454. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  97455. }
  97456. }
  97457. if (response.headers) {
  97458. request.responseHeaders = response.headers;
  97459. }
  97460. if (error && error.code === "ETIMEDOUT") {
  97461. request.timedout = true;
  97462. }
  97463. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  97464. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  97465. }
  97466. callback2(error, request);
  97467. };
  97468. var xhrFactory = function xhrFactory2() {
  97469. var xhr = function XhrFunction(options2, callback2) {
  97470. options2 = mergeOptions$1$1({
  97471. timeout: 45e3
  97472. }, options2);
  97473. var beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest;
  97474. if (beforeRequest && typeof beforeRequest === "function") {
  97475. var newOptions = beforeRequest(options2);
  97476. if (newOptions) {
  97477. options2 = newOptions;
  97478. }
  97479. }
  97480. var xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr;
  97481. var request = xhrMethod(options2, function(error, response) {
  97482. return callbackWrapper(request, error, response, callback2);
  97483. });
  97484. var originalAbort = request.abort;
  97485. request.abort = function() {
  97486. request.aborted = true;
  97487. return originalAbort.apply(request, arguments);
  97488. };
  97489. request.uri = options2.uri;
  97490. request.requestTime = Date.now();
  97491. return request;
  97492. };
  97493. xhr.original = true;
  97494. return xhr;
  97495. };
  97496. var byterangeStr = function byterangeStr2(byterange) {
  97497. var byterangeEnd;
  97498. var byterangeStart = byterange.offset;
  97499. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  97500. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  97501. } else {
  97502. byterangeEnd = byterange.offset + byterange.length - 1;
  97503. }
  97504. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  97505. };
  97506. var segmentXhrHeaders = function segmentXhrHeaders2(segment) {
  97507. var headers = {};
  97508. if (segment.byterange) {
  97509. headers.Range = byterangeStr(segment.byterange);
  97510. }
  97511. return headers;
  97512. };
  97513. var textRange = function textRange2(range3, i2) {
  97514. return range3.start(i2) + "-" + range3.end(i2);
  97515. };
  97516. var formatHexString = function formatHexString2(e, i2) {
  97517. var value = e.toString(16);
  97518. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  97519. };
  97520. var formatAsciiString = function formatAsciiString2(e) {
  97521. if (e >= 32 && e < 126) {
  97522. return String.fromCharCode(e);
  97523. }
  97524. return ".";
  97525. };
  97526. var createTransferableMessage = function createTransferableMessage2(message) {
  97527. var transferable = {};
  97528. Object.keys(message).forEach(function(key) {
  97529. var value = message[key];
  97530. if (isArrayBufferView2(value)) {
  97531. transferable[key] = {
  97532. bytes: value.buffer,
  97533. byteOffset: value.byteOffset,
  97534. byteLength: value.byteLength
  97535. };
  97536. } else {
  97537. transferable[key] = value;
  97538. }
  97539. });
  97540. return transferable;
  97541. };
  97542. var initSegmentId = function initSegmentId2(initSegment) {
  97543. var byterange = initSegment.byterange || {
  97544. length: Infinity,
  97545. offset: 0
  97546. };
  97547. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  97548. };
  97549. var segmentKeyId = function segmentKeyId2(key) {
  97550. return key.resolvedUri;
  97551. };
  97552. var hexDump = function hexDump2(data) {
  97553. var bytes = Array.prototype.slice.call(data);
  97554. var step = 16;
  97555. var result = "";
  97556. var hex;
  97557. var ascii;
  97558. for (var j = 0; j < bytes.length / step; j++) {
  97559. hex = bytes.slice(j * step, j * step + step).map(formatHexString).join("");
  97560. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join("");
  97561. result += hex + " " + ascii + "\n";
  97562. }
  97563. return result;
  97564. };
  97565. var tagDump = function tagDump2(_ref) {
  97566. var bytes = _ref.bytes;
  97567. return hexDump(bytes);
  97568. };
  97569. var textRanges = function textRanges2(ranges) {
  97570. var result = "";
  97571. var i2;
  97572. for (i2 = 0; i2 < ranges.length; i2++) {
  97573. result += textRange(ranges, i2) + " ";
  97574. }
  97575. return result;
  97576. };
  97577. var utils = /* @__PURE__ */ Object.freeze({
  97578. __proto__: null,
  97579. createTransferableMessage,
  97580. initSegmentId,
  97581. segmentKeyId,
  97582. hexDump,
  97583. tagDump,
  97584. textRanges
  97585. });
  97586. var SEGMENT_END_FUDGE_PERCENT = 0.25;
  97587. var playerTimeToProgramTime = function playerTimeToProgramTime2(playerTime, segment) {
  97588. if (!segment.dateTimeObject) {
  97589. return null;
  97590. }
  97591. var transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  97592. var transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  97593. var startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  97594. var offsetFromSegmentStart = playerTime - startOfSegment;
  97595. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  97596. };
  97597. var originalSegmentVideoDuration = function originalSegmentVideoDuration2(videoTimingInfo) {
  97598. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  97599. };
  97600. var findSegmentForProgramTime = function findSegmentForProgramTime2(programTime, playlist) {
  97601. var dateTimeObject;
  97602. try {
  97603. dateTimeObject = new Date(programTime);
  97604. } catch (e) {
  97605. return null;
  97606. }
  97607. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97608. return null;
  97609. }
  97610. var segment = playlist.segments[0];
  97611. if (dateTimeObject < segment.dateTimeObject) {
  97612. return null;
  97613. }
  97614. for (var i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  97615. segment = playlist.segments[i2];
  97616. var nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  97617. if (dateTimeObject < nextSegmentStart) {
  97618. break;
  97619. }
  97620. }
  97621. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97622. var lastSegmentStart = lastSegment.dateTimeObject;
  97623. var lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;
  97624. var lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  97625. if (dateTimeObject > lastSegmentEnd) {
  97626. return null;
  97627. }
  97628. if (dateTimeObject > lastSegmentStart) {
  97629. segment = lastSegment;
  97630. }
  97631. return {
  97632. segment,
  97633. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  97634. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97635. };
  97636. };
  97637. var findSegmentForPlayerTime = function findSegmentForPlayerTime2(time, playlist) {
  97638. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97639. return null;
  97640. }
  97641. var segmentEnd = 0;
  97642. var segment;
  97643. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97644. segment = playlist.segments[i2];
  97645. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  97646. if (time <= segmentEnd) {
  97647. break;
  97648. }
  97649. }
  97650. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97651. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  97652. return null;
  97653. }
  97654. if (time > segmentEnd) {
  97655. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {
  97656. return null;
  97657. }
  97658. segment = lastSegment;
  97659. }
  97660. return {
  97661. segment,
  97662. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  97663. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97664. };
  97665. };
  97666. var getOffsetFromTimestamp = function getOffsetFromTimestamp2(comparisonTimeStamp, programTime) {
  97667. var segmentDateTime;
  97668. var programDateTime;
  97669. try {
  97670. segmentDateTime = new Date(comparisonTimeStamp);
  97671. programDateTime = new Date(programTime);
  97672. } catch (e) {
  97673. }
  97674. var segmentTimeEpoch = segmentDateTime.getTime();
  97675. var programTimeEpoch = programDateTime.getTime();
  97676. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  97677. };
  97678. var verifyProgramDateTimeTags = function verifyProgramDateTimeTags2(playlist) {
  97679. if (!playlist.segments || playlist.segments.length === 0) {
  97680. return false;
  97681. }
  97682. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97683. var segment = playlist.segments[i2];
  97684. if (!segment.dateTimeObject) {
  97685. return false;
  97686. }
  97687. }
  97688. return true;
  97689. };
  97690. var getProgramTime = function getProgramTime2(_ref) {
  97691. var playlist = _ref.playlist, _ref$time = _ref.time, time = _ref$time === void 0 ? void 0 : _ref$time, callback2 = _ref.callback;
  97692. if (!callback2) {
  97693. throw new Error("getProgramTime: callback must be provided");
  97694. }
  97695. if (!playlist || time === void 0) {
  97696. return callback2({
  97697. message: "getProgramTime: playlist and time must be provided"
  97698. });
  97699. }
  97700. var matchedSegment = findSegmentForPlayerTime(time, playlist);
  97701. if (!matchedSegment) {
  97702. return callback2({
  97703. message: "valid programTime was not found"
  97704. });
  97705. }
  97706. if (matchedSegment.type === "estimate") {
  97707. return callback2({
  97708. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  97709. seekTime: matchedSegment.estimatedStart
  97710. });
  97711. }
  97712. var programTimeObject = {
  97713. mediaSeconds: time
  97714. };
  97715. var programTime = playerTimeToProgramTime(time, matchedSegment.segment);
  97716. if (programTime) {
  97717. programTimeObject.programDateTime = programTime.toISOString();
  97718. }
  97719. return callback2(null, programTimeObject);
  97720. };
  97721. var seekToProgramTime = function seekToProgramTime2(_ref2) {
  97722. var programTime = _ref2.programTime, playlist = _ref2.playlist, _ref2$retryCount = _ref2.retryCount, retryCount = _ref2$retryCount === void 0 ? 2 : _ref2$retryCount, seekTo = _ref2.seekTo, _ref2$pauseAfterSeek = _ref2.pauseAfterSeek, pauseAfterSeek = _ref2$pauseAfterSeek === void 0 ? true : _ref2$pauseAfterSeek, tech = _ref2.tech, callback2 = _ref2.callback;
  97723. if (!callback2) {
  97724. throw new Error("seekToProgramTime: callback must be provided");
  97725. }
  97726. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  97727. return callback2({
  97728. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  97729. });
  97730. }
  97731. if (!playlist.endList && !tech.hasStarted_) {
  97732. return callback2({
  97733. message: "player must be playing a live stream to start buffering"
  97734. });
  97735. }
  97736. if (!verifyProgramDateTimeTags(playlist)) {
  97737. return callback2({
  97738. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  97739. });
  97740. }
  97741. var matchedSegment = findSegmentForProgramTime(programTime, playlist);
  97742. if (!matchedSegment) {
  97743. return callback2({
  97744. message: programTime + " was not found in the stream"
  97745. });
  97746. }
  97747. var segment = matchedSegment.segment;
  97748. var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);
  97749. if (matchedSegment.type === "estimate") {
  97750. if (retryCount === 0) {
  97751. return callback2({
  97752. message: programTime + " is not buffered yet. Try again"
  97753. });
  97754. }
  97755. seekTo(matchedSegment.estimatedStart + mediaOffset);
  97756. tech.one("seeked", function() {
  97757. seekToProgramTime2({
  97758. programTime,
  97759. playlist,
  97760. retryCount: retryCount - 1,
  97761. seekTo,
  97762. pauseAfterSeek,
  97763. tech,
  97764. callback: callback2
  97765. });
  97766. });
  97767. return;
  97768. }
  97769. var seekToTime = segment.start + mediaOffset;
  97770. var seekedCallback = function seekedCallback2() {
  97771. return callback2(null, tech.currentTime());
  97772. };
  97773. tech.one("seeked", seekedCallback);
  97774. if (pauseAfterSeek) {
  97775. tech.pause();
  97776. }
  97777. seekTo(seekToTime);
  97778. };
  97779. var callbackOnCompleted = function callbackOnCompleted2(request, cb) {
  97780. if (request.readyState === 4) {
  97781. return cb();
  97782. }
  97783. return;
  97784. };
  97785. var containerRequest = function containerRequest2(uri, xhr, cb) {
  97786. var bytes = [];
  97787. var id3Offset;
  97788. var finished = false;
  97789. var endRequestAndCallback = function endRequestAndCallback2(err, req, type2, _bytes) {
  97790. req.abort();
  97791. finished = true;
  97792. return cb(err, req, type2, _bytes);
  97793. };
  97794. var progressListener = function progressListener2(error, request2) {
  97795. if (finished) {
  97796. return;
  97797. }
  97798. if (error) {
  97799. return endRequestAndCallback(error, request2, "", bytes);
  97800. }
  97801. var newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  97802. bytes = concatTypedArrays2(bytes, stringToBytes2(newPart, true));
  97803. id3Offset = id3Offset || getId3Offset2(bytes);
  97804. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  97805. return callbackOnCompleted(request2, function() {
  97806. return endRequestAndCallback(error, request2, "", bytes);
  97807. });
  97808. }
  97809. var type2 = detectContainerForBytes2(bytes);
  97810. if (type2 === "ts" && bytes.length < 188) {
  97811. return callbackOnCompleted(request2, function() {
  97812. return endRequestAndCallback(error, request2, "", bytes);
  97813. });
  97814. }
  97815. if (!type2 && bytes.length < 376) {
  97816. return callbackOnCompleted(request2, function() {
  97817. return endRequestAndCallback(error, request2, "", bytes);
  97818. });
  97819. }
  97820. return endRequestAndCallback(null, request2, type2, bytes);
  97821. };
  97822. var options2 = {
  97823. uri,
  97824. beforeSend: function beforeSend(request2) {
  97825. request2.overrideMimeType("text/plain; charset=x-user-defined");
  97826. request2.addEventListener("progress", function(_ref) {
  97827. _ref.total;
  97828. _ref.loaded;
  97829. return callbackWrapper(request2, null, {
  97830. statusCode: request2.status
  97831. }, progressListener);
  97832. });
  97833. }
  97834. };
  97835. var request = xhr(options2, function(error, response) {
  97836. return callbackWrapper(request, error, response, progressListener);
  97837. });
  97838. return request;
  97839. };
  97840. var EventTarget2 = videojs.EventTarget, mergeOptions$4 = videojs.mergeOptions;
  97841. var dashPlaylistUnchanged = function dashPlaylistUnchanged2(a, b) {
  97842. if (!isPlaylistUnchanged(a, b)) {
  97843. return false;
  97844. }
  97845. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  97846. return false;
  97847. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  97848. return false;
  97849. }
  97850. if (a.segments && !b.segments || !a.segments && b.segments) {
  97851. return false;
  97852. }
  97853. if (!a.segments && !b.segments) {
  97854. return true;
  97855. }
  97856. for (var i2 = 0; i2 < a.segments.length; i2++) {
  97857. var aSegment = a.segments[i2];
  97858. var bSegment = b.segments[i2];
  97859. if (aSegment.uri !== bSegment.uri) {
  97860. return false;
  97861. }
  97862. if (!aSegment.byterange && !bSegment.byterange) {
  97863. continue;
  97864. }
  97865. var aByterange = aSegment.byterange;
  97866. var bByterange = bSegment.byterange;
  97867. if (aByterange && !bByterange || !aByterange && bByterange) {
  97868. return false;
  97869. }
  97870. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  97871. return false;
  97872. }
  97873. }
  97874. return true;
  97875. };
  97876. var dashGroupId = function dashGroupId2(type2, group, label2, playlist) {
  97877. var playlistId = playlist.attributes.NAME || label2;
  97878. return "placeholder-uri-" + type2 + "-" + group + "-" + playlistId;
  97879. };
  97880. var parseMasterXml = function parseMasterXml2(_ref) {
  97881. var masterXml = _ref.masterXml, srcUrl = _ref.srcUrl, clientOffset = _ref.clientOffset, sidxMapping = _ref.sidxMapping, previousManifest = _ref.previousManifest;
  97882. var manifest = parse(masterXml, {
  97883. manifestUri: srcUrl,
  97884. clientOffset,
  97885. sidxMapping,
  97886. previousManifest
  97887. });
  97888. addPropertiesToMaster(manifest, srcUrl, dashGroupId);
  97889. return manifest;
  97890. };
  97891. var removeOldMediaGroupLabels = function removeOldMediaGroupLabels2(update, newMaster) {
  97892. forEachMediaGroup3(update, function(properties, type2, group, label2) {
  97893. if (!(label2 in newMaster.mediaGroups[type2][group])) {
  97894. delete update.mediaGroups[type2][group][label2];
  97895. }
  97896. });
  97897. };
  97898. var updateMaster2 = function updateMaster3(oldMaster, newMaster, sidxMapping) {
  97899. var noChanges = true;
  97900. var update = mergeOptions$4(oldMaster, {
  97901. duration: newMaster.duration,
  97902. minimumUpdatePeriod: newMaster.minimumUpdatePeriod,
  97903. timelineStarts: newMaster.timelineStarts
  97904. });
  97905. for (var i2 = 0; i2 < newMaster.playlists.length; i2++) {
  97906. var playlist = newMaster.playlists[i2];
  97907. if (playlist.sidx) {
  97908. var sidxKey = generateSidxKey(playlist.sidx);
  97909. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  97910. addSidxSegmentsToPlaylist$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  97911. }
  97912. }
  97913. var playlistUpdate = updateMaster$1(update, playlist, dashPlaylistUnchanged);
  97914. if (playlistUpdate) {
  97915. update = playlistUpdate;
  97916. noChanges = false;
  97917. }
  97918. }
  97919. forEachMediaGroup3(newMaster, function(properties, type2, group, label2) {
  97920. if (properties.playlists && properties.playlists.length) {
  97921. var id = properties.playlists[0].id;
  97922. var _playlistUpdate = updateMaster$1(update, properties.playlists[0], dashPlaylistUnchanged);
  97923. if (_playlistUpdate) {
  97924. update = _playlistUpdate;
  97925. if (!(label2 in update.mediaGroups[type2][group])) {
  97926. update.mediaGroups[type2][group][label2] = properties;
  97927. }
  97928. update.mediaGroups[type2][group][label2].playlists[0] = update.playlists[id];
  97929. noChanges = false;
  97930. }
  97931. }
  97932. });
  97933. removeOldMediaGroupLabels(update, newMaster);
  97934. if (newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  97935. noChanges = false;
  97936. }
  97937. if (noChanges) {
  97938. return null;
  97939. }
  97940. return update;
  97941. };
  97942. var equivalentSidx = function equivalentSidx2(a, b) {
  97943. var neitherMap = Boolean(!a.map && !b.map);
  97944. var equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  97945. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  97946. };
  97947. var compareSidxEntry = function compareSidxEntry2(playlists, oldSidxMapping) {
  97948. var newSidxMapping = {};
  97949. for (var id in playlists) {
  97950. var playlist = playlists[id];
  97951. var currentSidxInfo = playlist.sidx;
  97952. if (currentSidxInfo) {
  97953. var key = generateSidxKey(currentSidxInfo);
  97954. if (!oldSidxMapping[key]) {
  97955. break;
  97956. }
  97957. var savedSidxInfo = oldSidxMapping[key].sidxInfo;
  97958. if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {
  97959. newSidxMapping[key] = oldSidxMapping[key];
  97960. }
  97961. }
  97962. }
  97963. return newSidxMapping;
  97964. };
  97965. var filterChangedSidxMappings = function filterChangedSidxMappings2(master, oldSidxMapping) {
  97966. var videoSidx = compareSidxEntry(master.playlists, oldSidxMapping);
  97967. var mediaGroupSidx = videoSidx;
  97968. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97969. if (properties.playlists && properties.playlists.length) {
  97970. var playlists = properties.playlists;
  97971. mediaGroupSidx = mergeOptions$4(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));
  97972. }
  97973. });
  97974. return mediaGroupSidx;
  97975. };
  97976. var DashPlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97977. _inheritsLoose(DashPlaylistLoader2, _EventTarget);
  97978. function DashPlaylistLoader2(srcUrlOrPlaylist, vhs, options2, masterPlaylistLoader) {
  97979. var _this;
  97980. if (options2 === void 0) {
  97981. options2 = {};
  97982. }
  97983. _this = _EventTarget.call(this) || this;
  97984. _this.masterPlaylistLoader_ = masterPlaylistLoader || _assertThisInitialized(_this);
  97985. if (!masterPlaylistLoader) {
  97986. _this.isMaster_ = true;
  97987. }
  97988. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97989. _this.vhs_ = vhs;
  97990. _this.withCredentials = withCredentials;
  97991. _this.handleManifestRedirects = handleManifestRedirects;
  97992. if (!srcUrlOrPlaylist) {
  97993. throw new Error("A non-empty playlist URL or object is required");
  97994. }
  97995. _this.on("minimumUpdatePeriod", function() {
  97996. _this.refreshXml_();
  97997. });
  97998. _this.on("mediaupdatetimeout", function() {
  97999. _this.refreshMedia_(_this.media().id);
  98000. });
  98001. _this.state = "HAVE_NOTHING";
  98002. _this.loadedPlaylists_ = {};
  98003. _this.logger_ = logger("DashPlaylistLoader");
  98004. if (_this.isMaster_) {
  98005. _this.masterPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  98006. _this.masterPlaylistLoader_.sidxMapping_ = {};
  98007. } else {
  98008. _this.childPlaylist_ = srcUrlOrPlaylist;
  98009. }
  98010. return _this;
  98011. }
  98012. var _proto = DashPlaylistLoader2.prototype;
  98013. _proto.requestErrored_ = function requestErrored_(err, request, startingState) {
  98014. if (!this.request) {
  98015. return true;
  98016. }
  98017. this.request = null;
  98018. if (err) {
  98019. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  98020. status: request.status,
  98021. message: "DASH request error at URL: " + request.uri,
  98022. response: request.response,
  98023. code: 2
  98024. };
  98025. if (startingState) {
  98026. this.state = startingState;
  98027. }
  98028. this.trigger("error");
  98029. return true;
  98030. }
  98031. };
  98032. _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) {
  98033. var _this2 = this;
  98034. var sidxKey = playlist.sidx && generateSidxKey(playlist.sidx);
  98035. if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) {
  98036. this.mediaRequest_ = window_1.setTimeout(function() {
  98037. return cb(false);
  98038. }, 0);
  98039. return;
  98040. }
  98041. var uri = resolveManifestRedirect(this.handleManifestRedirects, playlist.sidx.resolvedUri);
  98042. var fin = function fin2(err, request) {
  98043. if (_this2.requestErrored_(err, request, startingState)) {
  98044. return;
  98045. }
  98046. var sidxMapping = _this2.masterPlaylistLoader_.sidxMapping_;
  98047. var sidx;
  98048. try {
  98049. sidx = parseSidx_1(toUint82(request.response).subarray(8));
  98050. } catch (e) {
  98051. _this2.requestErrored_(e, request, startingState);
  98052. return;
  98053. }
  98054. sidxMapping[sidxKey] = {
  98055. sidxInfo: playlist.sidx,
  98056. sidx
  98057. };
  98058. addSidxSegmentsToPlaylist$1(playlist, sidx, playlist.sidx.resolvedUri);
  98059. return cb(true);
  98060. };
  98061. this.request = containerRequest(uri, this.vhs_.xhr, function(err, request, container, bytes) {
  98062. if (err) {
  98063. return fin(err, request);
  98064. }
  98065. if (!container || container !== "mp4") {
  98066. return fin({
  98067. status: request.status,
  98068. message: "Unsupported " + (container || "unknown") + " container type for sidx segment at URL: " + uri,
  98069. response: "",
  98070. playlist,
  98071. internal: true,
  98072. blacklistDuration: Infinity,
  98073. code: 2
  98074. }, request);
  98075. }
  98076. var _playlist$sidx$bytera = playlist.sidx.byterange, offset = _playlist$sidx$bytera.offset, length = _playlist$sidx$bytera.length;
  98077. if (bytes.length >= length + offset) {
  98078. return fin(err, {
  98079. response: bytes.subarray(offset, offset + length),
  98080. status: request.status,
  98081. uri: request.uri
  98082. });
  98083. }
  98084. _this2.request = _this2.vhs_.xhr({
  98085. uri,
  98086. responseType: "arraybuffer",
  98087. headers: segmentXhrHeaders({
  98088. byterange: playlist.sidx.byterange
  98089. })
  98090. }, fin);
  98091. });
  98092. };
  98093. _proto.dispose = function dispose() {
  98094. this.trigger("dispose");
  98095. this.stopRequest();
  98096. this.loadedPlaylists_ = {};
  98097. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  98098. window_1.clearTimeout(this.mediaRequest_);
  98099. window_1.clearTimeout(this.mediaUpdateTimeout);
  98100. this.mediaUpdateTimeout = null;
  98101. this.mediaRequest_ = null;
  98102. this.minimumUpdatePeriodTimeout_ = null;
  98103. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98104. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98105. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98106. }
  98107. this.off();
  98108. };
  98109. _proto.hasPendingRequest = function hasPendingRequest() {
  98110. return this.request || this.mediaRequest_;
  98111. };
  98112. _proto.stopRequest = function stopRequest() {
  98113. if (this.request) {
  98114. var oldRequest = this.request;
  98115. this.request = null;
  98116. oldRequest.onreadystatechange = null;
  98117. oldRequest.abort();
  98118. }
  98119. };
  98120. _proto.media = function media(playlist) {
  98121. var _this3 = this;
  98122. if (!playlist) {
  98123. return this.media_;
  98124. }
  98125. if (this.state === "HAVE_NOTHING") {
  98126. throw new Error("Cannot switch media playlist from " + this.state);
  98127. }
  98128. var startingState = this.state;
  98129. if (typeof playlist === "string") {
  98130. if (!this.masterPlaylistLoader_.master.playlists[playlist]) {
  98131. throw new Error("Unknown playlist URI: " + playlist);
  98132. }
  98133. playlist = this.masterPlaylistLoader_.master.playlists[playlist];
  98134. }
  98135. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  98136. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  98137. this.state = "HAVE_METADATA";
  98138. this.media_ = playlist;
  98139. if (mediaChange) {
  98140. this.trigger("mediachanging");
  98141. this.trigger("mediachange");
  98142. }
  98143. return;
  98144. }
  98145. if (!mediaChange) {
  98146. return;
  98147. }
  98148. if (this.media_) {
  98149. this.trigger("mediachanging");
  98150. }
  98151. this.addSidxSegments_(playlist, startingState, function(sidxChanged) {
  98152. _this3.haveMetadata({
  98153. startingState,
  98154. playlist
  98155. });
  98156. });
  98157. };
  98158. _proto.haveMetadata = function haveMetadata(_ref2) {
  98159. var startingState = _ref2.startingState, playlist = _ref2.playlist;
  98160. this.state = "HAVE_METADATA";
  98161. this.loadedPlaylists_[playlist.id] = playlist;
  98162. this.mediaRequest_ = null;
  98163. this.refreshMedia_(playlist.id);
  98164. if (startingState === "HAVE_MASTER") {
  98165. this.trigger("loadedmetadata");
  98166. } else {
  98167. this.trigger("mediachange");
  98168. }
  98169. };
  98170. _proto.pause = function pause() {
  98171. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98172. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98173. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98174. }
  98175. this.stopRequest();
  98176. window_1.clearTimeout(this.mediaUpdateTimeout);
  98177. this.mediaUpdateTimeout = null;
  98178. if (this.isMaster_) {
  98179. window_1.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_);
  98180. this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  98181. }
  98182. if (this.state === "HAVE_NOTHING") {
  98183. this.started = false;
  98184. }
  98185. };
  98186. _proto.load = function load(isFinalRendition) {
  98187. var _this4 = this;
  98188. window_1.clearTimeout(this.mediaUpdateTimeout);
  98189. this.mediaUpdateTimeout = null;
  98190. var media = this.media();
  98191. if (isFinalRendition) {
  98192. var delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  98193. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  98194. return _this4.load();
  98195. }, delay);
  98196. return;
  98197. }
  98198. if (!this.started) {
  98199. this.start();
  98200. return;
  98201. }
  98202. if (media && !media.endList) {
  98203. if (this.isMaster_ && !this.minimumUpdatePeriodTimeout_) {
  98204. this.trigger("minimumUpdatePeriod");
  98205. this.updateMinimumUpdatePeriodTimeout_();
  98206. }
  98207. this.trigger("mediaupdatetimeout");
  98208. } else {
  98209. this.trigger("loadedplaylist");
  98210. }
  98211. };
  98212. _proto.start = function start2() {
  98213. var _this5 = this;
  98214. this.started = true;
  98215. if (!this.isMaster_) {
  98216. this.mediaRequest_ = window_1.setTimeout(function() {
  98217. return _this5.haveMaster_();
  98218. }, 0);
  98219. return;
  98220. }
  98221. this.requestMaster_(function(req, masterChanged) {
  98222. _this5.haveMaster_();
  98223. if (!_this5.hasPendingRequest() && !_this5.media_) {
  98224. _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]);
  98225. }
  98226. });
  98227. };
  98228. _proto.requestMaster_ = function requestMaster_(cb) {
  98229. var _this6 = this;
  98230. this.request = this.vhs_.xhr({
  98231. uri: this.masterPlaylistLoader_.srcUrl,
  98232. withCredentials: this.withCredentials
  98233. }, function(error, req) {
  98234. if (_this6.requestErrored_(error, req)) {
  98235. if (_this6.state === "HAVE_NOTHING") {
  98236. _this6.started = false;
  98237. }
  98238. return;
  98239. }
  98240. var masterChanged = req.responseText !== _this6.masterPlaylistLoader_.masterXml_;
  98241. _this6.masterPlaylistLoader_.masterXml_ = req.responseText;
  98242. if (req.responseHeaders && req.responseHeaders.date) {
  98243. _this6.masterLoaded_ = Date.parse(req.responseHeaders.date);
  98244. } else {
  98245. _this6.masterLoaded_ = Date.now();
  98246. }
  98247. _this6.masterPlaylistLoader_.srcUrl = resolveManifestRedirect(_this6.handleManifestRedirects, _this6.masterPlaylistLoader_.srcUrl, req);
  98248. if (masterChanged) {
  98249. _this6.handleMaster_();
  98250. _this6.syncClientServerClock_(function() {
  98251. return cb(req, masterChanged);
  98252. });
  98253. return;
  98254. }
  98255. return cb(req, masterChanged);
  98256. });
  98257. };
  98258. _proto.syncClientServerClock_ = function syncClientServerClock_(done) {
  98259. var _this7 = this;
  98260. var utcTiming = parseUTCTiming(this.masterPlaylistLoader_.masterXml_);
  98261. if (utcTiming === null) {
  98262. this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now();
  98263. return done();
  98264. }
  98265. if (utcTiming.method === "DIRECT") {
  98266. this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  98267. return done();
  98268. }
  98269. this.request = this.vhs_.xhr({
  98270. uri: resolveUrl4(this.masterPlaylistLoader_.srcUrl, utcTiming.value),
  98271. method: utcTiming.method,
  98272. withCredentials: this.withCredentials
  98273. }, function(error, req) {
  98274. if (!_this7.request) {
  98275. return;
  98276. }
  98277. if (error) {
  98278. _this7.masterPlaylistLoader_.clientOffset_ = _this7.masterLoaded_ - Date.now();
  98279. return done();
  98280. }
  98281. var serverTime;
  98282. if (utcTiming.method === "HEAD") {
  98283. if (!req.responseHeaders || !req.responseHeaders.date) {
  98284. serverTime = _this7.masterLoaded_;
  98285. } else {
  98286. serverTime = Date.parse(req.responseHeaders.date);
  98287. }
  98288. } else {
  98289. serverTime = Date.parse(req.responseText);
  98290. }
  98291. _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  98292. done();
  98293. });
  98294. };
  98295. _proto.haveMaster_ = function haveMaster_() {
  98296. this.state = "HAVE_MASTER";
  98297. if (this.isMaster_) {
  98298. this.trigger("loadedplaylist");
  98299. } else if (!this.media_) {
  98300. this.media(this.childPlaylist_);
  98301. }
  98302. };
  98303. _proto.handleMaster_ = function handleMaster_() {
  98304. this.mediaRequest_ = null;
  98305. var oldMaster = this.masterPlaylistLoader_.master;
  98306. var newMaster = parseMasterXml({
  98307. masterXml: this.masterPlaylistLoader_.masterXml_,
  98308. srcUrl: this.masterPlaylistLoader_.srcUrl,
  98309. clientOffset: this.masterPlaylistLoader_.clientOffset_,
  98310. sidxMapping: this.masterPlaylistLoader_.sidxMapping_,
  98311. previousManifest: oldMaster
  98312. });
  98313. if (oldMaster) {
  98314. newMaster = updateMaster2(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_);
  98315. }
  98316. this.masterPlaylistLoader_.master = newMaster ? newMaster : oldMaster;
  98317. var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0];
  98318. if (location && location !== this.masterPlaylistLoader_.srcUrl) {
  98319. this.masterPlaylistLoader_.srcUrl = location;
  98320. }
  98321. if (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  98322. this.updateMinimumUpdatePeriodTimeout_();
  98323. }
  98324. return Boolean(newMaster);
  98325. };
  98326. _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() {
  98327. var mpl = this.masterPlaylistLoader_;
  98328. if (mpl.createMupOnMedia_) {
  98329. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  98330. mpl.createMupOnMedia_ = null;
  98331. }
  98332. if (mpl.minimumUpdatePeriodTimeout_) {
  98333. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  98334. mpl.minimumUpdatePeriodTimeout_ = null;
  98335. }
  98336. var mup = mpl.master && mpl.master.minimumUpdatePeriod;
  98337. if (mup === 0) {
  98338. if (mpl.media()) {
  98339. mup = mpl.media().targetDuration * 1e3;
  98340. } else {
  98341. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  98342. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  98343. }
  98344. }
  98345. if (typeof mup !== "number" || mup <= 0) {
  98346. if (mup < 0) {
  98347. this.logger_("found invalid minimumUpdatePeriod of " + mup + ", not setting a timeout");
  98348. }
  98349. return;
  98350. }
  98351. this.createMUPTimeout_(mup);
  98352. };
  98353. _proto.createMUPTimeout_ = function createMUPTimeout_(mup) {
  98354. var mpl = this.masterPlaylistLoader_;
  98355. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(function() {
  98356. mpl.minimumUpdatePeriodTimeout_ = null;
  98357. mpl.trigger("minimumUpdatePeriod");
  98358. mpl.createMUPTimeout_(mup);
  98359. }, mup);
  98360. };
  98361. _proto.refreshXml_ = function refreshXml_() {
  98362. var _this8 = this;
  98363. this.requestMaster_(function(req, masterChanged) {
  98364. if (!masterChanged) {
  98365. return;
  98366. }
  98367. if (_this8.media_) {
  98368. _this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id];
  98369. }
  98370. _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_);
  98371. _this8.addSidxSegments_(_this8.media(), _this8.state, function(sidxChanged) {
  98372. _this8.refreshMedia_(_this8.media().id);
  98373. });
  98374. });
  98375. };
  98376. _proto.refreshMedia_ = function refreshMedia_(mediaID) {
  98377. var _this9 = this;
  98378. if (!mediaID) {
  98379. throw new Error("refreshMedia_ must take a media id");
  98380. }
  98381. if (this.media_ && this.isMaster_) {
  98382. this.handleMaster_();
  98383. }
  98384. var playlists = this.masterPlaylistLoader_.master.playlists;
  98385. var mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  98386. if (mediaChanged) {
  98387. this.media_ = playlists[mediaID];
  98388. } else {
  98389. this.trigger("playlistunchanged");
  98390. }
  98391. if (!this.mediaUpdateTimeout) {
  98392. var createMediaUpdateTimeout = function createMediaUpdateTimeout2() {
  98393. if (_this9.media().endList) {
  98394. return;
  98395. }
  98396. _this9.mediaUpdateTimeout = window_1.setTimeout(function() {
  98397. _this9.trigger("mediaupdatetimeout");
  98398. createMediaUpdateTimeout2();
  98399. }, refreshDelay(_this9.media(), Boolean(mediaChanged)));
  98400. };
  98401. createMediaUpdateTimeout();
  98402. }
  98403. this.trigger("loadedplaylist");
  98404. };
  98405. return DashPlaylistLoader2;
  98406. }(EventTarget2);
  98407. var Config = {
  98408. GOAL_BUFFER_LENGTH: 30,
  98409. MAX_GOAL_BUFFER_LENGTH: 60,
  98410. BACK_BUFFER_LENGTH: 30,
  98411. GOAL_BUFFER_LENGTH_RATE: 1,
  98412. INITIAL_BANDWIDTH: 4194304,
  98413. BANDWIDTH_VARIANCE: 1.2,
  98414. BUFFER_LOW_WATER_LINE: 0,
  98415. MAX_BUFFER_LOW_WATER_LINE: 30,
  98416. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  98417. BUFFER_LOW_WATER_LINE_RATE: 1,
  98418. BUFFER_HIGH_WATER_LINE: 30
  98419. };
  98420. var stringToArrayBuffer = function stringToArrayBuffer2(string) {
  98421. var view = new Uint8Array(new ArrayBuffer(string.length));
  98422. for (var i2 = 0; i2 < string.length; i2++) {
  98423. view[i2] = string.charCodeAt(i2);
  98424. }
  98425. return view.buffer;
  98426. };
  98427. var browserWorkerPolyFill = function browserWorkerPolyFill2(workerObj) {
  98428. workerObj.on = workerObj.addEventListener;
  98429. workerObj.off = workerObj.removeEventListener;
  98430. return workerObj;
  98431. };
  98432. var createObjectURL = function createObjectURL2(str) {
  98433. try {
  98434. return URL.createObjectURL(new Blob([str], {
  98435. type: "application/javascript"
  98436. }));
  98437. } catch (e) {
  98438. var blob = new BlobBuilder();
  98439. blob.append(str);
  98440. return URL.createObjectURL(blob.getBlob());
  98441. }
  98442. };
  98443. var factory = function factory2(code) {
  98444. return function() {
  98445. var objectUrl = createObjectURL(code);
  98446. var worker = browserWorkerPolyFill(new Worker(objectUrl));
  98447. worker.objURL = objectUrl;
  98448. var terminate = worker.terminate;
  98449. worker.on = worker.addEventListener;
  98450. worker.off = worker.removeEventListener;
  98451. worker.terminate = function() {
  98452. URL.revokeObjectURL(objectUrl);
  98453. return terminate.call(this);
  98454. };
  98455. return worker;
  98456. };
  98457. };
  98458. var transform = function transform2(code) {
  98459. return "var browserWorkerPolyFill = " + browserWorkerPolyFill.toString() + ";\nbrowserWorkerPolyFill(self);\n" + code;
  98460. };
  98461. var getWorkerString = function getWorkerString2(fn2) {
  98462. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  98463. };
  98464. var workerCode$1 = transform(getWorkerString(function() {
  98465. var Stream2 = function Stream3() {
  98466. this.init = function() {
  98467. var listeners = {};
  98468. this.on = function(type3, listener) {
  98469. if (!listeners[type3]) {
  98470. listeners[type3] = [];
  98471. }
  98472. listeners[type3] = listeners[type3].concat(listener);
  98473. };
  98474. this.off = function(type3, listener) {
  98475. var index2;
  98476. if (!listeners[type3]) {
  98477. return false;
  98478. }
  98479. index2 = listeners[type3].indexOf(listener);
  98480. listeners[type3] = listeners[type3].slice();
  98481. listeners[type3].splice(index2, 1);
  98482. return index2 > -1;
  98483. };
  98484. this.trigger = function(type3) {
  98485. var callbacks, i2, length, args;
  98486. callbacks = listeners[type3];
  98487. if (!callbacks) {
  98488. return;
  98489. }
  98490. if (arguments.length === 2) {
  98491. length = callbacks.length;
  98492. for (i2 = 0; i2 < length; ++i2) {
  98493. callbacks[i2].call(this, arguments[1]);
  98494. }
  98495. } else {
  98496. args = [];
  98497. i2 = arguments.length;
  98498. for (i2 = 1; i2 < arguments.length; ++i2) {
  98499. args.push(arguments[i2]);
  98500. }
  98501. length = callbacks.length;
  98502. for (i2 = 0; i2 < length; ++i2) {
  98503. callbacks[i2].apply(this, args);
  98504. }
  98505. }
  98506. };
  98507. this.dispose = function() {
  98508. listeners = {};
  98509. };
  98510. };
  98511. };
  98512. Stream2.prototype.pipe = function(destination2) {
  98513. this.on("data", function(data) {
  98514. destination2.push(data);
  98515. });
  98516. this.on("done", function(flushSource) {
  98517. destination2.flush(flushSource);
  98518. });
  98519. this.on("partialdone", function(flushSource) {
  98520. destination2.partialFlush(flushSource);
  98521. });
  98522. this.on("endedtimeline", function(flushSource) {
  98523. destination2.endTimeline(flushSource);
  98524. });
  98525. this.on("reset", function(flushSource) {
  98526. destination2.reset(flushSource);
  98527. });
  98528. return destination2;
  98529. };
  98530. Stream2.prototype.push = function(data) {
  98531. this.trigger("data", data);
  98532. };
  98533. Stream2.prototype.flush = function(flushSource) {
  98534. this.trigger("done", flushSource);
  98535. };
  98536. Stream2.prototype.partialFlush = function(flushSource) {
  98537. this.trigger("partialdone", flushSource);
  98538. };
  98539. Stream2.prototype.endTimeline = function(flushSource) {
  98540. this.trigger("endedtimeline", flushSource);
  98541. };
  98542. Stream2.prototype.reset = function(flushSource) {
  98543. this.trigger("reset", flushSource);
  98544. };
  98545. var stream = Stream2;
  98546. var MAX_UINT32$12 = Math.pow(2, 32);
  98547. var getUint64$22 = function getUint643(uint8) {
  98548. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  98549. var value;
  98550. if (dv.getBigUint64) {
  98551. value = dv.getBigUint64(0);
  98552. if (value < Number.MAX_SAFE_INTEGER) {
  98553. return Number(value);
  98554. }
  98555. return value;
  98556. }
  98557. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  98558. };
  98559. var numbers2 = {
  98560. getUint64: getUint64$22,
  98561. MAX_UINT32: MAX_UINT32$12
  98562. };
  98563. var MAX_UINT322 = numbers2.MAX_UINT32;
  98564. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  98565. (function() {
  98566. var i2;
  98567. types = {
  98568. avc1: [],
  98569. avcC: [],
  98570. btrt: [],
  98571. dinf: [],
  98572. dref: [],
  98573. esds: [],
  98574. ftyp: [],
  98575. hdlr: [],
  98576. mdat: [],
  98577. mdhd: [],
  98578. mdia: [],
  98579. mfhd: [],
  98580. minf: [],
  98581. moof: [],
  98582. moov: [],
  98583. mp4a: [],
  98584. mvex: [],
  98585. mvhd: [],
  98586. pasp: [],
  98587. sdtp: [],
  98588. smhd: [],
  98589. stbl: [],
  98590. stco: [],
  98591. stsc: [],
  98592. stsd: [],
  98593. stsz: [],
  98594. stts: [],
  98595. styp: [],
  98596. tfdt: [],
  98597. tfhd: [],
  98598. traf: [],
  98599. trak: [],
  98600. trun: [],
  98601. trex: [],
  98602. tkhd: [],
  98603. vmhd: []
  98604. };
  98605. if (typeof Uint8Array === "undefined") {
  98606. return;
  98607. }
  98608. for (i2 in types) {
  98609. if (types.hasOwnProperty(i2)) {
  98610. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  98611. }
  98612. }
  98613. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  98614. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  98615. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  98616. VIDEO_HDLR = new Uint8Array([
  98617. 0,
  98618. 0,
  98619. 0,
  98620. 0,
  98621. 0,
  98622. 0,
  98623. 0,
  98624. 0,
  98625. 118,
  98626. 105,
  98627. 100,
  98628. 101,
  98629. 0,
  98630. 0,
  98631. 0,
  98632. 0,
  98633. 0,
  98634. 0,
  98635. 0,
  98636. 0,
  98637. 0,
  98638. 0,
  98639. 0,
  98640. 0,
  98641. 86,
  98642. 105,
  98643. 100,
  98644. 101,
  98645. 111,
  98646. 72,
  98647. 97,
  98648. 110,
  98649. 100,
  98650. 108,
  98651. 101,
  98652. 114,
  98653. 0
  98654. ]);
  98655. AUDIO_HDLR = new Uint8Array([
  98656. 0,
  98657. 0,
  98658. 0,
  98659. 0,
  98660. 0,
  98661. 0,
  98662. 0,
  98663. 0,
  98664. 115,
  98665. 111,
  98666. 117,
  98667. 110,
  98668. 0,
  98669. 0,
  98670. 0,
  98671. 0,
  98672. 0,
  98673. 0,
  98674. 0,
  98675. 0,
  98676. 0,
  98677. 0,
  98678. 0,
  98679. 0,
  98680. 83,
  98681. 111,
  98682. 117,
  98683. 110,
  98684. 100,
  98685. 72,
  98686. 97,
  98687. 110,
  98688. 100,
  98689. 108,
  98690. 101,
  98691. 114,
  98692. 0
  98693. ]);
  98694. HDLR_TYPES = {
  98695. video: VIDEO_HDLR,
  98696. audio: AUDIO_HDLR
  98697. };
  98698. DREF = new Uint8Array([
  98699. 0,
  98700. 0,
  98701. 0,
  98702. 0,
  98703. 0,
  98704. 0,
  98705. 0,
  98706. 1,
  98707. 0,
  98708. 0,
  98709. 0,
  98710. 12,
  98711. 117,
  98712. 114,
  98713. 108,
  98714. 32,
  98715. 0,
  98716. 0,
  98717. 0,
  98718. 1
  98719. ]);
  98720. SMHD = new Uint8Array([
  98721. 0,
  98722. 0,
  98723. 0,
  98724. 0,
  98725. 0,
  98726. 0,
  98727. 0,
  98728. 0
  98729. ]);
  98730. STCO = new Uint8Array([
  98731. 0,
  98732. 0,
  98733. 0,
  98734. 0,
  98735. 0,
  98736. 0,
  98737. 0,
  98738. 0
  98739. ]);
  98740. STSC = STCO;
  98741. STSZ = new Uint8Array([
  98742. 0,
  98743. 0,
  98744. 0,
  98745. 0,
  98746. 0,
  98747. 0,
  98748. 0,
  98749. 0,
  98750. 0,
  98751. 0,
  98752. 0,
  98753. 0
  98754. ]);
  98755. STTS = STCO;
  98756. VMHD = new Uint8Array([
  98757. 0,
  98758. 0,
  98759. 0,
  98760. 1,
  98761. 0,
  98762. 0,
  98763. 0,
  98764. 0,
  98765. 0,
  98766. 0,
  98767. 0,
  98768. 0
  98769. ]);
  98770. })();
  98771. box = function box2(type3) {
  98772. var payload = [], size = 0, i2, result, view;
  98773. for (i2 = 1; i2 < arguments.length; i2++) {
  98774. payload.push(arguments[i2]);
  98775. }
  98776. i2 = payload.length;
  98777. while (i2--) {
  98778. size += payload[i2].byteLength;
  98779. }
  98780. result = new Uint8Array(size + 8);
  98781. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  98782. view.setUint32(0, result.byteLength);
  98783. result.set(type3, 4);
  98784. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  98785. result.set(payload[i2], size);
  98786. size += payload[i2].byteLength;
  98787. }
  98788. return result;
  98789. };
  98790. dinf = function dinf2() {
  98791. return box(types.dinf, box(types.dref, DREF));
  98792. };
  98793. esds = function esds2(track) {
  98794. return box(types.esds, new Uint8Array([
  98795. 0,
  98796. 0,
  98797. 0,
  98798. 0,
  98799. 3,
  98800. 25,
  98801. 0,
  98802. 0,
  98803. 0,
  98804. 4,
  98805. 17,
  98806. 64,
  98807. 21,
  98808. 0,
  98809. 6,
  98810. 0,
  98811. 0,
  98812. 0,
  98813. 218,
  98814. 192,
  98815. 0,
  98816. 0,
  98817. 218,
  98818. 192,
  98819. 5,
  98820. 2,
  98821. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  98822. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  98823. 6,
  98824. 1,
  98825. 2
  98826. ]));
  98827. };
  98828. ftyp = function ftyp2() {
  98829. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  98830. };
  98831. hdlr = function hdlr2(type3) {
  98832. return box(types.hdlr, HDLR_TYPES[type3]);
  98833. };
  98834. mdat = function mdat2(data) {
  98835. return box(types.mdat, data);
  98836. };
  98837. mdhd = function mdhd2(track) {
  98838. var result = new Uint8Array([
  98839. 0,
  98840. 0,
  98841. 0,
  98842. 0,
  98843. 0,
  98844. 0,
  98845. 0,
  98846. 2,
  98847. 0,
  98848. 0,
  98849. 0,
  98850. 3,
  98851. 0,
  98852. 1,
  98853. 95,
  98854. 144,
  98855. track.duration >>> 24 & 255,
  98856. track.duration >>> 16 & 255,
  98857. track.duration >>> 8 & 255,
  98858. track.duration & 255,
  98859. 85,
  98860. 196,
  98861. 0,
  98862. 0
  98863. ]);
  98864. if (track.samplerate) {
  98865. result[12] = track.samplerate >>> 24 & 255;
  98866. result[13] = track.samplerate >>> 16 & 255;
  98867. result[14] = track.samplerate >>> 8 & 255;
  98868. result[15] = track.samplerate & 255;
  98869. }
  98870. return box(types.mdhd, result);
  98871. };
  98872. mdia = function mdia2(track) {
  98873. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  98874. };
  98875. mfhd = function mfhd2(sequenceNumber) {
  98876. return box(types.mfhd, new Uint8Array([
  98877. 0,
  98878. 0,
  98879. 0,
  98880. 0,
  98881. (sequenceNumber & 4278190080) >> 24,
  98882. (sequenceNumber & 16711680) >> 16,
  98883. (sequenceNumber & 65280) >> 8,
  98884. sequenceNumber & 255
  98885. ]));
  98886. };
  98887. minf = function minf2(track) {
  98888. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  98889. };
  98890. moof = function moof2(sequenceNumber, tracks) {
  98891. var trackFragments = [], i2 = tracks.length;
  98892. while (i2--) {
  98893. trackFragments[i2] = traf(tracks[i2]);
  98894. }
  98895. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  98896. };
  98897. moov = function moov2(tracks) {
  98898. var i2 = tracks.length, boxes = [];
  98899. while (i2--) {
  98900. boxes[i2] = trak(tracks[i2]);
  98901. }
  98902. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  98903. };
  98904. mvex = function mvex2(tracks) {
  98905. var i2 = tracks.length, boxes = [];
  98906. while (i2--) {
  98907. boxes[i2] = trex(tracks[i2]);
  98908. }
  98909. return box.apply(null, [types.mvex].concat(boxes));
  98910. };
  98911. mvhd = function mvhd2(duration5) {
  98912. var bytes = new Uint8Array([
  98913. 0,
  98914. 0,
  98915. 0,
  98916. 0,
  98917. 0,
  98918. 0,
  98919. 0,
  98920. 1,
  98921. 0,
  98922. 0,
  98923. 0,
  98924. 2,
  98925. 0,
  98926. 1,
  98927. 95,
  98928. 144,
  98929. (duration5 & 4278190080) >> 24,
  98930. (duration5 & 16711680) >> 16,
  98931. (duration5 & 65280) >> 8,
  98932. duration5 & 255,
  98933. 0,
  98934. 1,
  98935. 0,
  98936. 0,
  98937. 1,
  98938. 0,
  98939. 0,
  98940. 0,
  98941. 0,
  98942. 0,
  98943. 0,
  98944. 0,
  98945. 0,
  98946. 0,
  98947. 0,
  98948. 0,
  98949. 0,
  98950. 1,
  98951. 0,
  98952. 0,
  98953. 0,
  98954. 0,
  98955. 0,
  98956. 0,
  98957. 0,
  98958. 0,
  98959. 0,
  98960. 0,
  98961. 0,
  98962. 0,
  98963. 0,
  98964. 0,
  98965. 0,
  98966. 1,
  98967. 0,
  98968. 0,
  98969. 0,
  98970. 0,
  98971. 0,
  98972. 0,
  98973. 0,
  98974. 0,
  98975. 0,
  98976. 0,
  98977. 0,
  98978. 0,
  98979. 0,
  98980. 0,
  98981. 64,
  98982. 0,
  98983. 0,
  98984. 0,
  98985. 0,
  98986. 0,
  98987. 0,
  98988. 0,
  98989. 0,
  98990. 0,
  98991. 0,
  98992. 0,
  98993. 0,
  98994. 0,
  98995. 0,
  98996. 0,
  98997. 0,
  98998. 0,
  98999. 0,
  99000. 0,
  99001. 0,
  99002. 0,
  99003. 0,
  99004. 0,
  99005. 0,
  99006. 0,
  99007. 0,
  99008. 0,
  99009. 255,
  99010. 255,
  99011. 255,
  99012. 255
  99013. ]);
  99014. return box(types.mvhd, bytes);
  99015. };
  99016. sdtp = function sdtp2(track) {
  99017. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  99018. for (i2 = 0; i2 < samples.length; i2++) {
  99019. flags = samples[i2].flags;
  99020. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  99021. }
  99022. return box(types.sdtp, bytes);
  99023. };
  99024. stbl = function stbl2(track) {
  99025. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  99026. };
  99027. (function() {
  99028. var videoSample, audioSample;
  99029. stsd = function stsd2(track) {
  99030. return box(types.stsd, new Uint8Array([
  99031. 0,
  99032. 0,
  99033. 0,
  99034. 0,
  99035. 0,
  99036. 0,
  99037. 0,
  99038. 1
  99039. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  99040. };
  99041. videoSample = function videoSample2(track) {
  99042. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  99043. for (i2 = 0; i2 < sps.length; i2++) {
  99044. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  99045. sequenceParameterSets.push(sps[i2].byteLength & 255);
  99046. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  99047. }
  99048. for (i2 = 0; i2 < pps.length; i2++) {
  99049. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  99050. pictureParameterSets.push(pps[i2].byteLength & 255);
  99051. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  99052. }
  99053. avc1Box = [types.avc1, new Uint8Array([
  99054. 0,
  99055. 0,
  99056. 0,
  99057. 0,
  99058. 0,
  99059. 0,
  99060. 0,
  99061. 1,
  99062. 0,
  99063. 0,
  99064. 0,
  99065. 0,
  99066. 0,
  99067. 0,
  99068. 0,
  99069. 0,
  99070. 0,
  99071. 0,
  99072. 0,
  99073. 0,
  99074. 0,
  99075. 0,
  99076. 0,
  99077. 0,
  99078. (track.width & 65280) >> 8,
  99079. track.width & 255,
  99080. (track.height & 65280) >> 8,
  99081. track.height & 255,
  99082. 0,
  99083. 72,
  99084. 0,
  99085. 0,
  99086. 0,
  99087. 72,
  99088. 0,
  99089. 0,
  99090. 0,
  99091. 0,
  99092. 0,
  99093. 0,
  99094. 0,
  99095. 1,
  99096. 19,
  99097. 118,
  99098. 105,
  99099. 100,
  99100. 101,
  99101. 111,
  99102. 106,
  99103. 115,
  99104. 45,
  99105. 99,
  99106. 111,
  99107. 110,
  99108. 116,
  99109. 114,
  99110. 105,
  99111. 98,
  99112. 45,
  99113. 104,
  99114. 108,
  99115. 115,
  99116. 0,
  99117. 0,
  99118. 0,
  99119. 0,
  99120. 0,
  99121. 0,
  99122. 0,
  99123. 0,
  99124. 0,
  99125. 0,
  99126. 0,
  99127. 0,
  99128. 0,
  99129. 24,
  99130. 17,
  99131. 17
  99132. ]), box(types.avcC, new Uint8Array([
  99133. 1,
  99134. track.profileIdc,
  99135. track.profileCompatibility,
  99136. track.levelIdc,
  99137. 255
  99138. ].concat(
  99139. [sps.length],
  99140. sequenceParameterSets,
  99141. [pps.length],
  99142. pictureParameterSets
  99143. ))), box(types.btrt, new Uint8Array([
  99144. 0,
  99145. 28,
  99146. 156,
  99147. 128,
  99148. 0,
  99149. 45,
  99150. 198,
  99151. 192,
  99152. 0,
  99153. 45,
  99154. 198,
  99155. 192
  99156. ]))];
  99157. if (track.sarRatio) {
  99158. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  99159. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  99160. }
  99161. return box.apply(null, avc1Box);
  99162. };
  99163. audioSample = function audioSample2(track) {
  99164. return box(types.mp4a, new Uint8Array([
  99165. 0,
  99166. 0,
  99167. 0,
  99168. 0,
  99169. 0,
  99170. 0,
  99171. 0,
  99172. 1,
  99173. 0,
  99174. 0,
  99175. 0,
  99176. 0,
  99177. 0,
  99178. 0,
  99179. 0,
  99180. 0,
  99181. (track.channelcount & 65280) >> 8,
  99182. track.channelcount & 255,
  99183. (track.samplesize & 65280) >> 8,
  99184. track.samplesize & 255,
  99185. 0,
  99186. 0,
  99187. 0,
  99188. 0,
  99189. (track.samplerate & 65280) >> 8,
  99190. track.samplerate & 255,
  99191. 0,
  99192. 0
  99193. ]), esds(track));
  99194. };
  99195. })();
  99196. tkhd = function tkhd2(track) {
  99197. var result = new Uint8Array([
  99198. 0,
  99199. 0,
  99200. 0,
  99201. 7,
  99202. 0,
  99203. 0,
  99204. 0,
  99205. 0,
  99206. 0,
  99207. 0,
  99208. 0,
  99209. 0,
  99210. (track.id & 4278190080) >> 24,
  99211. (track.id & 16711680) >> 16,
  99212. (track.id & 65280) >> 8,
  99213. track.id & 255,
  99214. 0,
  99215. 0,
  99216. 0,
  99217. 0,
  99218. (track.duration & 4278190080) >> 24,
  99219. (track.duration & 16711680) >> 16,
  99220. (track.duration & 65280) >> 8,
  99221. track.duration & 255,
  99222. 0,
  99223. 0,
  99224. 0,
  99225. 0,
  99226. 0,
  99227. 0,
  99228. 0,
  99229. 0,
  99230. 0,
  99231. 0,
  99232. 0,
  99233. 0,
  99234. 1,
  99235. 0,
  99236. 0,
  99237. 0,
  99238. 0,
  99239. 1,
  99240. 0,
  99241. 0,
  99242. 0,
  99243. 0,
  99244. 0,
  99245. 0,
  99246. 0,
  99247. 0,
  99248. 0,
  99249. 0,
  99250. 0,
  99251. 0,
  99252. 0,
  99253. 0,
  99254. 0,
  99255. 1,
  99256. 0,
  99257. 0,
  99258. 0,
  99259. 0,
  99260. 0,
  99261. 0,
  99262. 0,
  99263. 0,
  99264. 0,
  99265. 0,
  99266. 0,
  99267. 0,
  99268. 0,
  99269. 0,
  99270. 64,
  99271. 0,
  99272. 0,
  99273. 0,
  99274. (track.width & 65280) >> 8,
  99275. track.width & 255,
  99276. 0,
  99277. 0,
  99278. (track.height & 65280) >> 8,
  99279. track.height & 255,
  99280. 0,
  99281. 0
  99282. ]);
  99283. return box(types.tkhd, result);
  99284. };
  99285. traf = function traf2(track) {
  99286. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  99287. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  99288. 0,
  99289. 0,
  99290. 0,
  99291. 58,
  99292. (track.id & 4278190080) >> 24,
  99293. (track.id & 16711680) >> 16,
  99294. (track.id & 65280) >> 8,
  99295. track.id & 255,
  99296. 0,
  99297. 0,
  99298. 0,
  99299. 1,
  99300. 0,
  99301. 0,
  99302. 0,
  99303. 0,
  99304. 0,
  99305. 0,
  99306. 0,
  99307. 0,
  99308. 0,
  99309. 0,
  99310. 0,
  99311. 0
  99312. ]));
  99313. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  99314. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  99315. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  99316. 1,
  99317. 0,
  99318. 0,
  99319. 0,
  99320. upperWordBaseMediaDecodeTime >>> 24 & 255,
  99321. upperWordBaseMediaDecodeTime >>> 16 & 255,
  99322. upperWordBaseMediaDecodeTime >>> 8 & 255,
  99323. upperWordBaseMediaDecodeTime & 255,
  99324. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  99325. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  99326. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  99327. lowerWordBaseMediaDecodeTime & 255
  99328. ]));
  99329. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  99330. if (track.type === "audio") {
  99331. trackFragmentRun = trun$1(track, dataOffset);
  99332. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  99333. }
  99334. sampleDependencyTable = sdtp(track);
  99335. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  99336. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  99337. };
  99338. trak = function trak2(track) {
  99339. track.duration = track.duration || 4294967295;
  99340. return box(types.trak, tkhd(track), mdia(track));
  99341. };
  99342. trex = function trex2(track) {
  99343. var result = new Uint8Array([
  99344. 0,
  99345. 0,
  99346. 0,
  99347. 0,
  99348. (track.id & 4278190080) >> 24,
  99349. (track.id & 16711680) >> 16,
  99350. (track.id & 65280) >> 8,
  99351. track.id & 255,
  99352. 0,
  99353. 0,
  99354. 0,
  99355. 1,
  99356. 0,
  99357. 0,
  99358. 0,
  99359. 0,
  99360. 0,
  99361. 0,
  99362. 0,
  99363. 0,
  99364. 0,
  99365. 1,
  99366. 0,
  99367. 1
  99368. ]);
  99369. if (track.type !== "video") {
  99370. result[result.length - 1] = 0;
  99371. }
  99372. return box(types.trex, result);
  99373. };
  99374. (function() {
  99375. var audioTrun, videoTrun, trunHeader;
  99376. trunHeader = function trunHeader2(samples, offset) {
  99377. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  99378. if (samples.length) {
  99379. if (samples[0].duration !== void 0) {
  99380. durationPresent = 1;
  99381. }
  99382. if (samples[0].size !== void 0) {
  99383. sizePresent = 2;
  99384. }
  99385. if (samples[0].flags !== void 0) {
  99386. flagsPresent = 4;
  99387. }
  99388. if (samples[0].compositionTimeOffset !== void 0) {
  99389. compositionTimeOffset = 8;
  99390. }
  99391. }
  99392. return [
  99393. 0,
  99394. 0,
  99395. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  99396. 1,
  99397. (samples.length & 4278190080) >>> 24,
  99398. (samples.length & 16711680) >>> 16,
  99399. (samples.length & 65280) >>> 8,
  99400. samples.length & 255,
  99401. (offset & 4278190080) >>> 24,
  99402. (offset & 16711680) >>> 16,
  99403. (offset & 65280) >>> 8,
  99404. offset & 255
  99405. ];
  99406. };
  99407. videoTrun = function videoTrun2(track, offset) {
  99408. var bytesOffest, bytes, header, samples, sample, i2;
  99409. samples = track.samples || [];
  99410. offset += 8 + 12 + 16 * samples.length;
  99411. header = trunHeader(samples, offset);
  99412. bytes = new Uint8Array(header.length + samples.length * 16);
  99413. bytes.set(header);
  99414. bytesOffest = header.length;
  99415. for (i2 = 0; i2 < samples.length; i2++) {
  99416. sample = samples[i2];
  99417. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99418. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99419. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99420. bytes[bytesOffest++] = sample.duration & 255;
  99421. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99422. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99423. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99424. bytes[bytesOffest++] = sample.size & 255;
  99425. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  99426. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  99427. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  99428. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  99429. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  99430. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  99431. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  99432. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  99433. }
  99434. return box(types.trun, bytes);
  99435. };
  99436. audioTrun = function audioTrun2(track, offset) {
  99437. var bytes, bytesOffest, header, samples, sample, i2;
  99438. samples = track.samples || [];
  99439. offset += 8 + 12 + 8 * samples.length;
  99440. header = trunHeader(samples, offset);
  99441. bytes = new Uint8Array(header.length + samples.length * 8);
  99442. bytes.set(header);
  99443. bytesOffest = header.length;
  99444. for (i2 = 0; i2 < samples.length; i2++) {
  99445. sample = samples[i2];
  99446. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99447. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99448. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99449. bytes[bytesOffest++] = sample.duration & 255;
  99450. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99451. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99452. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99453. bytes[bytesOffest++] = sample.size & 255;
  99454. }
  99455. return box(types.trun, bytes);
  99456. };
  99457. trun$1 = function trun2(track, offset) {
  99458. if (track.type === "audio") {
  99459. return audioTrun(track, offset);
  99460. }
  99461. return videoTrun(track, offset);
  99462. };
  99463. })();
  99464. var mp4Generator = {
  99465. ftyp,
  99466. mdat,
  99467. moof,
  99468. moov,
  99469. initSegment: function initSegment(tracks) {
  99470. var fileType = ftyp(), movie = moov(tracks), result;
  99471. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  99472. result.set(fileType);
  99473. result.set(movie, fileType.byteLength);
  99474. return result;
  99475. }
  99476. };
  99477. var groupNalsIntoFrames = function groupNalsIntoFrames2(nalUnits) {
  99478. var i2, currentNal, currentFrame = [], frames = [];
  99479. frames.byteLength = 0;
  99480. frames.nalCount = 0;
  99481. frames.duration = 0;
  99482. currentFrame.byteLength = 0;
  99483. for (i2 = 0; i2 < nalUnits.length; i2++) {
  99484. currentNal = nalUnits[i2];
  99485. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  99486. if (currentFrame.length) {
  99487. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99488. frames.byteLength += currentFrame.byteLength;
  99489. frames.nalCount += currentFrame.length;
  99490. frames.duration += currentFrame.duration;
  99491. frames.push(currentFrame);
  99492. }
  99493. currentFrame = [currentNal];
  99494. currentFrame.byteLength = currentNal.data.byteLength;
  99495. currentFrame.pts = currentNal.pts;
  99496. currentFrame.dts = currentNal.dts;
  99497. } else {
  99498. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  99499. currentFrame.keyFrame = true;
  99500. }
  99501. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99502. currentFrame.byteLength += currentNal.data.byteLength;
  99503. currentFrame.push(currentNal);
  99504. }
  99505. }
  99506. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  99507. currentFrame.duration = frames[frames.length - 1].duration;
  99508. }
  99509. frames.byteLength += currentFrame.byteLength;
  99510. frames.nalCount += currentFrame.length;
  99511. frames.duration += currentFrame.duration;
  99512. frames.push(currentFrame);
  99513. return frames;
  99514. };
  99515. var groupFramesIntoGops = function groupFramesIntoGops2(frames) {
  99516. var i2, currentFrame, currentGop = [], gops = [];
  99517. currentGop.byteLength = 0;
  99518. currentGop.nalCount = 0;
  99519. currentGop.duration = 0;
  99520. currentGop.pts = frames[0].pts;
  99521. currentGop.dts = frames[0].dts;
  99522. gops.byteLength = 0;
  99523. gops.nalCount = 0;
  99524. gops.duration = 0;
  99525. gops.pts = frames[0].pts;
  99526. gops.dts = frames[0].dts;
  99527. for (i2 = 0; i2 < frames.length; i2++) {
  99528. currentFrame = frames[i2];
  99529. if (currentFrame.keyFrame) {
  99530. if (currentGop.length) {
  99531. gops.push(currentGop);
  99532. gops.byteLength += currentGop.byteLength;
  99533. gops.nalCount += currentGop.nalCount;
  99534. gops.duration += currentGop.duration;
  99535. }
  99536. currentGop = [currentFrame];
  99537. currentGop.nalCount = currentFrame.length;
  99538. currentGop.byteLength = currentFrame.byteLength;
  99539. currentGop.pts = currentFrame.pts;
  99540. currentGop.dts = currentFrame.dts;
  99541. currentGop.duration = currentFrame.duration;
  99542. } else {
  99543. currentGop.duration += currentFrame.duration;
  99544. currentGop.nalCount += currentFrame.length;
  99545. currentGop.byteLength += currentFrame.byteLength;
  99546. currentGop.push(currentFrame);
  99547. }
  99548. }
  99549. if (gops.length && currentGop.duration <= 0) {
  99550. currentGop.duration = gops[gops.length - 1].duration;
  99551. }
  99552. gops.byteLength += currentGop.byteLength;
  99553. gops.nalCount += currentGop.nalCount;
  99554. gops.duration += currentGop.duration;
  99555. gops.push(currentGop);
  99556. return gops;
  99557. };
  99558. var extendFirstKeyFrame = function extendFirstKeyFrame2(gops) {
  99559. var currentGop;
  99560. if (!gops[0][0].keyFrame && gops.length > 1) {
  99561. currentGop = gops.shift();
  99562. gops.byteLength -= currentGop.byteLength;
  99563. gops.nalCount -= currentGop.nalCount;
  99564. gops[0][0].dts = currentGop.dts;
  99565. gops[0][0].pts = currentGop.pts;
  99566. gops[0][0].duration += currentGop.duration;
  99567. }
  99568. return gops;
  99569. };
  99570. var createDefaultSample = function createDefaultSample2() {
  99571. return {
  99572. size: 0,
  99573. flags: {
  99574. isLeading: 0,
  99575. dependsOn: 1,
  99576. isDependedOn: 0,
  99577. hasRedundancy: 0,
  99578. degradationPriority: 0,
  99579. isNonSyncSample: 1
  99580. }
  99581. };
  99582. };
  99583. var sampleForFrame = function sampleForFrame2(frame, dataOffset) {
  99584. var sample = createDefaultSample();
  99585. sample.dataOffset = dataOffset;
  99586. sample.compositionTimeOffset = frame.pts - frame.dts;
  99587. sample.duration = frame.duration;
  99588. sample.size = 4 * frame.length;
  99589. sample.size += frame.byteLength;
  99590. if (frame.keyFrame) {
  99591. sample.flags.dependsOn = 2;
  99592. sample.flags.isNonSyncSample = 0;
  99593. }
  99594. return sample;
  99595. };
  99596. var generateSampleTable$1 = function generateSampleTable2(gops, baseDataOffset) {
  99597. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  99598. for (h2 = 0; h2 < gops.length; h2++) {
  99599. currentGop = gops[h2];
  99600. for (i2 = 0; i2 < currentGop.length; i2++) {
  99601. currentFrame = currentGop[i2];
  99602. sample = sampleForFrame(currentFrame, dataOffset);
  99603. dataOffset += sample.size;
  99604. samples.push(sample);
  99605. }
  99606. }
  99607. return samples;
  99608. };
  99609. var concatenateNalData = function concatenateNalData2(gops) {
  99610. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99611. for (h2 = 0; h2 < gops.length; h2++) {
  99612. currentGop = gops[h2];
  99613. for (i2 = 0; i2 < currentGop.length; i2++) {
  99614. currentFrame = currentGop[i2];
  99615. for (j = 0; j < currentFrame.length; j++) {
  99616. currentNal = currentFrame[j];
  99617. view.setUint32(dataOffset, currentNal.data.byteLength);
  99618. dataOffset += 4;
  99619. data.set(currentNal.data, dataOffset);
  99620. dataOffset += currentNal.data.byteLength;
  99621. }
  99622. }
  99623. }
  99624. return data;
  99625. };
  99626. var generateSampleTableForFrame = function generateSampleTableForFrame2(frame, baseDataOffset) {
  99627. var sample, dataOffset = baseDataOffset || 0, samples = [];
  99628. sample = sampleForFrame(frame, dataOffset);
  99629. samples.push(sample);
  99630. return samples;
  99631. };
  99632. var concatenateNalDataForFrame = function concatenateNalDataForFrame2(frame) {
  99633. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99634. for (i2 = 0; i2 < frame.length; i2++) {
  99635. currentNal = frame[i2];
  99636. view.setUint32(dataOffset, currentNal.data.byteLength);
  99637. dataOffset += 4;
  99638. data.set(currentNal.data, dataOffset);
  99639. dataOffset += currentNal.data.byteLength;
  99640. }
  99641. return data;
  99642. };
  99643. var frameUtils = {
  99644. groupNalsIntoFrames,
  99645. groupFramesIntoGops,
  99646. extendFirstKeyFrame,
  99647. generateSampleTable: generateSampleTable$1,
  99648. concatenateNalData,
  99649. generateSampleTableForFrame,
  99650. concatenateNalDataForFrame
  99651. };
  99652. var highPrefix = [33, 16, 5, 32, 164, 27];
  99653. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  99654. var zeroFill = function zeroFill2(count) {
  99655. var a = [];
  99656. while (count--) {
  99657. a.push(0);
  99658. }
  99659. return a;
  99660. };
  99661. var makeTable = function makeTable2(metaTable) {
  99662. return Object.keys(metaTable).reduce(function(obj, key) {
  99663. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  99664. return arr.concat(part);
  99665. }, []));
  99666. return obj;
  99667. }, {});
  99668. };
  99669. var silence;
  99670. var silence_1 = function silence_12() {
  99671. if (!silence) {
  99672. var coneOfSilence = {
  99673. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  99674. 88200: [highPrefix, [231], zeroFill(170), [56]],
  99675. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  99676. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  99677. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  99678. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  99679. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  99680. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  99681. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  99682. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  99683. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  99684. };
  99685. silence = makeTable(coneOfSilence);
  99686. }
  99687. return silence;
  99688. };
  99689. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  99690. secondsToVideoTs2 = function secondsToVideoTs3(seconds) {
  99691. return seconds * ONE_SECOND_IN_TS$4;
  99692. };
  99693. secondsToAudioTs2 = function secondsToAudioTs3(seconds, sampleRate) {
  99694. return seconds * sampleRate;
  99695. };
  99696. videoTsToSeconds2 = function videoTsToSeconds3(timestamp) {
  99697. return timestamp / ONE_SECOND_IN_TS$4;
  99698. };
  99699. audioTsToSeconds2 = function audioTsToSeconds3(timestamp, sampleRate) {
  99700. return timestamp / sampleRate;
  99701. };
  99702. audioTsToVideoTs2 = function audioTsToVideoTs3(timestamp, sampleRate) {
  99703. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  99704. };
  99705. videoTsToAudioTs2 = function videoTsToAudioTs3(timestamp, sampleRate) {
  99706. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  99707. };
  99708. metadataTsToSeconds2 = function metadataTsToSeconds3(timestamp, timelineStartPts, keepOriginalTimestamps) {
  99709. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  99710. };
  99711. var clock2 = {
  99712. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  99713. secondsToVideoTs: secondsToVideoTs2,
  99714. secondsToAudioTs: secondsToAudioTs2,
  99715. videoTsToSeconds: videoTsToSeconds2,
  99716. audioTsToSeconds: audioTsToSeconds2,
  99717. audioTsToVideoTs: audioTsToVideoTs2,
  99718. videoTsToAudioTs: videoTsToAudioTs2,
  99719. metadataTsToSeconds: metadataTsToSeconds2
  99720. };
  99721. var sumFrameByteLengths = function sumFrameByteLengths2(array) {
  99722. var i2, currentObj, sum = 0;
  99723. for (i2 = 0; i2 < array.length; i2++) {
  99724. currentObj = array[i2];
  99725. sum += currentObj.data.byteLength;
  99726. }
  99727. return sum;
  99728. };
  99729. var prefixWithSilence = function prefixWithSilence2(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  99730. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  99731. if (!frames.length) {
  99732. return;
  99733. }
  99734. baseMediaDecodeTimeTs = clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  99735. frameDuration = Math.ceil(clock2.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  99736. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  99737. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  99738. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  99739. audioFillDuration = audioFillFrameCount * frameDuration;
  99740. }
  99741. if (audioFillFrameCount < 1 || audioFillDuration > clock2.ONE_SECOND_IN_TS / 2) {
  99742. return;
  99743. }
  99744. silentFrame = silence_1()[track.samplerate];
  99745. if (!silentFrame) {
  99746. silentFrame = frames[0].data;
  99747. }
  99748. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  99749. firstFrame = frames[0];
  99750. frames.splice(0, 0, {
  99751. data: silentFrame,
  99752. dts: firstFrame.dts - frameDuration,
  99753. pts: firstFrame.pts - frameDuration
  99754. });
  99755. }
  99756. track.baseMediaDecodeTime -= Math.floor(clock2.videoTsToAudioTs(audioFillDuration, track.samplerate));
  99757. return audioFillDuration;
  99758. };
  99759. var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts2(adtsFrames, track, earliestAllowedDts) {
  99760. if (track.minSegmentDts >= earliestAllowedDts) {
  99761. return adtsFrames;
  99762. }
  99763. track.minSegmentDts = Infinity;
  99764. return adtsFrames.filter(function(currentFrame) {
  99765. if (currentFrame.dts >= earliestAllowedDts) {
  99766. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  99767. track.minSegmentPts = track.minSegmentDts;
  99768. return true;
  99769. }
  99770. return false;
  99771. });
  99772. };
  99773. var generateSampleTable = function generateSampleTable2(frames) {
  99774. var i2, currentFrame, samples = [];
  99775. for (i2 = 0; i2 < frames.length; i2++) {
  99776. currentFrame = frames[i2];
  99777. samples.push({
  99778. size: currentFrame.data.byteLength,
  99779. duration: 1024
  99780. });
  99781. }
  99782. return samples;
  99783. };
  99784. var concatenateFrameData = function concatenateFrameData2(frames) {
  99785. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  99786. for (i2 = 0; i2 < frames.length; i2++) {
  99787. currentFrame = frames[i2];
  99788. data.set(currentFrame.data, dataOffset);
  99789. dataOffset += currentFrame.data.byteLength;
  99790. }
  99791. return data;
  99792. };
  99793. var audioFrameUtils = {
  99794. prefixWithSilence,
  99795. trimAdtsFramesByEarliestDts,
  99796. generateSampleTable,
  99797. concatenateFrameData
  99798. };
  99799. var ONE_SECOND_IN_TS$3 = clock2.ONE_SECOND_IN_TS;
  99800. var collectDtsInfo = function collectDtsInfo2(track, data) {
  99801. if (typeof data.pts === "number") {
  99802. if (track.timelineStartInfo.pts === void 0) {
  99803. track.timelineStartInfo.pts = data.pts;
  99804. }
  99805. if (track.minSegmentPts === void 0) {
  99806. track.minSegmentPts = data.pts;
  99807. } else {
  99808. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  99809. }
  99810. if (track.maxSegmentPts === void 0) {
  99811. track.maxSegmentPts = data.pts;
  99812. } else {
  99813. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  99814. }
  99815. }
  99816. if (typeof data.dts === "number") {
  99817. if (track.timelineStartInfo.dts === void 0) {
  99818. track.timelineStartInfo.dts = data.dts;
  99819. }
  99820. if (track.minSegmentDts === void 0) {
  99821. track.minSegmentDts = data.dts;
  99822. } else {
  99823. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  99824. }
  99825. if (track.maxSegmentDts === void 0) {
  99826. track.maxSegmentDts = data.dts;
  99827. } else {
  99828. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  99829. }
  99830. }
  99831. };
  99832. var clearDtsInfo = function clearDtsInfo2(track) {
  99833. delete track.minSegmentDts;
  99834. delete track.maxSegmentDts;
  99835. delete track.minSegmentPts;
  99836. delete track.maxSegmentPts;
  99837. };
  99838. var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime2(track, keepOriginalTimestamps) {
  99839. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  99840. if (!keepOriginalTimestamps) {
  99841. minSegmentDts -= track.timelineStartInfo.dts;
  99842. }
  99843. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  99844. baseMediaDecodeTime += minSegmentDts;
  99845. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  99846. if (track.type === "audio") {
  99847. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  99848. baseMediaDecodeTime *= scale;
  99849. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  99850. }
  99851. return baseMediaDecodeTime;
  99852. };
  99853. var trackDecodeInfo = {
  99854. clearDtsInfo,
  99855. calculateTrackBaseMediaDecodeTime,
  99856. collectDtsInfo
  99857. };
  99858. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  99859. var parseSei = function parseSei2(bytes) {
  99860. var i2 = 0, result = {
  99861. payloadType: -1,
  99862. payloadSize: 0
  99863. }, payloadType = 0, payloadSize = 0;
  99864. while (i2 < bytes.byteLength) {
  99865. if (bytes[i2] === RBSP_TRAILING_BITS) {
  99866. break;
  99867. }
  99868. while (bytes[i2] === 255) {
  99869. payloadType += 255;
  99870. i2++;
  99871. }
  99872. payloadType += bytes[i2++];
  99873. while (bytes[i2] === 255) {
  99874. payloadSize += 255;
  99875. i2++;
  99876. }
  99877. payloadSize += bytes[i2++];
  99878. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  99879. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  99880. if (userIdentifier === "GA94") {
  99881. result.payloadType = payloadType;
  99882. result.payloadSize = payloadSize;
  99883. result.payload = bytes.subarray(i2, i2 + payloadSize);
  99884. break;
  99885. } else {
  99886. result.payload = void 0;
  99887. }
  99888. }
  99889. i2 += payloadSize;
  99890. payloadType = 0;
  99891. payloadSize = 0;
  99892. }
  99893. return result;
  99894. };
  99895. var parseUserData = function parseUserData2(sei) {
  99896. if (sei.payload[0] !== 181) {
  99897. return null;
  99898. }
  99899. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  99900. return null;
  99901. }
  99902. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  99903. return null;
  99904. }
  99905. if (sei.payload[7] !== 3) {
  99906. return null;
  99907. }
  99908. return sei.payload.subarray(8, sei.payload.length - 1);
  99909. };
  99910. var parseCaptionPackets = function parseCaptionPackets2(pts, userData) {
  99911. var results = [], i2, count, offset, data;
  99912. if (!(userData[0] & 64)) {
  99913. return results;
  99914. }
  99915. count = userData[0] & 31;
  99916. for (i2 = 0; i2 < count; i2++) {
  99917. offset = i2 * 3;
  99918. data = {
  99919. type: userData[offset + 2] & 3,
  99920. pts
  99921. };
  99922. if (userData[offset + 2] & 4) {
  99923. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  99924. results.push(data);
  99925. }
  99926. }
  99927. return results;
  99928. };
  99929. var discardEmulationPreventionBytes$12 = function discardEmulationPreventionBytes5(data) {
  99930. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  99931. while (i2 < length - 2) {
  99932. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  99933. emulationPreventionBytesPositions.push(i2 + 2);
  99934. i2 += 2;
  99935. } else {
  99936. i2++;
  99937. }
  99938. }
  99939. if (emulationPreventionBytesPositions.length === 0) {
  99940. return data;
  99941. }
  99942. newLength = length - emulationPreventionBytesPositions.length;
  99943. newData = new Uint8Array(newLength);
  99944. var sourceIndex = 0;
  99945. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  99946. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  99947. sourceIndex++;
  99948. emulationPreventionBytesPositions.shift();
  99949. }
  99950. newData[i2] = data[sourceIndex];
  99951. }
  99952. return newData;
  99953. };
  99954. var captionPacketParser = {
  99955. parseSei,
  99956. parseUserData,
  99957. parseCaptionPackets,
  99958. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  99959. USER_DATA_REGISTERED_ITU_T_T35
  99960. };
  99961. var CaptionStream$1 = function CaptionStream2(options2) {
  99962. options2 = options2 || {};
  99963. CaptionStream2.prototype.init.call(this);
  99964. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  99965. this.captionPackets_ = [];
  99966. this.ccStreams_ = [
  99967. new Cea608Stream(0, 0),
  99968. new Cea608Stream(0, 1),
  99969. new Cea608Stream(1, 0),
  99970. new Cea608Stream(1, 1)
  99971. ];
  99972. if (this.parse708captions_) {
  99973. this.cc708Stream_ = new Cea708Stream({
  99974. captionServices: options2.captionServices
  99975. });
  99976. }
  99977. this.reset();
  99978. this.ccStreams_.forEach(function(cc) {
  99979. cc.on("data", this.trigger.bind(this, "data"));
  99980. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  99981. cc.on("done", this.trigger.bind(this, "done"));
  99982. }, this);
  99983. if (this.parse708captions_) {
  99984. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  99985. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  99986. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  99987. }
  99988. };
  99989. CaptionStream$1.prototype = new stream();
  99990. CaptionStream$1.prototype.push = function(event2) {
  99991. var sei, userData, newCaptionPackets;
  99992. if (event2.nalUnitType !== "sei_rbsp") {
  99993. return;
  99994. }
  99995. sei = captionPacketParser.parseSei(event2.escapedRBSP);
  99996. if (!sei.payload) {
  99997. return;
  99998. }
  99999. if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {
  100000. return;
  100001. }
  100002. userData = captionPacketParser.parseUserData(sei);
  100003. if (!userData) {
  100004. return;
  100005. }
  100006. if (event2.dts < this.latestDts_) {
  100007. this.ignoreNextEqualDts_ = true;
  100008. return;
  100009. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  100010. this.numSameDts_--;
  100011. if (!this.numSameDts_) {
  100012. this.ignoreNextEqualDts_ = false;
  100013. }
  100014. return;
  100015. }
  100016. newCaptionPackets = captionPacketParser.parseCaptionPackets(event2.pts, userData);
  100017. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  100018. if (this.latestDts_ !== event2.dts) {
  100019. this.numSameDts_ = 0;
  100020. }
  100021. this.numSameDts_++;
  100022. this.latestDts_ = event2.dts;
  100023. };
  100024. CaptionStream$1.prototype.flushCCStreams = function(flushType) {
  100025. this.ccStreams_.forEach(function(cc) {
  100026. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  100027. }, this);
  100028. };
  100029. CaptionStream$1.prototype.flushStream = function(flushType) {
  100030. if (!this.captionPackets_.length) {
  100031. this.flushCCStreams(flushType);
  100032. return;
  100033. }
  100034. this.captionPackets_.forEach(function(elem, idx) {
  100035. elem.presortIndex = idx;
  100036. });
  100037. this.captionPackets_.sort(function(a, b) {
  100038. if (a.pts === b.pts) {
  100039. return a.presortIndex - b.presortIndex;
  100040. }
  100041. return a.pts - b.pts;
  100042. });
  100043. this.captionPackets_.forEach(function(packet) {
  100044. if (packet.type < 2) {
  100045. this.dispatchCea608Packet(packet);
  100046. } else {
  100047. this.dispatchCea708Packet(packet);
  100048. }
  100049. }, this);
  100050. this.captionPackets_.length = 0;
  100051. this.flushCCStreams(flushType);
  100052. };
  100053. CaptionStream$1.prototype.flush = function() {
  100054. return this.flushStream("flush");
  100055. };
  100056. CaptionStream$1.prototype.partialFlush = function() {
  100057. return this.flushStream("partialFlush");
  100058. };
  100059. CaptionStream$1.prototype.reset = function() {
  100060. this.latestDts_ = null;
  100061. this.ignoreNextEqualDts_ = false;
  100062. this.numSameDts_ = 0;
  100063. this.activeCea608Channel_ = [null, null];
  100064. this.ccStreams_.forEach(function(ccStream) {
  100065. ccStream.reset();
  100066. });
  100067. };
  100068. CaptionStream$1.prototype.dispatchCea608Packet = function(packet) {
  100069. if (this.setsTextOrXDSActive(packet)) {
  100070. this.activeCea608Channel_[packet.type] = null;
  100071. } else if (this.setsChannel1Active(packet)) {
  100072. this.activeCea608Channel_[packet.type] = 0;
  100073. } else if (this.setsChannel2Active(packet)) {
  100074. this.activeCea608Channel_[packet.type] = 1;
  100075. }
  100076. if (this.activeCea608Channel_[packet.type] === null) {
  100077. return;
  100078. }
  100079. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  100080. };
  100081. CaptionStream$1.prototype.setsChannel1Active = function(packet) {
  100082. return (packet.ccData & 30720) === 4096;
  100083. };
  100084. CaptionStream$1.prototype.setsChannel2Active = function(packet) {
  100085. return (packet.ccData & 30720) === 6144;
  100086. };
  100087. CaptionStream$1.prototype.setsTextOrXDSActive = function(packet) {
  100088. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  100089. };
  100090. CaptionStream$1.prototype.dispatchCea708Packet = function(packet) {
  100091. if (this.parse708captions_) {
  100092. this.cc708Stream_.push(packet);
  100093. }
  100094. };
  100095. var CHARACTER_TRANSLATION_708 = {
  100096. 127: 9834,
  100097. 4128: 32,
  100098. 4129: 160,
  100099. 4133: 8230,
  100100. 4138: 352,
  100101. 4140: 338,
  100102. 4144: 9608,
  100103. 4145: 8216,
  100104. 4146: 8217,
  100105. 4147: 8220,
  100106. 4148: 8221,
  100107. 4149: 8226,
  100108. 4153: 8482,
  100109. 4154: 353,
  100110. 4156: 339,
  100111. 4157: 8480,
  100112. 4159: 376,
  100113. 4214: 8539,
  100114. 4215: 8540,
  100115. 4216: 8541,
  100116. 4217: 8542,
  100117. 4218: 9168,
  100118. 4219: 9124,
  100119. 4220: 9123,
  100120. 4221: 9135,
  100121. 4222: 9126,
  100122. 4223: 9121,
  100123. 4256: 12600
  100124. };
  100125. var get708CharFromCode = function get708CharFromCode2(code) {
  100126. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  100127. if (code & 4096 && code === newCode) {
  100128. return "";
  100129. }
  100130. return String.fromCharCode(newCode);
  100131. };
  100132. var within708TextBlock = function within708TextBlock2(b) {
  100133. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  100134. };
  100135. var Cea708Window = function Cea708Window2(windowNum) {
  100136. this.windowNum = windowNum;
  100137. this.reset();
  100138. };
  100139. Cea708Window.prototype.reset = function() {
  100140. this.clearText();
  100141. this.pendingNewLine = false;
  100142. this.winAttr = {};
  100143. this.penAttr = {};
  100144. this.penLoc = {};
  100145. this.penColor = {};
  100146. this.visible = 0;
  100147. this.rowLock = 0;
  100148. this.columnLock = 0;
  100149. this.priority = 0;
  100150. this.relativePositioning = 0;
  100151. this.anchorVertical = 0;
  100152. this.anchorHorizontal = 0;
  100153. this.anchorPoint = 0;
  100154. this.rowCount = 1;
  100155. this.virtualRowCount = this.rowCount + 1;
  100156. this.columnCount = 41;
  100157. this.windowStyle = 0;
  100158. this.penStyle = 0;
  100159. };
  100160. Cea708Window.prototype.getText = function() {
  100161. return this.rows.join("\n");
  100162. };
  100163. Cea708Window.prototype.clearText = function() {
  100164. this.rows = [""];
  100165. this.rowIdx = 0;
  100166. };
  100167. Cea708Window.prototype.newLine = function(pts) {
  100168. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  100169. this.beforeRowOverflow(pts);
  100170. }
  100171. if (this.rows.length > 0) {
  100172. this.rows.push("");
  100173. this.rowIdx++;
  100174. }
  100175. while (this.rows.length > this.virtualRowCount) {
  100176. this.rows.shift();
  100177. this.rowIdx--;
  100178. }
  100179. };
  100180. Cea708Window.prototype.isEmpty = function() {
  100181. if (this.rows.length === 0) {
  100182. return true;
  100183. } else if (this.rows.length === 1) {
  100184. return this.rows[0] === "";
  100185. }
  100186. return false;
  100187. };
  100188. Cea708Window.prototype.addText = function(text) {
  100189. this.rows[this.rowIdx] += text;
  100190. };
  100191. Cea708Window.prototype.backspace = function() {
  100192. if (!this.isEmpty()) {
  100193. var row = this.rows[this.rowIdx];
  100194. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  100195. }
  100196. };
  100197. var Cea708Service = function Cea708Service2(serviceNum, encoding, stream2) {
  100198. this.serviceNum = serviceNum;
  100199. this.text = "";
  100200. this.currentWindow = new Cea708Window(-1);
  100201. this.windows = [];
  100202. this.stream = stream2;
  100203. if (typeof encoding === "string") {
  100204. this.createTextDecoder(encoding);
  100205. }
  100206. };
  100207. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  100208. this.startPts = pts;
  100209. for (var win3 = 0; win3 < 8; win3++) {
  100210. this.windows[win3] = new Cea708Window(win3);
  100211. if (typeof beforeRowOverflow === "function") {
  100212. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  100213. }
  100214. }
  100215. };
  100216. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  100217. this.currentWindow = this.windows[windowNum];
  100218. };
  100219. Cea708Service.prototype.createTextDecoder = function(encoding) {
  100220. if (typeof TextDecoder === "undefined") {
  100221. this.stream.trigger("log", {
  100222. level: "warn",
  100223. message: "The `encoding` option is unsupported without TextDecoder support"
  100224. });
  100225. } else {
  100226. try {
  100227. this.textDecoder_ = new TextDecoder(encoding);
  100228. } catch (error) {
  100229. this.stream.trigger("log", {
  100230. level: "warn",
  100231. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  100232. });
  100233. }
  100234. }
  100235. };
  100236. var Cea708Stream = function Cea708Stream2(options2) {
  100237. options2 = options2 || {};
  100238. Cea708Stream2.prototype.init.call(this);
  100239. var self2 = this;
  100240. var captionServices = options2.captionServices || {};
  100241. var captionServiceEncodings = {};
  100242. var serviceProps;
  100243. Object.keys(captionServices).forEach(function(serviceName) {
  100244. serviceProps = captionServices[serviceName];
  100245. if (/^SERVICE/.test(serviceName)) {
  100246. captionServiceEncodings[serviceName] = serviceProps.encoding;
  100247. }
  100248. });
  100249. this.serviceEncodings = captionServiceEncodings;
  100250. this.current708Packet = null;
  100251. this.services = {};
  100252. this.push = function(packet) {
  100253. if (packet.type === 3) {
  100254. self2.new708Packet();
  100255. self2.add708Bytes(packet);
  100256. } else {
  100257. if (self2.current708Packet === null) {
  100258. self2.new708Packet();
  100259. }
  100260. self2.add708Bytes(packet);
  100261. }
  100262. };
  100263. };
  100264. Cea708Stream.prototype = new stream();
  100265. Cea708Stream.prototype.new708Packet = function() {
  100266. if (this.current708Packet !== null) {
  100267. this.push708Packet();
  100268. }
  100269. this.current708Packet = {
  100270. data: [],
  100271. ptsVals: []
  100272. };
  100273. };
  100274. Cea708Stream.prototype.add708Bytes = function(packet) {
  100275. var data = packet.ccData;
  100276. var byte0 = data >>> 8;
  100277. var byte1 = data & 255;
  100278. this.current708Packet.ptsVals.push(packet.pts);
  100279. this.current708Packet.data.push(byte0);
  100280. this.current708Packet.data.push(byte1);
  100281. };
  100282. Cea708Stream.prototype.push708Packet = function() {
  100283. var packet708 = this.current708Packet;
  100284. var packetData = packet708.data;
  100285. var serviceNum = null;
  100286. var blockSize = null;
  100287. var i2 = 0;
  100288. var b = packetData[i2++];
  100289. packet708.seq = b >> 6;
  100290. packet708.sizeCode = b & 63;
  100291. for (; i2 < packetData.length; i2++) {
  100292. b = packetData[i2++];
  100293. serviceNum = b >> 5;
  100294. blockSize = b & 31;
  100295. if (serviceNum === 7 && blockSize > 0) {
  100296. b = packetData[i2++];
  100297. serviceNum = b;
  100298. }
  100299. this.pushServiceBlock(serviceNum, i2, blockSize);
  100300. if (blockSize > 0) {
  100301. i2 += blockSize - 1;
  100302. }
  100303. }
  100304. };
  100305. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  100306. var b;
  100307. var i2 = start2;
  100308. var packetData = this.current708Packet.data;
  100309. var service = this.services[serviceNum];
  100310. if (!service) {
  100311. service = this.initService(serviceNum, i2);
  100312. }
  100313. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  100314. b = packetData[i2];
  100315. if (within708TextBlock(b)) {
  100316. i2 = this.handleText(i2, service);
  100317. } else if (b === 24) {
  100318. i2 = this.multiByteCharacter(i2, service);
  100319. } else if (b === 16) {
  100320. i2 = this.extendedCommands(i2, service);
  100321. } else if (128 <= b && b <= 135) {
  100322. i2 = this.setCurrentWindow(i2, service);
  100323. } else if (152 <= b && b <= 159) {
  100324. i2 = this.defineWindow(i2, service);
  100325. } else if (b === 136) {
  100326. i2 = this.clearWindows(i2, service);
  100327. } else if (b === 140) {
  100328. i2 = this.deleteWindows(i2, service);
  100329. } else if (b === 137) {
  100330. i2 = this.displayWindows(i2, service);
  100331. } else if (b === 138) {
  100332. i2 = this.hideWindows(i2, service);
  100333. } else if (b === 139) {
  100334. i2 = this.toggleWindows(i2, service);
  100335. } else if (b === 151) {
  100336. i2 = this.setWindowAttributes(i2, service);
  100337. } else if (b === 144) {
  100338. i2 = this.setPenAttributes(i2, service);
  100339. } else if (b === 145) {
  100340. i2 = this.setPenColor(i2, service);
  100341. } else if (b === 146) {
  100342. i2 = this.setPenLocation(i2, service);
  100343. } else if (b === 143) {
  100344. service = this.reset(i2, service);
  100345. } else if (b === 8) {
  100346. service.currentWindow.backspace();
  100347. } else if (b === 12) {
  100348. service.currentWindow.clearText();
  100349. } else if (b === 13) {
  100350. service.currentWindow.pendingNewLine = true;
  100351. } else if (b === 14) {
  100352. service.currentWindow.clearText();
  100353. } else if (b === 141) {
  100354. i2++;
  100355. } else
  100356. ;
  100357. }
  100358. };
  100359. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  100360. var packetData = this.current708Packet.data;
  100361. var b = packetData[++i2];
  100362. if (within708TextBlock(b)) {
  100363. i2 = this.handleText(i2, service, {
  100364. isExtended: true
  100365. });
  100366. }
  100367. return i2;
  100368. };
  100369. Cea708Stream.prototype.getPts = function(byteIndex) {
  100370. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  100371. };
  100372. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  100373. var serviceName = "SERVICE" + serviceNum;
  100374. var self2 = this;
  100375. var serviceName;
  100376. var encoding;
  100377. if (serviceName in this.serviceEncodings) {
  100378. encoding = this.serviceEncodings[serviceName];
  100379. }
  100380. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  100381. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  100382. self2.flushDisplayed(pts, self2.services[serviceNum]);
  100383. });
  100384. return this.services[serviceNum];
  100385. };
  100386. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  100387. var isExtended = options2 && options2.isExtended;
  100388. var isMultiByte = options2 && options2.isMultiByte;
  100389. var packetData = this.current708Packet.data;
  100390. var extended = isExtended ? 4096 : 0;
  100391. var currentByte = packetData[i2];
  100392. var nextByte = packetData[i2 + 1];
  100393. var win3 = service.currentWindow;
  100394. var _char;
  100395. var charCodeArray;
  100396. if (service.textDecoder_ && !isExtended) {
  100397. if (isMultiByte) {
  100398. charCodeArray = [currentByte, nextByte];
  100399. i2++;
  100400. } else {
  100401. charCodeArray = [currentByte];
  100402. }
  100403. _char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  100404. } else {
  100405. _char = get708CharFromCode(extended | currentByte);
  100406. }
  100407. if (win3.pendingNewLine && !win3.isEmpty()) {
  100408. win3.newLine(this.getPts(i2));
  100409. }
  100410. win3.pendingNewLine = false;
  100411. win3.addText(_char);
  100412. return i2;
  100413. };
  100414. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  100415. var packetData = this.current708Packet.data;
  100416. var firstByte = packetData[i2 + 1];
  100417. var secondByte = packetData[i2 + 2];
  100418. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  100419. i2 = this.handleText(++i2, service, {
  100420. isMultiByte: true
  100421. });
  100422. }
  100423. return i2;
  100424. };
  100425. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  100426. var packetData = this.current708Packet.data;
  100427. var b = packetData[i2];
  100428. var windowNum = b & 7;
  100429. service.setCurrentWindow(windowNum);
  100430. return i2;
  100431. };
  100432. Cea708Stream.prototype.defineWindow = function(i2, service) {
  100433. var packetData = this.current708Packet.data;
  100434. var b = packetData[i2];
  100435. var windowNum = b & 7;
  100436. service.setCurrentWindow(windowNum);
  100437. var win3 = service.currentWindow;
  100438. b = packetData[++i2];
  100439. win3.visible = (b & 32) >> 5;
  100440. win3.rowLock = (b & 16) >> 4;
  100441. win3.columnLock = (b & 8) >> 3;
  100442. win3.priority = b & 7;
  100443. b = packetData[++i2];
  100444. win3.relativePositioning = (b & 128) >> 7;
  100445. win3.anchorVertical = b & 127;
  100446. b = packetData[++i2];
  100447. win3.anchorHorizontal = b;
  100448. b = packetData[++i2];
  100449. win3.anchorPoint = (b & 240) >> 4;
  100450. win3.rowCount = b & 15;
  100451. b = packetData[++i2];
  100452. win3.columnCount = b & 63;
  100453. b = packetData[++i2];
  100454. win3.windowStyle = (b & 56) >> 3;
  100455. win3.penStyle = b & 7;
  100456. win3.virtualRowCount = win3.rowCount + 1;
  100457. return i2;
  100458. };
  100459. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  100460. var packetData = this.current708Packet.data;
  100461. var b = packetData[i2];
  100462. var winAttr = service.currentWindow.winAttr;
  100463. b = packetData[++i2];
  100464. winAttr.fillOpacity = (b & 192) >> 6;
  100465. winAttr.fillRed = (b & 48) >> 4;
  100466. winAttr.fillGreen = (b & 12) >> 2;
  100467. winAttr.fillBlue = b & 3;
  100468. b = packetData[++i2];
  100469. winAttr.borderType = (b & 192) >> 6;
  100470. winAttr.borderRed = (b & 48) >> 4;
  100471. winAttr.borderGreen = (b & 12) >> 2;
  100472. winAttr.borderBlue = b & 3;
  100473. b = packetData[++i2];
  100474. winAttr.borderType += (b & 128) >> 5;
  100475. winAttr.wordWrap = (b & 64) >> 6;
  100476. winAttr.printDirection = (b & 48) >> 4;
  100477. winAttr.scrollDirection = (b & 12) >> 2;
  100478. winAttr.justify = b & 3;
  100479. b = packetData[++i2];
  100480. winAttr.effectSpeed = (b & 240) >> 4;
  100481. winAttr.effectDirection = (b & 12) >> 2;
  100482. winAttr.displayEffect = b & 3;
  100483. return i2;
  100484. };
  100485. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  100486. var displayedText = [];
  100487. for (var winId = 0; winId < 8; winId++) {
  100488. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  100489. displayedText.push(service.windows[winId].getText());
  100490. }
  100491. }
  100492. service.endPts = pts;
  100493. service.text = displayedText.join("\n\n");
  100494. this.pushCaption(service);
  100495. service.startPts = pts;
  100496. };
  100497. Cea708Stream.prototype.pushCaption = function(service) {
  100498. if (service.text !== "") {
  100499. this.trigger("data", {
  100500. startPts: service.startPts,
  100501. endPts: service.endPts,
  100502. text: service.text,
  100503. stream: "cc708_" + service.serviceNum
  100504. });
  100505. service.text = "";
  100506. service.startPts = service.endPts;
  100507. }
  100508. };
  100509. Cea708Stream.prototype.displayWindows = function(i2, service) {
  100510. var packetData = this.current708Packet.data;
  100511. var b = packetData[++i2];
  100512. var pts = this.getPts(i2);
  100513. this.flushDisplayed(pts, service);
  100514. for (var winId = 0; winId < 8; winId++) {
  100515. if (b & 1 << winId) {
  100516. service.windows[winId].visible = 1;
  100517. }
  100518. }
  100519. return i2;
  100520. };
  100521. Cea708Stream.prototype.hideWindows = function(i2, service) {
  100522. var packetData = this.current708Packet.data;
  100523. var b = packetData[++i2];
  100524. var pts = this.getPts(i2);
  100525. this.flushDisplayed(pts, service);
  100526. for (var winId = 0; winId < 8; winId++) {
  100527. if (b & 1 << winId) {
  100528. service.windows[winId].visible = 0;
  100529. }
  100530. }
  100531. return i2;
  100532. };
  100533. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  100534. var packetData = this.current708Packet.data;
  100535. var b = packetData[++i2];
  100536. var pts = this.getPts(i2);
  100537. this.flushDisplayed(pts, service);
  100538. for (var winId = 0; winId < 8; winId++) {
  100539. if (b & 1 << winId) {
  100540. service.windows[winId].visible ^= 1;
  100541. }
  100542. }
  100543. return i2;
  100544. };
  100545. Cea708Stream.prototype.clearWindows = function(i2, service) {
  100546. var packetData = this.current708Packet.data;
  100547. var b = packetData[++i2];
  100548. var pts = this.getPts(i2);
  100549. this.flushDisplayed(pts, service);
  100550. for (var winId = 0; winId < 8; winId++) {
  100551. if (b & 1 << winId) {
  100552. service.windows[winId].clearText();
  100553. }
  100554. }
  100555. return i2;
  100556. };
  100557. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  100558. var packetData = this.current708Packet.data;
  100559. var b = packetData[++i2];
  100560. var pts = this.getPts(i2);
  100561. this.flushDisplayed(pts, service);
  100562. for (var winId = 0; winId < 8; winId++) {
  100563. if (b & 1 << winId) {
  100564. service.windows[winId].reset();
  100565. }
  100566. }
  100567. return i2;
  100568. };
  100569. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  100570. var packetData = this.current708Packet.data;
  100571. var b = packetData[i2];
  100572. var penAttr = service.currentWindow.penAttr;
  100573. b = packetData[++i2];
  100574. penAttr.textTag = (b & 240) >> 4;
  100575. penAttr.offset = (b & 12) >> 2;
  100576. penAttr.penSize = b & 3;
  100577. b = packetData[++i2];
  100578. penAttr.italics = (b & 128) >> 7;
  100579. penAttr.underline = (b & 64) >> 6;
  100580. penAttr.edgeType = (b & 56) >> 3;
  100581. penAttr.fontStyle = b & 7;
  100582. return i2;
  100583. };
  100584. Cea708Stream.prototype.setPenColor = function(i2, service) {
  100585. var packetData = this.current708Packet.data;
  100586. var b = packetData[i2];
  100587. var penColor = service.currentWindow.penColor;
  100588. b = packetData[++i2];
  100589. penColor.fgOpacity = (b & 192) >> 6;
  100590. penColor.fgRed = (b & 48) >> 4;
  100591. penColor.fgGreen = (b & 12) >> 2;
  100592. penColor.fgBlue = b & 3;
  100593. b = packetData[++i2];
  100594. penColor.bgOpacity = (b & 192) >> 6;
  100595. penColor.bgRed = (b & 48) >> 4;
  100596. penColor.bgGreen = (b & 12) >> 2;
  100597. penColor.bgBlue = b & 3;
  100598. b = packetData[++i2];
  100599. penColor.edgeRed = (b & 48) >> 4;
  100600. penColor.edgeGreen = (b & 12) >> 2;
  100601. penColor.edgeBlue = b & 3;
  100602. return i2;
  100603. };
  100604. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  100605. var packetData = this.current708Packet.data;
  100606. var b = packetData[i2];
  100607. var penLoc = service.currentWindow.penLoc;
  100608. service.currentWindow.pendingNewLine = true;
  100609. b = packetData[++i2];
  100610. penLoc.row = b & 15;
  100611. b = packetData[++i2];
  100612. penLoc.column = b & 63;
  100613. return i2;
  100614. };
  100615. Cea708Stream.prototype.reset = function(i2, service) {
  100616. var pts = this.getPts(i2);
  100617. this.flushDisplayed(pts, service);
  100618. return this.initService(service.serviceNum, i2);
  100619. };
  100620. var CHARACTER_TRANSLATION = {
  100621. 42: 225,
  100622. 92: 233,
  100623. 94: 237,
  100624. 95: 243,
  100625. 96: 250,
  100626. 123: 231,
  100627. 124: 247,
  100628. 125: 209,
  100629. 126: 241,
  100630. 127: 9608,
  100631. 304: 174,
  100632. 305: 176,
  100633. 306: 189,
  100634. 307: 191,
  100635. 308: 8482,
  100636. 309: 162,
  100637. 310: 163,
  100638. 311: 9834,
  100639. 312: 224,
  100640. 313: 160,
  100641. 314: 232,
  100642. 315: 226,
  100643. 316: 234,
  100644. 317: 238,
  100645. 318: 244,
  100646. 319: 251,
  100647. 544: 193,
  100648. 545: 201,
  100649. 546: 211,
  100650. 547: 218,
  100651. 548: 220,
  100652. 549: 252,
  100653. 550: 8216,
  100654. 551: 161,
  100655. 552: 42,
  100656. 553: 39,
  100657. 554: 8212,
  100658. 555: 169,
  100659. 556: 8480,
  100660. 557: 8226,
  100661. 558: 8220,
  100662. 559: 8221,
  100663. 560: 192,
  100664. 561: 194,
  100665. 562: 199,
  100666. 563: 200,
  100667. 564: 202,
  100668. 565: 203,
  100669. 566: 235,
  100670. 567: 206,
  100671. 568: 207,
  100672. 569: 239,
  100673. 570: 212,
  100674. 571: 217,
  100675. 572: 249,
  100676. 573: 219,
  100677. 574: 171,
  100678. 575: 187,
  100679. 800: 195,
  100680. 801: 227,
  100681. 802: 205,
  100682. 803: 204,
  100683. 804: 236,
  100684. 805: 210,
  100685. 806: 242,
  100686. 807: 213,
  100687. 808: 245,
  100688. 809: 123,
  100689. 810: 125,
  100690. 811: 92,
  100691. 812: 94,
  100692. 813: 95,
  100693. 814: 124,
  100694. 815: 126,
  100695. 816: 196,
  100696. 817: 228,
  100697. 818: 214,
  100698. 819: 246,
  100699. 820: 223,
  100700. 821: 165,
  100701. 822: 164,
  100702. 823: 9474,
  100703. 824: 197,
  100704. 825: 229,
  100705. 826: 216,
  100706. 827: 248,
  100707. 828: 9484,
  100708. 829: 9488,
  100709. 830: 9492,
  100710. 831: 9496
  100711. };
  100712. var getCharFromCode = function getCharFromCode2(code) {
  100713. if (code === null) {
  100714. return "";
  100715. }
  100716. code = CHARACTER_TRANSLATION[code] || code;
  100717. return String.fromCharCode(code);
  100718. };
  100719. var BOTTOM_ROW = 14;
  100720. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  100721. var createDisplayBuffer = function createDisplayBuffer2() {
  100722. var result = [], i2 = BOTTOM_ROW + 1;
  100723. while (i2--) {
  100724. result.push("");
  100725. }
  100726. return result;
  100727. };
  100728. var Cea608Stream = function Cea608Stream2(field, dataChannel) {
  100729. Cea608Stream2.prototype.init.call(this);
  100730. this.field_ = field || 0;
  100731. this.dataChannel_ = dataChannel || 0;
  100732. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  100733. this.setConstants();
  100734. this.reset();
  100735. this.push = function(packet) {
  100736. var data, swap, char0, char1, text;
  100737. data = packet.ccData & 32639;
  100738. if (data === this.lastControlCode_) {
  100739. this.lastControlCode_ = null;
  100740. return;
  100741. }
  100742. if ((data & 61440) === 4096) {
  100743. this.lastControlCode_ = data;
  100744. } else if (data !== this.PADDING_) {
  100745. this.lastControlCode_ = null;
  100746. }
  100747. char0 = data >>> 8;
  100748. char1 = data & 255;
  100749. if (data === this.PADDING_) {
  100750. return;
  100751. } else if (data === this.RESUME_CAPTION_LOADING_) {
  100752. this.mode_ = "popOn";
  100753. } else if (data === this.END_OF_CAPTION_) {
  100754. this.mode_ = "popOn";
  100755. this.clearFormatting(packet.pts);
  100756. this.flushDisplayed(packet.pts);
  100757. swap = this.displayed_;
  100758. this.displayed_ = this.nonDisplayed_;
  100759. this.nonDisplayed_ = swap;
  100760. this.startPts_ = packet.pts;
  100761. } else if (data === this.ROLL_UP_2_ROWS_) {
  100762. this.rollUpRows_ = 2;
  100763. this.setRollUp(packet.pts);
  100764. } else if (data === this.ROLL_UP_3_ROWS_) {
  100765. this.rollUpRows_ = 3;
  100766. this.setRollUp(packet.pts);
  100767. } else if (data === this.ROLL_UP_4_ROWS_) {
  100768. this.rollUpRows_ = 4;
  100769. this.setRollUp(packet.pts);
  100770. } else if (data === this.CARRIAGE_RETURN_) {
  100771. this.clearFormatting(packet.pts);
  100772. this.flushDisplayed(packet.pts);
  100773. this.shiftRowsUp_();
  100774. this.startPts_ = packet.pts;
  100775. } else if (data === this.BACKSPACE_) {
  100776. if (this.mode_ === "popOn") {
  100777. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100778. } else {
  100779. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100780. }
  100781. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  100782. this.flushDisplayed(packet.pts);
  100783. this.displayed_ = createDisplayBuffer();
  100784. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  100785. this.nonDisplayed_ = createDisplayBuffer();
  100786. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  100787. if (this.mode_ !== "paintOn") {
  100788. this.flushDisplayed(packet.pts);
  100789. this.displayed_ = createDisplayBuffer();
  100790. }
  100791. this.mode_ = "paintOn";
  100792. this.startPts_ = packet.pts;
  100793. } else if (this.isSpecialCharacter(char0, char1)) {
  100794. char0 = (char0 & 3) << 8;
  100795. text = getCharFromCode(char0 | char1);
  100796. this[this.mode_](packet.pts, text);
  100797. this.column_++;
  100798. } else if (this.isExtCharacter(char0, char1)) {
  100799. if (this.mode_ === "popOn") {
  100800. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100801. } else {
  100802. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100803. }
  100804. char0 = (char0 & 3) << 8;
  100805. text = getCharFromCode(char0 | char1);
  100806. this[this.mode_](packet.pts, text);
  100807. this.column_++;
  100808. } else if (this.isMidRowCode(char0, char1)) {
  100809. this.clearFormatting(packet.pts);
  100810. this[this.mode_](packet.pts, " ");
  100811. this.column_++;
  100812. if ((char1 & 14) === 14) {
  100813. this.addFormatting(packet.pts, ["i"]);
  100814. }
  100815. if ((char1 & 1) === 1) {
  100816. this.addFormatting(packet.pts, ["u"]);
  100817. }
  100818. } else if (this.isOffsetControlCode(char0, char1)) {
  100819. this.column_ += char1 & 3;
  100820. } else if (this.isPAC(char0, char1)) {
  100821. var row = ROWS.indexOf(data & 7968);
  100822. if (this.mode_ === "rollUp") {
  100823. if (row - this.rollUpRows_ + 1 < 0) {
  100824. row = this.rollUpRows_ - 1;
  100825. }
  100826. this.setRollUp(packet.pts, row);
  100827. }
  100828. if (row !== this.row_) {
  100829. this.clearFormatting(packet.pts);
  100830. this.row_ = row;
  100831. }
  100832. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  100833. this.addFormatting(packet.pts, ["u"]);
  100834. }
  100835. if ((data & 16) === 16) {
  100836. this.column_ = ((data & 14) >> 1) * 4;
  100837. }
  100838. if (this.isColorPAC(char1)) {
  100839. if ((char1 & 14) === 14) {
  100840. this.addFormatting(packet.pts, ["i"]);
  100841. }
  100842. }
  100843. } else if (this.isNormalChar(char0)) {
  100844. if (char1 === 0) {
  100845. char1 = null;
  100846. }
  100847. text = getCharFromCode(char0);
  100848. text += getCharFromCode(char1);
  100849. this[this.mode_](packet.pts, text);
  100850. this.column_ += text.length;
  100851. }
  100852. };
  100853. };
  100854. Cea608Stream.prototype = new stream();
  100855. Cea608Stream.prototype.flushDisplayed = function(pts) {
  100856. var content = this.displayed_.map(function(row, index2) {
  100857. try {
  100858. return row.trim();
  100859. } catch (e) {
  100860. this.trigger("log", {
  100861. level: "warn",
  100862. message: "Skipping a malformed 608 caption at index " + index2 + "."
  100863. });
  100864. return "";
  100865. }
  100866. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  100867. if (content.length) {
  100868. this.trigger("data", {
  100869. startPts: this.startPts_,
  100870. endPts: pts,
  100871. text: content,
  100872. stream: this.name_
  100873. });
  100874. }
  100875. };
  100876. Cea608Stream.prototype.reset = function() {
  100877. this.mode_ = "popOn";
  100878. this.topRow_ = 0;
  100879. this.startPts_ = 0;
  100880. this.displayed_ = createDisplayBuffer();
  100881. this.nonDisplayed_ = createDisplayBuffer();
  100882. this.lastControlCode_ = null;
  100883. this.column_ = 0;
  100884. this.row_ = BOTTOM_ROW;
  100885. this.rollUpRows_ = 2;
  100886. this.formatting_ = [];
  100887. };
  100888. Cea608Stream.prototype.setConstants = function() {
  100889. if (this.dataChannel_ === 0) {
  100890. this.BASE_ = 16;
  100891. this.EXT_ = 17;
  100892. this.CONTROL_ = (20 | this.field_) << 8;
  100893. this.OFFSET_ = 23;
  100894. } else if (this.dataChannel_ === 1) {
  100895. this.BASE_ = 24;
  100896. this.EXT_ = 25;
  100897. this.CONTROL_ = (28 | this.field_) << 8;
  100898. this.OFFSET_ = 31;
  100899. }
  100900. this.PADDING_ = 0;
  100901. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  100902. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  100903. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  100904. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  100905. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  100906. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  100907. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  100908. this.BACKSPACE_ = this.CONTROL_ | 33;
  100909. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  100910. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  100911. };
  100912. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  100913. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  100914. };
  100915. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  100916. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  100917. };
  100918. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  100919. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  100920. };
  100921. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  100922. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  100923. };
  100924. Cea608Stream.prototype.isPAC = function(char0, char1) {
  100925. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  100926. };
  100927. Cea608Stream.prototype.isColorPAC = function(char1) {
  100928. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  100929. };
  100930. Cea608Stream.prototype.isNormalChar = function(_char2) {
  100931. return _char2 >= 32 && _char2 <= 127;
  100932. };
  100933. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  100934. if (this.mode_ !== "rollUp") {
  100935. this.row_ = BOTTOM_ROW;
  100936. this.mode_ = "rollUp";
  100937. this.flushDisplayed(pts);
  100938. this.nonDisplayed_ = createDisplayBuffer();
  100939. this.displayed_ = createDisplayBuffer();
  100940. }
  100941. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  100942. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  100943. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  100944. this.displayed_[this.row_ - i2] = "";
  100945. }
  100946. }
  100947. if (newBaseRow === void 0) {
  100948. newBaseRow = this.row_;
  100949. }
  100950. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  100951. };
  100952. Cea608Stream.prototype.addFormatting = function(pts, format) {
  100953. this.formatting_ = this.formatting_.concat(format);
  100954. var text = format.reduce(function(text2, format2) {
  100955. return text2 + "<" + format2 + ">";
  100956. }, "");
  100957. this[this.mode_](pts, text);
  100958. };
  100959. Cea608Stream.prototype.clearFormatting = function(pts) {
  100960. if (!this.formatting_.length) {
  100961. return;
  100962. }
  100963. var text = this.formatting_.reverse().reduce(function(text2, format) {
  100964. return text2 + "</" + format + ">";
  100965. }, "");
  100966. this.formatting_ = [];
  100967. this[this.mode_](pts, text);
  100968. };
  100969. Cea608Stream.prototype.popOn = function(pts, text) {
  100970. var baseRow = this.nonDisplayed_[this.row_];
  100971. baseRow += text;
  100972. this.nonDisplayed_[this.row_] = baseRow;
  100973. };
  100974. Cea608Stream.prototype.rollUp = function(pts, text) {
  100975. var baseRow = this.displayed_[this.row_];
  100976. baseRow += text;
  100977. this.displayed_[this.row_] = baseRow;
  100978. };
  100979. Cea608Stream.prototype.shiftRowsUp_ = function() {
  100980. var i2;
  100981. for (i2 = 0; i2 < this.topRow_; i2++) {
  100982. this.displayed_[i2] = "";
  100983. }
  100984. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  100985. this.displayed_[i2] = "";
  100986. }
  100987. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  100988. this.displayed_[i2] = this.displayed_[i2 + 1];
  100989. }
  100990. this.displayed_[this.row_] = "";
  100991. };
  100992. Cea608Stream.prototype.paintOn = function(pts, text) {
  100993. var baseRow = this.displayed_[this.row_];
  100994. baseRow += text;
  100995. this.displayed_[this.row_] = baseRow;
  100996. };
  100997. var captionStream = {
  100998. CaptionStream: CaptionStream$1,
  100999. Cea608Stream,
  101000. Cea708Stream
  101001. };
  101002. var streamTypes = {
  101003. H264_STREAM_TYPE: 27,
  101004. ADTS_STREAM_TYPE: 15,
  101005. METADATA_STREAM_TYPE: 21
  101006. };
  101007. var MAX_TS = 8589934592;
  101008. var RO_THRESH = 4294967296;
  101009. var TYPE_SHARED = "shared";
  101010. var handleRollover$1 = function handleRollover2(value, reference) {
  101011. var direction = 1;
  101012. if (value > reference) {
  101013. direction = -1;
  101014. }
  101015. while (Math.abs(reference - value) > RO_THRESH) {
  101016. value += direction * MAX_TS;
  101017. }
  101018. return value;
  101019. };
  101020. var TimestampRolloverStream$1 = function TimestampRolloverStream2(type3) {
  101021. var lastDTS, referenceDTS;
  101022. TimestampRolloverStream2.prototype.init.call(this);
  101023. this.type_ = type3 || TYPE_SHARED;
  101024. this.push = function(data) {
  101025. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  101026. return;
  101027. }
  101028. if (referenceDTS === void 0) {
  101029. referenceDTS = data.dts;
  101030. }
  101031. data.dts = handleRollover$1(data.dts, referenceDTS);
  101032. data.pts = handleRollover$1(data.pts, referenceDTS);
  101033. lastDTS = data.dts;
  101034. this.trigger("data", data);
  101035. };
  101036. this.flush = function() {
  101037. referenceDTS = lastDTS;
  101038. this.trigger("done");
  101039. };
  101040. this.endTimeline = function() {
  101041. this.flush();
  101042. this.trigger("endedtimeline");
  101043. };
  101044. this.discontinuity = function() {
  101045. referenceDTS = void 0;
  101046. lastDTS = void 0;
  101047. };
  101048. this.reset = function() {
  101049. this.discontinuity();
  101050. this.trigger("reset");
  101051. };
  101052. };
  101053. TimestampRolloverStream$1.prototype = new stream();
  101054. var timestampRolloverStream = {
  101055. TimestampRolloverStream: TimestampRolloverStream$1,
  101056. handleRollover: handleRollover$1
  101057. };
  101058. var percentEncode$1 = function percentEncode2(bytes, start2, end) {
  101059. var i2, result = "";
  101060. for (i2 = start2; i2 < end; i2++) {
  101061. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  101062. }
  101063. return result;
  101064. }, parseUtf8 = function parseUtf82(bytes, start2, end) {
  101065. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  101066. }, parseIso88591$1 = function parseIso885912(bytes, start2, end) {
  101067. return unescape(percentEncode$1(bytes, start2, end));
  101068. }, parseSyncSafeInteger$1 = function parseSyncSafeInteger2(data) {
  101069. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  101070. }, tagParsers = {
  101071. TXXX: function TXXX(tag) {
  101072. var i2;
  101073. if (tag.data[0] !== 3) {
  101074. return;
  101075. }
  101076. for (i2 = 1; i2 < tag.data.length; i2++) {
  101077. if (tag.data[i2] === 0) {
  101078. tag.description = parseUtf8(tag.data, 1, i2);
  101079. tag.value = parseUtf8(tag.data, i2 + 1, tag.data.length).replace(/\0*$/, "");
  101080. break;
  101081. }
  101082. }
  101083. tag.data = tag.value;
  101084. },
  101085. WXXX: function WXXX(tag) {
  101086. var i2;
  101087. if (tag.data[0] !== 3) {
  101088. return;
  101089. }
  101090. for (i2 = 1; i2 < tag.data.length; i2++) {
  101091. if (tag.data[i2] === 0) {
  101092. tag.description = parseUtf8(tag.data, 1, i2);
  101093. tag.url = parseUtf8(tag.data, i2 + 1, tag.data.length);
  101094. break;
  101095. }
  101096. }
  101097. },
  101098. PRIV: function PRIV(tag) {
  101099. var i2;
  101100. for (i2 = 0; i2 < tag.data.length; i2++) {
  101101. if (tag.data[i2] === 0) {
  101102. tag.owner = parseIso88591$1(tag.data, 0, i2);
  101103. break;
  101104. }
  101105. }
  101106. tag.privateData = tag.data.subarray(i2 + 1);
  101107. tag.data = tag.privateData;
  101108. }
  101109. }, _MetadataStream;
  101110. _MetadataStream = function MetadataStream(options2) {
  101111. var settings = {
  101112. descriptor: options2 && options2.descriptor
  101113. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  101114. _MetadataStream.prototype.init.call(this);
  101115. this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);
  101116. if (settings.descriptor) {
  101117. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  101118. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  101119. }
  101120. }
  101121. this.push = function(chunk) {
  101122. var tag, frameStart, frameSize, frame, i3, frameHeader;
  101123. if (chunk.type !== "timed-metadata") {
  101124. return;
  101125. }
  101126. if (chunk.dataAlignmentIndicator) {
  101127. bufferSize = 0;
  101128. buffer.length = 0;
  101129. }
  101130. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  101131. this.trigger("log", {
  101132. level: "warn",
  101133. message: "Skipping unrecognized metadata packet"
  101134. });
  101135. return;
  101136. }
  101137. buffer.push(chunk);
  101138. bufferSize += chunk.data.byteLength;
  101139. if (buffer.length === 1) {
  101140. tagSize = parseSyncSafeInteger$1(chunk.data.subarray(6, 10));
  101141. tagSize += 10;
  101142. }
  101143. if (bufferSize < tagSize) {
  101144. return;
  101145. }
  101146. tag = {
  101147. data: new Uint8Array(tagSize),
  101148. frames: [],
  101149. pts: buffer[0].pts,
  101150. dts: buffer[0].dts
  101151. };
  101152. for (i3 = 0; i3 < tagSize; ) {
  101153. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  101154. i3 += buffer[0].data.byteLength;
  101155. bufferSize -= buffer[0].data.byteLength;
  101156. buffer.shift();
  101157. }
  101158. frameStart = 10;
  101159. if (tag.data[5] & 64) {
  101160. frameStart += 4;
  101161. frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14));
  101162. tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20));
  101163. }
  101164. do {
  101165. frameSize = parseSyncSafeInteger$1(tag.data.subarray(frameStart + 4, frameStart + 8));
  101166. if (frameSize < 1) {
  101167. this.trigger("log", {
  101168. level: "warn",
  101169. message: "Malformed ID3 frame encountered. Skipping metadata parsing."
  101170. });
  101171. return;
  101172. }
  101173. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  101174. frame = {
  101175. id: frameHeader,
  101176. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  101177. };
  101178. frame.key = frame.id;
  101179. if (tagParsers[frame.id]) {
  101180. tagParsers[frame.id](frame);
  101181. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  101182. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  101183. size *= 4;
  101184. size += d2[7] & 3;
  101185. frame.timeStamp = size;
  101186. if (tag.pts === void 0 && tag.dts === void 0) {
  101187. tag.pts = frame.timeStamp;
  101188. tag.dts = frame.timeStamp;
  101189. }
  101190. this.trigger("timestamp", frame);
  101191. }
  101192. }
  101193. tag.frames.push(frame);
  101194. frameStart += 10;
  101195. frameStart += frameSize;
  101196. } while (frameStart < tagSize);
  101197. this.trigger("data", tag);
  101198. };
  101199. };
  101200. _MetadataStream.prototype = new stream();
  101201. var metadataStream = _MetadataStream;
  101202. var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  101203. var _TransportPacketStream, _TransportParseStream, _ElementaryStream;
  101204. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  101205. _TransportPacketStream = function TransportPacketStream() {
  101206. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  101207. _TransportPacketStream.prototype.init.call(this);
  101208. this.push = function(bytes) {
  101209. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  101210. if (bytesInBuffer) {
  101211. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  101212. everything.set(buffer.subarray(0, bytesInBuffer));
  101213. everything.set(bytes, bytesInBuffer);
  101214. bytesInBuffer = 0;
  101215. } else {
  101216. everything = bytes;
  101217. }
  101218. while (endIndex < everything.byteLength) {
  101219. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  101220. this.trigger("data", everything.subarray(startIndex, endIndex));
  101221. startIndex += MP2T_PACKET_LENGTH$1;
  101222. endIndex += MP2T_PACKET_LENGTH$1;
  101223. continue;
  101224. }
  101225. startIndex++;
  101226. endIndex++;
  101227. }
  101228. if (startIndex < everything.byteLength) {
  101229. buffer.set(everything.subarray(startIndex), 0);
  101230. bytesInBuffer = everything.byteLength - startIndex;
  101231. }
  101232. };
  101233. this.flush = function() {
  101234. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  101235. this.trigger("data", buffer);
  101236. bytesInBuffer = 0;
  101237. }
  101238. this.trigger("done");
  101239. };
  101240. this.endTimeline = function() {
  101241. this.flush();
  101242. this.trigger("endedtimeline");
  101243. };
  101244. this.reset = function() {
  101245. bytesInBuffer = 0;
  101246. this.trigger("reset");
  101247. };
  101248. };
  101249. _TransportPacketStream.prototype = new stream();
  101250. _TransportParseStream = function TransportParseStream() {
  101251. var parsePsi, parsePat2, parsePmt2, self2;
  101252. _TransportParseStream.prototype.init.call(this);
  101253. self2 = this;
  101254. this.packetsWaitingForPmt = [];
  101255. this.programMapTable = void 0;
  101256. parsePsi = function parsePsi2(payload, psi) {
  101257. var offset = 0;
  101258. if (psi.payloadUnitStartIndicator) {
  101259. offset += payload[offset] + 1;
  101260. }
  101261. if (psi.type === "pat") {
  101262. parsePat2(payload.subarray(offset), psi);
  101263. } else {
  101264. parsePmt2(payload.subarray(offset), psi);
  101265. }
  101266. };
  101267. parsePat2 = function parsePat3(payload, pat) {
  101268. pat.section_number = payload[7];
  101269. pat.last_section_number = payload[8];
  101270. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  101271. pat.pmtPid = self2.pmtPid;
  101272. };
  101273. parsePmt2 = function parsePmt3(payload, pmt) {
  101274. var sectionLength, tableEnd, programInfoLength, offset;
  101275. if (!(payload[5] & 1)) {
  101276. return;
  101277. }
  101278. self2.programMapTable = {
  101279. video: null,
  101280. audio: null,
  101281. "timed-metadata": {}
  101282. };
  101283. sectionLength = (payload[1] & 15) << 8 | payload[2];
  101284. tableEnd = 3 + sectionLength - 4;
  101285. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  101286. offset = 12 + programInfoLength;
  101287. while (offset < tableEnd) {
  101288. var streamType = payload[offset];
  101289. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  101290. if (streamType === streamTypes.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  101291. self2.programMapTable.video = pid;
  101292. } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  101293. self2.programMapTable.audio = pid;
  101294. } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {
  101295. self2.programMapTable["timed-metadata"][pid] = streamType;
  101296. }
  101297. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  101298. }
  101299. pmt.programMapTable = self2.programMapTable;
  101300. };
  101301. this.push = function(packet) {
  101302. var result = {}, offset = 4;
  101303. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  101304. result.pid = packet[1] & 31;
  101305. result.pid <<= 8;
  101306. result.pid |= packet[2];
  101307. if ((packet[3] & 48) >>> 4 > 1) {
  101308. offset += packet[offset] + 1;
  101309. }
  101310. if (result.pid === 0) {
  101311. result.type = "pat";
  101312. parsePsi(packet.subarray(offset), result);
  101313. this.trigger("data", result);
  101314. } else if (result.pid === this.pmtPid) {
  101315. result.type = "pmt";
  101316. parsePsi(packet.subarray(offset), result);
  101317. this.trigger("data", result);
  101318. while (this.packetsWaitingForPmt.length) {
  101319. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  101320. }
  101321. } else if (this.programMapTable === void 0) {
  101322. this.packetsWaitingForPmt.push([packet, offset, result]);
  101323. } else {
  101324. this.processPes_(packet, offset, result);
  101325. }
  101326. };
  101327. this.processPes_ = function(packet, offset, result) {
  101328. if (result.pid === this.programMapTable.video) {
  101329. result.streamType = streamTypes.H264_STREAM_TYPE;
  101330. } else if (result.pid === this.programMapTable.audio) {
  101331. result.streamType = streamTypes.ADTS_STREAM_TYPE;
  101332. } else {
  101333. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  101334. }
  101335. result.type = "pes";
  101336. result.data = packet.subarray(offset);
  101337. this.trigger("data", result);
  101338. };
  101339. };
  101340. _TransportParseStream.prototype = new stream();
  101341. _TransportParseStream.STREAM_TYPES = {
  101342. h264: 27,
  101343. adts: 15
  101344. };
  101345. _ElementaryStream = function ElementaryStream() {
  101346. var self2 = this, segmentHadPmt = false, video = {
  101347. data: [],
  101348. size: 0
  101349. }, audio = {
  101350. data: [],
  101351. size: 0
  101352. }, timedMetadata = {
  101353. data: [],
  101354. size: 0
  101355. }, programMapTable, parsePes = function parsePes2(payload, pes) {
  101356. var ptsDtsFlags;
  101357. var startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  101358. pes.data = new Uint8Array();
  101359. if (startPrefix !== 1) {
  101360. return;
  101361. }
  101362. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  101363. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  101364. ptsDtsFlags = payload[7];
  101365. if (ptsDtsFlags & 192) {
  101366. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  101367. pes.pts *= 4;
  101368. pes.pts += (payload[13] & 6) >>> 1;
  101369. pes.dts = pes.pts;
  101370. if (ptsDtsFlags & 64) {
  101371. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  101372. pes.dts *= 4;
  101373. pes.dts += (payload[18] & 6) >>> 1;
  101374. }
  101375. }
  101376. pes.data = payload.subarray(9 + payload[8]);
  101377. }, flushStream = function flushStream2(stream2, type3, forceFlush) {
  101378. var packetData = new Uint8Array(stream2.size), event2 = {
  101379. type: type3
  101380. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  101381. if (!stream2.data.length || stream2.size < 9) {
  101382. return;
  101383. }
  101384. event2.trackId = stream2.data[0].pid;
  101385. for (i2 = 0; i2 < stream2.data.length; i2++) {
  101386. fragment = stream2.data[i2];
  101387. packetData.set(fragment.data, offset);
  101388. offset += fragment.data.byteLength;
  101389. }
  101390. parsePes(packetData, event2);
  101391. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  101392. if (forceFlush || packetFlushable) {
  101393. stream2.size = 0;
  101394. stream2.data.length = 0;
  101395. }
  101396. if (packetFlushable) {
  101397. self2.trigger("data", event2);
  101398. }
  101399. };
  101400. _ElementaryStream.prototype.init.call(this);
  101401. this.push = function(data) {
  101402. ({
  101403. pat: function pat() {
  101404. },
  101405. pes: function pes() {
  101406. var stream2, streamType;
  101407. switch (data.streamType) {
  101408. case streamTypes.H264_STREAM_TYPE:
  101409. stream2 = video;
  101410. streamType = "video";
  101411. break;
  101412. case streamTypes.ADTS_STREAM_TYPE:
  101413. stream2 = audio;
  101414. streamType = "audio";
  101415. break;
  101416. case streamTypes.METADATA_STREAM_TYPE:
  101417. stream2 = timedMetadata;
  101418. streamType = "timed-metadata";
  101419. break;
  101420. default:
  101421. return;
  101422. }
  101423. if (data.payloadUnitStartIndicator) {
  101424. flushStream(stream2, streamType, true);
  101425. }
  101426. stream2.data.push(data);
  101427. stream2.size += data.data.byteLength;
  101428. },
  101429. pmt: function pmt() {
  101430. var event2 = {
  101431. type: "metadata",
  101432. tracks: []
  101433. };
  101434. programMapTable = data.programMapTable;
  101435. if (programMapTable.video !== null) {
  101436. event2.tracks.push({
  101437. timelineStartInfo: {
  101438. baseMediaDecodeTime: 0
  101439. },
  101440. id: +programMapTable.video,
  101441. codec: "avc",
  101442. type: "video"
  101443. });
  101444. }
  101445. if (programMapTable.audio !== null) {
  101446. event2.tracks.push({
  101447. timelineStartInfo: {
  101448. baseMediaDecodeTime: 0
  101449. },
  101450. id: +programMapTable.audio,
  101451. codec: "adts",
  101452. type: "audio"
  101453. });
  101454. }
  101455. segmentHadPmt = true;
  101456. self2.trigger("data", event2);
  101457. }
  101458. })[data.type]();
  101459. };
  101460. this.reset = function() {
  101461. video.size = 0;
  101462. video.data.length = 0;
  101463. audio.size = 0;
  101464. audio.data.length = 0;
  101465. this.trigger("reset");
  101466. };
  101467. this.flushStreams_ = function() {
  101468. flushStream(video, "video");
  101469. flushStream(audio, "audio");
  101470. flushStream(timedMetadata, "timed-metadata");
  101471. };
  101472. this.flush = function() {
  101473. if (!segmentHadPmt && programMapTable) {
  101474. var pmt = {
  101475. type: "metadata",
  101476. tracks: []
  101477. };
  101478. if (programMapTable.video !== null) {
  101479. pmt.tracks.push({
  101480. timelineStartInfo: {
  101481. baseMediaDecodeTime: 0
  101482. },
  101483. id: +programMapTable.video,
  101484. codec: "avc",
  101485. type: "video"
  101486. });
  101487. }
  101488. if (programMapTable.audio !== null) {
  101489. pmt.tracks.push({
  101490. timelineStartInfo: {
  101491. baseMediaDecodeTime: 0
  101492. },
  101493. id: +programMapTable.audio,
  101494. codec: "adts",
  101495. type: "audio"
  101496. });
  101497. }
  101498. self2.trigger("data", pmt);
  101499. }
  101500. segmentHadPmt = false;
  101501. this.flushStreams_();
  101502. this.trigger("done");
  101503. };
  101504. };
  101505. _ElementaryStream.prototype = new stream();
  101506. var m2ts = {
  101507. PAT_PID: 0,
  101508. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  101509. TransportPacketStream: _TransportPacketStream,
  101510. TransportParseStream: _TransportParseStream,
  101511. ElementaryStream: _ElementaryStream,
  101512. TimestampRolloverStream,
  101513. CaptionStream: captionStream.CaptionStream,
  101514. Cea608Stream: captionStream.Cea608Stream,
  101515. Cea708Stream: captionStream.Cea708Stream,
  101516. MetadataStream: metadataStream
  101517. };
  101518. for (var type2 in streamTypes) {
  101519. if (streamTypes.hasOwnProperty(type2)) {
  101520. m2ts[type2] = streamTypes[type2];
  101521. }
  101522. }
  101523. var m2ts_1 = m2ts;
  101524. var ONE_SECOND_IN_TS$2 = clock2.ONE_SECOND_IN_TS;
  101525. var _AdtsStream;
  101526. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  101527. _AdtsStream = function AdtsStream(handlePartialSegments) {
  101528. var buffer, frameNum = 0;
  101529. _AdtsStream.prototype.init.call(this);
  101530. this.skipWarn_ = function(start2, end) {
  101531. this.trigger("log", {
  101532. level: "warn",
  101533. message: "adts skiping bytes " + start2 + " to " + end + " in frame " + frameNum + " outside syncword"
  101534. });
  101535. };
  101536. this.push = function(packet) {
  101537. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  101538. if (!handlePartialSegments) {
  101539. frameNum = 0;
  101540. }
  101541. if (packet.type !== "audio") {
  101542. return;
  101543. }
  101544. if (buffer && buffer.length) {
  101545. oldBuffer = buffer;
  101546. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  101547. buffer.set(oldBuffer);
  101548. buffer.set(packet.data, oldBuffer.byteLength);
  101549. } else {
  101550. buffer = packet.data;
  101551. }
  101552. var skip;
  101553. while (i2 + 7 < buffer.length) {
  101554. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  101555. if (typeof skip !== "number") {
  101556. skip = i2;
  101557. }
  101558. i2++;
  101559. continue;
  101560. }
  101561. if (typeof skip === "number") {
  101562. this.skipWarn_(skip, i2);
  101563. skip = null;
  101564. }
  101565. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  101566. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  101567. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  101568. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  101569. if (buffer.byteLength - i2 < frameLength) {
  101570. break;
  101571. }
  101572. this.trigger("data", {
  101573. pts: packet.pts + frameNum * adtsFrameDuration,
  101574. dts: packet.dts + frameNum * adtsFrameDuration,
  101575. sampleCount,
  101576. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  101577. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  101578. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  101579. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  101580. samplesize: 16,
  101581. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  101582. });
  101583. frameNum++;
  101584. i2 += frameLength;
  101585. }
  101586. if (typeof skip === "number") {
  101587. this.skipWarn_(skip, i2);
  101588. skip = null;
  101589. }
  101590. buffer = buffer.subarray(i2);
  101591. };
  101592. this.flush = function() {
  101593. frameNum = 0;
  101594. this.trigger("done");
  101595. };
  101596. this.reset = function() {
  101597. buffer = void 0;
  101598. this.trigger("reset");
  101599. };
  101600. this.endTimeline = function() {
  101601. buffer = void 0;
  101602. this.trigger("endedtimeline");
  101603. };
  101604. };
  101605. _AdtsStream.prototype = new stream();
  101606. var adts = _AdtsStream;
  101607. var ExpGolomb;
  101608. ExpGolomb = function ExpGolomb2(workingData) {
  101609. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  101610. this.length = function() {
  101611. return 8 * workingBytesAvailable;
  101612. };
  101613. this.bitsAvailable = function() {
  101614. return 8 * workingBytesAvailable + workingBitsAvailable;
  101615. };
  101616. this.loadWord = function() {
  101617. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  101618. if (availableBytes === 0) {
  101619. throw new Error("no bytes available");
  101620. }
  101621. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  101622. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  101623. workingBitsAvailable = availableBytes * 8;
  101624. workingBytesAvailable -= availableBytes;
  101625. };
  101626. this.skipBits = function(count) {
  101627. var skipBytes;
  101628. if (workingBitsAvailable > count) {
  101629. workingWord <<= count;
  101630. workingBitsAvailable -= count;
  101631. } else {
  101632. count -= workingBitsAvailable;
  101633. skipBytes = Math.floor(count / 8);
  101634. count -= skipBytes * 8;
  101635. workingBytesAvailable -= skipBytes;
  101636. this.loadWord();
  101637. workingWord <<= count;
  101638. workingBitsAvailable -= count;
  101639. }
  101640. };
  101641. this.readBits = function(size) {
  101642. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  101643. workingBitsAvailable -= bits;
  101644. if (workingBitsAvailable > 0) {
  101645. workingWord <<= bits;
  101646. } else if (workingBytesAvailable > 0) {
  101647. this.loadWord();
  101648. }
  101649. bits = size - bits;
  101650. if (bits > 0) {
  101651. return valu << bits | this.readBits(bits);
  101652. }
  101653. return valu;
  101654. };
  101655. this.skipLeadingZeros = function() {
  101656. var leadingZeroCount;
  101657. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  101658. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  101659. workingWord <<= leadingZeroCount;
  101660. workingBitsAvailable -= leadingZeroCount;
  101661. return leadingZeroCount;
  101662. }
  101663. }
  101664. this.loadWord();
  101665. return leadingZeroCount + this.skipLeadingZeros();
  101666. };
  101667. this.skipUnsignedExpGolomb = function() {
  101668. this.skipBits(1 + this.skipLeadingZeros());
  101669. };
  101670. this.skipExpGolomb = function() {
  101671. this.skipBits(1 + this.skipLeadingZeros());
  101672. };
  101673. this.readUnsignedExpGolomb = function() {
  101674. var clz = this.skipLeadingZeros();
  101675. return this.readBits(clz + 1) - 1;
  101676. };
  101677. this.readExpGolomb = function() {
  101678. var valu = this.readUnsignedExpGolomb();
  101679. if (1 & valu) {
  101680. return 1 + valu >>> 1;
  101681. }
  101682. return -1 * (valu >>> 1);
  101683. };
  101684. this.readBoolean = function() {
  101685. return this.readBits(1) === 1;
  101686. };
  101687. this.readUnsignedByte = function() {
  101688. return this.readBits(8);
  101689. };
  101690. this.loadWord();
  101691. };
  101692. var expGolomb = ExpGolomb;
  101693. var _H264Stream, _NalByteStream;
  101694. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  101695. _NalByteStream = function NalByteStream() {
  101696. var syncPoint = 0, i2, buffer;
  101697. _NalByteStream.prototype.init.call(this);
  101698. this.push = function(data) {
  101699. var swapBuffer;
  101700. if (!buffer) {
  101701. buffer = data.data;
  101702. } else {
  101703. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  101704. swapBuffer.set(buffer);
  101705. swapBuffer.set(data.data, buffer.byteLength);
  101706. buffer = swapBuffer;
  101707. }
  101708. var len = buffer.byteLength;
  101709. for (; syncPoint < len - 3; syncPoint++) {
  101710. if (buffer[syncPoint + 2] === 1) {
  101711. i2 = syncPoint + 5;
  101712. break;
  101713. }
  101714. }
  101715. while (i2 < len) {
  101716. switch (buffer[i2]) {
  101717. case 0:
  101718. if (buffer[i2 - 1] !== 0) {
  101719. i2 += 2;
  101720. break;
  101721. } else if (buffer[i2 - 2] !== 0) {
  101722. i2++;
  101723. break;
  101724. }
  101725. if (syncPoint + 3 !== i2 - 2) {
  101726. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101727. }
  101728. do {
  101729. i2++;
  101730. } while (buffer[i2] !== 1 && i2 < len);
  101731. syncPoint = i2 - 2;
  101732. i2 += 3;
  101733. break;
  101734. case 1:
  101735. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  101736. i2 += 3;
  101737. break;
  101738. }
  101739. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101740. syncPoint = i2 - 2;
  101741. i2 += 3;
  101742. break;
  101743. default:
  101744. i2 += 3;
  101745. break;
  101746. }
  101747. }
  101748. buffer = buffer.subarray(syncPoint);
  101749. i2 -= syncPoint;
  101750. syncPoint = 0;
  101751. };
  101752. this.reset = function() {
  101753. buffer = null;
  101754. syncPoint = 0;
  101755. this.trigger("reset");
  101756. };
  101757. this.flush = function() {
  101758. if (buffer && buffer.byteLength > 3) {
  101759. this.trigger("data", buffer.subarray(syncPoint + 3));
  101760. }
  101761. buffer = null;
  101762. syncPoint = 0;
  101763. this.trigger("done");
  101764. };
  101765. this.endTimeline = function() {
  101766. this.flush();
  101767. this.trigger("endedtimeline");
  101768. };
  101769. };
  101770. _NalByteStream.prototype = new stream();
  101771. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  101772. 100: true,
  101773. 110: true,
  101774. 122: true,
  101775. 244: true,
  101776. 44: true,
  101777. 83: true,
  101778. 86: true,
  101779. 118: true,
  101780. 128: true,
  101781. 138: true,
  101782. 139: true,
  101783. 134: true
  101784. };
  101785. _H264Stream = function H264Stream2() {
  101786. var nalByteStream = new _NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  101787. _H264Stream.prototype.init.call(this);
  101788. self2 = this;
  101789. this.push = function(packet) {
  101790. if (packet.type !== "video") {
  101791. return;
  101792. }
  101793. trackId = packet.trackId;
  101794. currentPts = packet.pts;
  101795. currentDts = packet.dts;
  101796. nalByteStream.push(packet);
  101797. };
  101798. nalByteStream.on("data", function(data) {
  101799. var event2 = {
  101800. trackId,
  101801. pts: currentPts,
  101802. dts: currentDts,
  101803. data,
  101804. nalUnitTypeCode: data[0] & 31
  101805. };
  101806. switch (event2.nalUnitTypeCode) {
  101807. case 5:
  101808. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  101809. break;
  101810. case 6:
  101811. event2.nalUnitType = "sei_rbsp";
  101812. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101813. break;
  101814. case 7:
  101815. event2.nalUnitType = "seq_parameter_set_rbsp";
  101816. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101817. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  101818. break;
  101819. case 8:
  101820. event2.nalUnitType = "pic_parameter_set_rbsp";
  101821. break;
  101822. case 9:
  101823. event2.nalUnitType = "access_unit_delimiter_rbsp";
  101824. break;
  101825. }
  101826. self2.trigger("data", event2);
  101827. });
  101828. nalByteStream.on("done", function() {
  101829. self2.trigger("done");
  101830. });
  101831. nalByteStream.on("partialdone", function() {
  101832. self2.trigger("partialdone");
  101833. });
  101834. nalByteStream.on("reset", function() {
  101835. self2.trigger("reset");
  101836. });
  101837. nalByteStream.on("endedtimeline", function() {
  101838. self2.trigger("endedtimeline");
  101839. });
  101840. this.flush = function() {
  101841. nalByteStream.flush();
  101842. };
  101843. this.partialFlush = function() {
  101844. nalByteStream.partialFlush();
  101845. };
  101846. this.reset = function() {
  101847. nalByteStream.reset();
  101848. };
  101849. this.endTimeline = function() {
  101850. nalByteStream.endTimeline();
  101851. };
  101852. skipScalingList = function skipScalingList2(count, expGolombDecoder) {
  101853. var lastScale = 8, nextScale = 8, j, deltaScale;
  101854. for (j = 0; j < count; j++) {
  101855. if (nextScale !== 0) {
  101856. deltaScale = expGolombDecoder.readExpGolomb();
  101857. nextScale = (lastScale + deltaScale + 256) % 256;
  101858. }
  101859. lastScale = nextScale === 0 ? lastScale : nextScale;
  101860. }
  101861. };
  101862. discardEmulationPreventionBytes5 = function discardEmulationPreventionBytes6(data) {
  101863. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  101864. while (i2 < length - 2) {
  101865. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  101866. emulationPreventionBytesPositions.push(i2 + 2);
  101867. i2 += 2;
  101868. } else {
  101869. i2++;
  101870. }
  101871. }
  101872. if (emulationPreventionBytesPositions.length === 0) {
  101873. return data;
  101874. }
  101875. newLength = length - emulationPreventionBytesPositions.length;
  101876. newData = new Uint8Array(newLength);
  101877. var sourceIndex = 0;
  101878. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  101879. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  101880. sourceIndex++;
  101881. emulationPreventionBytesPositions.shift();
  101882. }
  101883. newData[i2] = data[sourceIndex];
  101884. }
  101885. return newData;
  101886. };
  101887. readSequenceParameterSet = function readSequenceParameterSet2(data) {
  101888. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  101889. expGolombDecoder = new expGolomb(data);
  101890. profileIdc = expGolombDecoder.readUnsignedByte();
  101891. profileCompatibility = expGolombDecoder.readUnsignedByte();
  101892. levelIdc = expGolombDecoder.readUnsignedByte();
  101893. expGolombDecoder.skipUnsignedExpGolomb();
  101894. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  101895. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  101896. if (chromaFormatIdc === 3) {
  101897. expGolombDecoder.skipBits(1);
  101898. }
  101899. expGolombDecoder.skipUnsignedExpGolomb();
  101900. expGolombDecoder.skipUnsignedExpGolomb();
  101901. expGolombDecoder.skipBits(1);
  101902. if (expGolombDecoder.readBoolean()) {
  101903. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  101904. for (i2 = 0; i2 < scalingListCount; i2++) {
  101905. if (expGolombDecoder.readBoolean()) {
  101906. if (i2 < 6) {
  101907. skipScalingList(16, expGolombDecoder);
  101908. } else {
  101909. skipScalingList(64, expGolombDecoder);
  101910. }
  101911. }
  101912. }
  101913. }
  101914. }
  101915. expGolombDecoder.skipUnsignedExpGolomb();
  101916. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  101917. if (picOrderCntType === 0) {
  101918. expGolombDecoder.readUnsignedExpGolomb();
  101919. } else if (picOrderCntType === 1) {
  101920. expGolombDecoder.skipBits(1);
  101921. expGolombDecoder.skipExpGolomb();
  101922. expGolombDecoder.skipExpGolomb();
  101923. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  101924. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  101925. expGolombDecoder.skipExpGolomb();
  101926. }
  101927. }
  101928. expGolombDecoder.skipUnsignedExpGolomb();
  101929. expGolombDecoder.skipBits(1);
  101930. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101931. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101932. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  101933. if (frameMbsOnlyFlag === 0) {
  101934. expGolombDecoder.skipBits(1);
  101935. }
  101936. expGolombDecoder.skipBits(1);
  101937. if (expGolombDecoder.readBoolean()) {
  101938. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  101939. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  101940. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  101941. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  101942. }
  101943. if (expGolombDecoder.readBoolean()) {
  101944. if (expGolombDecoder.readBoolean()) {
  101945. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  101946. switch (aspectRatioIdc) {
  101947. case 1:
  101948. sarRatio = [1, 1];
  101949. break;
  101950. case 2:
  101951. sarRatio = [12, 11];
  101952. break;
  101953. case 3:
  101954. sarRatio = [10, 11];
  101955. break;
  101956. case 4:
  101957. sarRatio = [16, 11];
  101958. break;
  101959. case 5:
  101960. sarRatio = [40, 33];
  101961. break;
  101962. case 6:
  101963. sarRatio = [24, 11];
  101964. break;
  101965. case 7:
  101966. sarRatio = [20, 11];
  101967. break;
  101968. case 8:
  101969. sarRatio = [32, 11];
  101970. break;
  101971. case 9:
  101972. sarRatio = [80, 33];
  101973. break;
  101974. case 10:
  101975. sarRatio = [18, 11];
  101976. break;
  101977. case 11:
  101978. sarRatio = [15, 11];
  101979. break;
  101980. case 12:
  101981. sarRatio = [64, 33];
  101982. break;
  101983. case 13:
  101984. sarRatio = [160, 99];
  101985. break;
  101986. case 14:
  101987. sarRatio = [4, 3];
  101988. break;
  101989. case 15:
  101990. sarRatio = [3, 2];
  101991. break;
  101992. case 16:
  101993. sarRatio = [2, 1];
  101994. break;
  101995. case 255: {
  101996. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  101997. break;
  101998. }
  101999. }
  102000. if (sarRatio) {
  102001. sarRatio[0] / sarRatio[1];
  102002. }
  102003. }
  102004. }
  102005. return {
  102006. profileIdc,
  102007. levelIdc,
  102008. profileCompatibility,
  102009. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  102010. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  102011. sarRatio
  102012. };
  102013. };
  102014. };
  102015. _H264Stream.prototype = new stream();
  102016. var h2643 = {
  102017. H264Stream: _H264Stream,
  102018. NalByteStream: _NalByteStream
  102019. };
  102020. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  102021. var parseId3TagSize = function parseId3TagSize2(header, byteIndex) {
  102022. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  102023. returnSize = returnSize >= 0 ? returnSize : 0;
  102024. if (footerPresent) {
  102025. return returnSize + 20;
  102026. }
  102027. return returnSize + 10;
  102028. };
  102029. var getId3Offset4 = function getId3Offset5(data, offset) {
  102030. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  102031. return offset;
  102032. }
  102033. offset += parseId3TagSize(data, offset);
  102034. return getId3Offset5(data, offset);
  102035. };
  102036. var isLikelyAacData$1 = function isLikelyAacData2(data) {
  102037. var offset = getId3Offset4(data, 0);
  102038. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  102039. };
  102040. var parseSyncSafeInteger = function parseSyncSafeInteger2(data) {
  102041. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  102042. };
  102043. var percentEncode = function percentEncode2(bytes, start2, end) {
  102044. var i2, result = "";
  102045. for (i2 = start2; i2 < end; i2++) {
  102046. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  102047. }
  102048. return result;
  102049. };
  102050. var parseIso88591 = function parseIso885912(bytes, start2, end) {
  102051. return unescape(percentEncode(bytes, start2, end));
  102052. };
  102053. var parseAdtsSize = function parseAdtsSize2(header, byteIndex) {
  102054. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  102055. return highTwo | middle | lowThree;
  102056. };
  102057. var parseType$2 = function parseType2(header, byteIndex) {
  102058. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  102059. return "timed-metadata";
  102060. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  102061. return "audio";
  102062. }
  102063. return null;
  102064. };
  102065. var parseSampleRate = function parseSampleRate2(packet) {
  102066. var i2 = 0;
  102067. while (i2 + 5 < packet.length) {
  102068. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  102069. i2++;
  102070. continue;
  102071. }
  102072. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  102073. }
  102074. return null;
  102075. };
  102076. var parseAacTimestamp = function parseAacTimestamp2(packet) {
  102077. var frameStart, frameSize, frame, frameHeader;
  102078. frameStart = 10;
  102079. if (packet[5] & 64) {
  102080. frameStart += 4;
  102081. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  102082. }
  102083. do {
  102084. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  102085. if (frameSize < 1) {
  102086. return null;
  102087. }
  102088. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  102089. if (frameHeader === "PRIV") {
  102090. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  102091. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  102092. if (frame[i2] === 0) {
  102093. var owner = parseIso88591(frame, 0, i2);
  102094. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  102095. var d2 = frame.subarray(i2 + 1);
  102096. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  102097. size *= 4;
  102098. size += d2[7] & 3;
  102099. return size;
  102100. }
  102101. break;
  102102. }
  102103. }
  102104. }
  102105. frameStart += 10;
  102106. frameStart += frameSize;
  102107. } while (frameStart < packet.byteLength);
  102108. return null;
  102109. };
  102110. var utils2 = {
  102111. isLikelyAacData: isLikelyAacData$1,
  102112. parseId3TagSize,
  102113. parseAdtsSize,
  102114. parseType: parseType$2,
  102115. parseSampleRate,
  102116. parseAacTimestamp
  102117. };
  102118. var _AacStream;
  102119. _AacStream = function AacStream() {
  102120. var everything = new Uint8Array(), timeStamp = 0;
  102121. _AacStream.prototype.init.call(this);
  102122. this.setTimestamp = function(timestamp) {
  102123. timeStamp = timestamp;
  102124. };
  102125. this.push = function(bytes) {
  102126. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  102127. if (everything.length) {
  102128. tempLength = everything.length;
  102129. everything = new Uint8Array(bytes.byteLength + tempLength);
  102130. everything.set(everything.subarray(0, tempLength));
  102131. everything.set(bytes, tempLength);
  102132. } else {
  102133. everything = bytes;
  102134. }
  102135. while (everything.length - byteIndex >= 3) {
  102136. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  102137. if (everything.length - byteIndex < 10) {
  102138. break;
  102139. }
  102140. frameSize = utils2.parseId3TagSize(everything, byteIndex);
  102141. if (byteIndex + frameSize > everything.length) {
  102142. break;
  102143. }
  102144. chunk = {
  102145. type: "timed-metadata",
  102146. data: everything.subarray(byteIndex, byteIndex + frameSize)
  102147. };
  102148. this.trigger("data", chunk);
  102149. byteIndex += frameSize;
  102150. continue;
  102151. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  102152. if (everything.length - byteIndex < 7) {
  102153. break;
  102154. }
  102155. frameSize = utils2.parseAdtsSize(everything, byteIndex);
  102156. if (byteIndex + frameSize > everything.length) {
  102157. break;
  102158. }
  102159. packet = {
  102160. type: "audio",
  102161. data: everything.subarray(byteIndex, byteIndex + frameSize),
  102162. pts: timeStamp,
  102163. dts: timeStamp
  102164. };
  102165. this.trigger("data", packet);
  102166. byteIndex += frameSize;
  102167. continue;
  102168. }
  102169. byteIndex++;
  102170. }
  102171. bytesLeft = everything.length - byteIndex;
  102172. if (bytesLeft > 0) {
  102173. everything = everything.subarray(byteIndex);
  102174. } else {
  102175. everything = new Uint8Array();
  102176. }
  102177. };
  102178. this.reset = function() {
  102179. everything = new Uint8Array();
  102180. this.trigger("reset");
  102181. };
  102182. this.endTimeline = function() {
  102183. everything = new Uint8Array();
  102184. this.trigger("endedtimeline");
  102185. };
  102186. };
  102187. _AacStream.prototype = new stream();
  102188. var aac3 = _AacStream;
  102189. var AUDIO_PROPERTIES = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  102190. var audioProperties = AUDIO_PROPERTIES;
  102191. var VIDEO_PROPERTIES = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  102192. var videoProperties = VIDEO_PROPERTIES;
  102193. var H264Stream = h2643.H264Stream;
  102194. var isLikelyAacData = utils2.isLikelyAacData;
  102195. var ONE_SECOND_IN_TS$12 = clock2.ONE_SECOND_IN_TS;
  102196. var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;
  102197. var retriggerForStream = function retriggerForStream2(key, event2) {
  102198. event2.stream = key;
  102199. this.trigger("log", event2);
  102200. };
  102201. var addPipelineLogRetriggers = function addPipelineLogRetriggers2(transmuxer2, pipeline) {
  102202. var keys3 = Object.keys(pipeline);
  102203. for (var i2 = 0; i2 < keys3.length; i2++) {
  102204. var key = keys3[i2];
  102205. if (key === "headOfPipeline" || !pipeline[key].on) {
  102206. continue;
  102207. }
  102208. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  102209. }
  102210. };
  102211. var arrayEquals = function arrayEquals2(a, b) {
  102212. var i2;
  102213. if (a.length !== b.length) {
  102214. return false;
  102215. }
  102216. for (i2 = 0; i2 < a.length; i2++) {
  102217. if (a[i2] !== b[i2]) {
  102218. return false;
  102219. }
  102220. }
  102221. return true;
  102222. };
  102223. var generateSegmentTimingInfo = function generateSegmentTimingInfo2(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  102224. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  102225. return {
  102226. start: {
  102227. dts: baseMediaDecodeTime,
  102228. pts: baseMediaDecodeTime + ptsOffsetFromDts
  102229. },
  102230. end: {
  102231. dts: baseMediaDecodeTime + decodeDuration,
  102232. pts: baseMediaDecodeTime + presentationDuration
  102233. },
  102234. prependedContentDuration,
  102235. baseMediaDecodeTime
  102236. };
  102237. };
  102238. _AudioSegmentStream = function AudioSegmentStream(track, options2) {
  102239. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  102240. options2 = options2 || {};
  102241. sequenceNumber = options2.firstSequenceNumber || 0;
  102242. _AudioSegmentStream.prototype.init.call(this);
  102243. this.push = function(data) {
  102244. trackDecodeInfo.collectDtsInfo(track, data);
  102245. if (track) {
  102246. audioProperties.forEach(function(prop) {
  102247. track[prop] = data[prop];
  102248. });
  102249. }
  102250. adtsFrames.push(data);
  102251. };
  102252. this.setEarliestDts = function(earliestDts) {
  102253. earliestAllowedDts = earliestDts;
  102254. };
  102255. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102256. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  102257. };
  102258. this.setAudioAppendStart = function(timestamp) {
  102259. audioAppendStartTs = timestamp;
  102260. };
  102261. this.flush = function() {
  102262. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  102263. if (adtsFrames.length === 0) {
  102264. this.trigger("done", "AudioSegmentStream");
  102265. return;
  102266. }
  102267. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  102268. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102269. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  102270. track.samples = audioFrameUtils.generateSampleTable(frames);
  102271. mdat2 = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));
  102272. adtsFrames = [];
  102273. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102274. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102275. sequenceNumber++;
  102276. boxes.set(moof2);
  102277. boxes.set(mdat2, moof2.byteLength);
  102278. trackDecodeInfo.clearDtsInfo(track);
  102279. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  102280. if (frames.length) {
  102281. segmentDuration = frames.length * frameDuration;
  102282. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  102283. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  102284. frames[0].dts,
  102285. frames[0].pts,
  102286. frames[0].dts + segmentDuration,
  102287. frames[0].pts + segmentDuration,
  102288. videoClockCyclesOfSilencePrefixed || 0
  102289. ));
  102290. this.trigger("timingInfo", {
  102291. start: frames[0].pts,
  102292. end: frames[0].pts + segmentDuration
  102293. });
  102294. }
  102295. this.trigger("data", {
  102296. track,
  102297. boxes
  102298. });
  102299. this.trigger("done", "AudioSegmentStream");
  102300. };
  102301. this.reset = function() {
  102302. trackDecodeInfo.clearDtsInfo(track);
  102303. adtsFrames = [];
  102304. this.trigger("reset");
  102305. };
  102306. };
  102307. _AudioSegmentStream.prototype = new stream();
  102308. _VideoSegmentStream = function VideoSegmentStream(track, options2) {
  102309. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  102310. options2 = options2 || {};
  102311. sequenceNumber = options2.firstSequenceNumber || 0;
  102312. _VideoSegmentStream.prototype.init.call(this);
  102313. delete track.minPTS;
  102314. this.gopCache_ = [];
  102315. this.push = function(nalUnit) {
  102316. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  102317. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  102318. config = nalUnit.config;
  102319. track.sps = [nalUnit.data];
  102320. videoProperties.forEach(function(prop) {
  102321. track[prop] = config[prop];
  102322. }, this);
  102323. }
  102324. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  102325. pps = nalUnit.data;
  102326. track.pps = [nalUnit.data];
  102327. }
  102328. nalUnits.push(nalUnit);
  102329. };
  102330. this.flush = function() {
  102331. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  102332. while (nalUnits.length) {
  102333. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  102334. break;
  102335. }
  102336. nalUnits.shift();
  102337. }
  102338. if (nalUnits.length === 0) {
  102339. this.resetStream_();
  102340. this.trigger("done", "VideoSegmentStream");
  102341. return;
  102342. }
  102343. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  102344. gops = frameUtils.groupFramesIntoGops(frames);
  102345. if (!gops[0][0].keyFrame) {
  102346. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  102347. if (gopForFusion) {
  102348. prependedContentDuration = gopForFusion.duration;
  102349. gops.unshift(gopForFusion);
  102350. gops.byteLength += gopForFusion.byteLength;
  102351. gops.nalCount += gopForFusion.nalCount;
  102352. gops.pts = gopForFusion.pts;
  102353. gops.dts = gopForFusion.dts;
  102354. gops.duration += gopForFusion.duration;
  102355. } else {
  102356. gops = frameUtils.extendFirstKeyFrame(gops);
  102357. }
  102358. }
  102359. if (gopsToAlignWith.length) {
  102360. var alignedGops;
  102361. if (options2.alignGopsAtEnd) {
  102362. alignedGops = this.alignGopsAtEnd_(gops);
  102363. } else {
  102364. alignedGops = this.alignGopsAtStart_(gops);
  102365. }
  102366. if (!alignedGops) {
  102367. this.gopCache_.unshift({
  102368. gop: gops.pop(),
  102369. pps: track.pps,
  102370. sps: track.sps
  102371. });
  102372. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102373. nalUnits = [];
  102374. this.resetStream_();
  102375. this.trigger("done", "VideoSegmentStream");
  102376. return;
  102377. }
  102378. trackDecodeInfo.clearDtsInfo(track);
  102379. gops = alignedGops;
  102380. }
  102381. trackDecodeInfo.collectDtsInfo(track, gops);
  102382. track.samples = frameUtils.generateSampleTable(gops);
  102383. mdat2 = mp4Generator.mdat(frameUtils.concatenateNalData(gops));
  102384. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102385. this.trigger("processedGopsInfo", gops.map(function(gop) {
  102386. return {
  102387. pts: gop.pts,
  102388. dts: gop.dts,
  102389. byteLength: gop.byteLength
  102390. };
  102391. }));
  102392. firstGop = gops[0];
  102393. lastGop = gops[gops.length - 1];
  102394. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  102395. this.trigger("timingInfo", {
  102396. start: gops[0].pts,
  102397. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  102398. });
  102399. this.gopCache_.unshift({
  102400. gop: gops.pop(),
  102401. pps: track.pps,
  102402. sps: track.sps
  102403. });
  102404. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102405. nalUnits = [];
  102406. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  102407. this.trigger("timelineStartInfo", track.timelineStartInfo);
  102408. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102409. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102410. sequenceNumber++;
  102411. boxes.set(moof2);
  102412. boxes.set(mdat2, moof2.byteLength);
  102413. this.trigger("data", {
  102414. track,
  102415. boxes
  102416. });
  102417. this.resetStream_();
  102418. this.trigger("done", "VideoSegmentStream");
  102419. };
  102420. this.reset = function() {
  102421. this.resetStream_();
  102422. nalUnits = [];
  102423. this.gopCache_.length = 0;
  102424. gopsToAlignWith.length = 0;
  102425. this.trigger("reset");
  102426. };
  102427. this.resetStream_ = function() {
  102428. trackDecodeInfo.clearDtsInfo(track);
  102429. config = void 0;
  102430. pps = void 0;
  102431. };
  102432. this.getGopForFusion_ = function(nalUnit) {
  102433. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  102434. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  102435. currentGopObj = this.gopCache_[i2];
  102436. currentGop = currentGopObj.gop;
  102437. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  102438. continue;
  102439. }
  102440. if (currentGop.dts < track.timelineStartInfo.dts) {
  102441. continue;
  102442. }
  102443. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  102444. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  102445. if (!nearestGopObj || nearestDistance > dtsDistance) {
  102446. nearestGopObj = currentGopObj;
  102447. nearestDistance = dtsDistance;
  102448. }
  102449. }
  102450. }
  102451. if (nearestGopObj) {
  102452. return nearestGopObj.gop;
  102453. }
  102454. return null;
  102455. };
  102456. this.alignGopsAtStart_ = function(gops) {
  102457. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  102458. byteLength = gops.byteLength;
  102459. nalCount = gops.nalCount;
  102460. duration5 = gops.duration;
  102461. alignIndex = gopIndex = 0;
  102462. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  102463. align = gopsToAlignWith[alignIndex];
  102464. gop = gops[gopIndex];
  102465. if (align.pts === gop.pts) {
  102466. break;
  102467. }
  102468. if (gop.pts > align.pts) {
  102469. alignIndex++;
  102470. continue;
  102471. }
  102472. gopIndex++;
  102473. byteLength -= gop.byteLength;
  102474. nalCount -= gop.nalCount;
  102475. duration5 -= gop.duration;
  102476. }
  102477. if (gopIndex === 0) {
  102478. return gops;
  102479. }
  102480. if (gopIndex === gops.length) {
  102481. return null;
  102482. }
  102483. alignedGops = gops.slice(gopIndex);
  102484. alignedGops.byteLength = byteLength;
  102485. alignedGops.duration = duration5;
  102486. alignedGops.nalCount = nalCount;
  102487. alignedGops.pts = alignedGops[0].pts;
  102488. alignedGops.dts = alignedGops[0].dts;
  102489. return alignedGops;
  102490. };
  102491. this.alignGopsAtEnd_ = function(gops) {
  102492. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  102493. alignIndex = gopsToAlignWith.length - 1;
  102494. gopIndex = gops.length - 1;
  102495. alignEndIndex = null;
  102496. matchFound = false;
  102497. while (alignIndex >= 0 && gopIndex >= 0) {
  102498. align = gopsToAlignWith[alignIndex];
  102499. gop = gops[gopIndex];
  102500. if (align.pts === gop.pts) {
  102501. matchFound = true;
  102502. break;
  102503. }
  102504. if (align.pts > gop.pts) {
  102505. alignIndex--;
  102506. continue;
  102507. }
  102508. if (alignIndex === gopsToAlignWith.length - 1) {
  102509. alignEndIndex = gopIndex;
  102510. }
  102511. gopIndex--;
  102512. }
  102513. if (!matchFound && alignEndIndex === null) {
  102514. return null;
  102515. }
  102516. var trimIndex;
  102517. if (matchFound) {
  102518. trimIndex = gopIndex;
  102519. } else {
  102520. trimIndex = alignEndIndex;
  102521. }
  102522. if (trimIndex === 0) {
  102523. return gops;
  102524. }
  102525. var alignedGops = gops.slice(trimIndex);
  102526. var metadata = alignedGops.reduce(function(total, gop2) {
  102527. total.byteLength += gop2.byteLength;
  102528. total.duration += gop2.duration;
  102529. total.nalCount += gop2.nalCount;
  102530. return total;
  102531. }, {
  102532. byteLength: 0,
  102533. duration: 0,
  102534. nalCount: 0
  102535. });
  102536. alignedGops.byteLength = metadata.byteLength;
  102537. alignedGops.duration = metadata.duration;
  102538. alignedGops.nalCount = metadata.nalCount;
  102539. alignedGops.pts = alignedGops[0].pts;
  102540. alignedGops.dts = alignedGops[0].dts;
  102541. return alignedGops;
  102542. };
  102543. this.alignGopsWith = function(newGopsToAlignWith) {
  102544. gopsToAlignWith = newGopsToAlignWith;
  102545. };
  102546. };
  102547. _VideoSegmentStream.prototype = new stream();
  102548. _CoalesceStream = function CoalesceStream(options2, metadataStream2) {
  102549. this.numberOfTracks = 0;
  102550. this.metadataStream = metadataStream2;
  102551. options2 = options2 || {};
  102552. if (typeof options2.remux !== "undefined") {
  102553. this.remuxTracks = !!options2.remux;
  102554. } else {
  102555. this.remuxTracks = true;
  102556. }
  102557. if (typeof options2.keepOriginalTimestamps === "boolean") {
  102558. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  102559. } else {
  102560. this.keepOriginalTimestamps = false;
  102561. }
  102562. this.pendingTracks = [];
  102563. this.videoTrack = null;
  102564. this.pendingBoxes = [];
  102565. this.pendingCaptions = [];
  102566. this.pendingMetadata = [];
  102567. this.pendingBytes = 0;
  102568. this.emittedTracks = 0;
  102569. _CoalesceStream.prototype.init.call(this);
  102570. this.push = function(output) {
  102571. if (output.text) {
  102572. return this.pendingCaptions.push(output);
  102573. }
  102574. if (output.frames) {
  102575. return this.pendingMetadata.push(output);
  102576. }
  102577. this.pendingTracks.push(output.track);
  102578. this.pendingBytes += output.boxes.byteLength;
  102579. if (output.track.type === "video") {
  102580. this.videoTrack = output.track;
  102581. this.pendingBoxes.push(output.boxes);
  102582. }
  102583. if (output.track.type === "audio") {
  102584. this.audioTrack = output.track;
  102585. this.pendingBoxes.unshift(output.boxes);
  102586. }
  102587. };
  102588. };
  102589. _CoalesceStream.prototype = new stream();
  102590. _CoalesceStream.prototype.flush = function(flushSource) {
  102591. var offset = 0, event2 = {
  102592. captions: [],
  102593. captionStreams: {},
  102594. metadata: [],
  102595. info: {}
  102596. }, caption, id3, initSegment, timelineStartPts = 0, i2;
  102597. if (this.pendingTracks.length < this.numberOfTracks) {
  102598. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  102599. return;
  102600. } else if (this.remuxTracks) {
  102601. return;
  102602. } else if (this.pendingTracks.length === 0) {
  102603. this.emittedTracks++;
  102604. if (this.emittedTracks >= this.numberOfTracks) {
  102605. this.trigger("done");
  102606. this.emittedTracks = 0;
  102607. }
  102608. return;
  102609. }
  102610. }
  102611. if (this.videoTrack) {
  102612. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  102613. videoProperties.forEach(function(prop) {
  102614. event2.info[prop] = this.videoTrack[prop];
  102615. }, this);
  102616. } else if (this.audioTrack) {
  102617. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  102618. audioProperties.forEach(function(prop) {
  102619. event2.info[prop] = this.audioTrack[prop];
  102620. }, this);
  102621. }
  102622. if (this.videoTrack || this.audioTrack) {
  102623. if (this.pendingTracks.length === 1) {
  102624. event2.type = this.pendingTracks[0].type;
  102625. } else {
  102626. event2.type = "combined";
  102627. }
  102628. this.emittedTracks += this.pendingTracks.length;
  102629. initSegment = mp4Generator.initSegment(this.pendingTracks);
  102630. event2.initSegment = new Uint8Array(initSegment.byteLength);
  102631. event2.initSegment.set(initSegment);
  102632. event2.data = new Uint8Array(this.pendingBytes);
  102633. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  102634. event2.data.set(this.pendingBoxes[i2], offset);
  102635. offset += this.pendingBoxes[i2].byteLength;
  102636. }
  102637. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  102638. caption = this.pendingCaptions[i2];
  102639. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  102640. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  102641. event2.captionStreams[caption.stream] = true;
  102642. event2.captions.push(caption);
  102643. }
  102644. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  102645. id3 = this.pendingMetadata[i2];
  102646. id3.cueTime = clock2.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);
  102647. event2.metadata.push(id3);
  102648. }
  102649. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  102650. this.pendingTracks.length = 0;
  102651. this.videoTrack = null;
  102652. this.pendingBoxes.length = 0;
  102653. this.pendingCaptions.length = 0;
  102654. this.pendingBytes = 0;
  102655. this.pendingMetadata.length = 0;
  102656. this.trigger("data", event2);
  102657. for (i2 = 0; i2 < event2.captions.length; i2++) {
  102658. caption = event2.captions[i2];
  102659. this.trigger("caption", caption);
  102660. }
  102661. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  102662. id3 = event2.metadata[i2];
  102663. this.trigger("id3Frame", id3);
  102664. }
  102665. }
  102666. if (this.emittedTracks >= this.numberOfTracks) {
  102667. this.trigger("done");
  102668. this.emittedTracks = 0;
  102669. }
  102670. };
  102671. _CoalesceStream.prototype.setRemux = function(val) {
  102672. this.remuxTracks = val;
  102673. };
  102674. _Transmuxer = function Transmuxer(options2) {
  102675. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  102676. _Transmuxer.prototype.init.call(this);
  102677. options2 = options2 || {};
  102678. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  102679. this.transmuxPipeline_ = {};
  102680. this.setupAacPipeline = function() {
  102681. var pipeline = {};
  102682. this.transmuxPipeline_ = pipeline;
  102683. pipeline.type = "aac";
  102684. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102685. pipeline.aacStream = new aac3();
  102686. pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("audio");
  102687. pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("timed-metadata");
  102688. pipeline.adtsStream = new adts();
  102689. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102690. pipeline.headOfPipeline = pipeline.aacStream;
  102691. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  102692. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102693. pipeline.metadataStream.on("timestamp", function(frame) {
  102694. pipeline.aacStream.setTimestamp(frame.timeStamp);
  102695. });
  102696. pipeline.aacStream.on("data", function(data) {
  102697. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  102698. return;
  102699. }
  102700. audioTrack = audioTrack || {
  102701. timelineStartInfo: {
  102702. baseMediaDecodeTime: self2.baseMediaDecodeTime
  102703. },
  102704. codec: "adts",
  102705. type: "audio"
  102706. };
  102707. pipeline.coalesceStream.numberOfTracks++;
  102708. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102709. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102710. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102711. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102712. self2.trigger("trackinfo", {
  102713. hasAudio: !!audioTrack,
  102714. hasVideo: !!videoTrack
  102715. });
  102716. });
  102717. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102718. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102719. addPipelineLogRetriggers(this, pipeline);
  102720. };
  102721. this.setupTsPipeline = function() {
  102722. var pipeline = {};
  102723. this.transmuxPipeline_ = pipeline;
  102724. pipeline.type = "ts";
  102725. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102726. pipeline.packetStream = new m2ts_1.TransportPacketStream();
  102727. pipeline.parseStream = new m2ts_1.TransportParseStream();
  102728. pipeline.elementaryStream = new m2ts_1.ElementaryStream();
  102729. pipeline.timestampRolloverStream = new m2ts_1.TimestampRolloverStream();
  102730. pipeline.adtsStream = new adts();
  102731. pipeline.h264Stream = new H264Stream();
  102732. pipeline.captionStream = new m2ts_1.CaptionStream(options2);
  102733. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102734. pipeline.headOfPipeline = pipeline.packetStream;
  102735. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  102736. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  102737. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  102738. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102739. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  102740. pipeline.elementaryStream.on("data", function(data) {
  102741. var i2;
  102742. if (data.type === "metadata") {
  102743. i2 = data.tracks.length;
  102744. while (i2--) {
  102745. if (!videoTrack && data.tracks[i2].type === "video") {
  102746. videoTrack = data.tracks[i2];
  102747. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102748. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  102749. audioTrack = data.tracks[i2];
  102750. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102751. }
  102752. }
  102753. if (videoTrack && !pipeline.videoSegmentStream) {
  102754. pipeline.coalesceStream.numberOfTracks++;
  102755. pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options2);
  102756. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  102757. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  102758. if (audioTrack && !options2.keepOriginalTimestamps) {
  102759. audioTrack.timelineStartInfo = timelineStartInfo;
  102760. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  102761. }
  102762. });
  102763. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  102764. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  102765. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  102766. if (audioTrack) {
  102767. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  102768. }
  102769. });
  102770. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  102771. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  102772. }
  102773. if (audioTrack && !pipeline.audioSegmentStream) {
  102774. pipeline.coalesceStream.numberOfTracks++;
  102775. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102776. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102777. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102778. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  102779. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102780. }
  102781. self2.trigger("trackinfo", {
  102782. hasAudio: !!audioTrack,
  102783. hasVideo: !!videoTrack
  102784. });
  102785. }
  102786. });
  102787. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102788. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  102789. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  102790. self2.trigger("id3Frame", id3Frame);
  102791. });
  102792. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  102793. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102794. addPipelineLogRetriggers(this, pipeline);
  102795. };
  102796. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102797. var pipeline = this.transmuxPipeline_;
  102798. if (!options2.keepOriginalTimestamps) {
  102799. this.baseMediaDecodeTime = baseMediaDecodeTime;
  102800. }
  102801. if (audioTrack) {
  102802. audioTrack.timelineStartInfo.dts = void 0;
  102803. audioTrack.timelineStartInfo.pts = void 0;
  102804. trackDecodeInfo.clearDtsInfo(audioTrack);
  102805. if (pipeline.audioTimestampRolloverStream) {
  102806. pipeline.audioTimestampRolloverStream.discontinuity();
  102807. }
  102808. }
  102809. if (videoTrack) {
  102810. if (pipeline.videoSegmentStream) {
  102811. pipeline.videoSegmentStream.gopCache_ = [];
  102812. }
  102813. videoTrack.timelineStartInfo.dts = void 0;
  102814. videoTrack.timelineStartInfo.pts = void 0;
  102815. trackDecodeInfo.clearDtsInfo(videoTrack);
  102816. pipeline.captionStream.reset();
  102817. }
  102818. if (pipeline.timestampRolloverStream) {
  102819. pipeline.timestampRolloverStream.discontinuity();
  102820. }
  102821. };
  102822. this.setAudioAppendStart = function(timestamp) {
  102823. if (audioTrack) {
  102824. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  102825. }
  102826. };
  102827. this.setRemux = function(val) {
  102828. var pipeline = this.transmuxPipeline_;
  102829. options2.remux = val;
  102830. if (pipeline && pipeline.coalesceStream) {
  102831. pipeline.coalesceStream.setRemux(val);
  102832. }
  102833. };
  102834. this.alignGopsWith = function(gopsToAlignWith) {
  102835. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  102836. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  102837. }
  102838. };
  102839. this.getLogTrigger_ = function(key) {
  102840. var self3 = this;
  102841. return function(event2) {
  102842. event2.stream = key;
  102843. self3.trigger("log", event2);
  102844. };
  102845. };
  102846. this.push = function(data) {
  102847. if (hasFlushed) {
  102848. var isAac = isLikelyAacData(data);
  102849. if (isAac && this.transmuxPipeline_.type !== "aac") {
  102850. this.setupAacPipeline();
  102851. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  102852. this.setupTsPipeline();
  102853. }
  102854. hasFlushed = false;
  102855. }
  102856. this.transmuxPipeline_.headOfPipeline.push(data);
  102857. };
  102858. this.flush = function() {
  102859. hasFlushed = true;
  102860. this.transmuxPipeline_.headOfPipeline.flush();
  102861. };
  102862. this.endTimeline = function() {
  102863. this.transmuxPipeline_.headOfPipeline.endTimeline();
  102864. };
  102865. this.reset = function() {
  102866. if (this.transmuxPipeline_.headOfPipeline) {
  102867. this.transmuxPipeline_.headOfPipeline.reset();
  102868. }
  102869. };
  102870. this.resetCaptions = function() {
  102871. if (this.transmuxPipeline_.captionStream) {
  102872. this.transmuxPipeline_.captionStream.reset();
  102873. }
  102874. };
  102875. };
  102876. _Transmuxer.prototype = new stream();
  102877. var transmuxer = {
  102878. Transmuxer: _Transmuxer,
  102879. VideoSegmentStream: _VideoSegmentStream,
  102880. AudioSegmentStream: _AudioSegmentStream,
  102881. AUDIO_PROPERTIES: audioProperties,
  102882. VIDEO_PROPERTIES: videoProperties,
  102883. generateSegmentTimingInfo
  102884. };
  102885. var toUnsigned$3 = function toUnsigned2(value) {
  102886. return value >>> 0;
  102887. };
  102888. var toHexString$1 = function toHexString2(value) {
  102889. return ("00" + value.toString(16)).slice(-2);
  102890. };
  102891. var bin = {
  102892. toUnsigned: toUnsigned$3,
  102893. toHexString: toHexString$1
  102894. };
  102895. var parseType$1 = function parseType2(buffer) {
  102896. var result = "";
  102897. result += String.fromCharCode(buffer[0]);
  102898. result += String.fromCharCode(buffer[1]);
  102899. result += String.fromCharCode(buffer[2]);
  102900. result += String.fromCharCode(buffer[3]);
  102901. return result;
  102902. };
  102903. var parseType_1 = parseType$1;
  102904. var toUnsigned$2 = bin.toUnsigned;
  102905. var findBox4 = function findBox5(data, path) {
  102906. var results = [], i2, size, type3, end, subresults;
  102907. if (!path.length) {
  102908. return null;
  102909. }
  102910. for (i2 = 0; i2 < data.byteLength; ) {
  102911. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  102912. type3 = parseType_1(data.subarray(i2 + 4, i2 + 8));
  102913. end = size > 1 ? i2 + size : data.byteLength;
  102914. if (type3 === path[0]) {
  102915. if (path.length === 1) {
  102916. results.push(data.subarray(i2 + 8, end));
  102917. } else {
  102918. subresults = findBox5(data.subarray(i2 + 8, end), path.slice(1));
  102919. if (subresults.length) {
  102920. results = results.concat(subresults);
  102921. }
  102922. }
  102923. }
  102924. i2 = end;
  102925. }
  102926. return results;
  102927. };
  102928. var findBox_1 = findBox4;
  102929. var toUnsigned$1 = bin.toUnsigned;
  102930. var getUint64$12 = numbers2.getUint64;
  102931. var tfdt = function tfdt2(data) {
  102932. var result = {
  102933. version: data[0],
  102934. flags: new Uint8Array(data.subarray(1, 4))
  102935. };
  102936. if (result.version === 1) {
  102937. result.baseMediaDecodeTime = getUint64$12(data.subarray(4));
  102938. } else {
  102939. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  102940. }
  102941. return result;
  102942. };
  102943. var parseTfdt = tfdt;
  102944. var parseSampleFlags = function parseSampleFlags2(flags) {
  102945. return {
  102946. isLeading: (flags[0] & 12) >>> 2,
  102947. dependsOn: flags[0] & 3,
  102948. isDependedOn: (flags[1] & 192) >>> 6,
  102949. hasRedundancy: (flags[1] & 48) >>> 4,
  102950. paddingValue: (flags[1] & 14) >>> 1,
  102951. isNonSyncSample: flags[1] & 1,
  102952. degradationPriority: flags[2] << 8 | flags[3]
  102953. };
  102954. };
  102955. var parseSampleFlags_1 = parseSampleFlags;
  102956. var trun = function trun2(data) {
  102957. var result = {
  102958. version: data[0],
  102959. flags: new Uint8Array(data.subarray(1, 4)),
  102960. samples: []
  102961. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  102962. if (dataOffsetPresent) {
  102963. result.dataOffset = view.getInt32(offset);
  102964. offset += 4;
  102965. }
  102966. if (firstSampleFlagsPresent && sampleCount) {
  102967. sample = {
  102968. flags: parseSampleFlags_1(data.subarray(offset, offset + 4))
  102969. };
  102970. offset += 4;
  102971. if (sampleDurationPresent) {
  102972. sample.duration = view.getUint32(offset);
  102973. offset += 4;
  102974. }
  102975. if (sampleSizePresent) {
  102976. sample.size = view.getUint32(offset);
  102977. offset += 4;
  102978. }
  102979. if (sampleCompositionTimeOffsetPresent) {
  102980. if (result.version === 1) {
  102981. sample.compositionTimeOffset = view.getInt32(offset);
  102982. } else {
  102983. sample.compositionTimeOffset = view.getUint32(offset);
  102984. }
  102985. offset += 4;
  102986. }
  102987. result.samples.push(sample);
  102988. sampleCount--;
  102989. }
  102990. while (sampleCount--) {
  102991. sample = {};
  102992. if (sampleDurationPresent) {
  102993. sample.duration = view.getUint32(offset);
  102994. offset += 4;
  102995. }
  102996. if (sampleSizePresent) {
  102997. sample.size = view.getUint32(offset);
  102998. offset += 4;
  102999. }
  103000. if (sampleFlagsPresent) {
  103001. sample.flags = parseSampleFlags_1(data.subarray(offset, offset + 4));
  103002. offset += 4;
  103003. }
  103004. if (sampleCompositionTimeOffsetPresent) {
  103005. if (result.version === 1) {
  103006. sample.compositionTimeOffset = view.getInt32(offset);
  103007. } else {
  103008. sample.compositionTimeOffset = view.getUint32(offset);
  103009. }
  103010. offset += 4;
  103011. }
  103012. result.samples.push(sample);
  103013. }
  103014. return result;
  103015. };
  103016. var parseTrun = trun;
  103017. var tfhd = function tfhd2(data) {
  103018. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  103019. version: data[0],
  103020. flags: new Uint8Array(data.subarray(1, 4)),
  103021. trackId: view.getUint32(4)
  103022. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  103023. i2 = 8;
  103024. if (baseDataOffsetPresent) {
  103025. i2 += 4;
  103026. result.baseDataOffset = view.getUint32(12);
  103027. i2 += 4;
  103028. }
  103029. if (sampleDescriptionIndexPresent) {
  103030. result.sampleDescriptionIndex = view.getUint32(i2);
  103031. i2 += 4;
  103032. }
  103033. if (defaultSampleDurationPresent) {
  103034. result.defaultSampleDuration = view.getUint32(i2);
  103035. i2 += 4;
  103036. }
  103037. if (defaultSampleSizePresent) {
  103038. result.defaultSampleSize = view.getUint32(i2);
  103039. i2 += 4;
  103040. }
  103041. if (defaultSampleFlagsPresent) {
  103042. result.defaultSampleFlags = view.getUint32(i2);
  103043. }
  103044. if (durationIsEmpty) {
  103045. result.durationIsEmpty = true;
  103046. }
  103047. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  103048. result.baseDataOffsetIsMoof = true;
  103049. }
  103050. return result;
  103051. };
  103052. var parseTfhd = tfhd;
  103053. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  103054. var win2;
  103055. if (typeof window !== "undefined") {
  103056. win2 = window;
  103057. } else if (typeof commonjsGlobal2 !== "undefined") {
  103058. win2 = commonjsGlobal2;
  103059. } else if (typeof self !== "undefined") {
  103060. win2 = self;
  103061. } else {
  103062. win2 = {};
  103063. }
  103064. var window_12 = win2;
  103065. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  103066. var CaptionStream = captionStream.CaptionStream;
  103067. var mapToSample = function mapToSample2(offset, samples) {
  103068. var approximateOffset = offset;
  103069. for (var i2 = 0; i2 < samples.length; i2++) {
  103070. var sample = samples[i2];
  103071. if (approximateOffset < sample.size) {
  103072. return sample;
  103073. }
  103074. approximateOffset -= sample.size;
  103075. }
  103076. return null;
  103077. };
  103078. var findSeiNals = function findSeiNals2(avcStream, samples, trackId) {
  103079. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  103080. logs: [],
  103081. seiNals: []
  103082. }, seiNal, i2, length, lastMatchedSample;
  103083. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  103084. length = avcView.getUint32(i2);
  103085. i2 += 4;
  103086. if (length <= 0) {
  103087. continue;
  103088. }
  103089. switch (avcStream[i2] & 31) {
  103090. case 6:
  103091. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  103092. var matchingSample = mapToSample(i2, samples);
  103093. seiNal = {
  103094. nalUnitType: "sei_rbsp",
  103095. size: length,
  103096. data,
  103097. escapedRBSP: discardEmulationPreventionBytes4(data),
  103098. trackId
  103099. };
  103100. if (matchingSample) {
  103101. seiNal.pts = matchingSample.pts;
  103102. seiNal.dts = matchingSample.dts;
  103103. lastMatchedSample = matchingSample;
  103104. } else if (lastMatchedSample) {
  103105. seiNal.pts = lastMatchedSample.pts;
  103106. seiNal.dts = lastMatchedSample.dts;
  103107. } else {
  103108. result.logs.push({
  103109. level: "warn",
  103110. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  103111. });
  103112. break;
  103113. }
  103114. result.seiNals.push(seiNal);
  103115. break;
  103116. }
  103117. }
  103118. return result;
  103119. };
  103120. var parseSamples = function parseSamples2(truns, baseMediaDecodeTime, tfhd2) {
  103121. var currentDts = baseMediaDecodeTime;
  103122. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  103123. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  103124. var trackId = tfhd2.trackId;
  103125. var allSamples = [];
  103126. truns.forEach(function(trun2) {
  103127. var trackRun = parseTrun(trun2);
  103128. var samples = trackRun.samples;
  103129. samples.forEach(function(sample) {
  103130. if (sample.duration === void 0) {
  103131. sample.duration = defaultSampleDuration;
  103132. }
  103133. if (sample.size === void 0) {
  103134. sample.size = defaultSampleSize;
  103135. }
  103136. sample.trackId = trackId;
  103137. sample.dts = currentDts;
  103138. if (sample.compositionTimeOffset === void 0) {
  103139. sample.compositionTimeOffset = 0;
  103140. }
  103141. if (typeof currentDts === "bigint") {
  103142. sample.pts = currentDts + window_12.BigInt(sample.compositionTimeOffset);
  103143. currentDts += window_12.BigInt(sample.duration);
  103144. } else {
  103145. sample.pts = currentDts + sample.compositionTimeOffset;
  103146. currentDts += sample.duration;
  103147. }
  103148. });
  103149. allSamples = allSamples.concat(samples);
  103150. });
  103151. return allSamples;
  103152. };
  103153. var parseCaptionNals = function parseCaptionNals2(segment, videoTrackId) {
  103154. var trafs = findBox_1(segment, ["moof", "traf"]);
  103155. var mdats = findBox_1(segment, ["mdat"]);
  103156. var captionNals = {};
  103157. var mdatTrafPairs = [];
  103158. mdats.forEach(function(mdat2, index2) {
  103159. var matchingTraf = trafs[index2];
  103160. mdatTrafPairs.push({
  103161. mdat: mdat2,
  103162. traf: matchingTraf
  103163. });
  103164. });
  103165. mdatTrafPairs.forEach(function(pair) {
  103166. var mdat2 = pair.mdat;
  103167. var traf2 = pair.traf;
  103168. var tfhd2 = findBox_1(traf2, ["tfhd"]);
  103169. var headerInfo = parseTfhd(tfhd2[0]);
  103170. var trackId = headerInfo.trackId;
  103171. var tfdt2 = findBox_1(traf2, ["tfdt"]);
  103172. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt(tfdt2[0]).baseMediaDecodeTime : 0;
  103173. var truns = findBox_1(traf2, ["trun"]);
  103174. var samples;
  103175. var result;
  103176. if (videoTrackId === trackId && truns.length > 0) {
  103177. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  103178. result = findSeiNals(mdat2, samples, trackId);
  103179. if (!captionNals[trackId]) {
  103180. captionNals[trackId] = {
  103181. seiNals: [],
  103182. logs: []
  103183. };
  103184. }
  103185. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  103186. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  103187. }
  103188. });
  103189. return captionNals;
  103190. };
  103191. var parseEmbeddedCaptions = function parseEmbeddedCaptions2(segment, trackId, timescale3) {
  103192. var captionNals;
  103193. if (trackId === null) {
  103194. return null;
  103195. }
  103196. captionNals = parseCaptionNals(segment, trackId);
  103197. var trackNals = captionNals[trackId] || {};
  103198. return {
  103199. seiNals: trackNals.seiNals,
  103200. logs: trackNals.logs,
  103201. timescale: timescale3
  103202. };
  103203. };
  103204. var CaptionParser = function CaptionParser2() {
  103205. var isInitialized = false;
  103206. var captionStream2;
  103207. var segmentCache;
  103208. var trackId;
  103209. var timescale3;
  103210. var parsedCaptions;
  103211. var parsingPartial;
  103212. this.isInitialized = function() {
  103213. return isInitialized;
  103214. };
  103215. this.init = function(options2) {
  103216. captionStream2 = new CaptionStream();
  103217. isInitialized = true;
  103218. parsingPartial = options2 ? options2.isPartial : false;
  103219. captionStream2.on("data", function(event2) {
  103220. event2.startTime = event2.startPts / timescale3;
  103221. event2.endTime = event2.endPts / timescale3;
  103222. parsedCaptions.captions.push(event2);
  103223. parsedCaptions.captionStreams[event2.stream] = true;
  103224. });
  103225. captionStream2.on("log", function(log2) {
  103226. parsedCaptions.logs.push(log2);
  103227. });
  103228. };
  103229. this.isNewInit = function(videoTrackIds, timescales) {
  103230. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  103231. return false;
  103232. }
  103233. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  103234. };
  103235. this.parse = function(segment, videoTrackIds, timescales) {
  103236. var parsedData;
  103237. if (!this.isInitialized()) {
  103238. return null;
  103239. } else if (!videoTrackIds || !timescales) {
  103240. return null;
  103241. } else if (this.isNewInit(videoTrackIds, timescales)) {
  103242. trackId = videoTrackIds[0];
  103243. timescale3 = timescales[trackId];
  103244. } else if (trackId === null || !timescale3) {
  103245. segmentCache.push(segment);
  103246. return null;
  103247. }
  103248. while (segmentCache.length > 0) {
  103249. var cachedSegment = segmentCache.shift();
  103250. this.parse(cachedSegment, videoTrackIds, timescales);
  103251. }
  103252. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  103253. if (parsedData && parsedData.logs) {
  103254. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  103255. }
  103256. if (parsedData === null || !parsedData.seiNals) {
  103257. if (parsedCaptions.logs.length) {
  103258. return {
  103259. logs: parsedCaptions.logs,
  103260. captions: [],
  103261. captionStreams: []
  103262. };
  103263. }
  103264. return null;
  103265. }
  103266. this.pushNals(parsedData.seiNals);
  103267. this.flushStream();
  103268. return parsedCaptions;
  103269. };
  103270. this.pushNals = function(nals) {
  103271. if (!this.isInitialized() || !nals || nals.length === 0) {
  103272. return null;
  103273. }
  103274. nals.forEach(function(nal) {
  103275. captionStream2.push(nal);
  103276. });
  103277. };
  103278. this.flushStream = function() {
  103279. if (!this.isInitialized()) {
  103280. return null;
  103281. }
  103282. if (!parsingPartial) {
  103283. captionStream2.flush();
  103284. } else {
  103285. captionStream2.partialFlush();
  103286. }
  103287. };
  103288. this.clearParsedCaptions = function() {
  103289. parsedCaptions.captions = [];
  103290. parsedCaptions.captionStreams = {};
  103291. parsedCaptions.logs = [];
  103292. };
  103293. this.resetCaptionStream = function() {
  103294. if (!this.isInitialized()) {
  103295. return null;
  103296. }
  103297. captionStream2.reset();
  103298. };
  103299. this.clearAllCaptions = function() {
  103300. this.clearParsedCaptions();
  103301. this.resetCaptionStream();
  103302. };
  103303. this.reset = function() {
  103304. segmentCache = [];
  103305. trackId = null;
  103306. timescale3 = null;
  103307. if (!parsedCaptions) {
  103308. parsedCaptions = {
  103309. captions: [],
  103310. captionStreams: {},
  103311. logs: []
  103312. };
  103313. } else {
  103314. this.clearParsedCaptions();
  103315. }
  103316. this.resetCaptionStream();
  103317. };
  103318. this.reset();
  103319. };
  103320. var captionParser = CaptionParser;
  103321. var toUnsigned = bin.toUnsigned;
  103322. var toHexString = bin.toHexString;
  103323. var getUint642 = numbers2.getUint64;
  103324. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader;
  103325. timescale2 = function timescale3(init) {
  103326. var result = {}, traks = findBox_1(init, ["moov", "trak"]);
  103327. return traks.reduce(function(result2, trak2) {
  103328. var tkhd2, version2, index2, id, mdhd2;
  103329. tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103330. if (!tkhd2) {
  103331. return null;
  103332. }
  103333. version2 = tkhd2[0];
  103334. index2 = version2 === 0 ? 12 : 20;
  103335. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  103336. mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103337. if (!mdhd2) {
  103338. return null;
  103339. }
  103340. version2 = mdhd2[0];
  103341. index2 = version2 === 0 ? 12 : 20;
  103342. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103343. return result2;
  103344. }, result);
  103345. };
  103346. startTime = function startTime2(timescale3, fragment) {
  103347. var trafs;
  103348. trafs = findBox_1(fragment, ["moof", "traf"]);
  103349. var lowestTime = trafs.reduce(function(acc, traf2) {
  103350. var tfhd2 = findBox_1(traf2, ["tfhd"])[0];
  103351. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  103352. var scale = timescale3[id] || 9e4;
  103353. var tfdt2 = findBox_1(traf2, ["tfdt"])[0];
  103354. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  103355. var baseTime;
  103356. if (tfdt2[0] === 1) {
  103357. baseTime = getUint642(tfdt2.subarray(4, 12));
  103358. } else {
  103359. baseTime = dv.getUint32(4);
  103360. }
  103361. var seconds;
  103362. if (typeof baseTime === "bigint") {
  103363. seconds = baseTime / window_12.BigInt(scale);
  103364. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  103365. seconds = baseTime / scale;
  103366. }
  103367. if (seconds < Number.MAX_SAFE_INTEGER) {
  103368. seconds = Number(seconds);
  103369. }
  103370. if (seconds < acc) {
  103371. acc = seconds;
  103372. }
  103373. return acc;
  103374. }, Infinity);
  103375. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  103376. };
  103377. compositionStartTime = function compositionStartTime2(timescales, fragment) {
  103378. var trafBoxes = findBox_1(fragment, ["moof", "traf"]);
  103379. var baseMediaDecodeTime = 0;
  103380. var compositionTimeOffset = 0;
  103381. var trackId;
  103382. if (trafBoxes && trafBoxes.length) {
  103383. var tfhd2 = findBox_1(trafBoxes[0], ["tfhd"])[0];
  103384. var trun2 = findBox_1(trafBoxes[0], ["trun"])[0];
  103385. var tfdt2 = findBox_1(trafBoxes[0], ["tfdt"])[0];
  103386. if (tfhd2) {
  103387. var parsedTfhd = parseTfhd(tfhd2);
  103388. trackId = parsedTfhd.trackId;
  103389. }
  103390. if (tfdt2) {
  103391. var parsedTfdt = parseTfdt(tfdt2);
  103392. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  103393. }
  103394. if (trun2) {
  103395. var parsedTrun = parseTrun(trun2);
  103396. if (parsedTrun.samples && parsedTrun.samples.length) {
  103397. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  103398. }
  103399. }
  103400. }
  103401. var timescale3 = timescales[trackId] || 9e4;
  103402. if (typeof baseMediaDecodeTime === "bigint") {
  103403. compositionTimeOffset = window_12.BigInt(compositionTimeOffset);
  103404. timescale3 = window_12.BigInt(timescale3);
  103405. }
  103406. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  103407. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  103408. result = Number(result);
  103409. }
  103410. return result;
  103411. };
  103412. getVideoTrackIds = function getVideoTrackIds2(init) {
  103413. var traks = findBox_1(init, ["moov", "trak"]);
  103414. var videoTrackIds = [];
  103415. traks.forEach(function(trak2) {
  103416. var hdlrs = findBox_1(trak2, ["mdia", "hdlr"]);
  103417. var tkhds = findBox_1(trak2, ["tkhd"]);
  103418. hdlrs.forEach(function(hdlr2, index2) {
  103419. var handlerType = parseType_1(hdlr2.subarray(8, 12));
  103420. var tkhd2 = tkhds[index2];
  103421. var view;
  103422. var version2;
  103423. var trackId;
  103424. if (handlerType === "vide") {
  103425. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103426. version2 = view.getUint8(0);
  103427. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  103428. videoTrackIds.push(trackId);
  103429. }
  103430. });
  103431. });
  103432. return videoTrackIds;
  103433. };
  103434. getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader2(mdhd2) {
  103435. var version2 = mdhd2[0];
  103436. var index2 = version2 === 0 ? 12 : 20;
  103437. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103438. };
  103439. getTracks = function getTracks2(init) {
  103440. var traks = findBox_1(init, ["moov", "trak"]);
  103441. var tracks = [];
  103442. traks.forEach(function(trak2) {
  103443. var track = {};
  103444. var tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103445. var view, tkhdVersion;
  103446. if (tkhd2) {
  103447. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103448. tkhdVersion = view.getUint8(0);
  103449. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  103450. }
  103451. var hdlr2 = findBox_1(trak2, ["mdia", "hdlr"])[0];
  103452. if (hdlr2) {
  103453. var type3 = parseType_1(hdlr2.subarray(8, 12));
  103454. if (type3 === "vide") {
  103455. track.type = "video";
  103456. } else if (type3 === "soun") {
  103457. track.type = "audio";
  103458. } else {
  103459. track.type = type3;
  103460. }
  103461. }
  103462. var stsd2 = findBox_1(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  103463. if (stsd2) {
  103464. var sampleDescriptions = stsd2.subarray(8);
  103465. track.codec = parseType_1(sampleDescriptions.subarray(4, 8));
  103466. var codecBox = findBox_1(sampleDescriptions, [track.codec])[0];
  103467. var codecConfig, codecConfigType;
  103468. if (codecBox) {
  103469. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  103470. codecConfig = codecBox.subarray(78);
  103471. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103472. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  103473. track.codec += ".";
  103474. track.codec += toHexString(codecConfig[9]);
  103475. track.codec += toHexString(codecConfig[10]);
  103476. track.codec += toHexString(codecConfig[11]);
  103477. } else {
  103478. track.codec = "avc1.4d400d";
  103479. }
  103480. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  103481. codecConfig = codecBox.subarray(28);
  103482. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103483. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  103484. track.codec += "." + toHexString(codecConfig[19]);
  103485. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  103486. } else {
  103487. track.codec = "mp4a.40.2";
  103488. }
  103489. } else {
  103490. track.codec = track.codec.toLowerCase();
  103491. }
  103492. }
  103493. }
  103494. var mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103495. if (mdhd2) {
  103496. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  103497. }
  103498. tracks.push(track);
  103499. });
  103500. return tracks;
  103501. };
  103502. var probe$2 = {
  103503. findBox: findBox_1,
  103504. parseType: parseType_1,
  103505. timescale: timescale2,
  103506. startTime,
  103507. compositionStartTime,
  103508. videoTrackIds: getVideoTrackIds,
  103509. tracks: getTracks,
  103510. getTimescaleFromMediaHeader
  103511. };
  103512. var parsePid = function parsePid2(packet) {
  103513. var pid = packet[1] & 31;
  103514. pid <<= 8;
  103515. pid |= packet[2];
  103516. return pid;
  103517. };
  103518. var parsePayloadUnitStartIndicator = function parsePayloadUnitStartIndicator2(packet) {
  103519. return !!(packet[1] & 64);
  103520. };
  103521. var parseAdaptionField = function parseAdaptionField2(packet) {
  103522. var offset = 0;
  103523. if ((packet[3] & 48) >>> 4 > 1) {
  103524. offset += packet[4] + 1;
  103525. }
  103526. return offset;
  103527. };
  103528. var parseType = function parseType2(packet, pmtPid) {
  103529. var pid = parsePid(packet);
  103530. if (pid === 0) {
  103531. return "pat";
  103532. } else if (pid === pmtPid) {
  103533. return "pmt";
  103534. } else if (pmtPid) {
  103535. return "pes";
  103536. }
  103537. return null;
  103538. };
  103539. var parsePat = function parsePat2(packet) {
  103540. var pusi = parsePayloadUnitStartIndicator(packet);
  103541. var offset = 4 + parseAdaptionField(packet);
  103542. if (pusi) {
  103543. offset += packet[offset] + 1;
  103544. }
  103545. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  103546. };
  103547. var parsePmt = function parsePmt2(packet) {
  103548. var programMapTable = {};
  103549. var pusi = parsePayloadUnitStartIndicator(packet);
  103550. var payloadOffset = 4 + parseAdaptionField(packet);
  103551. if (pusi) {
  103552. payloadOffset += packet[payloadOffset] + 1;
  103553. }
  103554. if (!(packet[payloadOffset + 5] & 1)) {
  103555. return;
  103556. }
  103557. var sectionLength, tableEnd, programInfoLength;
  103558. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  103559. tableEnd = 3 + sectionLength - 4;
  103560. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  103561. var offset = 12 + programInfoLength;
  103562. while (offset < tableEnd) {
  103563. var i2 = payloadOffset + offset;
  103564. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  103565. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  103566. }
  103567. return programMapTable;
  103568. };
  103569. var parsePesType = function parsePesType2(packet, programMapTable) {
  103570. var pid = parsePid(packet);
  103571. var type3 = programMapTable[pid];
  103572. switch (type3) {
  103573. case streamTypes.H264_STREAM_TYPE:
  103574. return "video";
  103575. case streamTypes.ADTS_STREAM_TYPE:
  103576. return "audio";
  103577. case streamTypes.METADATA_STREAM_TYPE:
  103578. return "timed-metadata";
  103579. default:
  103580. return null;
  103581. }
  103582. };
  103583. var parsePesTime = function parsePesTime2(packet) {
  103584. var pusi = parsePayloadUnitStartIndicator(packet);
  103585. if (!pusi) {
  103586. return null;
  103587. }
  103588. var offset = 4 + parseAdaptionField(packet);
  103589. if (offset >= packet.byteLength) {
  103590. return null;
  103591. }
  103592. var pes = null;
  103593. var ptsDtsFlags;
  103594. ptsDtsFlags = packet[offset + 7];
  103595. if (ptsDtsFlags & 192) {
  103596. pes = {};
  103597. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  103598. pes.pts *= 4;
  103599. pes.pts += (packet[offset + 13] & 6) >>> 1;
  103600. pes.dts = pes.pts;
  103601. if (ptsDtsFlags & 64) {
  103602. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  103603. pes.dts *= 4;
  103604. pes.dts += (packet[offset + 18] & 6) >>> 1;
  103605. }
  103606. }
  103607. return pes;
  103608. };
  103609. var parseNalUnitType = function parseNalUnitType2(type3) {
  103610. switch (type3) {
  103611. case 5:
  103612. return "slice_layer_without_partitioning_rbsp_idr";
  103613. case 6:
  103614. return "sei_rbsp";
  103615. case 7:
  103616. return "seq_parameter_set_rbsp";
  103617. case 8:
  103618. return "pic_parameter_set_rbsp";
  103619. case 9:
  103620. return "access_unit_delimiter_rbsp";
  103621. default:
  103622. return null;
  103623. }
  103624. };
  103625. var videoPacketContainsKeyFrame = function videoPacketContainsKeyFrame2(packet) {
  103626. var offset = 4 + parseAdaptionField(packet);
  103627. var frameBuffer = packet.subarray(offset);
  103628. var frameI = 0;
  103629. var frameSyncPoint = 0;
  103630. var foundKeyFrame = false;
  103631. var nalType;
  103632. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  103633. if (frameBuffer[frameSyncPoint + 2] === 1) {
  103634. frameI = frameSyncPoint + 5;
  103635. break;
  103636. }
  103637. }
  103638. while (frameI < frameBuffer.byteLength) {
  103639. switch (frameBuffer[frameI]) {
  103640. case 0:
  103641. if (frameBuffer[frameI - 1] !== 0) {
  103642. frameI += 2;
  103643. break;
  103644. } else if (frameBuffer[frameI - 2] !== 0) {
  103645. frameI++;
  103646. break;
  103647. }
  103648. if (frameSyncPoint + 3 !== frameI - 2) {
  103649. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103650. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103651. foundKeyFrame = true;
  103652. }
  103653. }
  103654. do {
  103655. frameI++;
  103656. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  103657. frameSyncPoint = frameI - 2;
  103658. frameI += 3;
  103659. break;
  103660. case 1:
  103661. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  103662. frameI += 3;
  103663. break;
  103664. }
  103665. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103666. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103667. foundKeyFrame = true;
  103668. }
  103669. frameSyncPoint = frameI - 2;
  103670. frameI += 3;
  103671. break;
  103672. default:
  103673. frameI += 3;
  103674. break;
  103675. }
  103676. }
  103677. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  103678. frameI -= frameSyncPoint;
  103679. frameSyncPoint = 0;
  103680. if (frameBuffer && frameBuffer.byteLength > 3) {
  103681. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103682. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103683. foundKeyFrame = true;
  103684. }
  103685. }
  103686. return foundKeyFrame;
  103687. };
  103688. var probe$1 = {
  103689. parseType,
  103690. parsePat,
  103691. parsePmt,
  103692. parsePayloadUnitStartIndicator,
  103693. parsePesType,
  103694. parsePesTime,
  103695. videoPacketContainsKeyFrame
  103696. };
  103697. var handleRollover = timestampRolloverStream.handleRollover;
  103698. var probe = {};
  103699. probe.ts = probe$1;
  103700. probe.aac = utils2;
  103701. var ONE_SECOND_IN_TS2 = clock2.ONE_SECOND_IN_TS;
  103702. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  103703. var parsePsi_ = function parsePsi_2(bytes, pmt) {
  103704. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  103705. while (endIndex < bytes.byteLength) {
  103706. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103707. packet = bytes.subarray(startIndex, endIndex);
  103708. type3 = probe.ts.parseType(packet, pmt.pid);
  103709. switch (type3) {
  103710. case "pat":
  103711. pmt.pid = probe.ts.parsePat(packet);
  103712. break;
  103713. case "pmt":
  103714. var table = probe.ts.parsePmt(packet);
  103715. pmt.table = pmt.table || {};
  103716. Object.keys(table).forEach(function(key) {
  103717. pmt.table[key] = table[key];
  103718. });
  103719. break;
  103720. }
  103721. startIndex += MP2T_PACKET_LENGTH;
  103722. endIndex += MP2T_PACKET_LENGTH;
  103723. continue;
  103724. }
  103725. startIndex++;
  103726. endIndex++;
  103727. }
  103728. };
  103729. var parseAudioPes_ = function parseAudioPes_2(bytes, pmt, result) {
  103730. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  103731. var endLoop = false;
  103732. while (endIndex <= bytes.byteLength) {
  103733. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103734. packet = bytes.subarray(startIndex, endIndex);
  103735. type3 = probe.ts.parseType(packet, pmt.pid);
  103736. switch (type3) {
  103737. case "pes":
  103738. pesType = probe.ts.parsePesType(packet, pmt.table);
  103739. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103740. if (pesType === "audio" && pusi) {
  103741. parsed = probe.ts.parsePesTime(packet);
  103742. if (parsed) {
  103743. parsed.type = "audio";
  103744. result.audio.push(parsed);
  103745. endLoop = true;
  103746. }
  103747. }
  103748. break;
  103749. }
  103750. if (endLoop) {
  103751. break;
  103752. }
  103753. startIndex += MP2T_PACKET_LENGTH;
  103754. endIndex += MP2T_PACKET_LENGTH;
  103755. continue;
  103756. }
  103757. startIndex++;
  103758. endIndex++;
  103759. }
  103760. endIndex = bytes.byteLength;
  103761. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103762. endLoop = false;
  103763. while (startIndex >= 0) {
  103764. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103765. packet = bytes.subarray(startIndex, endIndex);
  103766. type3 = probe.ts.parseType(packet, pmt.pid);
  103767. switch (type3) {
  103768. case "pes":
  103769. pesType = probe.ts.parsePesType(packet, pmt.table);
  103770. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103771. if (pesType === "audio" && pusi) {
  103772. parsed = probe.ts.parsePesTime(packet);
  103773. if (parsed) {
  103774. parsed.type = "audio";
  103775. result.audio.push(parsed);
  103776. endLoop = true;
  103777. }
  103778. }
  103779. break;
  103780. }
  103781. if (endLoop) {
  103782. break;
  103783. }
  103784. startIndex -= MP2T_PACKET_LENGTH;
  103785. endIndex -= MP2T_PACKET_LENGTH;
  103786. continue;
  103787. }
  103788. startIndex--;
  103789. endIndex--;
  103790. }
  103791. };
  103792. var parseVideoPes_ = function parseVideoPes_2(bytes, pmt, result) {
  103793. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  103794. var endLoop = false;
  103795. var currentFrame = {
  103796. data: [],
  103797. size: 0
  103798. };
  103799. while (endIndex < bytes.byteLength) {
  103800. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103801. packet = bytes.subarray(startIndex, endIndex);
  103802. type3 = probe.ts.parseType(packet, pmt.pid);
  103803. switch (type3) {
  103804. case "pes":
  103805. pesType = probe.ts.parsePesType(packet, pmt.table);
  103806. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103807. if (pesType === "video") {
  103808. if (pusi && !endLoop) {
  103809. parsed = probe.ts.parsePesTime(packet);
  103810. if (parsed) {
  103811. parsed.type = "video";
  103812. result.video.push(parsed);
  103813. endLoop = true;
  103814. }
  103815. }
  103816. if (!result.firstKeyFrame) {
  103817. if (pusi) {
  103818. if (currentFrame.size !== 0) {
  103819. frame = new Uint8Array(currentFrame.size);
  103820. i2 = 0;
  103821. while (currentFrame.data.length) {
  103822. pes = currentFrame.data.shift();
  103823. frame.set(pes, i2);
  103824. i2 += pes.byteLength;
  103825. }
  103826. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  103827. var firstKeyFrame = probe.ts.parsePesTime(frame);
  103828. if (firstKeyFrame) {
  103829. result.firstKeyFrame = firstKeyFrame;
  103830. result.firstKeyFrame.type = "video";
  103831. } else {
  103832. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  103833. }
  103834. }
  103835. currentFrame.size = 0;
  103836. }
  103837. }
  103838. currentFrame.data.push(packet);
  103839. currentFrame.size += packet.byteLength;
  103840. }
  103841. }
  103842. break;
  103843. }
  103844. if (endLoop && result.firstKeyFrame) {
  103845. break;
  103846. }
  103847. startIndex += MP2T_PACKET_LENGTH;
  103848. endIndex += MP2T_PACKET_LENGTH;
  103849. continue;
  103850. }
  103851. startIndex++;
  103852. endIndex++;
  103853. }
  103854. endIndex = bytes.byteLength;
  103855. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103856. endLoop = false;
  103857. while (startIndex >= 0) {
  103858. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103859. packet = bytes.subarray(startIndex, endIndex);
  103860. type3 = probe.ts.parseType(packet, pmt.pid);
  103861. switch (type3) {
  103862. case "pes":
  103863. pesType = probe.ts.parsePesType(packet, pmt.table);
  103864. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103865. if (pesType === "video" && pusi) {
  103866. parsed = probe.ts.parsePesTime(packet);
  103867. if (parsed) {
  103868. parsed.type = "video";
  103869. result.video.push(parsed);
  103870. endLoop = true;
  103871. }
  103872. }
  103873. break;
  103874. }
  103875. if (endLoop) {
  103876. break;
  103877. }
  103878. startIndex -= MP2T_PACKET_LENGTH;
  103879. endIndex -= MP2T_PACKET_LENGTH;
  103880. continue;
  103881. }
  103882. startIndex--;
  103883. endIndex--;
  103884. }
  103885. };
  103886. var adjustTimestamp_ = function adjustTimestamp_2(segmentInfo, baseTimestamp) {
  103887. if (segmentInfo.audio && segmentInfo.audio.length) {
  103888. var audioBaseTimestamp = baseTimestamp;
  103889. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  103890. audioBaseTimestamp = segmentInfo.audio[0].dts;
  103891. }
  103892. segmentInfo.audio.forEach(function(info) {
  103893. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  103894. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  103895. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103896. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103897. });
  103898. }
  103899. if (segmentInfo.video && segmentInfo.video.length) {
  103900. var videoBaseTimestamp = baseTimestamp;
  103901. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  103902. videoBaseTimestamp = segmentInfo.video[0].dts;
  103903. }
  103904. segmentInfo.video.forEach(function(info) {
  103905. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  103906. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  103907. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103908. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103909. });
  103910. if (segmentInfo.firstKeyFrame) {
  103911. var frame = segmentInfo.firstKeyFrame;
  103912. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  103913. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  103914. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  103915. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  103916. }
  103917. }
  103918. };
  103919. var inspectAac_ = function inspectAac_2(bytes) {
  103920. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  103921. while (bytes.length - byteIndex >= 3) {
  103922. var type3 = probe.aac.parseType(bytes, byteIndex);
  103923. switch (type3) {
  103924. case "timed-metadata":
  103925. if (bytes.length - byteIndex < 10) {
  103926. endLoop = true;
  103927. break;
  103928. }
  103929. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  103930. if (frameSize > bytes.length) {
  103931. endLoop = true;
  103932. break;
  103933. }
  103934. if (timestamp === null) {
  103935. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103936. timestamp = probe.aac.parseAacTimestamp(packet);
  103937. }
  103938. byteIndex += frameSize;
  103939. break;
  103940. case "audio":
  103941. if (bytes.length - byteIndex < 7) {
  103942. endLoop = true;
  103943. break;
  103944. }
  103945. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  103946. if (frameSize > bytes.length) {
  103947. endLoop = true;
  103948. break;
  103949. }
  103950. if (sampleRate === null) {
  103951. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103952. sampleRate = probe.aac.parseSampleRate(packet);
  103953. }
  103954. audioCount++;
  103955. byteIndex += frameSize;
  103956. break;
  103957. default:
  103958. byteIndex++;
  103959. break;
  103960. }
  103961. if (endLoop) {
  103962. return null;
  103963. }
  103964. }
  103965. if (sampleRate === null || timestamp === null) {
  103966. return null;
  103967. }
  103968. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  103969. var result = {
  103970. audio: [{
  103971. type: "audio",
  103972. dts: timestamp,
  103973. pts: timestamp
  103974. }, {
  103975. type: "audio",
  103976. dts: timestamp + audioCount * 1024 * audioTimescale,
  103977. pts: timestamp + audioCount * 1024 * audioTimescale
  103978. }]
  103979. };
  103980. return result;
  103981. };
  103982. var inspectTs_ = function inspectTs_2(bytes) {
  103983. var pmt = {
  103984. pid: null,
  103985. table: null
  103986. };
  103987. var result = {};
  103988. parsePsi_(bytes, pmt);
  103989. for (var pid in pmt.table) {
  103990. if (pmt.table.hasOwnProperty(pid)) {
  103991. var type3 = pmt.table[pid];
  103992. switch (type3) {
  103993. case streamTypes.H264_STREAM_TYPE:
  103994. result.video = [];
  103995. parseVideoPes_(bytes, pmt, result);
  103996. if (result.video.length === 0) {
  103997. delete result.video;
  103998. }
  103999. break;
  104000. case streamTypes.ADTS_STREAM_TYPE:
  104001. result.audio = [];
  104002. parseAudioPes_(bytes, pmt, result);
  104003. if (result.audio.length === 0) {
  104004. delete result.audio;
  104005. }
  104006. break;
  104007. }
  104008. }
  104009. }
  104010. return result;
  104011. };
  104012. var inspect = function inspect2(bytes, baseTimestamp) {
  104013. var isAacData = probe.aac.isLikelyAacData(bytes);
  104014. var result;
  104015. if (isAacData) {
  104016. result = inspectAac_(bytes);
  104017. } else {
  104018. result = inspectTs_(bytes);
  104019. }
  104020. if (!result || !result.audio && !result.video) {
  104021. return null;
  104022. }
  104023. adjustTimestamp_(result, baseTimestamp);
  104024. return result;
  104025. };
  104026. var tsInspector = {
  104027. inspect,
  104028. parseAudioPes_
  104029. };
  104030. var wireTransmuxerEvents = function wireTransmuxerEvents2(self2, transmuxer2) {
  104031. transmuxer2.on("data", function(segment) {
  104032. var initArray = segment.initSegment;
  104033. segment.initSegment = {
  104034. data: initArray.buffer,
  104035. byteOffset: initArray.byteOffset,
  104036. byteLength: initArray.byteLength
  104037. };
  104038. var typedArray = segment.data;
  104039. segment.data = typedArray.buffer;
  104040. self2.postMessage({
  104041. action: "data",
  104042. segment,
  104043. byteOffset: typedArray.byteOffset,
  104044. byteLength: typedArray.byteLength
  104045. }, [segment.data]);
  104046. });
  104047. transmuxer2.on("done", function(data) {
  104048. self2.postMessage({
  104049. action: "done"
  104050. });
  104051. });
  104052. transmuxer2.on("gopInfo", function(gopInfo) {
  104053. self2.postMessage({
  104054. action: "gopInfo",
  104055. gopInfo
  104056. });
  104057. });
  104058. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  104059. var videoSegmentTimingInfo = {
  104060. start: {
  104061. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  104062. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104063. },
  104064. end: {
  104065. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104066. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104067. },
  104068. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104069. };
  104070. if (timingInfo.prependedContentDuration) {
  104071. videoSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104072. }
  104073. self2.postMessage({
  104074. action: "videoSegmentTimingInfo",
  104075. videoSegmentTimingInfo
  104076. });
  104077. });
  104078. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  104079. var audioSegmentTimingInfo = {
  104080. start: {
  104081. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  104082. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104083. },
  104084. end: {
  104085. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104086. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104087. },
  104088. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104089. };
  104090. if (timingInfo.prependedContentDuration) {
  104091. audioSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104092. }
  104093. self2.postMessage({
  104094. action: "audioSegmentTimingInfo",
  104095. audioSegmentTimingInfo
  104096. });
  104097. });
  104098. transmuxer2.on("id3Frame", function(id3Frame) {
  104099. self2.postMessage({
  104100. action: "id3Frame",
  104101. id3Frame
  104102. });
  104103. });
  104104. transmuxer2.on("caption", function(caption) {
  104105. self2.postMessage({
  104106. action: "caption",
  104107. caption
  104108. });
  104109. });
  104110. transmuxer2.on("trackinfo", function(trackInfo) {
  104111. self2.postMessage({
  104112. action: "trackinfo",
  104113. trackInfo
  104114. });
  104115. });
  104116. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  104117. self2.postMessage({
  104118. action: "audioTimingInfo",
  104119. audioTimingInfo: {
  104120. start: clock2.videoTsToSeconds(audioTimingInfo.start),
  104121. end: clock2.videoTsToSeconds(audioTimingInfo.end)
  104122. }
  104123. });
  104124. });
  104125. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  104126. self2.postMessage({
  104127. action: "videoTimingInfo",
  104128. videoTimingInfo: {
  104129. start: clock2.videoTsToSeconds(videoTimingInfo.start),
  104130. end: clock2.videoTsToSeconds(videoTimingInfo.end)
  104131. }
  104132. });
  104133. });
  104134. transmuxer2.on("log", function(log2) {
  104135. self2.postMessage({
  104136. action: "log",
  104137. log: log2
  104138. });
  104139. });
  104140. };
  104141. var MessageHandlers = /* @__PURE__ */ function() {
  104142. function MessageHandlers2(self2, options2) {
  104143. this.options = options2 || {};
  104144. this.self = self2;
  104145. this.init();
  104146. }
  104147. var _proto = MessageHandlers2.prototype;
  104148. _proto.init = function init() {
  104149. if (this.transmuxer) {
  104150. this.transmuxer.dispose();
  104151. }
  104152. this.transmuxer = new transmuxer.Transmuxer(this.options);
  104153. wireTransmuxerEvents(this.self, this.transmuxer);
  104154. };
  104155. _proto.pushMp4Captions = function pushMp4Captions(data) {
  104156. if (!this.captionParser) {
  104157. this.captionParser = new captionParser();
  104158. this.captionParser.init();
  104159. }
  104160. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104161. var parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  104162. this.self.postMessage({
  104163. action: "mp4Captions",
  104164. captions: parsed && parsed.captions || [],
  104165. logs: parsed && parsed.logs || [],
  104166. data: segment.buffer
  104167. }, [segment.buffer]);
  104168. };
  104169. _proto.probeMp4StartTime = function probeMp4StartTime(_ref) {
  104170. var timescales = _ref.timescales, data = _ref.data;
  104171. var startTime2 = probe$2.startTime(timescales, data);
  104172. this.self.postMessage({
  104173. action: "probeMp4StartTime",
  104174. startTime: startTime2,
  104175. data
  104176. }, [data.buffer]);
  104177. };
  104178. _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) {
  104179. var data = _ref2.data;
  104180. var tracks = probe$2.tracks(data);
  104181. this.self.postMessage({
  104182. action: "probeMp4Tracks",
  104183. tracks,
  104184. data
  104185. }, [data.buffer]);
  104186. };
  104187. _proto.probeTs = function probeTs(_ref3) {
  104188. var data = _ref3.data, baseStartTime = _ref3.baseStartTime;
  104189. var tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock2.ONE_SECOND_IN_TS : void 0;
  104190. var timeInfo = tsInspector.inspect(data, tsStartTime);
  104191. var result = null;
  104192. if (timeInfo) {
  104193. result = {
  104194. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  104195. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  104196. };
  104197. if (result.hasVideo) {
  104198. result.videoStart = timeInfo.video[0].ptsTime;
  104199. }
  104200. if (result.hasAudio) {
  104201. result.audioStart = timeInfo.audio[0].ptsTime;
  104202. }
  104203. }
  104204. this.self.postMessage({
  104205. action: "probeTs",
  104206. result,
  104207. data
  104208. }, [data.buffer]);
  104209. };
  104210. _proto.clearAllMp4Captions = function clearAllMp4Captions() {
  104211. if (this.captionParser) {
  104212. this.captionParser.clearAllCaptions();
  104213. }
  104214. };
  104215. _proto.clearParsedMp4Captions = function clearParsedMp4Captions() {
  104216. if (this.captionParser) {
  104217. this.captionParser.clearParsedCaptions();
  104218. }
  104219. };
  104220. _proto.push = function push(data) {
  104221. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104222. this.transmuxer.push(segment);
  104223. };
  104224. _proto.reset = function reset3() {
  104225. this.transmuxer.reset();
  104226. };
  104227. _proto.setTimestampOffset = function setTimestampOffset(data) {
  104228. var timestampOffset2 = data.timestampOffset || 0;
  104229. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock2.secondsToVideoTs(timestampOffset2)));
  104230. };
  104231. _proto.setAudioAppendStart = function setAudioAppendStart(data) {
  104232. this.transmuxer.setAudioAppendStart(Math.ceil(clock2.secondsToVideoTs(data.appendStart)));
  104233. };
  104234. _proto.setRemux = function setRemux(data) {
  104235. this.transmuxer.setRemux(data.remux);
  104236. };
  104237. _proto.flush = function flush(data) {
  104238. this.transmuxer.flush();
  104239. self.postMessage({
  104240. action: "done",
  104241. type: "transmuxed"
  104242. });
  104243. };
  104244. _proto.endTimeline = function endTimeline3() {
  104245. this.transmuxer.endTimeline();
  104246. self.postMessage({
  104247. action: "endedtimeline",
  104248. type: "transmuxed"
  104249. });
  104250. };
  104251. _proto.alignGopsWith = function alignGopsWith(data) {
  104252. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  104253. };
  104254. return MessageHandlers2;
  104255. }();
  104256. self.onmessage = function(event2) {
  104257. if (event2.data.action === "init" && event2.data.options) {
  104258. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  104259. return;
  104260. }
  104261. if (!this.messageHandlers) {
  104262. this.messageHandlers = new MessageHandlers(self);
  104263. }
  104264. if (event2.data && event2.data.action && event2.data.action !== "init") {
  104265. if (this.messageHandlers[event2.data.action]) {
  104266. this.messageHandlers[event2.data.action](event2.data);
  104267. }
  104268. }
  104269. };
  104270. }));
  104271. var TransmuxWorker = factory(workerCode$1);
  104272. var handleData_ = function handleData_2(event2, transmuxedData, callback2) {
  104273. var _event$data$segment = event2.data.segment, type2 = _event$data$segment.type, initSegment = _event$data$segment.initSegment, captions = _event$data$segment.captions, captionStreams = _event$data$segment.captionStreams, metadata = _event$data$segment.metadata, videoFrameDtsTime = _event$data$segment.videoFrameDtsTime, videoFramePtsTime = _event$data$segment.videoFramePtsTime;
  104274. transmuxedData.buffer.push({
  104275. captions,
  104276. captionStreams,
  104277. metadata
  104278. });
  104279. var boxes = event2.data.segment.boxes || {
  104280. data: event2.data.segment.data
  104281. };
  104282. var result = {
  104283. type: type2,
  104284. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  104285. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  104286. };
  104287. if (typeof videoFrameDtsTime !== "undefined") {
  104288. result.videoFrameDtsTime = videoFrameDtsTime;
  104289. }
  104290. if (typeof videoFramePtsTime !== "undefined") {
  104291. result.videoFramePtsTime = videoFramePtsTime;
  104292. }
  104293. callback2(result);
  104294. };
  104295. var handleDone_ = function handleDone_2(_ref) {
  104296. var transmuxedData = _ref.transmuxedData, callback2 = _ref.callback;
  104297. transmuxedData.buffer = [];
  104298. callback2(transmuxedData);
  104299. };
  104300. var handleGopInfo_ = function handleGopInfo_2(event2, transmuxedData) {
  104301. transmuxedData.gopInfo = event2.data.gopInfo;
  104302. };
  104303. var processTransmux = function processTransmux2(options2) {
  104304. var transmuxer = options2.transmuxer, bytes = options2.bytes, audioAppendStart = options2.audioAppendStart, gopsToAlignWith = options2.gopsToAlignWith, remux = options2.remux, onData = options2.onData, onTrackInfo = options2.onTrackInfo, onAudioTimingInfo = options2.onAudioTimingInfo, onVideoTimingInfo = options2.onVideoTimingInfo, onVideoSegmentTimingInfo = options2.onVideoSegmentTimingInfo, onAudioSegmentTimingInfo = options2.onAudioSegmentTimingInfo, onId3 = options2.onId3, onCaptions = options2.onCaptions, onDone = options2.onDone, onEndedTimeline = options2.onEndedTimeline, onTransmuxerLog = options2.onTransmuxerLog, isEndOfTimeline = options2.isEndOfTimeline;
  104305. var transmuxedData = {
  104306. buffer: []
  104307. };
  104308. var waitForEndedTimelineEvent = isEndOfTimeline;
  104309. var handleMessage = function handleMessage2(event2) {
  104310. if (transmuxer.currentTransmux !== options2) {
  104311. return;
  104312. }
  104313. if (event2.data.action === "data") {
  104314. handleData_(event2, transmuxedData, onData);
  104315. }
  104316. if (event2.data.action === "trackinfo") {
  104317. onTrackInfo(event2.data.trackInfo);
  104318. }
  104319. if (event2.data.action === "gopInfo") {
  104320. handleGopInfo_(event2, transmuxedData);
  104321. }
  104322. if (event2.data.action === "audioTimingInfo") {
  104323. onAudioTimingInfo(event2.data.audioTimingInfo);
  104324. }
  104325. if (event2.data.action === "videoTimingInfo") {
  104326. onVideoTimingInfo(event2.data.videoTimingInfo);
  104327. }
  104328. if (event2.data.action === "videoSegmentTimingInfo") {
  104329. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  104330. }
  104331. if (event2.data.action === "audioSegmentTimingInfo") {
  104332. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  104333. }
  104334. if (event2.data.action === "id3Frame") {
  104335. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  104336. }
  104337. if (event2.data.action === "caption") {
  104338. onCaptions(event2.data.caption);
  104339. }
  104340. if (event2.data.action === "endedtimeline") {
  104341. waitForEndedTimelineEvent = false;
  104342. onEndedTimeline();
  104343. }
  104344. if (event2.data.action === "log") {
  104345. onTransmuxerLog(event2.data.log);
  104346. }
  104347. if (event2.data.type !== "transmuxed") {
  104348. return;
  104349. }
  104350. if (waitForEndedTimelineEvent) {
  104351. return;
  104352. }
  104353. transmuxer.onmessage = null;
  104354. handleDone_({
  104355. transmuxedData,
  104356. callback: onDone
  104357. });
  104358. dequeue(transmuxer);
  104359. };
  104360. transmuxer.onmessage = handleMessage;
  104361. if (audioAppendStart) {
  104362. transmuxer.postMessage({
  104363. action: "setAudioAppendStart",
  104364. appendStart: audioAppendStart
  104365. });
  104366. }
  104367. if (Array.isArray(gopsToAlignWith)) {
  104368. transmuxer.postMessage({
  104369. action: "alignGopsWith",
  104370. gopsToAlignWith
  104371. });
  104372. }
  104373. if (typeof remux !== "undefined") {
  104374. transmuxer.postMessage({
  104375. action: "setRemux",
  104376. remux
  104377. });
  104378. }
  104379. if (bytes.byteLength) {
  104380. var buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  104381. var byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  104382. transmuxer.postMessage({
  104383. action: "push",
  104384. data: buffer,
  104385. byteOffset,
  104386. byteLength: bytes.byteLength
  104387. }, [buffer]);
  104388. }
  104389. if (isEndOfTimeline) {
  104390. transmuxer.postMessage({
  104391. action: "endTimeline"
  104392. });
  104393. }
  104394. transmuxer.postMessage({
  104395. action: "flush"
  104396. });
  104397. };
  104398. var dequeue = function dequeue2(transmuxer) {
  104399. transmuxer.currentTransmux = null;
  104400. if (transmuxer.transmuxQueue.length) {
  104401. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  104402. if (typeof transmuxer.currentTransmux === "function") {
  104403. transmuxer.currentTransmux();
  104404. } else {
  104405. processTransmux(transmuxer.currentTransmux);
  104406. }
  104407. }
  104408. };
  104409. var processAction = function processAction2(transmuxer, action) {
  104410. transmuxer.postMessage({
  104411. action
  104412. });
  104413. dequeue(transmuxer);
  104414. };
  104415. var enqueueAction = function enqueueAction2(action, transmuxer) {
  104416. if (!transmuxer.currentTransmux) {
  104417. transmuxer.currentTransmux = action;
  104418. processAction(transmuxer, action);
  104419. return;
  104420. }
  104421. transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));
  104422. };
  104423. var reset = function reset2(transmuxer) {
  104424. enqueueAction("reset", transmuxer);
  104425. };
  104426. var endTimeline = function endTimeline2(transmuxer) {
  104427. enqueueAction("endTimeline", transmuxer);
  104428. };
  104429. var transmux = function transmux2(options2) {
  104430. if (!options2.transmuxer.currentTransmux) {
  104431. options2.transmuxer.currentTransmux = options2;
  104432. processTransmux(options2);
  104433. return;
  104434. }
  104435. options2.transmuxer.transmuxQueue.push(options2);
  104436. };
  104437. var createTransmuxer = function createTransmuxer2(options2) {
  104438. var transmuxer = new TransmuxWorker();
  104439. transmuxer.currentTransmux = null;
  104440. transmuxer.transmuxQueue = [];
  104441. var term = transmuxer.terminate;
  104442. transmuxer.terminate = function() {
  104443. transmuxer.currentTransmux = null;
  104444. transmuxer.transmuxQueue.length = 0;
  104445. return term.call(transmuxer);
  104446. };
  104447. transmuxer.postMessage({
  104448. action: "init",
  104449. options: options2
  104450. });
  104451. return transmuxer;
  104452. };
  104453. var segmentTransmuxer = {
  104454. reset,
  104455. endTimeline,
  104456. transmux,
  104457. createTransmuxer
  104458. };
  104459. var workerCallback = function workerCallback2(options2) {
  104460. var transmuxer = options2.transmuxer;
  104461. var endAction = options2.endAction || options2.action;
  104462. var callback2 = options2.callback;
  104463. var message = _extends$2({}, options2, {
  104464. endAction: null,
  104465. transmuxer: null,
  104466. callback: null
  104467. });
  104468. var listenForEndEvent = function listenForEndEvent2(event2) {
  104469. if (event2.data.action !== endAction) {
  104470. return;
  104471. }
  104472. transmuxer.removeEventListener("message", listenForEndEvent2);
  104473. if (event2.data.data) {
  104474. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  104475. if (options2.data) {
  104476. options2.data = event2.data.data;
  104477. }
  104478. }
  104479. callback2(event2.data);
  104480. };
  104481. transmuxer.addEventListener("message", listenForEndEvent);
  104482. if (options2.data) {
  104483. var isArrayBuffer = options2.data instanceof ArrayBuffer;
  104484. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  104485. message.byteLength = options2.data.byteLength;
  104486. var transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  104487. transmuxer.postMessage(message, transfers);
  104488. } else {
  104489. transmuxer.postMessage(message);
  104490. }
  104491. };
  104492. var REQUEST_ERRORS = {
  104493. FAILURE: 2,
  104494. TIMEOUT: -101,
  104495. ABORTED: -102
  104496. };
  104497. var abortAll = function abortAll2(activeXhrs) {
  104498. activeXhrs.forEach(function(xhr) {
  104499. xhr.abort();
  104500. });
  104501. };
  104502. var getRequestStats = function getRequestStats2(request) {
  104503. return {
  104504. bandwidth: request.bandwidth,
  104505. bytesReceived: request.bytesReceived || 0,
  104506. roundTripTime: request.roundTripTime || 0
  104507. };
  104508. };
  104509. var getProgressStats = function getProgressStats2(progressEvent) {
  104510. var request = progressEvent.target;
  104511. var roundTripTime = Date.now() - request.requestTime;
  104512. var stats = {
  104513. bandwidth: Infinity,
  104514. bytesReceived: 0,
  104515. roundTripTime: roundTripTime || 0
  104516. };
  104517. stats.bytesReceived = progressEvent.loaded;
  104518. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  104519. return stats;
  104520. };
  104521. var handleErrors = function handleErrors2(error, request) {
  104522. if (request.timedout) {
  104523. return {
  104524. status: request.status,
  104525. message: "HLS request timed-out at URL: " + request.uri,
  104526. code: REQUEST_ERRORS.TIMEOUT,
  104527. xhr: request
  104528. };
  104529. }
  104530. if (request.aborted) {
  104531. return {
  104532. status: request.status,
  104533. message: "HLS request aborted at URL: " + request.uri,
  104534. code: REQUEST_ERRORS.ABORTED,
  104535. xhr: request
  104536. };
  104537. }
  104538. if (error) {
  104539. return {
  104540. status: request.status,
  104541. message: "HLS request errored at URL: " + request.uri,
  104542. code: REQUEST_ERRORS.FAILURE,
  104543. xhr: request
  104544. };
  104545. }
  104546. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  104547. return {
  104548. status: request.status,
  104549. message: "Empty HLS response at URL: " + request.uri,
  104550. code: REQUEST_ERRORS.FAILURE,
  104551. xhr: request
  104552. };
  104553. }
  104554. return null;
  104555. };
  104556. var handleKeyResponse = function handleKeyResponse2(segment, objects, finishProcessingFn) {
  104557. return function(error, request) {
  104558. var response = request.response;
  104559. var errorObj = handleErrors(error, request);
  104560. if (errorObj) {
  104561. return finishProcessingFn(errorObj, segment);
  104562. }
  104563. if (response.byteLength !== 16) {
  104564. return finishProcessingFn({
  104565. status: request.status,
  104566. message: "Invalid HLS key at URL: " + request.uri,
  104567. code: REQUEST_ERRORS.FAILURE,
  104568. xhr: request
  104569. }, segment);
  104570. }
  104571. var view = new DataView(response);
  104572. var bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  104573. for (var i2 = 0; i2 < objects.length; i2++) {
  104574. objects[i2].bytes = bytes;
  104575. }
  104576. return finishProcessingFn(null, segment);
  104577. };
  104578. };
  104579. var parseInitSegment = function parseInitSegment2(segment, _callback) {
  104580. var type2 = detectContainerForBytes2(segment.map.bytes);
  104581. if (type2 !== "mp4") {
  104582. var uri = segment.map.resolvedUri || segment.map.uri;
  104583. return _callback({
  104584. internal: true,
  104585. message: "Found unsupported " + (type2 || "unknown") + " container for initialization segment at URL: " + uri,
  104586. code: REQUEST_ERRORS.FAILURE
  104587. });
  104588. }
  104589. workerCallback({
  104590. action: "probeMp4Tracks",
  104591. data: segment.map.bytes,
  104592. transmuxer: segment.transmuxer,
  104593. callback: function callback2(_ref) {
  104594. var tracks = _ref.tracks, data = _ref.data;
  104595. segment.map.bytes = data;
  104596. tracks.forEach(function(track) {
  104597. segment.map.tracks = segment.map.tracks || {};
  104598. if (segment.map.tracks[track.type]) {
  104599. return;
  104600. }
  104601. segment.map.tracks[track.type] = track;
  104602. if (typeof track.id === "number" && track.timescale) {
  104603. segment.map.timescales = segment.map.timescales || {};
  104604. segment.map.timescales[track.id] = track.timescale;
  104605. }
  104606. });
  104607. return _callback(null);
  104608. }
  104609. });
  104610. };
  104611. var handleInitSegmentResponse = function handleInitSegmentResponse2(_ref2) {
  104612. var segment = _ref2.segment, finishProcessingFn = _ref2.finishProcessingFn;
  104613. return function(error, request) {
  104614. var errorObj = handleErrors(error, request);
  104615. if (errorObj) {
  104616. return finishProcessingFn(errorObj, segment);
  104617. }
  104618. var bytes = new Uint8Array(request.response);
  104619. if (segment.map.key) {
  104620. segment.map.encryptedBytes = bytes;
  104621. return finishProcessingFn(null, segment);
  104622. }
  104623. segment.map.bytes = bytes;
  104624. parseInitSegment(segment, function(parseError) {
  104625. if (parseError) {
  104626. parseError.xhr = request;
  104627. parseError.status = request.status;
  104628. return finishProcessingFn(parseError, segment);
  104629. }
  104630. finishProcessingFn(null, segment);
  104631. });
  104632. };
  104633. };
  104634. var handleSegmentResponse = function handleSegmentResponse2(_ref3) {
  104635. var segment = _ref3.segment, finishProcessingFn = _ref3.finishProcessingFn, responseType = _ref3.responseType;
  104636. return function(error, request) {
  104637. var errorObj = handleErrors(error, request);
  104638. if (errorObj) {
  104639. return finishProcessingFn(errorObj, segment);
  104640. }
  104641. var newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));
  104642. segment.stats = getRequestStats(request);
  104643. if (segment.key) {
  104644. segment.encryptedBytes = new Uint8Array(newBytes);
  104645. } else {
  104646. segment.bytes = new Uint8Array(newBytes);
  104647. }
  104648. return finishProcessingFn(null, segment);
  104649. };
  104650. };
  104651. var transmuxAndNotify = function transmuxAndNotify2(_ref4) {
  104652. var segment = _ref4.segment, bytes = _ref4.bytes, trackInfoFn = _ref4.trackInfoFn, timingInfoFn = _ref4.timingInfoFn, videoSegmentTimingInfoFn = _ref4.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref4.audioSegmentTimingInfoFn, id3Fn = _ref4.id3Fn, captionsFn = _ref4.captionsFn, isEndOfTimeline = _ref4.isEndOfTimeline, endedTimelineFn = _ref4.endedTimelineFn, dataFn = _ref4.dataFn, doneFn = _ref4.doneFn, onTransmuxerLog = _ref4.onTransmuxerLog;
  104653. var fmp4Tracks = segment.map && segment.map.tracks || {};
  104654. var isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  104655. var audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  104656. var audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  104657. var videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  104658. var videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  104659. var finish = function finish2() {
  104660. return transmux({
  104661. bytes,
  104662. transmuxer: segment.transmuxer,
  104663. audioAppendStart: segment.audioAppendStart,
  104664. gopsToAlignWith: segment.gopsToAlignWith,
  104665. remux: isMuxed3,
  104666. onData: function onData(result) {
  104667. result.type = result.type === "combined" ? "video" : result.type;
  104668. dataFn(segment, result);
  104669. },
  104670. onTrackInfo: function onTrackInfo(trackInfo) {
  104671. if (trackInfoFn) {
  104672. if (isMuxed3) {
  104673. trackInfo.isMuxed = true;
  104674. }
  104675. trackInfoFn(segment, trackInfo);
  104676. }
  104677. },
  104678. onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) {
  104679. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  104680. audioStartFn(audioTimingInfo.start);
  104681. audioStartFn = null;
  104682. }
  104683. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  104684. audioEndFn(audioTimingInfo.end);
  104685. }
  104686. },
  104687. onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) {
  104688. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  104689. videoStartFn(videoTimingInfo.start);
  104690. videoStartFn = null;
  104691. }
  104692. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  104693. videoEndFn(videoTimingInfo.end);
  104694. }
  104695. },
  104696. onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) {
  104697. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  104698. },
  104699. onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) {
  104700. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  104701. },
  104702. onId3: function onId3(id3Frames, dispatchType) {
  104703. id3Fn(segment, id3Frames, dispatchType);
  104704. },
  104705. onCaptions: function onCaptions(captions) {
  104706. captionsFn(segment, [captions]);
  104707. },
  104708. isEndOfTimeline,
  104709. onEndedTimeline: function onEndedTimeline() {
  104710. endedTimelineFn();
  104711. },
  104712. onTransmuxerLog,
  104713. onDone: function onDone(result) {
  104714. if (!doneFn) {
  104715. return;
  104716. }
  104717. result.type = result.type === "combined" ? "video" : result.type;
  104718. doneFn(null, segment, result);
  104719. }
  104720. });
  104721. };
  104722. workerCallback({
  104723. action: "probeTs",
  104724. transmuxer: segment.transmuxer,
  104725. data: bytes,
  104726. baseStartTime: segment.baseStartTime,
  104727. callback: function callback2(data) {
  104728. segment.bytes = bytes = data.data;
  104729. var probeResult = data.result;
  104730. if (probeResult) {
  104731. trackInfoFn(segment, {
  104732. hasAudio: probeResult.hasAudio,
  104733. hasVideo: probeResult.hasVideo,
  104734. isMuxed: isMuxed3
  104735. });
  104736. trackInfoFn = null;
  104737. if (probeResult.hasAudio && !isMuxed3) {
  104738. audioStartFn(probeResult.audioStart);
  104739. }
  104740. if (probeResult.hasVideo) {
  104741. videoStartFn(probeResult.videoStart);
  104742. }
  104743. audioStartFn = null;
  104744. videoStartFn = null;
  104745. }
  104746. finish();
  104747. }
  104748. });
  104749. };
  104750. var handleSegmentBytes = function handleSegmentBytes2(_ref5) {
  104751. var segment = _ref5.segment, bytes = _ref5.bytes, trackInfoFn = _ref5.trackInfoFn, timingInfoFn = _ref5.timingInfoFn, videoSegmentTimingInfoFn = _ref5.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref5.audioSegmentTimingInfoFn, id3Fn = _ref5.id3Fn, captionsFn = _ref5.captionsFn, isEndOfTimeline = _ref5.isEndOfTimeline, endedTimelineFn = _ref5.endedTimelineFn, dataFn = _ref5.dataFn, doneFn = _ref5.doneFn, onTransmuxerLog = _ref5.onTransmuxerLog;
  104752. var bytesAsUint8Array = new Uint8Array(bytes);
  104753. if (isLikelyFmp4MediaSegment2(bytesAsUint8Array)) {
  104754. segment.isFmp4 = true;
  104755. var tracks = segment.map.tracks;
  104756. var trackInfo = {
  104757. isFmp4: true,
  104758. hasVideo: !!tracks.video,
  104759. hasAudio: !!tracks.audio
  104760. };
  104761. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  104762. trackInfo.audioCodec = tracks.audio.codec;
  104763. }
  104764. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  104765. trackInfo.videoCodec = tracks.video.codec;
  104766. }
  104767. if (tracks.video && tracks.audio) {
  104768. trackInfo.isMuxed = true;
  104769. }
  104770. trackInfoFn(segment, trackInfo);
  104771. var finishLoading = function finishLoading2(captions) {
  104772. dataFn(segment, {
  104773. data: bytesAsUint8Array,
  104774. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  104775. });
  104776. if (captions && captions.length) {
  104777. captionsFn(segment, captions);
  104778. }
  104779. doneFn(null, segment, {});
  104780. };
  104781. workerCallback({
  104782. action: "probeMp4StartTime",
  104783. timescales: segment.map.timescales,
  104784. data: bytesAsUint8Array,
  104785. transmuxer: segment.transmuxer,
  104786. callback: function callback2(_ref6) {
  104787. var data = _ref6.data, startTime = _ref6.startTime;
  104788. bytes = data.buffer;
  104789. segment.bytes = bytesAsUint8Array = data;
  104790. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  104791. timingInfoFn(segment, "audio", "start", startTime);
  104792. }
  104793. if (trackInfo.hasVideo) {
  104794. timingInfoFn(segment, "video", "start", startTime);
  104795. }
  104796. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  104797. finishLoading();
  104798. return;
  104799. }
  104800. workerCallback({
  104801. action: "pushMp4Captions",
  104802. endAction: "mp4Captions",
  104803. transmuxer: segment.transmuxer,
  104804. data: bytesAsUint8Array,
  104805. timescales: segment.map.timescales,
  104806. trackIds: [tracks.video.id],
  104807. callback: function callback3(message) {
  104808. bytes = message.data.buffer;
  104809. segment.bytes = bytesAsUint8Array = message.data;
  104810. message.logs.forEach(function(log2) {
  104811. onTransmuxerLog(videojs.mergeOptions(log2, {
  104812. stream: "mp4CaptionParser"
  104813. }));
  104814. });
  104815. finishLoading(message.captions);
  104816. }
  104817. });
  104818. }
  104819. });
  104820. return;
  104821. }
  104822. if (!segment.transmuxer) {
  104823. doneFn(null, segment, {});
  104824. return;
  104825. }
  104826. if (typeof segment.container === "undefined") {
  104827. segment.container = detectContainerForBytes2(bytesAsUint8Array);
  104828. }
  104829. if (segment.container !== "ts" && segment.container !== "aac") {
  104830. trackInfoFn(segment, {
  104831. hasAudio: false,
  104832. hasVideo: false
  104833. });
  104834. doneFn(null, segment, {});
  104835. return;
  104836. }
  104837. transmuxAndNotify({
  104838. segment,
  104839. bytes,
  104840. trackInfoFn,
  104841. timingInfoFn,
  104842. videoSegmentTimingInfoFn,
  104843. audioSegmentTimingInfoFn,
  104844. id3Fn,
  104845. captionsFn,
  104846. isEndOfTimeline,
  104847. endedTimelineFn,
  104848. dataFn,
  104849. doneFn,
  104850. onTransmuxerLog
  104851. });
  104852. };
  104853. var decrypt = function decrypt2(_ref7, callback2) {
  104854. var id = _ref7.id, key = _ref7.key, encryptedBytes = _ref7.encryptedBytes, decryptionWorker = _ref7.decryptionWorker;
  104855. var decryptionHandler = function decryptionHandler2(event2) {
  104856. if (event2.data.source === id) {
  104857. decryptionWorker.removeEventListener("message", decryptionHandler2);
  104858. var decrypted = event2.data.decrypted;
  104859. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  104860. }
  104861. };
  104862. decryptionWorker.addEventListener("message", decryptionHandler);
  104863. var keyBytes;
  104864. if (key.bytes.slice) {
  104865. keyBytes = key.bytes.slice();
  104866. } else {
  104867. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  104868. }
  104869. decryptionWorker.postMessage(createTransferableMessage({
  104870. source: id,
  104871. encrypted: encryptedBytes,
  104872. key: keyBytes,
  104873. iv: key.iv
  104874. }), [encryptedBytes.buffer, keyBytes.buffer]);
  104875. };
  104876. var decryptSegment = function decryptSegment2(_ref8) {
  104877. var decryptionWorker = _ref8.decryptionWorker, segment = _ref8.segment, trackInfoFn = _ref8.trackInfoFn, timingInfoFn = _ref8.timingInfoFn, videoSegmentTimingInfoFn = _ref8.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref8.audioSegmentTimingInfoFn, id3Fn = _ref8.id3Fn, captionsFn = _ref8.captionsFn, isEndOfTimeline = _ref8.isEndOfTimeline, endedTimelineFn = _ref8.endedTimelineFn, dataFn = _ref8.dataFn, doneFn = _ref8.doneFn, onTransmuxerLog = _ref8.onTransmuxerLog;
  104878. decrypt({
  104879. id: segment.requestId,
  104880. key: segment.key,
  104881. encryptedBytes: segment.encryptedBytes,
  104882. decryptionWorker
  104883. }, function(decryptedBytes) {
  104884. segment.bytes = decryptedBytes;
  104885. handleSegmentBytes({
  104886. segment,
  104887. bytes: segment.bytes,
  104888. trackInfoFn,
  104889. timingInfoFn,
  104890. videoSegmentTimingInfoFn,
  104891. audioSegmentTimingInfoFn,
  104892. id3Fn,
  104893. captionsFn,
  104894. isEndOfTimeline,
  104895. endedTimelineFn,
  104896. dataFn,
  104897. doneFn,
  104898. onTransmuxerLog
  104899. });
  104900. });
  104901. };
  104902. var waitForCompletion = function waitForCompletion2(_ref9) {
  104903. var activeXhrs = _ref9.activeXhrs, decryptionWorker = _ref9.decryptionWorker, trackInfoFn = _ref9.trackInfoFn, timingInfoFn = _ref9.timingInfoFn, videoSegmentTimingInfoFn = _ref9.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref9.audioSegmentTimingInfoFn, id3Fn = _ref9.id3Fn, captionsFn = _ref9.captionsFn, isEndOfTimeline = _ref9.isEndOfTimeline, endedTimelineFn = _ref9.endedTimelineFn, dataFn = _ref9.dataFn, doneFn = _ref9.doneFn, onTransmuxerLog = _ref9.onTransmuxerLog;
  104904. var count = 0;
  104905. var didError = false;
  104906. return function(error, segment) {
  104907. if (didError) {
  104908. return;
  104909. }
  104910. if (error) {
  104911. didError = true;
  104912. abortAll(activeXhrs);
  104913. return doneFn(error, segment);
  104914. }
  104915. count += 1;
  104916. if (count === activeXhrs.length) {
  104917. var segmentFinish = function segmentFinish2() {
  104918. if (segment.encryptedBytes) {
  104919. return decryptSegment({
  104920. decryptionWorker,
  104921. segment,
  104922. trackInfoFn,
  104923. timingInfoFn,
  104924. videoSegmentTimingInfoFn,
  104925. audioSegmentTimingInfoFn,
  104926. id3Fn,
  104927. captionsFn,
  104928. isEndOfTimeline,
  104929. endedTimelineFn,
  104930. dataFn,
  104931. doneFn,
  104932. onTransmuxerLog
  104933. });
  104934. }
  104935. handleSegmentBytes({
  104936. segment,
  104937. bytes: segment.bytes,
  104938. trackInfoFn,
  104939. timingInfoFn,
  104940. videoSegmentTimingInfoFn,
  104941. audioSegmentTimingInfoFn,
  104942. id3Fn,
  104943. captionsFn,
  104944. isEndOfTimeline,
  104945. endedTimelineFn,
  104946. dataFn,
  104947. doneFn,
  104948. onTransmuxerLog
  104949. });
  104950. };
  104951. segment.endOfAllRequests = Date.now();
  104952. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  104953. return decrypt({
  104954. decryptionWorker,
  104955. id: segment.requestId + "-init",
  104956. encryptedBytes: segment.map.encryptedBytes,
  104957. key: segment.map.key
  104958. }, function(decryptedBytes) {
  104959. segment.map.bytes = decryptedBytes;
  104960. parseInitSegment(segment, function(parseError) {
  104961. if (parseError) {
  104962. abortAll(activeXhrs);
  104963. return doneFn(parseError, segment);
  104964. }
  104965. segmentFinish();
  104966. });
  104967. });
  104968. }
  104969. segmentFinish();
  104970. }
  104971. };
  104972. };
  104973. var handleLoadEnd = function handleLoadEnd2(_ref10) {
  104974. var loadendState = _ref10.loadendState, abortFn = _ref10.abortFn;
  104975. return function(event2) {
  104976. var request = event2.target;
  104977. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  104978. abortFn();
  104979. loadendState.calledAbortFn = true;
  104980. }
  104981. };
  104982. };
  104983. var handleProgress = function handleProgress2(_ref11) {
  104984. var segment = _ref11.segment, progressFn = _ref11.progressFn;
  104985. _ref11.trackInfoFn;
  104986. _ref11.timingInfoFn;
  104987. _ref11.videoSegmentTimingInfoFn;
  104988. _ref11.audioSegmentTimingInfoFn;
  104989. _ref11.id3Fn;
  104990. _ref11.captionsFn;
  104991. _ref11.isEndOfTimeline;
  104992. _ref11.endedTimelineFn;
  104993. _ref11.dataFn;
  104994. return function(event2) {
  104995. var request = event2.target;
  104996. if (request.aborted) {
  104997. return;
  104998. }
  104999. segment.stats = videojs.mergeOptions(segment.stats, getProgressStats(event2));
  105000. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  105001. segment.stats.firstBytesReceivedAt = Date.now();
  105002. }
  105003. return progressFn(event2, segment);
  105004. };
  105005. };
  105006. var mediaSegmentRequest = function mediaSegmentRequest2(_ref12) {
  105007. var xhr = _ref12.xhr, xhrOptions = _ref12.xhrOptions, decryptionWorker = _ref12.decryptionWorker, segment = _ref12.segment, abortFn = _ref12.abortFn, progressFn = _ref12.progressFn, trackInfoFn = _ref12.trackInfoFn, timingInfoFn = _ref12.timingInfoFn, videoSegmentTimingInfoFn = _ref12.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref12.audioSegmentTimingInfoFn, id3Fn = _ref12.id3Fn, captionsFn = _ref12.captionsFn, isEndOfTimeline = _ref12.isEndOfTimeline, endedTimelineFn = _ref12.endedTimelineFn, dataFn = _ref12.dataFn, doneFn = _ref12.doneFn, onTransmuxerLog = _ref12.onTransmuxerLog;
  105008. var activeXhrs = [];
  105009. var finishProcessingFn = waitForCompletion({
  105010. activeXhrs,
  105011. decryptionWorker,
  105012. trackInfoFn,
  105013. timingInfoFn,
  105014. videoSegmentTimingInfoFn,
  105015. audioSegmentTimingInfoFn,
  105016. id3Fn,
  105017. captionsFn,
  105018. isEndOfTimeline,
  105019. endedTimelineFn,
  105020. dataFn,
  105021. doneFn,
  105022. onTransmuxerLog
  105023. });
  105024. if (segment.key && !segment.key.bytes) {
  105025. var objects = [segment.key];
  105026. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  105027. objects.push(segment.map.key);
  105028. }
  105029. var keyRequestOptions = videojs.mergeOptions(xhrOptions, {
  105030. uri: segment.key.resolvedUri,
  105031. responseType: "arraybuffer"
  105032. });
  105033. var keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);
  105034. var keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  105035. activeXhrs.push(keyXhr);
  105036. }
  105037. if (segment.map && !segment.map.bytes) {
  105038. var differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  105039. if (differentMapKey) {
  105040. var mapKeyRequestOptions = videojs.mergeOptions(xhrOptions, {
  105041. uri: segment.map.key.resolvedUri,
  105042. responseType: "arraybuffer"
  105043. });
  105044. var mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);
  105045. var mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  105046. activeXhrs.push(mapKeyXhr);
  105047. }
  105048. var initSegmentOptions = videojs.mergeOptions(xhrOptions, {
  105049. uri: segment.map.resolvedUri,
  105050. responseType: "arraybuffer",
  105051. headers: segmentXhrHeaders(segment.map)
  105052. });
  105053. var initSegmentRequestCallback = handleInitSegmentResponse({
  105054. segment,
  105055. finishProcessingFn
  105056. });
  105057. var initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  105058. activeXhrs.push(initSegmentXhr);
  105059. }
  105060. var segmentRequestOptions = videojs.mergeOptions(xhrOptions, {
  105061. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  105062. responseType: "arraybuffer",
  105063. headers: segmentXhrHeaders(segment)
  105064. });
  105065. var segmentRequestCallback = handleSegmentResponse({
  105066. segment,
  105067. finishProcessingFn,
  105068. responseType: segmentRequestOptions.responseType
  105069. });
  105070. var segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  105071. segmentXhr.addEventListener("progress", handleProgress({
  105072. segment,
  105073. progressFn,
  105074. trackInfoFn,
  105075. timingInfoFn,
  105076. videoSegmentTimingInfoFn,
  105077. audioSegmentTimingInfoFn,
  105078. id3Fn,
  105079. captionsFn,
  105080. isEndOfTimeline,
  105081. endedTimelineFn,
  105082. dataFn
  105083. }));
  105084. activeXhrs.push(segmentXhr);
  105085. var loadendState = {};
  105086. activeXhrs.forEach(function(activeXhr) {
  105087. activeXhr.addEventListener("loadend", handleLoadEnd({
  105088. loadendState,
  105089. abortFn
  105090. }));
  105091. });
  105092. return function() {
  105093. return abortAll(activeXhrs);
  105094. };
  105095. };
  105096. var logFn$1 = logger("CodecUtils");
  105097. var getCodecs = function getCodecs2(media) {
  105098. var mediaAttributes = media.attributes || {};
  105099. if (mediaAttributes.CODECS) {
  105100. return parseCodecs2(mediaAttributes.CODECS);
  105101. }
  105102. };
  105103. var isMaat = function isMaat2(master, media) {
  105104. var mediaAttributes = media.attributes || {};
  105105. return master && master.mediaGroups && master.mediaGroups.AUDIO && mediaAttributes.AUDIO && master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105106. };
  105107. var isMuxed = function isMuxed2(master, media) {
  105108. if (!isMaat(master, media)) {
  105109. return true;
  105110. }
  105111. var mediaAttributes = media.attributes || {};
  105112. var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105113. for (var groupId in audioGroup) {
  105114. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  105115. return true;
  105116. }
  105117. }
  105118. return false;
  105119. };
  105120. var unwrapCodecList = function unwrapCodecList2(codecList) {
  105121. var codecs = {};
  105122. codecList.forEach(function(_ref) {
  105123. var mediaType = _ref.mediaType, type2 = _ref.type, details = _ref.details;
  105124. codecs[mediaType] = codecs[mediaType] || [];
  105125. codecs[mediaType].push(translateLegacyCodec2("" + type2 + details));
  105126. });
  105127. Object.keys(codecs).forEach(function(mediaType) {
  105128. if (codecs[mediaType].length > 1) {
  105129. logFn$1("multiple " + mediaType + " codecs found as attributes: " + codecs[mediaType].join(", ") + ". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.");
  105130. codecs[mediaType] = null;
  105131. return;
  105132. }
  105133. codecs[mediaType] = codecs[mediaType][0];
  105134. });
  105135. return codecs;
  105136. };
  105137. var codecCount = function codecCount2(codecObj) {
  105138. var count = 0;
  105139. if (codecObj.audio) {
  105140. count++;
  105141. }
  105142. if (codecObj.video) {
  105143. count++;
  105144. }
  105145. return count;
  105146. };
  105147. var codecsForPlaylist = function codecsForPlaylist2(master, media) {
  105148. var mediaAttributes = media.attributes || {};
  105149. var codecInfo = unwrapCodecList(getCodecs(media) || []);
  105150. if (isMaat(master, media) && !codecInfo.audio) {
  105151. if (!isMuxed(master, media)) {
  105152. var defaultCodecs = unwrapCodecList(codecsFromDefault2(master, mediaAttributes.AUDIO) || []);
  105153. if (defaultCodecs.audio) {
  105154. codecInfo.audio = defaultCodecs.audio;
  105155. }
  105156. }
  105157. }
  105158. return codecInfo;
  105159. };
  105160. var logFn = logger("PlaylistSelector");
  105161. var representationToString = function representationToString2(representation) {
  105162. if (!representation || !representation.playlist) {
  105163. return;
  105164. }
  105165. var playlist = representation.playlist;
  105166. return JSON.stringify({
  105167. id: playlist.id,
  105168. bandwidth: representation.bandwidth,
  105169. width: representation.width,
  105170. height: representation.height,
  105171. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  105172. });
  105173. };
  105174. var safeGetComputedStyle = function safeGetComputedStyle2(el, property) {
  105175. if (!el) {
  105176. return "";
  105177. }
  105178. var result = window_1.getComputedStyle(el);
  105179. if (!result) {
  105180. return "";
  105181. }
  105182. return result[property];
  105183. };
  105184. var stableSort = function stableSort2(array, sortFn) {
  105185. var newArray = array.slice();
  105186. array.sort(function(left, right) {
  105187. var cmp = sortFn(left, right);
  105188. if (cmp === 0) {
  105189. return newArray.indexOf(left) - newArray.indexOf(right);
  105190. }
  105191. return cmp;
  105192. });
  105193. };
  105194. var comparePlaylistBandwidth = function comparePlaylistBandwidth2(left, right) {
  105195. var leftBandwidth;
  105196. var rightBandwidth;
  105197. if (left.attributes.BANDWIDTH) {
  105198. leftBandwidth = left.attributes.BANDWIDTH;
  105199. }
  105200. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  105201. if (right.attributes.BANDWIDTH) {
  105202. rightBandwidth = right.attributes.BANDWIDTH;
  105203. }
  105204. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  105205. return leftBandwidth - rightBandwidth;
  105206. };
  105207. var comparePlaylistResolution = function comparePlaylistResolution2(left, right) {
  105208. var leftWidth;
  105209. var rightWidth;
  105210. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  105211. leftWidth = left.attributes.RESOLUTION.width;
  105212. }
  105213. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  105214. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  105215. rightWidth = right.attributes.RESOLUTION.width;
  105216. }
  105217. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  105218. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  105219. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  105220. }
  105221. return leftWidth - rightWidth;
  105222. };
  105223. var simpleSelector = function simpleSelector2(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, masterPlaylistController) {
  105224. if (!master) {
  105225. return;
  105226. }
  105227. var options2 = {
  105228. bandwidth: playerBandwidth,
  105229. width: playerWidth,
  105230. height: playerHeight,
  105231. limitRenditionByPlayerDimensions
  105232. };
  105233. var playlists = master.playlists;
  105234. if (Playlist.isAudioOnly(master)) {
  105235. playlists = masterPlaylistController.getAudioTrackPlaylists_();
  105236. options2.audioOnly = true;
  105237. }
  105238. var sortedPlaylistReps = playlists.map(function(playlist) {
  105239. var bandwidth2;
  105240. var width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  105241. var height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  105242. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  105243. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  105244. return {
  105245. bandwidth: bandwidth2,
  105246. width: width2,
  105247. height: height2,
  105248. playlist
  105249. };
  105250. });
  105251. stableSort(sortedPlaylistReps, function(left, right) {
  105252. return left.bandwidth - right.bandwidth;
  105253. });
  105254. sortedPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105255. return !Playlist.isIncompatible(rep2.playlist);
  105256. });
  105257. var enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105258. return Playlist.isEnabled(rep2.playlist);
  105259. });
  105260. if (!enabledPlaylistReps.length) {
  105261. enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105262. return !Playlist.isDisabled(rep2.playlist);
  105263. });
  105264. }
  105265. var bandwidthPlaylistReps = enabledPlaylistReps.filter(function(rep2) {
  105266. return rep2.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;
  105267. });
  105268. var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  105269. var bandwidthBestRep = bandwidthPlaylistReps.filter(function(rep2) {
  105270. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105271. })[0];
  105272. if (limitRenditionByPlayerDimensions === false) {
  105273. var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105274. if (_chosenRep && _chosenRep.playlist) {
  105275. var type2 = "sortedPlaylistReps";
  105276. if (bandwidthBestRep) {
  105277. type2 = "bandwidthBestRep";
  105278. }
  105279. if (enabledPlaylistReps[0]) {
  105280. type2 = "enabledPlaylistReps";
  105281. }
  105282. logFn("choosing " + representationToString(_chosenRep) + " using " + type2 + " with options", options2);
  105283. return _chosenRep.playlist;
  105284. }
  105285. logFn("could not choose a playlist with options", options2);
  105286. return null;
  105287. }
  105288. var haveResolution = bandwidthPlaylistReps.filter(function(rep2) {
  105289. return rep2.width && rep2.height;
  105290. });
  105291. stableSort(haveResolution, function(left, right) {
  105292. return left.width - right.width;
  105293. });
  105294. var resolutionBestRepList = haveResolution.filter(function(rep2) {
  105295. return rep2.width === playerWidth && rep2.height === playerHeight;
  105296. });
  105297. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  105298. var resolutionBestRep = resolutionBestRepList.filter(function(rep2) {
  105299. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105300. })[0];
  105301. var resolutionPlusOneList;
  105302. var resolutionPlusOneSmallest;
  105303. var resolutionPlusOneRep;
  105304. if (!resolutionBestRep) {
  105305. resolutionPlusOneList = haveResolution.filter(function(rep2) {
  105306. return rep2.width > playerWidth || rep2.height > playerHeight;
  105307. });
  105308. resolutionPlusOneSmallest = resolutionPlusOneList.filter(function(rep2) {
  105309. return rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height;
  105310. });
  105311. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  105312. resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function(rep2) {
  105313. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105314. })[0];
  105315. }
  105316. var leastPixelDiffRep;
  105317. if (masterPlaylistController.experimentalLeastPixelDiffSelector) {
  105318. var leastPixelDiffList = haveResolution.map(function(rep2) {
  105319. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  105320. return rep2;
  105321. });
  105322. stableSort(leastPixelDiffList, function(left, right) {
  105323. if (left.pixelDiff === right.pixelDiff) {
  105324. return right.bandwidth - left.bandwidth;
  105325. }
  105326. return left.pixelDiff - right.pixelDiff;
  105327. });
  105328. leastPixelDiffRep = leastPixelDiffList[0];
  105329. }
  105330. var chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105331. if (chosenRep && chosenRep.playlist) {
  105332. var _type = "sortedPlaylistReps";
  105333. if (leastPixelDiffRep) {
  105334. _type = "leastPixelDiffRep";
  105335. } else if (resolutionPlusOneRep) {
  105336. _type = "resolutionPlusOneRep";
  105337. } else if (resolutionBestRep) {
  105338. _type = "resolutionBestRep";
  105339. } else if (bandwidthBestRep) {
  105340. _type = "bandwidthBestRep";
  105341. } else if (enabledPlaylistReps[0]) {
  105342. _type = "enabledPlaylistReps";
  105343. }
  105344. logFn("choosing " + representationToString(chosenRep) + " using " + _type + " with options", options2);
  105345. return chosenRep.playlist;
  105346. }
  105347. logFn("could not choose a playlist with options", options2);
  105348. return null;
  105349. };
  105350. var lastBandwidthSelector = function lastBandwidthSelector2() {
  105351. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105352. return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105353. };
  105354. var movingAverageBandwidthSelector = function movingAverageBandwidthSelector2(decay) {
  105355. var average = -1;
  105356. var lastSystemBandwidth = -1;
  105357. if (decay < 0 || decay > 1) {
  105358. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  105359. }
  105360. return function() {
  105361. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105362. if (average < 0) {
  105363. average = this.systemBandwidth;
  105364. lastSystemBandwidth = this.systemBandwidth;
  105365. }
  105366. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  105367. average = decay * this.systemBandwidth + (1 - decay) * average;
  105368. lastSystemBandwidth = this.systemBandwidth;
  105369. }
  105370. return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105371. };
  105372. };
  105373. var minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector2(settings) {
  105374. var master = settings.master, currentTime = settings.currentTime, bandwidth2 = settings.bandwidth, duration5 = settings.duration, segmentDuration = settings.segmentDuration, timeUntilRebuffer3 = settings.timeUntilRebuffer, currentTimeline = settings.currentTimeline, syncController = settings.syncController;
  105375. var compatiblePlaylists = master.playlists.filter(function(playlist) {
  105376. return !Playlist.isIncompatible(playlist);
  105377. });
  105378. var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);
  105379. if (!enabledPlaylists.length) {
  105380. enabledPlaylists = compatiblePlaylists.filter(function(playlist) {
  105381. return !Playlist.isDisabled(playlist);
  105382. });
  105383. }
  105384. var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, "BANDWIDTH"));
  105385. var rebufferingEstimates = bandwidthPlaylists.map(function(playlist) {
  105386. var syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  105387. var numRequests = syncPoint ? 1 : 2;
  105388. var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  105389. var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  105390. return {
  105391. playlist,
  105392. rebufferingImpact
  105393. };
  105394. });
  105395. var noRebufferingPlaylists = rebufferingEstimates.filter(function(estimate) {
  105396. return estimate.rebufferingImpact <= 0;
  105397. });
  105398. stableSort(noRebufferingPlaylists, function(a, b) {
  105399. return comparePlaylistBandwidth(b.playlist, a.playlist);
  105400. });
  105401. if (noRebufferingPlaylists.length) {
  105402. return noRebufferingPlaylists[0];
  105403. }
  105404. stableSort(rebufferingEstimates, function(a, b) {
  105405. return a.rebufferingImpact - b.rebufferingImpact;
  105406. });
  105407. return rebufferingEstimates[0] || null;
  105408. };
  105409. var lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector2() {
  105410. var _this = this;
  105411. var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled);
  105412. stableSort(playlists, function(a, b) {
  105413. return comparePlaylistBandwidth(a, b);
  105414. });
  105415. var playlistsWithVideo = playlists.filter(function(playlist) {
  105416. return !!codecsForPlaylist(_this.playlists.master, playlist).video;
  105417. });
  105418. return playlistsWithVideo[0] || null;
  105419. };
  105420. var concatSegments = function concatSegments2(segmentObj) {
  105421. var offset = 0;
  105422. var tempBuffer;
  105423. if (segmentObj.bytes) {
  105424. tempBuffer = new Uint8Array(segmentObj.bytes);
  105425. segmentObj.segments.forEach(function(segment) {
  105426. tempBuffer.set(segment, offset);
  105427. offset += segment.byteLength;
  105428. });
  105429. }
  105430. return tempBuffer;
  105431. };
  105432. var createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists2(inbandTextTracks, tech, captionStream) {
  105433. if (!inbandTextTracks[captionStream]) {
  105434. tech.trigger({
  105435. type: "usage",
  105436. name: "vhs-608"
  105437. });
  105438. tech.trigger({
  105439. type: "usage",
  105440. name: "hls-608"
  105441. });
  105442. var instreamId = captionStream;
  105443. if (/^cc708_/.test(captionStream)) {
  105444. instreamId = "SERVICE" + captionStream.split("_")[1];
  105445. }
  105446. var track = tech.textTracks().getTrackById(instreamId);
  105447. if (track) {
  105448. inbandTextTracks[captionStream] = track;
  105449. } else {
  105450. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  105451. var label2 = captionStream;
  105452. var language = captionStream;
  105453. var def = false;
  105454. var captionService = captionServices[instreamId];
  105455. if (captionService) {
  105456. label2 = captionService.label;
  105457. language = captionService.language;
  105458. def = captionService["default"];
  105459. }
  105460. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  105461. kind: "captions",
  105462. id: instreamId,
  105463. "default": def,
  105464. label: label2,
  105465. language
  105466. }, false).track;
  105467. }
  105468. }
  105469. };
  105470. var addCaptionData = function addCaptionData2(_ref) {
  105471. var inbandTextTracks = _ref.inbandTextTracks, captionArray = _ref.captionArray, timestampOffset2 = _ref.timestampOffset;
  105472. if (!captionArray) {
  105473. return;
  105474. }
  105475. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105476. captionArray.forEach(function(caption) {
  105477. var track = caption.stream;
  105478. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  105479. });
  105480. };
  105481. var deprecateOldCue = function deprecateOldCue2(cue) {
  105482. Object.defineProperties(cue.frame, {
  105483. id: {
  105484. get: function get7() {
  105485. videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  105486. return cue.value.key;
  105487. }
  105488. },
  105489. value: {
  105490. get: function get7() {
  105491. videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  105492. return cue.value.data;
  105493. }
  105494. },
  105495. privateData: {
  105496. get: function get7() {
  105497. videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  105498. return cue.value.data;
  105499. }
  105500. }
  105501. });
  105502. };
  105503. var addMetadata = function addMetadata2(_ref2) {
  105504. var inbandTextTracks = _ref2.inbandTextTracks, metadataArray = _ref2.metadataArray, timestampOffset2 = _ref2.timestampOffset, videoDuration = _ref2.videoDuration;
  105505. if (!metadataArray) {
  105506. return;
  105507. }
  105508. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105509. var metadataTrack = inbandTextTracks.metadataTrack_;
  105510. if (!metadataTrack) {
  105511. return;
  105512. }
  105513. metadataArray.forEach(function(metadata) {
  105514. var time = metadata.cueTime + timestampOffset2;
  105515. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  105516. return;
  105517. }
  105518. metadata.frames.forEach(function(frame) {
  105519. var cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  105520. cue.frame = frame;
  105521. cue.value = frame;
  105522. deprecateOldCue(cue);
  105523. metadataTrack.addCue(cue);
  105524. });
  105525. });
  105526. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  105527. return;
  105528. }
  105529. var cues = metadataTrack.cues;
  105530. var cuesArray = [];
  105531. for (var i2 = 0; i2 < cues.length; i2++) {
  105532. if (cues[i2]) {
  105533. cuesArray.push(cues[i2]);
  105534. }
  105535. }
  105536. var cuesGroupedByStartTime = cuesArray.reduce(function(obj, cue) {
  105537. var timeSlot = obj[cue.startTime] || [];
  105538. timeSlot.push(cue);
  105539. obj[cue.startTime] = timeSlot;
  105540. return obj;
  105541. }, {});
  105542. var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function(a, b) {
  105543. return Number(a) - Number(b);
  105544. });
  105545. sortedStartTimes.forEach(function(startTime, idx) {
  105546. var cueGroup = cuesGroupedByStartTime[startTime];
  105547. var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  105548. cueGroup.forEach(function(cue) {
  105549. cue.endTime = nextTime;
  105550. });
  105551. });
  105552. };
  105553. var createMetadataTrackIfNotExists = function createMetadataTrackIfNotExists2(inbandTextTracks, dispatchType, tech) {
  105554. if (inbandTextTracks.metadataTrack_) {
  105555. return;
  105556. }
  105557. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  105558. kind: "metadata",
  105559. label: "Timed Metadata"
  105560. }, false).track;
  105561. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  105562. };
  105563. var removeCuesFromTrack = function removeCuesFromTrack2(start2, end, track) {
  105564. var i2;
  105565. var cue;
  105566. if (!track) {
  105567. return;
  105568. }
  105569. if (!track.cues) {
  105570. return;
  105571. }
  105572. i2 = track.cues.length;
  105573. while (i2--) {
  105574. cue = track.cues[i2];
  105575. if (cue.startTime >= start2 && cue.endTime <= end) {
  105576. track.removeCue(cue);
  105577. }
  105578. }
  105579. };
  105580. var removeDuplicateCuesFromTrack = function removeDuplicateCuesFromTrack2(track) {
  105581. var cues = track.cues;
  105582. if (!cues) {
  105583. return;
  105584. }
  105585. for (var i2 = 0; i2 < cues.length; i2++) {
  105586. var duplicates = [];
  105587. var occurrences = 0;
  105588. for (var j = 0; j < cues.length; j++) {
  105589. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  105590. occurrences++;
  105591. if (occurrences > 1) {
  105592. duplicates.push(cues[j]);
  105593. }
  105594. }
  105595. }
  105596. if (duplicates.length) {
  105597. duplicates.forEach(function(dupe) {
  105598. return track.removeCue(dupe);
  105599. });
  105600. }
  105601. }
  105602. };
  105603. var gopsSafeToAlignWith = function gopsSafeToAlignWith2(buffer, currentTime, mapping) {
  105604. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  105605. return [];
  105606. }
  105607. var currentTimePts = Math.ceil((currentTime - mapping + 3) * clock.ONE_SECOND_IN_TS);
  105608. var i2;
  105609. for (i2 = 0; i2 < buffer.length; i2++) {
  105610. if (buffer[i2].pts > currentTimePts) {
  105611. break;
  105612. }
  105613. }
  105614. return buffer.slice(i2);
  105615. };
  105616. var updateGopBuffer = function updateGopBuffer2(buffer, gops, replace) {
  105617. if (!gops.length) {
  105618. return buffer;
  105619. }
  105620. if (replace) {
  105621. return gops.slice();
  105622. }
  105623. var start2 = gops[0].pts;
  105624. var i2 = 0;
  105625. for (i2; i2 < buffer.length; i2++) {
  105626. if (buffer[i2].pts >= start2) {
  105627. break;
  105628. }
  105629. }
  105630. return buffer.slice(0, i2).concat(gops);
  105631. };
  105632. var removeGopBuffer = function removeGopBuffer2(buffer, start2, end, mapping) {
  105633. var startPts = Math.ceil((start2 - mapping) * clock.ONE_SECOND_IN_TS);
  105634. var endPts = Math.ceil((end - mapping) * clock.ONE_SECOND_IN_TS);
  105635. var updatedBuffer = buffer.slice();
  105636. var i2 = buffer.length;
  105637. while (i2--) {
  105638. if (buffer[i2].pts <= endPts) {
  105639. break;
  105640. }
  105641. }
  105642. if (i2 === -1) {
  105643. return updatedBuffer;
  105644. }
  105645. var j = i2 + 1;
  105646. while (j--) {
  105647. if (buffer[j].pts <= startPts) {
  105648. break;
  105649. }
  105650. }
  105651. j = Math.max(j, 0);
  105652. updatedBuffer.splice(j, i2 - j + 1);
  105653. return updatedBuffer;
  105654. };
  105655. var shallowEqual = function shallowEqual2(a, b) {
  105656. if (!a && !b || !a && b || a && !b) {
  105657. return false;
  105658. }
  105659. if (a === b) {
  105660. return true;
  105661. }
  105662. var akeys = Object.keys(a).sort();
  105663. var bkeys = Object.keys(b).sort();
  105664. if (akeys.length !== bkeys.length) {
  105665. return false;
  105666. }
  105667. for (var i2 = 0; i2 < akeys.length; i2++) {
  105668. var key = akeys[i2];
  105669. if (key !== bkeys[i2]) {
  105670. return false;
  105671. }
  105672. if (a[key] !== b[key]) {
  105673. return false;
  105674. }
  105675. }
  105676. return true;
  105677. };
  105678. var QUOTA_EXCEEDED_ERR = 22;
  105679. var getSyncSegmentCandidate = function getSyncSegmentCandidate2(currentTimeline, segments, targetTime) {
  105680. segments = segments || [];
  105681. var timelineSegments = [];
  105682. var time = 0;
  105683. for (var i2 = 0; i2 < segments.length; i2++) {
  105684. var segment = segments[i2];
  105685. if (currentTimeline === segment.timeline) {
  105686. timelineSegments.push(i2);
  105687. time += segment.duration;
  105688. if (time > targetTime) {
  105689. return i2;
  105690. }
  105691. }
  105692. }
  105693. if (timelineSegments.length === 0) {
  105694. return 0;
  105695. }
  105696. return timelineSegments[timelineSegments.length - 1];
  105697. };
  105698. var MIN_BACK_BUFFER = 1;
  105699. var CHECK_BUFFER_DELAY = 500;
  105700. var finite = function finite2(num) {
  105701. return typeof num === "number" && isFinite(num);
  105702. };
  105703. var MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;
  105704. var illegalMediaSwitch = function illegalMediaSwitch2(loaderType, startingMedia, trackInfo) {
  105705. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  105706. return null;
  105707. }
  105708. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  105709. return "Neither audio nor video found in segment.";
  105710. }
  105711. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  105712. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  105713. }
  105714. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  105715. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  105716. }
  105717. return null;
  105718. };
  105719. var safeBackBufferTrimTime = function safeBackBufferTrimTime2(seekable3, currentTime, targetDuration) {
  105720. var trimTime = currentTime - Config.BACK_BUFFER_LENGTH;
  105721. if (seekable3.length) {
  105722. trimTime = Math.max(trimTime, seekable3.start(0));
  105723. }
  105724. var maxTrimTime = currentTime - targetDuration;
  105725. return Math.min(maxTrimTime, trimTime);
  105726. };
  105727. var segmentInfoString = function segmentInfoString2(segmentInfo) {
  105728. var startOfSegment = segmentInfo.startOfSegment, duration5 = segmentInfo.duration, segment = segmentInfo.segment, part = segmentInfo.part, _segmentInfo$playlist = segmentInfo.playlist, seq = _segmentInfo$playlist.mediaSequence, id = _segmentInfo$playlist.id, _segmentInfo$playlist2 = _segmentInfo$playlist.segments, segments = _segmentInfo$playlist2 === void 0 ? [] : _segmentInfo$playlist2, index2 = segmentInfo.mediaIndex, partIndex = segmentInfo.partIndex, timeline = segmentInfo.timeline;
  105729. var segmentLen = segments.length - 1;
  105730. var selection = "mediaIndex/partIndex increment";
  105731. if (segmentInfo.getMediaInfoForTime) {
  105732. selection = "getMediaInfoForTime (" + segmentInfo.getMediaInfoForTime + ")";
  105733. } else if (segmentInfo.isSyncRequest) {
  105734. selection = "getSyncSegmentCandidate (isSyncRequest)";
  105735. }
  105736. if (segmentInfo.independent) {
  105737. selection += " with independent " + segmentInfo.independent;
  105738. }
  105739. var hasPartIndex = typeof partIndex === "number";
  105740. var name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  105741. var zeroBasedPartCount = hasPartIndex ? getKnownPartCount({
  105742. preloadSegment: segment
  105743. }) - 1 : 0;
  105744. return name + " [" + (seq + index2) + "/" + (seq + segmentLen) + "]" + (hasPartIndex ? " part [" + partIndex + "/" + zeroBasedPartCount + "]" : "") + (" segment start/end [" + segment.start + " => " + segment.end + "]") + (hasPartIndex ? " part start/end [" + part.start + " => " + part.end + "]" : "") + (" startOfSegment [" + startOfSegment + "]") + (" duration [" + duration5 + "]") + (" timeline [" + timeline + "]") + (" selected by [" + selection + "]") + (" playlist [" + id + "]");
  105745. };
  105746. var timingInfoPropertyForMedia = function timingInfoPropertyForMedia2(mediaType) {
  105747. return mediaType + "TimingInfo";
  105748. };
  105749. var timestampOffsetForSegment = function timestampOffsetForSegment2(_ref) {
  105750. var segmentTimeline = _ref.segmentTimeline, currentTimeline = _ref.currentTimeline, startOfSegment = _ref.startOfSegment, buffered = _ref.buffered, overrideCheck = _ref.overrideCheck;
  105751. if (!overrideCheck && segmentTimeline === currentTimeline) {
  105752. return null;
  105753. }
  105754. if (segmentTimeline < currentTimeline) {
  105755. return startOfSegment;
  105756. }
  105757. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  105758. };
  105759. var shouldWaitForTimelineChange = function shouldWaitForTimelineChange2(_ref2) {
  105760. var timelineChangeController = _ref2.timelineChangeController, currentTimeline = _ref2.currentTimeline, segmentTimeline = _ref2.segmentTimeline, loaderType = _ref2.loaderType, audioDisabled = _ref2.audioDisabled;
  105761. if (currentTimeline === segmentTimeline) {
  105762. return false;
  105763. }
  105764. if (loaderType === "audio") {
  105765. var lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  105766. type: "main"
  105767. });
  105768. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  105769. }
  105770. if (loaderType === "main" && audioDisabled) {
  105771. var pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  105772. type: "audio"
  105773. });
  105774. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  105775. return false;
  105776. }
  105777. return true;
  105778. }
  105779. return false;
  105780. };
  105781. var mediaDuration = function mediaDuration2(timingInfos) {
  105782. var maxDuration = 0;
  105783. ["video", "audio"].forEach(function(type2) {
  105784. var typeTimingInfo = timingInfos[type2 + "TimingInfo"];
  105785. if (!typeTimingInfo) {
  105786. return;
  105787. }
  105788. var start2 = typeTimingInfo.start, end = typeTimingInfo.end;
  105789. var duration5;
  105790. if (typeof start2 === "bigint" || typeof end === "bigint") {
  105791. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  105792. } else if (typeof start2 === "number" && typeof end === "number") {
  105793. duration5 = end - start2;
  105794. }
  105795. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  105796. maxDuration = duration5;
  105797. }
  105798. });
  105799. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  105800. maxDuration = Number(maxDuration);
  105801. }
  105802. return maxDuration;
  105803. };
  105804. var segmentTooLong = function segmentTooLong2(_ref3) {
  105805. var segmentDuration = _ref3.segmentDuration, maxDuration = _ref3.maxDuration;
  105806. if (!segmentDuration) {
  105807. return false;
  105808. }
  105809. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;
  105810. };
  105811. var getTroublesomeSegmentDurationMessage = function getTroublesomeSegmentDurationMessage2(segmentInfo, sourceType) {
  105812. if (sourceType !== "hls") {
  105813. return null;
  105814. }
  105815. var segmentDuration = mediaDuration({
  105816. audioTimingInfo: segmentInfo.audioTimingInfo,
  105817. videoTimingInfo: segmentInfo.videoTimingInfo
  105818. });
  105819. if (!segmentDuration) {
  105820. return null;
  105821. }
  105822. var targetDuration = segmentInfo.playlist.targetDuration;
  105823. var isSegmentWayTooLong = segmentTooLong({
  105824. segmentDuration,
  105825. maxDuration: targetDuration * 2
  105826. });
  105827. var isSegmentSlightlyTooLong = segmentTooLong({
  105828. segmentDuration,
  105829. maxDuration: targetDuration
  105830. });
  105831. var segmentTooLongMessage = "Segment with index " + segmentInfo.mediaIndex + " " + ("from playlist " + segmentInfo.playlist.id + " ") + ("has a duration of " + segmentDuration + " ") + ("when the reported duration is " + segmentInfo.duration + " ") + ("and the target duration is " + targetDuration + ". ") + "For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";
  105832. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  105833. return {
  105834. severity: isSegmentWayTooLong ? "warn" : "info",
  105835. message: segmentTooLongMessage
  105836. };
  105837. }
  105838. return null;
  105839. };
  105840. var SegmentLoader = /* @__PURE__ */ function(_videojs$EventTarget) {
  105841. _inheritsLoose(SegmentLoader2, _videojs$EventTarget);
  105842. function SegmentLoader2(settings, options2) {
  105843. var _this;
  105844. _this = _videojs$EventTarget.call(this) || this;
  105845. if (!settings) {
  105846. throw new TypeError("Initialization settings are required");
  105847. }
  105848. if (typeof settings.currentTime !== "function") {
  105849. throw new TypeError("No currentTime getter specified");
  105850. }
  105851. if (!settings.mediaSource) {
  105852. throw new TypeError("No MediaSource specified");
  105853. }
  105854. _this.bandwidth = settings.bandwidth;
  105855. _this.throughput = {
  105856. rate: 0,
  105857. count: 0
  105858. };
  105859. _this.roundTrip = NaN;
  105860. _this.resetStats_();
  105861. _this.mediaIndex = null;
  105862. _this.partIndex = null;
  105863. _this.hasPlayed_ = settings.hasPlayed;
  105864. _this.currentTime_ = settings.currentTime;
  105865. _this.seekable_ = settings.seekable;
  105866. _this.seeking_ = settings.seeking;
  105867. _this.duration_ = settings.duration;
  105868. _this.mediaSource_ = settings.mediaSource;
  105869. _this.vhs_ = settings.vhs;
  105870. _this.loaderType_ = settings.loaderType;
  105871. _this.currentMediaInfo_ = void 0;
  105872. _this.startingMediaInfo_ = void 0;
  105873. _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  105874. _this.goalBufferLength_ = settings.goalBufferLength;
  105875. _this.sourceType_ = settings.sourceType;
  105876. _this.sourceUpdater_ = settings.sourceUpdater;
  105877. _this.inbandTextTracks_ = settings.inbandTextTracks;
  105878. _this.state_ = "INIT";
  105879. _this.timelineChangeController_ = settings.timelineChangeController;
  105880. _this.shouldSaveSegmentTimingInfo_ = true;
  105881. _this.parse708captions_ = settings.parse708captions;
  105882. _this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  105883. _this.captionServices_ = settings.captionServices;
  105884. _this.experimentalExactManifestTimings = settings.experimentalExactManifestTimings;
  105885. _this.checkBufferTimeout_ = null;
  105886. _this.error_ = void 0;
  105887. _this.currentTimeline_ = -1;
  105888. _this.pendingSegment_ = null;
  105889. _this.xhrOptions_ = null;
  105890. _this.pendingSegments_ = [];
  105891. _this.audioDisabled_ = false;
  105892. _this.isPendingTimestampOffset_ = false;
  105893. _this.gopBuffer_ = [];
  105894. _this.timeMapping_ = 0;
  105895. _this.safeAppend_ = videojs.browser.IE_VERSION >= 11;
  105896. _this.appendInitSegment_ = {
  105897. audio: true,
  105898. video: true
  105899. };
  105900. _this.playlistOfLastInitSegment_ = {
  105901. audio: null,
  105902. video: null
  105903. };
  105904. _this.callQueue_ = [];
  105905. _this.loadQueue_ = [];
  105906. _this.metadataQueue_ = {
  105907. id3: [],
  105908. caption: []
  105909. };
  105910. _this.waitingOnRemove_ = false;
  105911. _this.quotaExceededErrorRetryTimeout_ = null;
  105912. _this.activeInitSegmentId_ = null;
  105913. _this.initSegments_ = {};
  105914. _this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  105915. _this.keyCache_ = {};
  105916. _this.decrypter_ = settings.decrypter;
  105917. _this.syncController_ = settings.syncController;
  105918. _this.syncPoint_ = {
  105919. segmentIndex: 0,
  105920. time: 0
  105921. };
  105922. _this.transmuxer_ = _this.createTransmuxer_();
  105923. _this.triggerSyncInfoUpdate_ = function() {
  105924. return _this.trigger("syncinfoupdate");
  105925. };
  105926. _this.syncController_.on("syncinfoupdate", _this.triggerSyncInfoUpdate_);
  105927. _this.mediaSource_.addEventListener("sourceopen", function() {
  105928. if (!_this.isEndOfStream_()) {
  105929. _this.ended_ = false;
  105930. }
  105931. });
  105932. _this.fetchAtBuffer_ = false;
  105933. _this.logger_ = logger("SegmentLoader[" + _this.loaderType_ + "]");
  105934. Object.defineProperty(_assertThisInitialized(_this), "state", {
  105935. get: function get7() {
  105936. return this.state_;
  105937. },
  105938. set: function set4(newState) {
  105939. if (newState !== this.state_) {
  105940. this.logger_(this.state_ + " -> " + newState);
  105941. this.state_ = newState;
  105942. this.trigger("statechange");
  105943. }
  105944. }
  105945. });
  105946. _this.sourceUpdater_.on("ready", function() {
  105947. if (_this.hasEnoughInfoToAppend_()) {
  105948. _this.processCallQueue_();
  105949. }
  105950. });
  105951. if (_this.loaderType_ === "main") {
  105952. _this.timelineChangeController_.on("pendingtimelinechange", function() {
  105953. if (_this.hasEnoughInfoToAppend_()) {
  105954. _this.processCallQueue_();
  105955. }
  105956. });
  105957. }
  105958. if (_this.loaderType_ === "audio") {
  105959. _this.timelineChangeController_.on("timelinechange", function() {
  105960. if (_this.hasEnoughInfoToLoad_()) {
  105961. _this.processLoadQueue_();
  105962. }
  105963. if (_this.hasEnoughInfoToAppend_()) {
  105964. _this.processCallQueue_();
  105965. }
  105966. });
  105967. }
  105968. return _this;
  105969. }
  105970. var _proto = SegmentLoader2.prototype;
  105971. _proto.createTransmuxer_ = function createTransmuxer_() {
  105972. return segmentTransmuxer.createTransmuxer({
  105973. remux: false,
  105974. alignGopsAtEnd: this.safeAppend_,
  105975. keepOriginalTimestamps: true,
  105976. parse708captions: this.parse708captions_,
  105977. captionServices: this.captionServices_
  105978. });
  105979. };
  105980. _proto.resetStats_ = function resetStats_() {
  105981. this.mediaBytesTransferred = 0;
  105982. this.mediaRequests = 0;
  105983. this.mediaRequestsAborted = 0;
  105984. this.mediaRequestsTimedout = 0;
  105985. this.mediaRequestsErrored = 0;
  105986. this.mediaTransferDuration = 0;
  105987. this.mediaSecondsLoaded = 0;
  105988. this.mediaAppends = 0;
  105989. };
  105990. _proto.dispose = function dispose() {
  105991. this.trigger("dispose");
  105992. this.state = "DISPOSED";
  105993. this.pause();
  105994. this.abort_();
  105995. if (this.transmuxer_) {
  105996. this.transmuxer_.terminate();
  105997. }
  105998. this.resetStats_();
  105999. if (this.checkBufferTimeout_) {
  106000. window_1.clearTimeout(this.checkBufferTimeout_);
  106001. }
  106002. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  106003. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  106004. }
  106005. this.off();
  106006. };
  106007. _proto.setAudio = function setAudio(enable) {
  106008. this.audioDisabled_ = !enable;
  106009. if (enable) {
  106010. this.appendInitSegment_.audio = true;
  106011. } else {
  106012. this.sourceUpdater_.removeAudio(0, this.duration_());
  106013. }
  106014. };
  106015. _proto.abort = function abort2() {
  106016. if (this.state !== "WAITING") {
  106017. if (this.pendingSegment_) {
  106018. this.pendingSegment_ = null;
  106019. }
  106020. return;
  106021. }
  106022. this.abort_();
  106023. this.state = "READY";
  106024. if (!this.paused()) {
  106025. this.monitorBuffer_();
  106026. }
  106027. };
  106028. _proto.abort_ = function abort_() {
  106029. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  106030. this.pendingSegment_.abortRequests();
  106031. }
  106032. this.pendingSegment_ = null;
  106033. this.callQueue_ = [];
  106034. this.loadQueue_ = [];
  106035. this.metadataQueue_.id3 = [];
  106036. this.metadataQueue_.caption = [];
  106037. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  106038. this.waitingOnRemove_ = false;
  106039. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  106040. this.quotaExceededErrorRetryTimeout_ = null;
  106041. };
  106042. _proto.checkForAbort_ = function checkForAbort_(requestId) {
  106043. if (this.state === "APPENDING" && !this.pendingSegment_) {
  106044. this.state = "READY";
  106045. return true;
  106046. }
  106047. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  106048. return true;
  106049. }
  106050. return false;
  106051. };
  106052. _proto.error = function error(_error) {
  106053. if (typeof _error !== "undefined") {
  106054. this.logger_("error occurred:", _error);
  106055. this.error_ = _error;
  106056. }
  106057. this.pendingSegment_ = null;
  106058. return this.error_;
  106059. };
  106060. _proto.endOfStream = function endOfStream2() {
  106061. this.ended_ = true;
  106062. if (this.transmuxer_) {
  106063. segmentTransmuxer.reset(this.transmuxer_);
  106064. }
  106065. this.gopBuffer_.length = 0;
  106066. this.pause();
  106067. this.trigger("ended");
  106068. };
  106069. _proto.buffered_ = function buffered_() {
  106070. var trackInfo = this.getMediaInfo_();
  106071. if (!this.sourceUpdater_ || !trackInfo) {
  106072. return videojs.createTimeRanges();
  106073. }
  106074. if (this.loaderType_ === "main") {
  106075. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106076. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  106077. return this.sourceUpdater_.buffered();
  106078. }
  106079. if (hasVideo) {
  106080. return this.sourceUpdater_.videoBuffered();
  106081. }
  106082. }
  106083. return this.sourceUpdater_.audioBuffered();
  106084. };
  106085. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  106086. if (set4 === void 0) {
  106087. set4 = false;
  106088. }
  106089. if (!map) {
  106090. return null;
  106091. }
  106092. var id = initSegmentId(map);
  106093. var storedMap = this.initSegments_[id];
  106094. if (set4 && !storedMap && map.bytes) {
  106095. this.initSegments_[id] = storedMap = {
  106096. resolvedUri: map.resolvedUri,
  106097. byterange: map.byterange,
  106098. bytes: map.bytes,
  106099. tracks: map.tracks,
  106100. timescales: map.timescales
  106101. };
  106102. }
  106103. return storedMap || map;
  106104. };
  106105. _proto.segmentKey = function segmentKey(key, set4) {
  106106. if (set4 === void 0) {
  106107. set4 = false;
  106108. }
  106109. if (!key) {
  106110. return null;
  106111. }
  106112. var id = segmentKeyId(key);
  106113. var storedKey = this.keyCache_[id];
  106114. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  106115. this.keyCache_[id] = storedKey = {
  106116. resolvedUri: key.resolvedUri,
  106117. bytes: key.bytes
  106118. };
  106119. }
  106120. var result = {
  106121. resolvedUri: (storedKey || key).resolvedUri
  106122. };
  106123. if (storedKey) {
  106124. result.bytes = storedKey.bytes;
  106125. }
  106126. return result;
  106127. };
  106128. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  106129. return this.playlist_ && !this.paused();
  106130. };
  106131. _proto.load = function load() {
  106132. this.monitorBuffer_();
  106133. if (!this.playlist_) {
  106134. return;
  106135. }
  106136. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106137. return this.init_();
  106138. }
  106139. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  106140. return;
  106141. }
  106142. this.state = "READY";
  106143. };
  106144. _proto.init_ = function init_() {
  106145. this.state = "READY";
  106146. this.resetEverything();
  106147. return this.monitorBuffer_();
  106148. };
  106149. _proto.playlist = function playlist(newPlaylist, options2) {
  106150. if (options2 === void 0) {
  106151. options2 = {};
  106152. }
  106153. if (!newPlaylist) {
  106154. return;
  106155. }
  106156. var oldPlaylist = this.playlist_;
  106157. var segmentInfo = this.pendingSegment_;
  106158. this.playlist_ = newPlaylist;
  106159. this.xhrOptions_ = options2;
  106160. if (this.state === "INIT") {
  106161. newPlaylist.syncInfo = {
  106162. mediaSequence: newPlaylist.mediaSequence,
  106163. time: 0
  106164. };
  106165. if (this.loaderType_ === "main") {
  106166. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  106167. }
  106168. }
  106169. var oldId = null;
  106170. if (oldPlaylist) {
  106171. if (oldPlaylist.id) {
  106172. oldId = oldPlaylist.id;
  106173. } else if (oldPlaylist.uri) {
  106174. oldId = oldPlaylist.uri;
  106175. }
  106176. }
  106177. this.logger_("playlist update [" + oldId + " => " + (newPlaylist.id || newPlaylist.uri) + "]");
  106178. this.trigger("syncinfoupdate");
  106179. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106180. return this.init_();
  106181. }
  106182. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  106183. if (this.mediaIndex !== null) {
  106184. if (!newPlaylist.endList) {
  106185. this.resetLoader();
  106186. } else {
  106187. this.resyncLoader();
  106188. }
  106189. }
  106190. this.currentMediaInfo_ = void 0;
  106191. this.trigger("playlistupdate");
  106192. return;
  106193. }
  106194. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  106195. this.logger_("live window shift [" + mediaSequenceDiff + "]");
  106196. if (this.mediaIndex !== null) {
  106197. this.mediaIndex -= mediaSequenceDiff;
  106198. if (this.mediaIndex < 0) {
  106199. this.mediaIndex = null;
  106200. this.partIndex = null;
  106201. } else {
  106202. var segment = this.playlist_.segments[this.mediaIndex];
  106203. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  106204. var mediaIndex = this.mediaIndex;
  106205. this.logger_("currently processing part (index " + this.partIndex + ") no longer exists.");
  106206. this.resetLoader();
  106207. this.mediaIndex = mediaIndex;
  106208. }
  106209. }
  106210. }
  106211. if (segmentInfo) {
  106212. segmentInfo.mediaIndex -= mediaSequenceDiff;
  106213. if (segmentInfo.mediaIndex < 0) {
  106214. segmentInfo.mediaIndex = null;
  106215. segmentInfo.partIndex = null;
  106216. } else {
  106217. if (segmentInfo.mediaIndex >= 0) {
  106218. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  106219. }
  106220. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  106221. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  106222. }
  106223. }
  106224. }
  106225. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  106226. };
  106227. _proto.pause = function pause() {
  106228. if (this.checkBufferTimeout_) {
  106229. window_1.clearTimeout(this.checkBufferTimeout_);
  106230. this.checkBufferTimeout_ = null;
  106231. }
  106232. };
  106233. _proto.paused = function paused() {
  106234. return this.checkBufferTimeout_ === null;
  106235. };
  106236. _proto.resetEverything = function resetEverything(done) {
  106237. this.ended_ = false;
  106238. this.activeInitSegmentId_ = null;
  106239. this.appendInitSegment_ = {
  106240. audio: true,
  106241. video: true
  106242. };
  106243. this.resetLoader();
  106244. this.remove(0, Infinity, done);
  106245. if (this.transmuxer_) {
  106246. this.transmuxer_.postMessage({
  106247. action: "clearAllMp4Captions"
  106248. });
  106249. this.transmuxer_.postMessage({
  106250. action: "reset"
  106251. });
  106252. }
  106253. };
  106254. _proto.resetLoader = function resetLoader() {
  106255. this.fetchAtBuffer_ = false;
  106256. this.resyncLoader();
  106257. };
  106258. _proto.resyncLoader = function resyncLoader() {
  106259. if (this.transmuxer_) {
  106260. segmentTransmuxer.reset(this.transmuxer_);
  106261. }
  106262. this.mediaIndex = null;
  106263. this.partIndex = null;
  106264. this.syncPoint_ = null;
  106265. this.isPendingTimestampOffset_ = false;
  106266. this.callQueue_ = [];
  106267. this.loadQueue_ = [];
  106268. this.metadataQueue_.id3 = [];
  106269. this.metadataQueue_.caption = [];
  106270. this.abort();
  106271. if (this.transmuxer_) {
  106272. this.transmuxer_.postMessage({
  106273. action: "clearParsedMp4Captions"
  106274. });
  106275. }
  106276. };
  106277. _proto.remove = function remove2(start2, end, done, force) {
  106278. if (done === void 0) {
  106279. done = function done2() {
  106280. };
  106281. }
  106282. if (force === void 0) {
  106283. force = false;
  106284. }
  106285. if (end === Infinity) {
  106286. end = this.duration_();
  106287. }
  106288. if (end <= start2) {
  106289. this.logger_("skipping remove because end ${end} is <= start ${start}");
  106290. return;
  106291. }
  106292. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  106293. this.logger_("skipping remove because no source updater or starting media info");
  106294. return;
  106295. }
  106296. var removesRemaining = 1;
  106297. var removeFinished = function removeFinished2() {
  106298. removesRemaining--;
  106299. if (removesRemaining === 0) {
  106300. done();
  106301. }
  106302. };
  106303. if (force || !this.audioDisabled_) {
  106304. removesRemaining++;
  106305. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  106306. }
  106307. if (force || this.loaderType_ === "main") {
  106308. this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start2, end, this.timeMapping_);
  106309. removesRemaining++;
  106310. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  106311. }
  106312. for (var track in this.inbandTextTracks_) {
  106313. removeCuesFromTrack(start2, end, this.inbandTextTracks_[track]);
  106314. }
  106315. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  106316. removeFinished();
  106317. };
  106318. _proto.monitorBuffer_ = function monitorBuffer_() {
  106319. if (this.checkBufferTimeout_) {
  106320. window_1.clearTimeout(this.checkBufferTimeout_);
  106321. }
  106322. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  106323. };
  106324. _proto.monitorBufferTick_ = function monitorBufferTick_() {
  106325. if (this.state === "READY") {
  106326. this.fillBuffer_();
  106327. }
  106328. if (this.checkBufferTimeout_) {
  106329. window_1.clearTimeout(this.checkBufferTimeout_);
  106330. }
  106331. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);
  106332. };
  106333. _proto.fillBuffer_ = function fillBuffer_() {
  106334. if (this.sourceUpdater_.updating()) {
  106335. return;
  106336. }
  106337. var segmentInfo = this.chooseNextRequest_();
  106338. if (!segmentInfo) {
  106339. return;
  106340. }
  106341. if (typeof segmentInfo.timestampOffset === "number") {
  106342. this.isPendingTimestampOffset_ = false;
  106343. this.timelineChangeController_.pendingTimelineChange({
  106344. type: this.loaderType_,
  106345. from: this.currentTimeline_,
  106346. to: segmentInfo.timeline
  106347. });
  106348. }
  106349. this.loadSegment_(segmentInfo);
  106350. };
  106351. _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) {
  106352. if (mediaIndex === void 0) {
  106353. mediaIndex = this.mediaIndex;
  106354. }
  106355. if (playlist === void 0) {
  106356. playlist = this.playlist_;
  106357. }
  106358. if (partIndex === void 0) {
  106359. partIndex = this.partIndex;
  106360. }
  106361. if (!playlist || !this.mediaSource_) {
  106362. return false;
  106363. }
  106364. var segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  106365. var appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  106366. var appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  106367. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  106368. };
  106369. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  106370. var buffered = this.buffered_();
  106371. var bufferedEnd = lastBufferedEnd(buffered) || 0;
  106372. var bufferedTime = timeAheadOf(buffered, this.currentTime_());
  106373. var preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  106374. var haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  106375. var segments = this.playlist_.segments;
  106376. if (!segments.length || preloaded || haveEnoughBuffer) {
  106377. return null;
  106378. }
  106379. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  106380. var next = {
  106381. partIndex: null,
  106382. mediaIndex: null,
  106383. startOfSegment: null,
  106384. playlist: this.playlist_,
  106385. isSyncRequest: Boolean(!this.syncPoint_)
  106386. };
  106387. if (next.isSyncRequest) {
  106388. next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);
  106389. } else if (this.mediaIndex !== null) {
  106390. var segment = segments[this.mediaIndex];
  106391. var partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  106392. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  106393. if (segment.parts && segment.parts[partIndex + 1]) {
  106394. next.mediaIndex = this.mediaIndex;
  106395. next.partIndex = partIndex + 1;
  106396. } else {
  106397. next.mediaIndex = this.mediaIndex + 1;
  106398. }
  106399. } else {
  106400. var _Playlist$getMediaInf = Playlist.getMediaInfoForTime({
  106401. experimentalExactManifestTimings: this.experimentalExactManifestTimings,
  106402. playlist: this.playlist_,
  106403. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  106404. startingPartIndex: this.syncPoint_.partIndex,
  106405. startingSegmentIndex: this.syncPoint_.segmentIndex,
  106406. startTime: this.syncPoint_.time
  106407. }), segmentIndex = _Playlist$getMediaInf.segmentIndex, startTime = _Playlist$getMediaInf.startTime, _partIndex = _Playlist$getMediaInf.partIndex;
  106408. next.getMediaInfoForTime = this.fetchAtBuffer_ ? "bufferedEnd " + bufferedEnd : "currentTime " + this.currentTime_();
  106409. next.mediaIndex = segmentIndex;
  106410. next.startOfSegment = startTime;
  106411. next.partIndex = _partIndex;
  106412. }
  106413. var nextSegment = segments[next.mediaIndex];
  106414. var nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  106415. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  106416. return null;
  106417. }
  106418. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  106419. next.partIndex = 0;
  106420. nextPart = nextSegment.parts[0];
  106421. }
  106422. if (!bufferedTime && nextPart && !nextPart.independent) {
  106423. if (next.partIndex === 0) {
  106424. var lastSegment = segments[next.mediaIndex - 1];
  106425. var lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  106426. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  106427. next.mediaIndex -= 1;
  106428. next.partIndex = lastSegment.parts.length - 1;
  106429. next.independent = "previous segment";
  106430. }
  106431. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  106432. next.partIndex -= 1;
  106433. next.independent = "previous part";
  106434. }
  106435. }
  106436. var ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  106437. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  106438. return null;
  106439. }
  106440. return this.generateSegmentInfo_(next);
  106441. };
  106442. _proto.generateSegmentInfo_ = function generateSegmentInfo_(options2) {
  106443. var independent = options2.independent, playlist = options2.playlist, mediaIndex = options2.mediaIndex, startOfSegment = options2.startOfSegment, isSyncRequest = options2.isSyncRequest, partIndex = options2.partIndex, forceTimestampOffset = options2.forceTimestampOffset, getMediaInfoForTime3 = options2.getMediaInfoForTime;
  106444. var segment = playlist.segments[mediaIndex];
  106445. var part = typeof partIndex === "number" && segment.parts[partIndex];
  106446. var segmentInfo = {
  106447. requestId: "segment-loader-" + Math.random(),
  106448. uri: part && part.resolvedUri || segment.resolvedUri,
  106449. mediaIndex,
  106450. partIndex: part ? partIndex : null,
  106451. isSyncRequest,
  106452. startOfSegment,
  106453. playlist,
  106454. bytes: null,
  106455. encryptedBytes: null,
  106456. timestampOffset: null,
  106457. timeline: segment.timeline,
  106458. duration: part && part.duration || segment.duration,
  106459. segment,
  106460. part,
  106461. byteLength: 0,
  106462. transmuxer: this.transmuxer_,
  106463. getMediaInfoForTime: getMediaInfoForTime3,
  106464. independent
  106465. };
  106466. var overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  106467. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  106468. segmentTimeline: segment.timeline,
  106469. currentTimeline: this.currentTimeline_,
  106470. startOfSegment,
  106471. buffered: this.buffered_(),
  106472. overrideCheck
  106473. });
  106474. var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());
  106475. if (typeof audioBufferedEnd === "number") {
  106476. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  106477. }
  106478. if (this.sourceUpdater_.videoBuffered().length) {
  106479. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(
  106480. this.gopBuffer_,
  106481. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  106482. this.timeMapping_
  106483. );
  106484. }
  106485. return segmentInfo;
  106486. };
  106487. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options2) {
  106488. return timestampOffsetForSegment(options2);
  106489. };
  106490. _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) {
  106491. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  106492. return;
  106493. }
  106494. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  106495. return;
  106496. }
  106497. var currentTime = this.currentTime_();
  106498. var measuredBandwidth = stats.bandwidth;
  106499. var segmentDuration = this.pendingSegment_.duration;
  106500. var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  106501. var timeUntilRebuffer$12 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  106502. if (requestTimeRemaining <= timeUntilRebuffer$12) {
  106503. return;
  106504. }
  106505. var switchCandidate = minRebufferMaxBandwidthSelector({
  106506. master: this.vhs_.playlists.master,
  106507. currentTime,
  106508. bandwidth: measuredBandwidth,
  106509. duration: this.duration_(),
  106510. segmentDuration,
  106511. timeUntilRebuffer: timeUntilRebuffer$12,
  106512. currentTimeline: this.currentTimeline_,
  106513. syncController: this.syncController_
  106514. });
  106515. if (!switchCandidate) {
  106516. return;
  106517. }
  106518. var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$12;
  106519. var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  106520. var minimumTimeSaving = 0.5;
  106521. if (timeUntilRebuffer$12 <= TIME_FUDGE_FACTOR) {
  106522. minimumTimeSaving = 1;
  106523. }
  106524. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  106525. return;
  106526. }
  106527. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;
  106528. this.trigger("earlyabort");
  106529. };
  106530. _proto.handleAbort_ = function handleAbort_(segmentInfo) {
  106531. this.logger_("Aborting " + segmentInfoString(segmentInfo));
  106532. this.mediaRequestsAborted += 1;
  106533. };
  106534. _proto.handleProgress_ = function handleProgress_(event2, simpleSegment) {
  106535. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106536. if (this.checkForAbort_(simpleSegment.requestId)) {
  106537. return;
  106538. }
  106539. this.trigger("progress");
  106540. };
  106541. _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) {
  106542. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106543. if (this.checkForAbort_(simpleSegment.requestId)) {
  106544. return;
  106545. }
  106546. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  106547. return;
  106548. }
  106549. trackInfo = trackInfo || {};
  106550. if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {
  106551. this.appendInitSegment_ = {
  106552. audio: true,
  106553. video: true
  106554. };
  106555. this.startingMediaInfo_ = trackInfo;
  106556. this.currentMediaInfo_ = trackInfo;
  106557. this.logger_("trackinfo update", trackInfo);
  106558. this.trigger("trackinfo");
  106559. }
  106560. if (this.checkForAbort_(simpleSegment.requestId)) {
  106561. return;
  106562. }
  106563. this.pendingSegment_.trackInfo = trackInfo;
  106564. if (this.hasEnoughInfoToAppend_()) {
  106565. this.processCallQueue_();
  106566. }
  106567. };
  106568. _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  106569. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106570. if (this.checkForAbort_(simpleSegment.requestId)) {
  106571. return;
  106572. }
  106573. var segmentInfo = this.pendingSegment_;
  106574. var timingInfoProperty = timingInfoPropertyForMedia(mediaType);
  106575. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  106576. segmentInfo[timingInfoProperty][timeType] = time;
  106577. this.logger_("timinginfo: " + mediaType + " - " + timeType + " - " + time);
  106578. if (this.hasEnoughInfoToAppend_()) {
  106579. this.processCallQueue_();
  106580. }
  106581. };
  106582. _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) {
  106583. var _this2 = this;
  106584. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106585. if (this.checkForAbort_(simpleSegment.requestId)) {
  106586. return;
  106587. }
  106588. if (captionData.length === 0) {
  106589. this.logger_("SegmentLoader received no captions from a caption event");
  106590. return;
  106591. }
  106592. var segmentInfo = this.pendingSegment_;
  106593. if (!segmentInfo.hasAppendedData_) {
  106594. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  106595. return;
  106596. }
  106597. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106598. var captionTracks = {};
  106599. captionData.forEach(function(caption) {
  106600. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  106601. startTime: Infinity,
  106602. captions: [],
  106603. endTime: 0
  106604. };
  106605. var captionTrack = captionTracks[caption.stream];
  106606. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  106607. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  106608. captionTrack.captions.push(caption);
  106609. });
  106610. Object.keys(captionTracks).forEach(function(trackName) {
  106611. var _captionTracks$trackN = captionTracks[trackName], startTime = _captionTracks$trackN.startTime, endTime = _captionTracks$trackN.endTime, captions = _captionTracks$trackN.captions;
  106612. var inbandTextTracks = _this2.inbandTextTracks_;
  106613. _this2.logger_("adding cues from " + startTime + " -> " + endTime + " for " + trackName);
  106614. createCaptionsTrackIfNotExists(inbandTextTracks, _this2.vhs_.tech_, trackName);
  106615. removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);
  106616. addCaptionData({
  106617. captionArray: captions,
  106618. inbandTextTracks,
  106619. timestampOffset: timestampOffset2
  106620. });
  106621. });
  106622. if (this.transmuxer_) {
  106623. this.transmuxer_.postMessage({
  106624. action: "clearParsedMp4Captions"
  106625. });
  106626. }
  106627. };
  106628. _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) {
  106629. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106630. if (this.checkForAbort_(simpleSegment.requestId)) {
  106631. return;
  106632. }
  106633. var segmentInfo = this.pendingSegment_;
  106634. if (!segmentInfo.hasAppendedData_) {
  106635. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  106636. return;
  106637. }
  106638. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106639. createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  106640. addMetadata({
  106641. inbandTextTracks: this.inbandTextTracks_,
  106642. metadataArray: id3Frames,
  106643. timestampOffset: timestampOffset2,
  106644. videoDuration: this.duration_()
  106645. });
  106646. };
  106647. _proto.processMetadataQueue_ = function processMetadataQueue_() {
  106648. this.metadataQueue_.id3.forEach(function(fn2) {
  106649. return fn2();
  106650. });
  106651. this.metadataQueue_.caption.forEach(function(fn2) {
  106652. return fn2();
  106653. });
  106654. this.metadataQueue_.id3 = [];
  106655. this.metadataQueue_.caption = [];
  106656. };
  106657. _proto.processCallQueue_ = function processCallQueue_() {
  106658. var callQueue = this.callQueue_;
  106659. this.callQueue_ = [];
  106660. callQueue.forEach(function(fun) {
  106661. return fun();
  106662. });
  106663. };
  106664. _proto.processLoadQueue_ = function processLoadQueue_() {
  106665. var loadQueue = this.loadQueue_;
  106666. this.loadQueue_ = [];
  106667. loadQueue.forEach(function(fun) {
  106668. return fun();
  106669. });
  106670. };
  106671. _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() {
  106672. if (this.loaderType_ !== "audio") {
  106673. return true;
  106674. }
  106675. var segmentInfo = this.pendingSegment_;
  106676. if (!segmentInfo) {
  106677. return false;
  106678. }
  106679. if (!this.getCurrentMediaInfo_()) {
  106680. return true;
  106681. }
  106682. if (shouldWaitForTimelineChange({
  106683. timelineChangeController: this.timelineChangeController_,
  106684. currentTimeline: this.currentTimeline_,
  106685. segmentTimeline: segmentInfo.timeline,
  106686. loaderType: this.loaderType_,
  106687. audioDisabled: this.audioDisabled_
  106688. })) {
  106689. return false;
  106690. }
  106691. return true;
  106692. };
  106693. _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) {
  106694. if (segmentInfo === void 0) {
  106695. segmentInfo = this.pendingSegment_;
  106696. }
  106697. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  106698. };
  106699. _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) {
  106700. if (segmentInfo === void 0) {
  106701. segmentInfo = this.pendingSegment_;
  106702. }
  106703. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  106704. };
  106705. _proto.getPendingSegmentPlaylist = function getPendingSegmentPlaylist() {
  106706. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  106707. };
  106708. _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() {
  106709. if (!this.sourceUpdater_.ready()) {
  106710. return false;
  106711. }
  106712. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  106713. return false;
  106714. }
  106715. var segmentInfo = this.pendingSegment_;
  106716. var trackInfo = this.getCurrentMediaInfo_();
  106717. if (!segmentInfo || !trackInfo) {
  106718. return false;
  106719. }
  106720. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106721. if (hasVideo && !segmentInfo.videoTimingInfo) {
  106722. return false;
  106723. }
  106724. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  106725. return false;
  106726. }
  106727. if (shouldWaitForTimelineChange({
  106728. timelineChangeController: this.timelineChangeController_,
  106729. currentTimeline: this.currentTimeline_,
  106730. segmentTimeline: segmentInfo.timeline,
  106731. loaderType: this.loaderType_,
  106732. audioDisabled: this.audioDisabled_
  106733. })) {
  106734. return false;
  106735. }
  106736. return true;
  106737. };
  106738. _proto.handleData_ = function handleData_3(simpleSegment, result) {
  106739. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106740. if (this.checkForAbort_(simpleSegment.requestId)) {
  106741. return;
  106742. }
  106743. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  106744. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  106745. return;
  106746. }
  106747. var segmentInfo = this.pendingSegment_;
  106748. this.setTimeMapping_(segmentInfo.timeline);
  106749. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  106750. if (this.mediaSource_.readyState === "closed") {
  106751. return;
  106752. }
  106753. if (simpleSegment.map) {
  106754. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  106755. segmentInfo.segment.map = simpleSegment.map;
  106756. }
  106757. if (simpleSegment.key) {
  106758. this.segmentKey(simpleSegment.key, true);
  106759. }
  106760. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  106761. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  106762. if (segmentInfo.isFmp4) {
  106763. this.trigger("fmp4");
  106764. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;
  106765. } else {
  106766. var trackInfo = this.getCurrentMediaInfo_();
  106767. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  106768. var firstVideoFrameTimeForData;
  106769. if (useVideoTimingInfo) {
  106770. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  106771. }
  106772. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  106773. currentStart: segmentInfo.timingInfo.start,
  106774. playlist: segmentInfo.playlist,
  106775. mediaIndex: segmentInfo.mediaIndex,
  106776. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  106777. useVideoTimingInfo,
  106778. firstVideoFrameTimeForData,
  106779. videoTimingInfo: segmentInfo.videoTimingInfo,
  106780. audioTimingInfo: segmentInfo.audioTimingInfo
  106781. });
  106782. }
  106783. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  106784. this.updateSourceBufferTimestampOffset_(segmentInfo);
  106785. if (segmentInfo.isSyncRequest) {
  106786. this.updateTimingInfoEnd_(segmentInfo);
  106787. this.syncController_.saveSegmentTimingInfo({
  106788. segmentInfo,
  106789. shouldSaveTimelineMapping: this.loaderType_ === "main"
  106790. });
  106791. var next = this.chooseNextRequest_();
  106792. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  106793. this.logger_("sync segment was incorrect, not appending");
  106794. return;
  106795. }
  106796. this.logger_("sync segment was correct, appending");
  106797. }
  106798. segmentInfo.hasAppendedData_ = true;
  106799. this.processMetadataQueue_();
  106800. this.appendData_(segmentInfo, result);
  106801. };
  106802. _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type2) {
  106803. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  106804. this.appendInitSegment_ = {
  106805. audio: true,
  106806. video: true
  106807. };
  106808. }
  106809. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  106810. this.appendInitSegment_[type2] = true;
  106811. }
  106812. };
  106813. _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) {
  106814. var type2 = _ref4.type, initSegment = _ref4.initSegment, map = _ref4.map, playlist = _ref4.playlist;
  106815. if (map) {
  106816. var id = initSegmentId(map);
  106817. if (this.activeInitSegmentId_ === id) {
  106818. return null;
  106819. }
  106820. initSegment = this.initSegmentForMap(map, true).bytes;
  106821. this.activeInitSegmentId_ = id;
  106822. }
  106823. if (initSegment && this.appendInitSegment_[type2]) {
  106824. this.playlistOfLastInitSegment_[type2] = playlist;
  106825. this.appendInitSegment_[type2] = false;
  106826. this.activeInitSegmentId_ = null;
  106827. return initSegment;
  106828. }
  106829. return null;
  106830. };
  106831. _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) {
  106832. var _this3 = this;
  106833. var segmentInfo = _ref5.segmentInfo, type2 = _ref5.type, bytes = _ref5.bytes;
  106834. var audioBuffered = this.sourceUpdater_.audioBuffered();
  106835. var videoBuffered = this.sourceUpdater_.videoBuffered();
  106836. if (audioBuffered.length > 1) {
  106837. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray(audioBuffered).join(", "));
  106838. }
  106839. if (videoBuffered.length > 1) {
  106840. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray(videoBuffered).join(", "));
  106841. }
  106842. var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  106843. var audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  106844. var videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  106845. var videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  106846. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {
  106847. this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. " + ("Appended byte length: " + bytes.byteLength + ", ") + ("audio buffer: " + timeRangesToArray(audioBuffered).join(", ") + ", ") + ("video buffer: " + timeRangesToArray(videoBuffered).join(", ") + ", "));
  106848. this.error({
  106849. message: "Quota exceeded error with append of a single segment of content",
  106850. excludeUntil: Infinity
  106851. });
  106852. this.trigger("error");
  106853. return;
  106854. }
  106855. this.waitingOnRemove_ = true;
  106856. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  106857. segmentInfo,
  106858. type: type2,
  106859. bytes
  106860. }));
  106861. var currentTime = this.currentTime_();
  106862. var timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;
  106863. this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to " + timeToRemoveUntil);
  106864. this.remove(0, timeToRemoveUntil, function() {
  106865. _this3.logger_("On QUOTA_EXCEEDED_ERR, retrying append in " + MIN_BACK_BUFFER + "s");
  106866. _this3.waitingOnRemove_ = false;
  106867. _this3.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(function() {
  106868. _this3.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  106869. _this3.quotaExceededErrorRetryTimeout_ = null;
  106870. _this3.processCallQueue_();
  106871. }, MIN_BACK_BUFFER * 1e3);
  106872. }, true);
  106873. };
  106874. _proto.handleAppendError_ = function handleAppendError_(_ref6, error) {
  106875. var segmentInfo = _ref6.segmentInfo, type2 = _ref6.type, bytes = _ref6.bytes;
  106876. if (!error) {
  106877. return;
  106878. }
  106879. if (error.code === QUOTA_EXCEEDED_ERR) {
  106880. this.handleQuotaExceededError_({
  106881. segmentInfo,
  106882. type: type2,
  106883. bytes
  106884. });
  106885. return;
  106886. }
  106887. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  106888. this.error(type2 + " append of " + bytes.length + "b failed for segment " + ("#" + segmentInfo.mediaIndex + " in playlist " + segmentInfo.playlist.id));
  106889. this.trigger("appenderror");
  106890. };
  106891. _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) {
  106892. var segmentInfo = _ref7.segmentInfo, type2 = _ref7.type, initSegment = _ref7.initSegment, data = _ref7.data, bytes = _ref7.bytes;
  106893. if (!bytes) {
  106894. var segments = [data];
  106895. var byteLength = data.byteLength;
  106896. if (initSegment) {
  106897. segments.unshift(initSegment);
  106898. byteLength += initSegment.byteLength;
  106899. }
  106900. bytes = concatSegments({
  106901. bytes: byteLength,
  106902. segments
  106903. });
  106904. }
  106905. this.sourceUpdater_.appendBuffer({
  106906. segmentInfo,
  106907. type: type2,
  106908. bytes
  106909. }, this.handleAppendError_.bind(this, {
  106910. segmentInfo,
  106911. type: type2,
  106912. bytes
  106913. }));
  106914. };
  106915. _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  106916. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  106917. return;
  106918. }
  106919. var segment = this.pendingSegment_.segment;
  106920. var timingInfoProperty = type2 + "TimingInfo";
  106921. if (!segment[timingInfoProperty]) {
  106922. segment[timingInfoProperty] = {};
  106923. }
  106924. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  106925. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  106926. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  106927. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  106928. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  106929. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  106930. };
  106931. _proto.appendData_ = function appendData_(segmentInfo, result) {
  106932. var type2 = result.type, data = result.data;
  106933. if (!data || !data.byteLength) {
  106934. return;
  106935. }
  106936. if (type2 === "audio" && this.audioDisabled_) {
  106937. return;
  106938. }
  106939. var initSegment = this.getInitSegmentAndUpdateState_({
  106940. type: type2,
  106941. initSegment: result.initSegment,
  106942. playlist: segmentInfo.playlist,
  106943. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  106944. });
  106945. this.appendToSourceBuffer_({
  106946. segmentInfo,
  106947. type: type2,
  106948. initSegment,
  106949. data
  106950. });
  106951. };
  106952. _proto.loadSegment_ = function loadSegment_(segmentInfo) {
  106953. var _this4 = this;
  106954. this.state = "WAITING";
  106955. this.pendingSegment_ = segmentInfo;
  106956. this.trimBackBuffer_(segmentInfo);
  106957. if (typeof segmentInfo.timestampOffset === "number") {
  106958. if (this.transmuxer_) {
  106959. this.transmuxer_.postMessage({
  106960. action: "clearAllMp4Captions"
  106961. });
  106962. }
  106963. }
  106964. if (!this.hasEnoughInfoToLoad_()) {
  106965. this.loadQueue_.push(function() {
  106966. var options2 = _extends$2({}, segmentInfo, {
  106967. forceTimestampOffset: true
  106968. });
  106969. _extends$2(segmentInfo, _this4.generateSegmentInfo_(options2));
  106970. _this4.isPendingTimestampOffset_ = false;
  106971. _this4.updateTransmuxerAndRequestSegment_(segmentInfo);
  106972. });
  106973. return;
  106974. }
  106975. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  106976. };
  106977. _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) {
  106978. var _this5 = this;
  106979. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  106980. this.gopBuffer_.length = 0;
  106981. segmentInfo.gopsToAlignWith = [];
  106982. this.timeMapping_ = 0;
  106983. this.transmuxer_.postMessage({
  106984. action: "reset"
  106985. });
  106986. this.transmuxer_.postMessage({
  106987. action: "setTimestampOffset",
  106988. timestampOffset: segmentInfo.timestampOffset
  106989. });
  106990. }
  106991. var simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  106992. var isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  106993. var isWalkingForward = this.mediaIndex !== null;
  106994. var isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  106995. var isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  106996. this.logger_("Requesting " + segmentInfoString(segmentInfo));
  106997. if (simpleSegment.map && !simpleSegment.map.bytes) {
  106998. this.logger_("going to request init segment.");
  106999. this.appendInitSegment_ = {
  107000. video: true,
  107001. audio: true
  107002. };
  107003. }
  107004. segmentInfo.abortRequests = mediaSegmentRequest({
  107005. xhr: this.vhs_.xhr,
  107006. xhrOptions: this.xhrOptions_,
  107007. decryptionWorker: this.decrypter_,
  107008. segment: simpleSegment,
  107009. abortFn: this.handleAbort_.bind(this, segmentInfo),
  107010. progressFn: this.handleProgress_.bind(this),
  107011. trackInfoFn: this.handleTrackInfo_.bind(this),
  107012. timingInfoFn: this.handleTimingInfo_.bind(this),
  107013. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  107014. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  107015. captionsFn: this.handleCaptions_.bind(this),
  107016. isEndOfTimeline,
  107017. endedTimelineFn: function endedTimelineFn() {
  107018. _this5.logger_("received endedtimeline callback");
  107019. },
  107020. id3Fn: this.handleId3_.bind(this),
  107021. dataFn: this.handleData_.bind(this),
  107022. doneFn: this.segmentRequestFinished_.bind(this),
  107023. onTransmuxerLog: function onTransmuxerLog(_ref8) {
  107024. var message = _ref8.message, level = _ref8.level, stream = _ref8.stream;
  107025. _this5.logger_(segmentInfoString(segmentInfo) + " logged from transmuxer stream " + stream + " as a " + level + ": " + message);
  107026. }
  107027. });
  107028. };
  107029. _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) {
  107030. var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  107031. if (removeToTime > 0) {
  107032. this.remove(0, removeToTime);
  107033. }
  107034. };
  107035. _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) {
  107036. var segment = segmentInfo.segment;
  107037. var part = segmentInfo.part;
  107038. var simpleSegment = {
  107039. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  107040. byterange: part ? part.byterange : segment.byterange,
  107041. requestId: segmentInfo.requestId,
  107042. transmuxer: segmentInfo.transmuxer,
  107043. audioAppendStart: segmentInfo.audioAppendStart,
  107044. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  107045. part: segmentInfo.part
  107046. };
  107047. var previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  107048. if (previousSegment && previousSegment.timeline === segment.timeline) {
  107049. if (previousSegment.videoTimingInfo) {
  107050. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  107051. } else if (previousSegment.audioTimingInfo) {
  107052. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  107053. }
  107054. }
  107055. if (segment.key) {
  107056. var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  107057. simpleSegment.key = this.segmentKey(segment.key);
  107058. simpleSegment.key.iv = iv;
  107059. }
  107060. if (segment.map) {
  107061. simpleSegment.map = this.initSegmentForMap(segment.map);
  107062. }
  107063. return simpleSegment;
  107064. };
  107065. _proto.saveTransferStats_ = function saveTransferStats_(stats) {
  107066. this.mediaRequests += 1;
  107067. if (stats) {
  107068. this.mediaBytesTransferred += stats.bytesReceived;
  107069. this.mediaTransferDuration += stats.roundTripTime;
  107070. }
  107071. };
  107072. _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration5, stats) {
  107073. this.pendingSegment_.byteLength = stats.bytesReceived;
  107074. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107075. this.logger_("Ignoring segment's bandwidth because its duration of " + duration5 + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107076. return;
  107077. }
  107078. this.bandwidth = stats.bandwidth;
  107079. this.roundTrip = stats.roundTripTime;
  107080. };
  107081. _proto.handleTimeout_ = function handleTimeout_() {
  107082. this.mediaRequestsTimedout += 1;
  107083. this.bandwidth = 1;
  107084. this.roundTrip = NaN;
  107085. this.trigger("bandwidthupdate");
  107086. this.trigger("timeout");
  107087. };
  107088. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  107089. if (this.callQueue_.length) {
  107090. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  107091. return;
  107092. }
  107093. this.saveTransferStats_(simpleSegment.stats);
  107094. if (!this.pendingSegment_) {
  107095. return;
  107096. }
  107097. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  107098. return;
  107099. }
  107100. if (error) {
  107101. this.pendingSegment_ = null;
  107102. this.state = "READY";
  107103. if (error.code === REQUEST_ERRORS.ABORTED) {
  107104. return;
  107105. }
  107106. this.pause();
  107107. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  107108. this.handleTimeout_();
  107109. return;
  107110. }
  107111. this.mediaRequestsErrored += 1;
  107112. this.error(error);
  107113. this.trigger("error");
  107114. return;
  107115. }
  107116. var segmentInfo = this.pendingSegment_;
  107117. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  107118. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  107119. if (result.gopInfo) {
  107120. this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  107121. }
  107122. this.state = "APPENDING";
  107123. this.trigger("appending");
  107124. this.waitForAppendsToComplete_(segmentInfo);
  107125. };
  107126. _proto.setTimeMapping_ = function setTimeMapping_(timeline) {
  107127. var timelineMapping = this.syncController_.mappingForTimeline(timeline);
  107128. if (timelineMapping !== null) {
  107129. this.timeMapping_ = timelineMapping;
  107130. }
  107131. };
  107132. _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) {
  107133. if (typeof segment.start === "number" && typeof segment.end === "number") {
  107134. this.mediaSecondsLoaded += segment.end - segment.start;
  107135. } else {
  107136. this.mediaSecondsLoaded += segment.duration;
  107137. }
  107138. };
  107139. _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  107140. if (timestampOffset2 === null) {
  107141. return false;
  107142. }
  107143. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  107144. return true;
  107145. }
  107146. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  107147. return true;
  107148. }
  107149. return false;
  107150. };
  107151. _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) {
  107152. var currentStart = _ref9.currentStart, playlist = _ref9.playlist, mediaIndex = _ref9.mediaIndex, firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData, currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset, useVideoTimingInfo = _ref9.useVideoTimingInfo, videoTimingInfo = _ref9.videoTimingInfo, audioTimingInfo = _ref9.audioTimingInfo;
  107153. if (typeof currentStart !== "undefined") {
  107154. return currentStart;
  107155. }
  107156. if (!useVideoTimingInfo) {
  107157. return audioTimingInfo.start;
  107158. }
  107159. var previousSegment = playlist.segments[mediaIndex - 1];
  107160. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  107161. return firstVideoFrameTimeForData;
  107162. }
  107163. return videoTimingInfo.start;
  107164. };
  107165. _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) {
  107166. var trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  107167. if (!trackInfo) {
  107168. this.error({
  107169. message: "No starting media returned, likely due to an unsupported media format.",
  107170. blacklistDuration: Infinity
  107171. });
  107172. this.trigger("error");
  107173. return;
  107174. }
  107175. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  107176. var waitForVideo = this.loaderType_ === "main" && hasVideo;
  107177. var waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  107178. segmentInfo.waitingOnAppends = 0;
  107179. if (!segmentInfo.hasAppendedData_) {
  107180. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  107181. this.isPendingTimestampOffset_ = true;
  107182. }
  107183. segmentInfo.timingInfo = {
  107184. start: 0
  107185. };
  107186. segmentInfo.waitingOnAppends++;
  107187. if (!this.isPendingTimestampOffset_) {
  107188. this.updateSourceBufferTimestampOffset_(segmentInfo);
  107189. this.processMetadataQueue_();
  107190. }
  107191. this.checkAppendsDone_(segmentInfo);
  107192. return;
  107193. }
  107194. if (waitForVideo) {
  107195. segmentInfo.waitingOnAppends++;
  107196. }
  107197. if (waitForAudio) {
  107198. segmentInfo.waitingOnAppends++;
  107199. }
  107200. if (waitForVideo) {
  107201. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107202. }
  107203. if (waitForAudio) {
  107204. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107205. }
  107206. };
  107207. _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) {
  107208. if (this.checkForAbort_(segmentInfo.requestId)) {
  107209. return;
  107210. }
  107211. segmentInfo.waitingOnAppends--;
  107212. if (segmentInfo.waitingOnAppends === 0) {
  107213. this.handleAppendsDone_();
  107214. }
  107215. };
  107216. _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) {
  107217. var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  107218. if (illegalMediaSwitchError) {
  107219. this.error({
  107220. message: illegalMediaSwitchError,
  107221. blacklistDuration: Infinity
  107222. });
  107223. this.trigger("error");
  107224. return true;
  107225. }
  107226. return false;
  107227. };
  107228. _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) {
  107229. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  107230. return;
  107231. }
  107232. var didChange = false;
  107233. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  107234. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  107235. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  107236. timingInfo: segmentInfo.timingInfo
  107237. });
  107238. segmentInfo.changedTimestampOffset = true;
  107239. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  107240. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  107241. didChange = true;
  107242. }
  107243. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  107244. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  107245. didChange = true;
  107246. }
  107247. if (didChange) {
  107248. this.trigger("timestampoffset");
  107249. }
  107250. };
  107251. _proto.getSegmentStartTimeForTimestampOffsetCalculation_ = function getSegmentStartTimeForTimestampOffsetCalculation_(_ref10) {
  107252. var videoTimingInfo = _ref10.videoTimingInfo, audioTimingInfo = _ref10.audioTimingInfo, timingInfo = _ref10.timingInfo;
  107253. if (!this.useDtsForTimestampOffset_) {
  107254. return timingInfo.start;
  107255. }
  107256. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  107257. return videoTimingInfo.transmuxedDecodeStart;
  107258. }
  107259. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  107260. return audioTimingInfo.transmuxedDecodeStart;
  107261. }
  107262. return timingInfo.start;
  107263. };
  107264. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) {
  107265. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  107266. var trackInfo = this.getMediaInfo_();
  107267. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  107268. var prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  107269. if (!prioritizedTimingInfo) {
  107270. return;
  107271. }
  107272. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  107273. };
  107274. _proto.handleAppendsDone_ = function handleAppendsDone_() {
  107275. if (this.pendingSegment_) {
  107276. this.trigger("appendsdone");
  107277. }
  107278. if (!this.pendingSegment_) {
  107279. this.state = "READY";
  107280. if (!this.paused()) {
  107281. this.monitorBuffer_();
  107282. }
  107283. return;
  107284. }
  107285. var segmentInfo = this.pendingSegment_;
  107286. this.updateTimingInfoEnd_(segmentInfo);
  107287. if (this.shouldSaveSegmentTimingInfo_) {
  107288. this.syncController_.saveSegmentTimingInfo({
  107289. segmentInfo,
  107290. shouldSaveTimelineMapping: this.loaderType_ === "main"
  107291. });
  107292. }
  107293. var segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);
  107294. if (segmentDurationMessage) {
  107295. if (segmentDurationMessage.severity === "warn") {
  107296. videojs.log.warn(segmentDurationMessage.message);
  107297. } else {
  107298. this.logger_(segmentDurationMessage.message);
  107299. }
  107300. }
  107301. this.recordThroughput_(segmentInfo);
  107302. this.pendingSegment_ = null;
  107303. this.state = "READY";
  107304. if (segmentInfo.isSyncRequest) {
  107305. this.trigger("syncinfoupdate");
  107306. if (!segmentInfo.hasAppendedData_) {
  107307. this.logger_("Throwing away un-appended sync request " + segmentInfoString(segmentInfo));
  107308. return;
  107309. }
  107310. }
  107311. this.logger_("Appended " + segmentInfoString(segmentInfo));
  107312. this.addSegmentMetadataCue_(segmentInfo);
  107313. this.fetchAtBuffer_ = true;
  107314. if (this.currentTimeline_ !== segmentInfo.timeline) {
  107315. this.timelineChangeController_.lastTimelineChange({
  107316. type: this.loaderType_,
  107317. from: this.currentTimeline_,
  107318. to: segmentInfo.timeline
  107319. });
  107320. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  107321. this.timelineChangeController_.lastTimelineChange({
  107322. type: "audio",
  107323. from: this.currentTimeline_,
  107324. to: segmentInfo.timeline
  107325. });
  107326. }
  107327. }
  107328. this.currentTimeline_ = segmentInfo.timeline;
  107329. this.trigger("syncinfoupdate");
  107330. var segment = segmentInfo.segment;
  107331. var part = segmentInfo.part;
  107332. var badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  107333. var badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  107334. if (badSegmentGuess || badPartGuess) {
  107335. this.logger_("bad " + (badSegmentGuess ? "segment" : "part") + " " + segmentInfoString(segmentInfo));
  107336. this.resetEverything();
  107337. return;
  107338. }
  107339. var isWalkingForward = this.mediaIndex !== null;
  107340. if (isWalkingForward) {
  107341. this.trigger("bandwidthupdate");
  107342. }
  107343. this.trigger("progress");
  107344. this.mediaIndex = segmentInfo.mediaIndex;
  107345. this.partIndex = segmentInfo.partIndex;
  107346. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  107347. this.endOfStream();
  107348. }
  107349. this.trigger("appended");
  107350. if (segmentInfo.hasAppendedData_) {
  107351. this.mediaAppends++;
  107352. }
  107353. if (!this.paused()) {
  107354. this.monitorBuffer_();
  107355. }
  107356. };
  107357. _proto.recordThroughput_ = function recordThroughput_(segmentInfo) {
  107358. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107359. this.logger_("Ignoring segment's throughput because its duration of " + segmentInfo.duration + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107360. return;
  107361. }
  107362. var rate = this.throughput.rate;
  107363. var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  107364. var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  107365. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  107366. };
  107367. _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) {
  107368. if (!this.segmentMetadataTrack_) {
  107369. return;
  107370. }
  107371. var segment = segmentInfo.segment;
  107372. var start2 = segment.start;
  107373. var end = segment.end;
  107374. if (!finite(start2) || !finite(end)) {
  107375. return;
  107376. }
  107377. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  107378. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  107379. var value = {
  107380. custom: segment.custom,
  107381. dateTimeObject: segment.dateTimeObject,
  107382. dateTimeString: segment.dateTimeString,
  107383. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  107384. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  107385. codecs: segmentInfo.playlist.attributes.CODECS,
  107386. byteLength: segmentInfo.byteLength,
  107387. uri: segmentInfo.uri,
  107388. timeline: segmentInfo.timeline,
  107389. playlist: segmentInfo.playlist.id,
  107390. start: start2,
  107391. end
  107392. };
  107393. var data = JSON.stringify(value);
  107394. var cue = new Cue(start2, end, data);
  107395. cue.value = value;
  107396. this.segmentMetadataTrack_.addCue(cue);
  107397. };
  107398. return SegmentLoader2;
  107399. }(videojs.EventTarget);
  107400. function noop() {
  107401. }
  107402. var toTitleCase2 = function toTitleCase3(string) {
  107403. if (typeof string !== "string") {
  107404. return string;
  107405. }
  107406. return string.replace(/./, function(w) {
  107407. return w.toUpperCase();
  107408. });
  107409. };
  107410. var bufferTypes = ["video", "audio"];
  107411. var _updating = function updating2(type2, sourceUpdater) {
  107412. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107413. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  107414. };
  107415. var nextQueueIndexOfType = function nextQueueIndexOfType2(type2, queue) {
  107416. for (var i2 = 0; i2 < queue.length; i2++) {
  107417. var queueEntry = queue[i2];
  107418. if (queueEntry.type === "mediaSource") {
  107419. return null;
  107420. }
  107421. if (queueEntry.type === type2) {
  107422. return i2;
  107423. }
  107424. }
  107425. return null;
  107426. };
  107427. var shiftQueue = function shiftQueue2(type2, sourceUpdater) {
  107428. if (sourceUpdater.queue.length === 0) {
  107429. return;
  107430. }
  107431. var queueIndex = 0;
  107432. var queueEntry = sourceUpdater.queue[queueIndex];
  107433. if (queueEntry.type === "mediaSource") {
  107434. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  107435. sourceUpdater.queue.shift();
  107436. queueEntry.action(sourceUpdater);
  107437. if (queueEntry.doneFn) {
  107438. queueEntry.doneFn();
  107439. }
  107440. shiftQueue2("audio", sourceUpdater);
  107441. shiftQueue2("video", sourceUpdater);
  107442. }
  107443. return;
  107444. }
  107445. if (type2 === "mediaSource") {
  107446. return;
  107447. }
  107448. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || _updating(type2, sourceUpdater)) {
  107449. return;
  107450. }
  107451. if (queueEntry.type !== type2) {
  107452. queueIndex = nextQueueIndexOfType(type2, sourceUpdater.queue);
  107453. if (queueIndex === null) {
  107454. return;
  107455. }
  107456. queueEntry = sourceUpdater.queue[queueIndex];
  107457. }
  107458. sourceUpdater.queue.splice(queueIndex, 1);
  107459. sourceUpdater.queuePending[type2] = queueEntry;
  107460. queueEntry.action(type2, sourceUpdater);
  107461. if (!queueEntry.doneFn) {
  107462. sourceUpdater.queuePending[type2] = null;
  107463. shiftQueue2(type2, sourceUpdater);
  107464. return;
  107465. }
  107466. };
  107467. var cleanupBuffer = function cleanupBuffer2(type2, sourceUpdater) {
  107468. var buffer = sourceUpdater[type2 + "Buffer"];
  107469. var titleType = toTitleCase2(type2);
  107470. if (!buffer) {
  107471. return;
  107472. }
  107473. buffer.removeEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107474. buffer.removeEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107475. sourceUpdater.codecs[type2] = null;
  107476. sourceUpdater[type2 + "Buffer"] = null;
  107477. };
  107478. var inSourceBuffers = function inSourceBuffers2(mediaSource, sourceBuffer) {
  107479. return mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  107480. };
  107481. var actions = {
  107482. appendBuffer: function appendBuffer(bytes, segmentInfo, onError2) {
  107483. return function(type2, sourceUpdater) {
  107484. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107485. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107486. return;
  107487. }
  107488. sourceUpdater.logger_("Appending segment " + segmentInfo.mediaIndex + "'s " + bytes.length + " bytes to " + type2 + "Buffer");
  107489. try {
  107490. sourceBuffer.appendBuffer(bytes);
  107491. } catch (e) {
  107492. sourceUpdater.logger_("Error with code " + e.code + " " + (e.code === QUOTA_EXCEEDED_ERR ? "(QUOTA_EXCEEDED_ERR) " : "") + ("when appending segment " + segmentInfo.mediaIndex + " to " + type2 + "Buffer"));
  107493. sourceUpdater.queuePending[type2] = null;
  107494. onError2(e);
  107495. }
  107496. };
  107497. },
  107498. remove: function remove(start2, end) {
  107499. return function(type2, sourceUpdater) {
  107500. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107501. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107502. return;
  107503. }
  107504. sourceUpdater.logger_("Removing " + start2 + " to " + end + " from " + type2 + "Buffer");
  107505. try {
  107506. sourceBuffer.remove(start2, end);
  107507. } catch (e) {
  107508. sourceUpdater.logger_("Remove " + start2 + " to " + end + " from " + type2 + "Buffer failed");
  107509. }
  107510. };
  107511. },
  107512. timestampOffset: function timestampOffset(offset) {
  107513. return function(type2, sourceUpdater) {
  107514. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107515. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107516. return;
  107517. }
  107518. sourceUpdater.logger_("Setting " + type2 + "timestampOffset to " + offset);
  107519. sourceBuffer.timestampOffset = offset;
  107520. };
  107521. },
  107522. callback: function callback(_callback) {
  107523. return function(type2, sourceUpdater) {
  107524. _callback();
  107525. };
  107526. },
  107527. endOfStream: function endOfStream(error) {
  107528. return function(sourceUpdater) {
  107529. if (sourceUpdater.mediaSource.readyState !== "open") {
  107530. return;
  107531. }
  107532. sourceUpdater.logger_("Calling mediaSource endOfStream(" + (error || "") + ")");
  107533. try {
  107534. sourceUpdater.mediaSource.endOfStream(error);
  107535. } catch (e) {
  107536. videojs.log.warn("Failed to call media source endOfStream", e);
  107537. }
  107538. };
  107539. },
  107540. duration: function duration4(_duration) {
  107541. return function(sourceUpdater) {
  107542. sourceUpdater.logger_("Setting mediaSource duration to " + _duration);
  107543. try {
  107544. sourceUpdater.mediaSource.duration = _duration;
  107545. } catch (e) {
  107546. videojs.log.warn("Failed to set media source duration", e);
  107547. }
  107548. };
  107549. },
  107550. abort: function abort() {
  107551. return function(type2, sourceUpdater) {
  107552. if (sourceUpdater.mediaSource.readyState !== "open") {
  107553. return;
  107554. }
  107555. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107556. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107557. return;
  107558. }
  107559. sourceUpdater.logger_("calling abort on " + type2 + "Buffer");
  107560. try {
  107561. sourceBuffer.abort();
  107562. } catch (e) {
  107563. videojs.log.warn("Failed to abort on " + type2 + "Buffer", e);
  107564. }
  107565. };
  107566. },
  107567. addSourceBuffer: function addSourceBuffer(type2, codec) {
  107568. return function(sourceUpdater) {
  107569. var titleType = toTitleCase2(type2);
  107570. var mime = getMimeForCodec2(codec);
  107571. sourceUpdater.logger_("Adding " + type2 + "Buffer with codec " + codec + " to mediaSource");
  107572. var sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  107573. sourceBuffer.addEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107574. sourceBuffer.addEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107575. sourceUpdater.codecs[type2] = codec;
  107576. sourceUpdater[type2 + "Buffer"] = sourceBuffer;
  107577. };
  107578. },
  107579. removeSourceBuffer: function removeSourceBuffer(type2) {
  107580. return function(sourceUpdater) {
  107581. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107582. cleanupBuffer(type2, sourceUpdater);
  107583. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107584. return;
  107585. }
  107586. sourceUpdater.logger_("Removing " + type2 + "Buffer with codec " + sourceUpdater.codecs[type2] + " from mediaSource");
  107587. try {
  107588. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  107589. } catch (e) {
  107590. videojs.log.warn("Failed to removeSourceBuffer " + type2 + "Buffer", e);
  107591. }
  107592. };
  107593. },
  107594. changeType: function changeType(codec) {
  107595. return function(type2, sourceUpdater) {
  107596. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107597. var mime = getMimeForCodec2(codec);
  107598. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107599. return;
  107600. }
  107601. if (sourceUpdater.codecs[type2] === codec) {
  107602. return;
  107603. }
  107604. sourceUpdater.logger_("changing " + type2 + "Buffer codec from " + sourceUpdater.codecs[type2] + " to " + codec);
  107605. sourceBuffer.changeType(mime);
  107606. sourceUpdater.codecs[type2] = codec;
  107607. };
  107608. }
  107609. };
  107610. var pushQueue = function pushQueue2(_ref) {
  107611. var type2 = _ref.type, sourceUpdater = _ref.sourceUpdater, action = _ref.action, doneFn = _ref.doneFn, name = _ref.name;
  107612. sourceUpdater.queue.push({
  107613. type: type2,
  107614. action,
  107615. doneFn,
  107616. name
  107617. });
  107618. shiftQueue(type2, sourceUpdater);
  107619. };
  107620. var onUpdateend = function onUpdateend2(type2, sourceUpdater) {
  107621. return function(e) {
  107622. if (sourceUpdater.queuePending[type2]) {
  107623. var doneFn = sourceUpdater.queuePending[type2].doneFn;
  107624. sourceUpdater.queuePending[type2] = null;
  107625. if (doneFn) {
  107626. doneFn(sourceUpdater[type2 + "Error_"]);
  107627. }
  107628. }
  107629. shiftQueue(type2, sourceUpdater);
  107630. };
  107631. };
  107632. var SourceUpdater = /* @__PURE__ */ function(_videojs$EventTarget) {
  107633. _inheritsLoose(SourceUpdater2, _videojs$EventTarget);
  107634. function SourceUpdater2(mediaSource) {
  107635. var _this;
  107636. _this = _videojs$EventTarget.call(this) || this;
  107637. _this.mediaSource = mediaSource;
  107638. _this.sourceopenListener_ = function() {
  107639. return shiftQueue("mediaSource", _assertThisInitialized(_this));
  107640. };
  107641. _this.mediaSource.addEventListener("sourceopen", _this.sourceopenListener_);
  107642. _this.logger_ = logger("SourceUpdater");
  107643. _this.audioTimestampOffset_ = 0;
  107644. _this.videoTimestampOffset_ = 0;
  107645. _this.queue = [];
  107646. _this.queuePending = {
  107647. audio: null,
  107648. video: null
  107649. };
  107650. _this.delayedAudioAppendQueue_ = [];
  107651. _this.videoAppendQueued_ = false;
  107652. _this.codecs = {};
  107653. _this.onVideoUpdateEnd_ = onUpdateend("video", _assertThisInitialized(_this));
  107654. _this.onAudioUpdateEnd_ = onUpdateend("audio", _assertThisInitialized(_this));
  107655. _this.onVideoError_ = function(e) {
  107656. _this.videoError_ = e;
  107657. };
  107658. _this.onAudioError_ = function(e) {
  107659. _this.audioError_ = e;
  107660. };
  107661. _this.createdSourceBuffers_ = false;
  107662. _this.initializedEme_ = false;
  107663. _this.triggeredReady_ = false;
  107664. return _this;
  107665. }
  107666. var _proto = SourceUpdater2.prototype;
  107667. _proto.initializedEme = function initializedEme() {
  107668. this.initializedEme_ = true;
  107669. this.triggerReady();
  107670. };
  107671. _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() {
  107672. return this.createdSourceBuffers_;
  107673. };
  107674. _proto.hasInitializedAnyEme = function hasInitializedAnyEme() {
  107675. return this.initializedEme_;
  107676. };
  107677. _proto.ready = function ready() {
  107678. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  107679. };
  107680. _proto.createSourceBuffers = function createSourceBuffers(codecs) {
  107681. if (this.hasCreatedSourceBuffers()) {
  107682. return;
  107683. }
  107684. this.addOrChangeSourceBuffers(codecs);
  107685. this.createdSourceBuffers_ = true;
  107686. this.trigger("createdsourcebuffers");
  107687. this.triggerReady();
  107688. };
  107689. _proto.triggerReady = function triggerReady() {
  107690. if (this.ready() && !this.triggeredReady_) {
  107691. this.triggeredReady_ = true;
  107692. this.trigger("ready");
  107693. }
  107694. };
  107695. _proto.addSourceBuffer = function addSourceBuffer2(type2, codec) {
  107696. pushQueue({
  107697. type: "mediaSource",
  107698. sourceUpdater: this,
  107699. action: actions.addSourceBuffer(type2, codec),
  107700. name: "addSourceBuffer"
  107701. });
  107702. };
  107703. _proto.abort = function abort2(type2) {
  107704. pushQueue({
  107705. type: type2,
  107706. sourceUpdater: this,
  107707. action: actions.abort(type2),
  107708. name: "abort"
  107709. });
  107710. };
  107711. _proto.removeSourceBuffer = function removeSourceBuffer2(type2) {
  107712. if (!this.canRemoveSourceBuffer()) {
  107713. videojs.log.error("removeSourceBuffer is not supported!");
  107714. return;
  107715. }
  107716. pushQueue({
  107717. type: "mediaSource",
  107718. sourceUpdater: this,
  107719. action: actions.removeSourceBuffer(type2),
  107720. name: "removeSourceBuffer"
  107721. });
  107722. };
  107723. _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() {
  107724. return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  107725. };
  107726. SourceUpdater2.canChangeType = function canChangeType() {
  107727. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  107728. };
  107729. _proto.canChangeType = function canChangeType() {
  107730. return this.constructor.canChangeType();
  107731. };
  107732. _proto.changeType = function changeType2(type2, codec) {
  107733. if (!this.canChangeType()) {
  107734. videojs.log.error("changeType is not supported!");
  107735. return;
  107736. }
  107737. pushQueue({
  107738. type: type2,
  107739. sourceUpdater: this,
  107740. action: actions.changeType(codec),
  107741. name: "changeType"
  107742. });
  107743. };
  107744. _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) {
  107745. var _this2 = this;
  107746. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  107747. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  107748. }
  107749. Object.keys(codecs).forEach(function(type2) {
  107750. var codec = codecs[type2];
  107751. if (!_this2.hasCreatedSourceBuffers()) {
  107752. return _this2.addSourceBuffer(type2, codec);
  107753. }
  107754. if (_this2.canChangeType()) {
  107755. _this2.changeType(type2, codec);
  107756. }
  107757. });
  107758. };
  107759. _proto.appendBuffer = function appendBuffer2(options2, doneFn) {
  107760. var _this3 = this;
  107761. var segmentInfo = options2.segmentInfo, type2 = options2.type, bytes = options2.bytes;
  107762. this.processedAppend_ = true;
  107763. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  107764. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  107765. this.logger_("delayed audio append of " + bytes.length + " until video append");
  107766. return;
  107767. }
  107768. var onError2 = doneFn;
  107769. pushQueue({
  107770. type: type2,
  107771. sourceUpdater: this,
  107772. action: actions.appendBuffer(bytes, segmentInfo || {
  107773. mediaIndex: -1
  107774. }, onError2),
  107775. doneFn,
  107776. name: "appendBuffer"
  107777. });
  107778. if (type2 === "video") {
  107779. this.videoAppendQueued_ = true;
  107780. if (!this.delayedAudioAppendQueue_.length) {
  107781. return;
  107782. }
  107783. var queue = this.delayedAudioAppendQueue_.slice();
  107784. this.logger_("queuing delayed audio " + queue.length + " appendBuffers");
  107785. this.delayedAudioAppendQueue_.length = 0;
  107786. queue.forEach(function(que) {
  107787. _this3.appendBuffer.apply(_this3, que);
  107788. });
  107789. }
  107790. };
  107791. _proto.audioBuffered = function audioBuffered() {
  107792. if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {
  107793. return videojs.createTimeRange();
  107794. }
  107795. return this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange();
  107796. };
  107797. _proto.videoBuffered = function videoBuffered() {
  107798. if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {
  107799. return videojs.createTimeRange();
  107800. }
  107801. return this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange();
  107802. };
  107803. _proto.buffered = function buffered() {
  107804. var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  107805. var audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  107806. if (audio && !video) {
  107807. return this.audioBuffered();
  107808. }
  107809. if (video && !audio) {
  107810. return this.videoBuffered();
  107811. }
  107812. return bufferIntersection(this.audioBuffered(), this.videoBuffered());
  107813. };
  107814. _proto.setDuration = function setDuration(duration5, doneFn) {
  107815. if (doneFn === void 0) {
  107816. doneFn = noop;
  107817. }
  107818. pushQueue({
  107819. type: "mediaSource",
  107820. sourceUpdater: this,
  107821. action: actions.duration(duration5),
  107822. name: "duration",
  107823. doneFn
  107824. });
  107825. };
  107826. _proto.endOfStream = function endOfStream2(error, doneFn) {
  107827. if (error === void 0) {
  107828. error = null;
  107829. }
  107830. if (doneFn === void 0) {
  107831. doneFn = noop;
  107832. }
  107833. if (typeof error !== "string") {
  107834. error = void 0;
  107835. }
  107836. pushQueue({
  107837. type: "mediaSource",
  107838. sourceUpdater: this,
  107839. action: actions.endOfStream(error),
  107840. name: "endOfStream",
  107841. doneFn
  107842. });
  107843. };
  107844. _proto.removeAudio = function removeAudio(start2, end, done) {
  107845. if (done === void 0) {
  107846. done = noop;
  107847. }
  107848. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  107849. done();
  107850. return;
  107851. }
  107852. pushQueue({
  107853. type: "audio",
  107854. sourceUpdater: this,
  107855. action: actions.remove(start2, end),
  107856. doneFn: done,
  107857. name: "remove"
  107858. });
  107859. };
  107860. _proto.removeVideo = function removeVideo(start2, end, done) {
  107861. if (done === void 0) {
  107862. done = noop;
  107863. }
  107864. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  107865. done();
  107866. return;
  107867. }
  107868. pushQueue({
  107869. type: "video",
  107870. sourceUpdater: this,
  107871. action: actions.remove(start2, end),
  107872. doneFn: done,
  107873. name: "remove"
  107874. });
  107875. };
  107876. _proto.updating = function updating3() {
  107877. if (_updating("audio", this) || _updating("video", this)) {
  107878. return true;
  107879. }
  107880. return false;
  107881. };
  107882. _proto.audioTimestampOffset = function audioTimestampOffset(offset) {
  107883. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  107884. pushQueue({
  107885. type: "audio",
  107886. sourceUpdater: this,
  107887. action: actions.timestampOffset(offset),
  107888. name: "timestampOffset"
  107889. });
  107890. this.audioTimestampOffset_ = offset;
  107891. }
  107892. return this.audioTimestampOffset_;
  107893. };
  107894. _proto.videoTimestampOffset = function videoTimestampOffset(offset) {
  107895. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  107896. pushQueue({
  107897. type: "video",
  107898. sourceUpdater: this,
  107899. action: actions.timestampOffset(offset),
  107900. name: "timestampOffset"
  107901. });
  107902. this.videoTimestampOffset_ = offset;
  107903. }
  107904. return this.videoTimestampOffset_;
  107905. };
  107906. _proto.audioQueueCallback = function audioQueueCallback(callback2) {
  107907. if (!this.audioBuffer) {
  107908. return;
  107909. }
  107910. pushQueue({
  107911. type: "audio",
  107912. sourceUpdater: this,
  107913. action: actions.callback(callback2),
  107914. name: "callback"
  107915. });
  107916. };
  107917. _proto.videoQueueCallback = function videoQueueCallback(callback2) {
  107918. if (!this.videoBuffer) {
  107919. return;
  107920. }
  107921. pushQueue({
  107922. type: "video",
  107923. sourceUpdater: this,
  107924. action: actions.callback(callback2),
  107925. name: "callback"
  107926. });
  107927. };
  107928. _proto.dispose = function dispose() {
  107929. var _this4 = this;
  107930. this.trigger("dispose");
  107931. bufferTypes.forEach(function(type2) {
  107932. _this4.abort(type2);
  107933. if (_this4.canRemoveSourceBuffer()) {
  107934. _this4.removeSourceBuffer(type2);
  107935. } else {
  107936. _this4[type2 + "QueueCallback"](function() {
  107937. return cleanupBuffer(type2, _this4);
  107938. });
  107939. }
  107940. });
  107941. this.videoAppendQueued_ = false;
  107942. this.delayedAudioAppendQueue_.length = 0;
  107943. if (this.sourceopenListener_) {
  107944. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  107945. }
  107946. this.off();
  107947. };
  107948. return SourceUpdater2;
  107949. }(videojs.EventTarget);
  107950. var uint8ToUtf8 = function uint8ToUtf82(uintArray) {
  107951. return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  107952. };
  107953. var VTT_LINE_TERMINATORS = new Uint8Array("\n\n".split("").map(function(_char3) {
  107954. return _char3.charCodeAt(0);
  107955. }));
  107956. var NoVttJsError = /* @__PURE__ */ function(_Error) {
  107957. _inheritsLoose(NoVttJsError2, _Error);
  107958. function NoVttJsError2() {
  107959. return _Error.call(this, "Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.") || this;
  107960. }
  107961. return NoVttJsError2;
  107962. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  107963. var VTTSegmentLoader = /* @__PURE__ */ function(_SegmentLoader) {
  107964. _inheritsLoose(VTTSegmentLoader2, _SegmentLoader);
  107965. function VTTSegmentLoader2(settings, options2) {
  107966. var _this;
  107967. if (options2 === void 0) {
  107968. options2 = {};
  107969. }
  107970. _this = _SegmentLoader.call(this, settings, options2) || this;
  107971. _this.mediaSource_ = null;
  107972. _this.subtitlesTrack_ = null;
  107973. _this.loaderType_ = "subtitle";
  107974. _this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  107975. _this.loadVttJs = settings.loadVttJs;
  107976. _this.shouldSaveSegmentTimingInfo_ = false;
  107977. return _this;
  107978. }
  107979. var _proto = VTTSegmentLoader2.prototype;
  107980. _proto.createTransmuxer_ = function createTransmuxer_() {
  107981. return null;
  107982. };
  107983. _proto.buffered_ = function buffered_() {
  107984. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  107985. return videojs.createTimeRanges();
  107986. }
  107987. var cues = this.subtitlesTrack_.cues;
  107988. var start2 = cues[0].startTime;
  107989. var end = cues[cues.length - 1].startTime;
  107990. return videojs.createTimeRanges([[start2, end]]);
  107991. };
  107992. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  107993. if (set4 === void 0) {
  107994. set4 = false;
  107995. }
  107996. if (!map) {
  107997. return null;
  107998. }
  107999. var id = initSegmentId(map);
  108000. var storedMap = this.initSegments_[id];
  108001. if (set4 && !storedMap && map.bytes) {
  108002. var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;
  108003. var combinedSegment = new Uint8Array(combinedByteLength);
  108004. combinedSegment.set(map.bytes);
  108005. combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);
  108006. this.initSegments_[id] = storedMap = {
  108007. resolvedUri: map.resolvedUri,
  108008. byterange: map.byterange,
  108009. bytes: combinedSegment
  108010. };
  108011. }
  108012. return storedMap || map;
  108013. };
  108014. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  108015. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  108016. };
  108017. _proto.init_ = function init_() {
  108018. this.state = "READY";
  108019. this.resetEverything();
  108020. return this.monitorBuffer_();
  108021. };
  108022. _proto.track = function track(_track) {
  108023. if (typeof _track === "undefined") {
  108024. return this.subtitlesTrack_;
  108025. }
  108026. this.subtitlesTrack_ = _track;
  108027. if (this.state === "INIT" && this.couldBeginLoading_()) {
  108028. this.init_();
  108029. }
  108030. return this.subtitlesTrack_;
  108031. };
  108032. _proto.remove = function remove2(start2, end) {
  108033. removeCuesFromTrack(start2, end, this.subtitlesTrack_);
  108034. };
  108035. _proto.fillBuffer_ = function fillBuffer_() {
  108036. var _this2 = this;
  108037. var segmentInfo = this.chooseNextRequest_();
  108038. if (!segmentInfo) {
  108039. return;
  108040. }
  108041. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  108042. var checkTimestampOffset = function checkTimestampOffset2() {
  108043. _this2.state = "READY";
  108044. if (!_this2.paused()) {
  108045. _this2.monitorBuffer_();
  108046. }
  108047. };
  108048. this.syncController_.one("timestampoffset", checkTimestampOffset);
  108049. this.state = "WAITING_ON_TIMELINE";
  108050. return;
  108051. }
  108052. this.loadSegment_(segmentInfo);
  108053. };
  108054. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() {
  108055. return null;
  108056. };
  108057. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  108058. return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this));
  108059. };
  108060. _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) {
  108061. while (segmentInfo && segmentInfo.segment.empty) {
  108062. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  108063. segmentInfo = null;
  108064. break;
  108065. }
  108066. segmentInfo = this.generateSegmentInfo_({
  108067. playlist: segmentInfo.playlist,
  108068. mediaIndex: segmentInfo.mediaIndex + 1,
  108069. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  108070. isSyncRequest: segmentInfo.isSyncRequest
  108071. });
  108072. }
  108073. return segmentInfo;
  108074. };
  108075. _proto.stopForError = function stopForError(error) {
  108076. this.error(error);
  108077. this.state = "READY";
  108078. this.pause();
  108079. this.trigger("error");
  108080. };
  108081. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  108082. var _this3 = this;
  108083. if (!this.subtitlesTrack_) {
  108084. this.state = "READY";
  108085. return;
  108086. }
  108087. this.saveTransferStats_(simpleSegment.stats);
  108088. if (!this.pendingSegment_) {
  108089. this.state = "READY";
  108090. this.mediaRequestsAborted += 1;
  108091. return;
  108092. }
  108093. if (error) {
  108094. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  108095. this.handleTimeout_();
  108096. }
  108097. if (error.code === REQUEST_ERRORS.ABORTED) {
  108098. this.mediaRequestsAborted += 1;
  108099. } else {
  108100. this.mediaRequestsErrored += 1;
  108101. }
  108102. this.stopForError(error);
  108103. return;
  108104. }
  108105. var segmentInfo = this.pendingSegment_;
  108106. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  108107. if (simpleSegment.key) {
  108108. this.segmentKey(simpleSegment.key, true);
  108109. }
  108110. this.state = "APPENDING";
  108111. this.trigger("appending");
  108112. var segment = segmentInfo.segment;
  108113. if (segment.map) {
  108114. segment.map.bytes = simpleSegment.map.bytes;
  108115. }
  108116. segmentInfo.bytes = simpleSegment.bytes;
  108117. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  108118. this.state = "WAITING_ON_VTTJS";
  108119. this.loadVttJs().then(function() {
  108120. return _this3.segmentRequestFinished_(error, simpleSegment, result);
  108121. }, function() {
  108122. return _this3.stopForError({
  108123. message: "Error loading vtt.js"
  108124. });
  108125. });
  108126. return;
  108127. }
  108128. segment.requested = true;
  108129. try {
  108130. this.parseVTTCues_(segmentInfo);
  108131. } catch (e) {
  108132. this.stopForError({
  108133. message: e.message
  108134. });
  108135. return;
  108136. }
  108137. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  108138. if (segmentInfo.cues.length) {
  108139. segmentInfo.timingInfo = {
  108140. start: segmentInfo.cues[0].startTime,
  108141. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  108142. };
  108143. } else {
  108144. segmentInfo.timingInfo = {
  108145. start: segmentInfo.startOfSegment,
  108146. end: segmentInfo.startOfSegment + segmentInfo.duration
  108147. };
  108148. }
  108149. if (segmentInfo.isSyncRequest) {
  108150. this.trigger("syncinfoupdate");
  108151. this.pendingSegment_ = null;
  108152. this.state = "READY";
  108153. return;
  108154. }
  108155. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  108156. this.mediaSecondsLoaded += segment.duration;
  108157. segmentInfo.cues.forEach(function(cue) {
  108158. _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  108159. });
  108160. removeDuplicateCuesFromTrack(this.subtitlesTrack_);
  108161. this.handleAppendsDone_();
  108162. };
  108163. _proto.handleData_ = function handleData_3() {
  108164. };
  108165. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {
  108166. };
  108167. _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) {
  108168. var decoder;
  108169. var decodeBytesToString = false;
  108170. if (typeof window_1.WebVTT !== "function") {
  108171. throw new NoVttJsError();
  108172. }
  108173. if (typeof window_1.TextDecoder === "function") {
  108174. decoder = new window_1.TextDecoder("utf8");
  108175. } else {
  108176. decoder = window_1.WebVTT.StringDecoder();
  108177. decodeBytesToString = true;
  108178. }
  108179. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  108180. segmentInfo.cues = [];
  108181. segmentInfo.timestampmap = {
  108182. MPEGTS: 0,
  108183. LOCAL: 0
  108184. };
  108185. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  108186. parser2.ontimestampmap = function(map) {
  108187. segmentInfo.timestampmap = map;
  108188. };
  108189. parser2.onparsingerror = function(error) {
  108190. videojs.log.warn("Error encountered when parsing cues: " + error.message);
  108191. };
  108192. if (segmentInfo.segment.map) {
  108193. var mapData = segmentInfo.segment.map.bytes;
  108194. if (decodeBytesToString) {
  108195. mapData = uint8ToUtf8(mapData);
  108196. }
  108197. parser2.parse(mapData);
  108198. }
  108199. var segmentData = segmentInfo.bytes;
  108200. if (decodeBytesToString) {
  108201. segmentData = uint8ToUtf8(segmentData);
  108202. }
  108203. parser2.parse(segmentData);
  108204. parser2.flush();
  108205. };
  108206. _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  108207. var segment = segmentInfo.segment;
  108208. if (!mappingObj) {
  108209. return;
  108210. }
  108211. if (!segmentInfo.cues.length) {
  108212. segment.empty = true;
  108213. return;
  108214. }
  108215. var timestampmap = segmentInfo.timestampmap;
  108216. var diff = timestampmap.MPEGTS / clock.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  108217. segmentInfo.cues.forEach(function(cue) {
  108218. cue.startTime += diff;
  108219. cue.endTime += diff;
  108220. });
  108221. if (!playlist.syncInfo) {
  108222. var firstStart = segmentInfo.cues[0].startTime;
  108223. var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  108224. playlist.syncInfo = {
  108225. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  108226. time: Math.min(firstStart, lastStart - segment.duration)
  108227. };
  108228. }
  108229. };
  108230. return VTTSegmentLoader2;
  108231. }(SegmentLoader);
  108232. var findAdCue = function findAdCue2(track, mediaTime) {
  108233. var cues = track.cues;
  108234. for (var i2 = 0; i2 < cues.length; i2++) {
  108235. var cue = cues[i2];
  108236. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  108237. return cue;
  108238. }
  108239. }
  108240. return null;
  108241. };
  108242. var updateAdCues = function updateAdCues2(media, track, offset) {
  108243. if (offset === void 0) {
  108244. offset = 0;
  108245. }
  108246. if (!media.segments) {
  108247. return;
  108248. }
  108249. var mediaTime = offset;
  108250. var cue;
  108251. for (var i2 = 0; i2 < media.segments.length; i2++) {
  108252. var segment = media.segments[i2];
  108253. if (!cue) {
  108254. cue = findAdCue(track, mediaTime + segment.duration / 2);
  108255. }
  108256. if (cue) {
  108257. if ("cueIn" in segment) {
  108258. cue.endTime = mediaTime;
  108259. cue.adEndTime = mediaTime;
  108260. mediaTime += segment.duration;
  108261. cue = null;
  108262. continue;
  108263. }
  108264. if (mediaTime < cue.endTime) {
  108265. mediaTime += segment.duration;
  108266. continue;
  108267. }
  108268. cue.endTime += segment.duration;
  108269. } else {
  108270. if ("cueOut" in segment) {
  108271. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  108272. cue.adStartTime = mediaTime;
  108273. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  108274. track.addCue(cue);
  108275. }
  108276. if ("cueOutCont" in segment) {
  108277. var _segment$cueOutCont$s = segment.cueOutCont.split("/").map(parseFloat), adOffset = _segment$cueOutCont$s[0], adTotal = _segment$cueOutCont$s[1];
  108278. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  108279. cue.adStartTime = mediaTime - adOffset;
  108280. cue.adEndTime = cue.adStartTime + adTotal;
  108281. track.addCue(cue);
  108282. }
  108283. }
  108284. mediaTime += segment.duration;
  108285. }
  108286. };
  108287. var MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;
  108288. var syncPointStrategies = [
  108289. {
  108290. name: "VOD",
  108291. run: function run(syncController, playlist, duration5, currentTimeline, currentTime) {
  108292. if (duration5 !== Infinity) {
  108293. var syncPoint = {
  108294. time: 0,
  108295. segmentIndex: 0,
  108296. partIndex: null
  108297. };
  108298. return syncPoint;
  108299. }
  108300. return null;
  108301. }
  108302. },
  108303. {
  108304. name: "ProgramDateTime",
  108305. run: function run2(syncController, playlist, duration5, currentTimeline, currentTime) {
  108306. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  108307. return null;
  108308. }
  108309. var syncPoint = null;
  108310. var lastDistance = null;
  108311. var partsAndSegments = getPartsAndSegments(playlist);
  108312. currentTime = currentTime || 0;
  108313. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108314. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108315. var partAndSegment = partsAndSegments[index2];
  108316. var segment = partAndSegment.segment;
  108317. var datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  108318. if (!datetimeMapping || !segment.dateTimeObject) {
  108319. continue;
  108320. }
  108321. var segmentTime = segment.dateTimeObject.getTime() / 1e3;
  108322. var start2 = segmentTime + datetimeMapping;
  108323. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  108324. for (var z = 0; z < partAndSegment.partIndex; z++) {
  108325. start2 += segment.parts[z].duration;
  108326. }
  108327. }
  108328. var distance2 = Math.abs(currentTime - start2);
  108329. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  108330. break;
  108331. }
  108332. lastDistance = distance2;
  108333. syncPoint = {
  108334. time: start2,
  108335. segmentIndex: partAndSegment.segmentIndex,
  108336. partIndex: partAndSegment.partIndex
  108337. };
  108338. }
  108339. return syncPoint;
  108340. }
  108341. },
  108342. {
  108343. name: "Segment",
  108344. run: function run3(syncController, playlist, duration5, currentTimeline, currentTime) {
  108345. var syncPoint = null;
  108346. var lastDistance = null;
  108347. currentTime = currentTime || 0;
  108348. var partsAndSegments = getPartsAndSegments(playlist);
  108349. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108350. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108351. var partAndSegment = partsAndSegments[index2];
  108352. var segment = partAndSegment.segment;
  108353. var start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  108354. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  108355. var distance2 = Math.abs(currentTime - start2);
  108356. if (lastDistance !== null && lastDistance < distance2) {
  108357. break;
  108358. }
  108359. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108360. lastDistance = distance2;
  108361. syncPoint = {
  108362. time: start2,
  108363. segmentIndex: partAndSegment.segmentIndex,
  108364. partIndex: partAndSegment.partIndex
  108365. };
  108366. }
  108367. }
  108368. }
  108369. return syncPoint;
  108370. }
  108371. },
  108372. {
  108373. name: "Discontinuity",
  108374. run: function run4(syncController, playlist, duration5, currentTimeline, currentTime) {
  108375. var syncPoint = null;
  108376. currentTime = currentTime || 0;
  108377. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108378. var lastDistance = null;
  108379. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108380. var segmentIndex = playlist.discontinuityStarts[i2];
  108381. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108382. var discontinuitySync = syncController.discontinuities[discontinuity];
  108383. if (discontinuitySync) {
  108384. var distance2 = Math.abs(currentTime - discontinuitySync.time);
  108385. if (lastDistance !== null && lastDistance < distance2) {
  108386. break;
  108387. }
  108388. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108389. lastDistance = distance2;
  108390. syncPoint = {
  108391. time: discontinuitySync.time,
  108392. segmentIndex,
  108393. partIndex: null
  108394. };
  108395. }
  108396. }
  108397. }
  108398. }
  108399. return syncPoint;
  108400. }
  108401. },
  108402. {
  108403. name: "Playlist",
  108404. run: function run5(syncController, playlist, duration5, currentTimeline, currentTime) {
  108405. if (playlist.syncInfo) {
  108406. var syncPoint = {
  108407. time: playlist.syncInfo.time,
  108408. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  108409. partIndex: null
  108410. };
  108411. return syncPoint;
  108412. }
  108413. return null;
  108414. }
  108415. }
  108416. ];
  108417. var SyncController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108418. _inheritsLoose(SyncController2, _videojs$EventTarget);
  108419. function SyncController2(options2) {
  108420. var _this;
  108421. _this = _videojs$EventTarget.call(this) || this;
  108422. _this.timelines = [];
  108423. _this.discontinuities = [];
  108424. _this.timelineToDatetimeMappings = {};
  108425. _this.logger_ = logger("SyncController");
  108426. return _this;
  108427. }
  108428. var _proto = SyncController2.prototype;
  108429. _proto.getSyncPoint = function getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  108430. var syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  108431. if (!syncPoints.length) {
  108432. return null;
  108433. }
  108434. return this.selectSyncPoint_(syncPoints, {
  108435. key: "time",
  108436. value: currentTime
  108437. });
  108438. };
  108439. _proto.getExpiredTime = function getExpiredTime(playlist, duration5) {
  108440. if (!playlist || !playlist.segments) {
  108441. return null;
  108442. }
  108443. var syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  108444. if (!syncPoints.length) {
  108445. return null;
  108446. }
  108447. var syncPoint = this.selectSyncPoint_(syncPoints, {
  108448. key: "segmentIndex",
  108449. value: 0
  108450. });
  108451. if (syncPoint.segmentIndex > 0) {
  108452. syncPoint.time *= -1;
  108453. }
  108454. return Math.abs(syncPoint.time + sumDurations({
  108455. defaultDuration: playlist.targetDuration,
  108456. durationList: playlist.segments,
  108457. startIndex: syncPoint.segmentIndex,
  108458. endIndex: 0
  108459. }));
  108460. };
  108461. _proto.runStrategies_ = function runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  108462. var syncPoints = [];
  108463. for (var i2 = 0; i2 < syncPointStrategies.length; i2++) {
  108464. var strategy = syncPointStrategies[i2];
  108465. var syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  108466. if (syncPoint) {
  108467. syncPoint.strategy = strategy.name;
  108468. syncPoints.push({
  108469. strategy: strategy.name,
  108470. syncPoint
  108471. });
  108472. }
  108473. }
  108474. return syncPoints;
  108475. };
  108476. _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) {
  108477. var bestSyncPoint = syncPoints[0].syncPoint;
  108478. var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  108479. var bestStrategy = syncPoints[0].strategy;
  108480. for (var i2 = 1; i2 < syncPoints.length; i2++) {
  108481. var newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  108482. if (newDistance < bestDistance) {
  108483. bestDistance = newDistance;
  108484. bestSyncPoint = syncPoints[i2].syncPoint;
  108485. bestStrategy = syncPoints[i2].strategy;
  108486. }
  108487. }
  108488. this.logger_("syncPoint for [" + target.key + ": " + target.value + "] chosen with strategy" + (" [" + bestStrategy + "]: [time:" + bestSyncPoint.time + ",") + (" segmentIndex:" + bestSyncPoint.segmentIndex) + (typeof bestSyncPoint.partIndex === "number" ? ",partIndex:" + bestSyncPoint.partIndex : "") + "]");
  108489. return bestSyncPoint;
  108490. };
  108491. _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  108492. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  108493. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {
  108494. videojs.log.warn("Not saving expired segment info. Media sequence gap " + mediaSequenceDiff + " is too large.");
  108495. return;
  108496. }
  108497. for (var i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  108498. var lastRemovedSegment = oldPlaylist.segments[i2];
  108499. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  108500. newPlaylist.syncInfo = {
  108501. mediaSequence: oldPlaylist.mediaSequence + i2,
  108502. time: lastRemovedSegment.start
  108503. };
  108504. this.logger_("playlist refresh sync: [time:" + newPlaylist.syncInfo.time + "," + (" mediaSequence: " + newPlaylist.syncInfo.mediaSequence + "]"));
  108505. this.trigger("syncinfoupdate");
  108506. break;
  108507. }
  108508. }
  108509. };
  108510. _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) {
  108511. this.timelineToDatetimeMappings = {};
  108512. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  108513. var firstSegment = playlist.segments[0];
  108514. var playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  108515. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  108516. }
  108517. };
  108518. _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) {
  108519. var segmentInfo = _ref.segmentInfo, shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping;
  108520. var didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  108521. var segment = segmentInfo.segment;
  108522. if (didCalculateSegmentTimeMapping) {
  108523. this.saveDiscontinuitySyncInfo_(segmentInfo);
  108524. if (!segmentInfo.playlist.syncInfo) {
  108525. segmentInfo.playlist.syncInfo = {
  108526. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  108527. time: segment.start
  108528. };
  108529. }
  108530. }
  108531. var dateTime = segment.dateTimeObject;
  108532. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  108533. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  108534. }
  108535. };
  108536. _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) {
  108537. if (typeof this.timelines[timeline] === "undefined") {
  108538. return null;
  108539. }
  108540. return this.timelines[timeline].time;
  108541. };
  108542. _proto.mappingForTimeline = function mappingForTimeline(timeline) {
  108543. if (typeof this.timelines[timeline] === "undefined") {
  108544. return null;
  108545. }
  108546. return this.timelines[timeline].mapping;
  108547. };
  108548. _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  108549. var segment = segmentInfo.segment;
  108550. var part = segmentInfo.part;
  108551. var mappingObj = this.timelines[segmentInfo.timeline];
  108552. var start2;
  108553. var end;
  108554. if (typeof segmentInfo.timestampOffset === "number") {
  108555. mappingObj = {
  108556. time: segmentInfo.startOfSegment,
  108557. mapping: segmentInfo.startOfSegment - timingInfo.start
  108558. };
  108559. if (shouldSaveTimelineMapping) {
  108560. this.timelines[segmentInfo.timeline] = mappingObj;
  108561. this.trigger("timestampoffset");
  108562. this.logger_("time mapping for timeline " + segmentInfo.timeline + ": " + ("[time: " + mappingObj.time + "] [mapping: " + mappingObj.mapping + "]"));
  108563. }
  108564. start2 = segmentInfo.startOfSegment;
  108565. end = timingInfo.end + mappingObj.mapping;
  108566. } else if (mappingObj) {
  108567. start2 = timingInfo.start + mappingObj.mapping;
  108568. end = timingInfo.end + mappingObj.mapping;
  108569. } else {
  108570. return false;
  108571. }
  108572. if (part) {
  108573. part.start = start2;
  108574. part.end = end;
  108575. }
  108576. if (!segment.start || start2 < segment.start) {
  108577. segment.start = start2;
  108578. }
  108579. segment.end = end;
  108580. return true;
  108581. };
  108582. _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) {
  108583. var playlist = segmentInfo.playlist;
  108584. var segment = segmentInfo.segment;
  108585. if (segment.discontinuity) {
  108586. this.discontinuities[segment.timeline] = {
  108587. time: segment.start,
  108588. accuracy: 0
  108589. };
  108590. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108591. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108592. var segmentIndex = playlist.discontinuityStarts[i2];
  108593. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108594. var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  108595. var accuracy = Math.abs(mediaIndexDiff);
  108596. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  108597. var time = void 0;
  108598. if (mediaIndexDiff < 0) {
  108599. time = segment.start - sumDurations({
  108600. defaultDuration: playlist.targetDuration,
  108601. durationList: playlist.segments,
  108602. startIndex: segmentInfo.mediaIndex,
  108603. endIndex: segmentIndex
  108604. });
  108605. } else {
  108606. time = segment.end + sumDurations({
  108607. defaultDuration: playlist.targetDuration,
  108608. durationList: playlist.segments,
  108609. startIndex: segmentInfo.mediaIndex + 1,
  108610. endIndex: segmentIndex
  108611. });
  108612. }
  108613. this.discontinuities[discontinuity] = {
  108614. time,
  108615. accuracy
  108616. };
  108617. }
  108618. }
  108619. }
  108620. };
  108621. _proto.dispose = function dispose() {
  108622. this.trigger("dispose");
  108623. this.off();
  108624. };
  108625. return SyncController2;
  108626. }(videojs.EventTarget);
  108627. var TimelineChangeController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108628. _inheritsLoose(TimelineChangeController2, _videojs$EventTarget);
  108629. function TimelineChangeController2() {
  108630. var _this;
  108631. _this = _videojs$EventTarget.call(this) || this;
  108632. _this.pendingTimelineChanges_ = {};
  108633. _this.lastTimelineChanges_ = {};
  108634. return _this;
  108635. }
  108636. var _proto = TimelineChangeController2.prototype;
  108637. _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type2) {
  108638. this.pendingTimelineChanges_[type2] = null;
  108639. this.trigger("pendingtimelinechange");
  108640. };
  108641. _proto.pendingTimelineChange = function pendingTimelineChange(_ref) {
  108642. var type2 = _ref.type, from3 = _ref.from, to = _ref.to;
  108643. if (typeof from3 === "number" && typeof to === "number") {
  108644. this.pendingTimelineChanges_[type2] = {
  108645. type: type2,
  108646. from: from3,
  108647. to
  108648. };
  108649. this.trigger("pendingtimelinechange");
  108650. }
  108651. return this.pendingTimelineChanges_[type2];
  108652. };
  108653. _proto.lastTimelineChange = function lastTimelineChange(_ref2) {
  108654. var type2 = _ref2.type, from3 = _ref2.from, to = _ref2.to;
  108655. if (typeof from3 === "number" && typeof to === "number") {
  108656. this.lastTimelineChanges_[type2] = {
  108657. type: type2,
  108658. from: from3,
  108659. to
  108660. };
  108661. delete this.pendingTimelineChanges_[type2];
  108662. this.trigger("timelinechange");
  108663. }
  108664. return this.lastTimelineChanges_[type2];
  108665. };
  108666. _proto.dispose = function dispose() {
  108667. this.trigger("dispose");
  108668. this.pendingTimelineChanges_ = {};
  108669. this.lastTimelineChanges_ = {};
  108670. this.off();
  108671. };
  108672. return TimelineChangeController2;
  108673. }(videojs.EventTarget);
  108674. var workerCode = transform(getWorkerString(function() {
  108675. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  108676. function createCommonjsModule(fn2, basedir, module2) {
  108677. return module2 = {
  108678. path: basedir,
  108679. exports: {},
  108680. require: function require2(path, base2) {
  108681. return commonjsRequire(path, base2 === void 0 || base2 === null ? module2.path : base2);
  108682. }
  108683. }, fn2(module2, module2.exports), module2.exports;
  108684. }
  108685. function commonjsRequire() {
  108686. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  108687. }
  108688. var createClass = createCommonjsModule(function(module2) {
  108689. function _defineProperties(target, props) {
  108690. for (var i2 = 0; i2 < props.length; i2++) {
  108691. var descriptor = props[i2];
  108692. descriptor.enumerable = descriptor.enumerable || false;
  108693. descriptor.configurable = true;
  108694. if ("value" in descriptor)
  108695. descriptor.writable = true;
  108696. Object.defineProperty(target, descriptor.key, descriptor);
  108697. }
  108698. }
  108699. function _createClass(Constructor, protoProps, staticProps) {
  108700. if (protoProps)
  108701. _defineProperties(Constructor.prototype, protoProps);
  108702. if (staticProps)
  108703. _defineProperties(Constructor, staticProps);
  108704. return Constructor;
  108705. }
  108706. module2.exports = _createClass;
  108707. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108708. });
  108709. var setPrototypeOf = createCommonjsModule(function(module2) {
  108710. function _setPrototypeOf2(o, p) {
  108711. module2.exports = _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) {
  108712. o2.__proto__ = p2;
  108713. return o2;
  108714. };
  108715. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108716. return _setPrototypeOf2(o, p);
  108717. }
  108718. module2.exports = _setPrototypeOf2;
  108719. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108720. });
  108721. var inheritsLoose = createCommonjsModule(function(module2) {
  108722. function _inheritsLoose2(subClass, superClass) {
  108723. subClass.prototype = Object.create(superClass.prototype);
  108724. subClass.prototype.constructor = subClass;
  108725. setPrototypeOf(subClass, superClass);
  108726. }
  108727. module2.exports = _inheritsLoose2;
  108728. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108729. });
  108730. var Stream2 = /* @__PURE__ */ function() {
  108731. function Stream3() {
  108732. this.listeners = {};
  108733. }
  108734. var _proto = Stream3.prototype;
  108735. _proto.on = function on3(type2, listener) {
  108736. if (!this.listeners[type2]) {
  108737. this.listeners[type2] = [];
  108738. }
  108739. this.listeners[type2].push(listener);
  108740. };
  108741. _proto.off = function off2(type2, listener) {
  108742. if (!this.listeners[type2]) {
  108743. return false;
  108744. }
  108745. var index2 = this.listeners[type2].indexOf(listener);
  108746. this.listeners[type2] = this.listeners[type2].slice(0);
  108747. this.listeners[type2].splice(index2, 1);
  108748. return index2 > -1;
  108749. };
  108750. _proto.trigger = function trigger2(type2) {
  108751. var callbacks = this.listeners[type2];
  108752. if (!callbacks) {
  108753. return;
  108754. }
  108755. if (arguments.length === 2) {
  108756. var length = callbacks.length;
  108757. for (var i2 = 0; i2 < length; ++i2) {
  108758. callbacks[i2].call(this, arguments[1]);
  108759. }
  108760. } else {
  108761. var args = Array.prototype.slice.call(arguments, 1);
  108762. var _length = callbacks.length;
  108763. for (var _i = 0; _i < _length; ++_i) {
  108764. callbacks[_i].apply(this, args);
  108765. }
  108766. }
  108767. };
  108768. _proto.dispose = function dispose() {
  108769. this.listeners = {};
  108770. };
  108771. _proto.pipe = function pipe(destination2) {
  108772. this.on("data", function(data) {
  108773. destination2.push(data);
  108774. });
  108775. };
  108776. return Stream3;
  108777. }();
  108778. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  108779. function unpad(padded) {
  108780. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  108781. }
  108782. /*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */
  108783. var precompute = function precompute2() {
  108784. var tables = [[[], [], [], [], []], [[], [], [], [], []]];
  108785. var encTable = tables[0];
  108786. var decTable = tables[1];
  108787. var sbox = encTable[4];
  108788. var sboxInv = decTable[4];
  108789. var i2;
  108790. var x;
  108791. var xInv;
  108792. var d2 = [];
  108793. var th = [];
  108794. var x2;
  108795. var x4;
  108796. var x8;
  108797. var s;
  108798. var tEnc;
  108799. var tDec;
  108800. for (i2 = 0; i2 < 256; i2++) {
  108801. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  108802. }
  108803. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  108804. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  108805. s = s >> 8 ^ s & 255 ^ 99;
  108806. sbox[x] = s;
  108807. sboxInv[s] = x;
  108808. x8 = d2[x4 = d2[x2 = d2[x]]];
  108809. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  108810. tEnc = d2[s] * 257 ^ s * 16843008;
  108811. for (i2 = 0; i2 < 4; i2++) {
  108812. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  108813. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  108814. }
  108815. }
  108816. for (i2 = 0; i2 < 5; i2++) {
  108817. encTable[i2] = encTable[i2].slice(0);
  108818. decTable[i2] = decTable[i2].slice(0);
  108819. }
  108820. return tables;
  108821. };
  108822. var aesTables = null;
  108823. var AES = /* @__PURE__ */ function() {
  108824. function AES2(key) {
  108825. if (!aesTables) {
  108826. aesTables = precompute();
  108827. }
  108828. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  108829. var i2;
  108830. var j;
  108831. var tmp;
  108832. var sbox = this._tables[0][4];
  108833. var decTable = this._tables[1];
  108834. var keyLen = key.length;
  108835. var rcon = 1;
  108836. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  108837. throw new Error("Invalid aes key size");
  108838. }
  108839. var encKey = key.slice(0);
  108840. var decKey = [];
  108841. this._key = [encKey, decKey];
  108842. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  108843. tmp = encKey[i2 - 1];
  108844. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  108845. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  108846. if (i2 % keyLen === 0) {
  108847. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  108848. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  108849. }
  108850. }
  108851. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  108852. }
  108853. for (j = 0; i2; j++, i2--) {
  108854. tmp = encKey[j & 3 ? i2 : i2 - 4];
  108855. if (i2 <= 4 || j < 4) {
  108856. decKey[j] = tmp;
  108857. } else {
  108858. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  108859. }
  108860. }
  108861. }
  108862. var _proto = AES2.prototype;
  108863. _proto.decrypt = function decrypt4(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  108864. var key = this._key[1];
  108865. var a = encrypted0 ^ key[0];
  108866. var b = encrypted3 ^ key[1];
  108867. var c = encrypted2 ^ key[2];
  108868. var d2 = encrypted1 ^ key[3];
  108869. var a2;
  108870. var b2;
  108871. var c2;
  108872. var nInnerRounds = key.length / 4 - 2;
  108873. var i2;
  108874. var kIndex = 4;
  108875. var table = this._tables[1];
  108876. var table0 = table[0];
  108877. var table1 = table[1];
  108878. var table2 = table[2];
  108879. var table3 = table[3];
  108880. var sbox = table[4];
  108881. for (i2 = 0; i2 < nInnerRounds; i2++) {
  108882. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  108883. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  108884. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  108885. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  108886. kIndex += 4;
  108887. a = a2;
  108888. b = b2;
  108889. c = c2;
  108890. }
  108891. for (i2 = 0; i2 < 4; i2++) {
  108892. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  108893. a2 = a;
  108894. a = b;
  108895. b = c;
  108896. c = d2;
  108897. d2 = a2;
  108898. }
  108899. };
  108900. return AES2;
  108901. }();
  108902. var AsyncStream = /* @__PURE__ */ function(_Stream) {
  108903. inheritsLoose(AsyncStream2, _Stream);
  108904. function AsyncStream2() {
  108905. var _this;
  108906. _this = _Stream.call(this, Stream2) || this;
  108907. _this.jobs = [];
  108908. _this.delay = 1;
  108909. _this.timeout_ = null;
  108910. return _this;
  108911. }
  108912. var _proto = AsyncStream2.prototype;
  108913. _proto.processJob_ = function processJob_() {
  108914. this.jobs.shift()();
  108915. if (this.jobs.length) {
  108916. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108917. } else {
  108918. this.timeout_ = null;
  108919. }
  108920. };
  108921. _proto.push = function push(job) {
  108922. this.jobs.push(job);
  108923. if (!this.timeout_) {
  108924. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108925. }
  108926. };
  108927. return AsyncStream2;
  108928. }(Stream2);
  108929. var ntoh = function ntoh2(word) {
  108930. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  108931. };
  108932. var decrypt3 = function decrypt4(encrypted, key, initVector) {
  108933. var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  108934. var decipher = new AES(Array.prototype.slice.call(key));
  108935. var decrypted = new Uint8Array(encrypted.byteLength);
  108936. var decrypted32 = new Int32Array(decrypted.buffer);
  108937. var init0;
  108938. var init1;
  108939. var init2;
  108940. var init3;
  108941. var encrypted0;
  108942. var encrypted1;
  108943. var encrypted2;
  108944. var encrypted3;
  108945. var wordIx;
  108946. init0 = initVector[0];
  108947. init1 = initVector[1];
  108948. init2 = initVector[2];
  108949. init3 = initVector[3];
  108950. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  108951. encrypted0 = ntoh(encrypted32[wordIx]);
  108952. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  108953. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  108954. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  108955. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  108956. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  108957. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  108958. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  108959. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  108960. init0 = encrypted0;
  108961. init1 = encrypted1;
  108962. init2 = encrypted2;
  108963. init3 = encrypted3;
  108964. }
  108965. return decrypted;
  108966. };
  108967. var Decrypter2 = /* @__PURE__ */ function() {
  108968. function Decrypter3(encrypted, key, initVector, done) {
  108969. var step = Decrypter3.STEP;
  108970. var encrypted32 = new Int32Array(encrypted.buffer);
  108971. var decrypted = new Uint8Array(encrypted.byteLength);
  108972. var i2 = 0;
  108973. this.asyncStream_ = new AsyncStream();
  108974. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108975. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  108976. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  108977. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108978. }
  108979. this.asyncStream_.push(function() {
  108980. done(null, unpad(decrypted));
  108981. });
  108982. }
  108983. var _proto = Decrypter3.prototype;
  108984. _proto.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {
  108985. return function() {
  108986. var bytes = decrypt3(encrypted, key, initVector);
  108987. decrypted.set(bytes, encrypted.byteOffset);
  108988. };
  108989. };
  108990. createClass(Decrypter3, null, [{
  108991. key: "STEP",
  108992. get: function get7() {
  108993. return 32e3;
  108994. }
  108995. }]);
  108996. return Decrypter3;
  108997. }();
  108998. var win2;
  108999. if (typeof window !== "undefined") {
  109000. win2 = window;
  109001. } else if (typeof commonjsGlobal2 !== "undefined") {
  109002. win2 = commonjsGlobal2;
  109003. } else if (typeof self !== "undefined") {
  109004. win2 = self;
  109005. } else {
  109006. win2 = {};
  109007. }
  109008. var window_12 = win2;
  109009. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  109010. if (ArrayBuffer.isView === "function") {
  109011. return ArrayBuffer.isView(obj);
  109012. }
  109013. return obj && obj.buffer instanceof ArrayBuffer;
  109014. };
  109015. var BigInt2 = window_12.BigInt || Number;
  109016. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  109017. var createTransferableMessage3 = function createTransferableMessage4(message) {
  109018. var transferable = {};
  109019. Object.keys(message).forEach(function(key) {
  109020. var value = message[key];
  109021. if (isArrayBufferView4(value)) {
  109022. transferable[key] = {
  109023. bytes: value.buffer,
  109024. byteOffset: value.byteOffset,
  109025. byteLength: value.byteLength
  109026. };
  109027. } else {
  109028. transferable[key] = value;
  109029. }
  109030. });
  109031. return transferable;
  109032. };
  109033. self.onmessage = function(event2) {
  109034. var data = event2.data;
  109035. var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  109036. var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  109037. var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  109038. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  109039. self.postMessage(createTransferableMessage3({
  109040. source: data.source,
  109041. decrypted: bytes
  109042. }), [bytes.buffer]);
  109043. });
  109044. };
  109045. }));
  109046. var Decrypter = factory(workerCode);
  109047. var audioTrackKind_ = function audioTrackKind_2(properties) {
  109048. var kind = properties["default"] ? "main" : "alternative";
  109049. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  109050. kind = "main-desc";
  109051. }
  109052. return kind;
  109053. };
  109054. var stopLoaders = function stopLoaders2(segmentLoader, mediaType) {
  109055. segmentLoader.abort();
  109056. segmentLoader.pause();
  109057. if (mediaType && mediaType.activePlaylistLoader) {
  109058. mediaType.activePlaylistLoader.pause();
  109059. mediaType.activePlaylistLoader = null;
  109060. }
  109061. };
  109062. var startLoaders = function startLoaders2(playlistLoader, mediaType) {
  109063. mediaType.activePlaylistLoader = playlistLoader;
  109064. playlistLoader.load();
  109065. };
  109066. var onGroupChanged = function onGroupChanged2(type2, settings) {
  109067. return function() {
  109068. var _settings$segmentLoad = settings.segmentLoaders, segmentLoader = _settings$segmentLoad[type2], mainSegmentLoader = _settings$segmentLoad.main, mediaType = settings.mediaTypes[type2];
  109069. var activeTrack2 = mediaType.activeTrack();
  109070. var activeGroup3 = mediaType.getActiveGroup();
  109071. var previousActiveLoader = mediaType.activePlaylistLoader;
  109072. var lastGroup = mediaType.lastGroup_;
  109073. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  109074. return;
  109075. }
  109076. mediaType.lastGroup_ = activeGroup3;
  109077. mediaType.lastTrack_ = activeTrack2;
  109078. stopLoaders(segmentLoader, mediaType);
  109079. if (!activeGroup3 || activeGroup3.isMasterPlaylist) {
  109080. return;
  109081. }
  109082. if (!activeGroup3.playlistLoader) {
  109083. if (previousActiveLoader) {
  109084. mainSegmentLoader.resetEverything();
  109085. }
  109086. return;
  109087. }
  109088. segmentLoader.resyncLoader();
  109089. startLoaders(activeGroup3.playlistLoader, mediaType);
  109090. };
  109091. };
  109092. var onGroupChanging = function onGroupChanging2(type2, settings) {
  109093. return function() {
  109094. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109095. mediaType.lastGroup_ = null;
  109096. segmentLoader.abort();
  109097. segmentLoader.pause();
  109098. };
  109099. };
  109100. var onTrackChanged = function onTrackChanged2(type2, settings) {
  109101. return function() {
  109102. var masterPlaylistLoader = settings.masterPlaylistLoader, _settings$segmentLoad2 = settings.segmentLoaders, segmentLoader = _settings$segmentLoad2[type2], mainSegmentLoader = _settings$segmentLoad2.main, mediaType = settings.mediaTypes[type2];
  109103. var activeTrack2 = mediaType.activeTrack();
  109104. var activeGroup3 = mediaType.getActiveGroup();
  109105. var previousActiveLoader = mediaType.activePlaylistLoader;
  109106. var lastTrack = mediaType.lastTrack_;
  109107. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  109108. return;
  109109. }
  109110. mediaType.lastGroup_ = activeGroup3;
  109111. mediaType.lastTrack_ = activeTrack2;
  109112. stopLoaders(segmentLoader, mediaType);
  109113. if (!activeGroup3) {
  109114. return;
  109115. }
  109116. if (activeGroup3.isMasterPlaylist) {
  109117. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  109118. return;
  109119. }
  109120. var mpc = settings.vhs.masterPlaylistController_;
  109121. var newPlaylist = mpc.selectPlaylist();
  109122. if (mpc.media() === newPlaylist) {
  109123. return;
  109124. }
  109125. mediaType.logger_("track change. Switching master audio from " + lastTrack.id + " to " + activeTrack2.id);
  109126. masterPlaylistLoader.pause();
  109127. mainSegmentLoader.resetEverything();
  109128. mpc.fastQualityChange_(newPlaylist);
  109129. return;
  109130. }
  109131. if (type2 === "AUDIO") {
  109132. if (!activeGroup3.playlistLoader) {
  109133. mainSegmentLoader.setAudio(true);
  109134. mainSegmentLoader.resetEverything();
  109135. return;
  109136. }
  109137. segmentLoader.setAudio(true);
  109138. mainSegmentLoader.setAudio(false);
  109139. }
  109140. if (previousActiveLoader === activeGroup3.playlistLoader) {
  109141. startLoaders(activeGroup3.playlistLoader, mediaType);
  109142. return;
  109143. }
  109144. if (segmentLoader.track) {
  109145. segmentLoader.track(activeTrack2);
  109146. }
  109147. segmentLoader.resetEverything();
  109148. startLoaders(activeGroup3.playlistLoader, mediaType);
  109149. };
  109150. };
  109151. var onError = {
  109152. AUDIO: function AUDIO(type2, settings) {
  109153. return function() {
  109154. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2], blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;
  109155. stopLoaders(segmentLoader, mediaType);
  109156. var activeTrack2 = mediaType.activeTrack();
  109157. var activeGroup3 = mediaType.activeGroup();
  109158. var id = (activeGroup3.filter(function(group) {
  109159. return group["default"];
  109160. })[0] || activeGroup3[0]).id;
  109161. var defaultTrack = mediaType.tracks[id];
  109162. if (activeTrack2 === defaultTrack) {
  109163. blacklistCurrentPlaylist({
  109164. message: "Problem encountered loading the default audio track."
  109165. });
  109166. return;
  109167. }
  109168. videojs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  109169. for (var trackId in mediaType.tracks) {
  109170. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  109171. }
  109172. mediaType.onTrackChanged();
  109173. };
  109174. },
  109175. SUBTITLES: function SUBTITLES(type2, settings) {
  109176. return function() {
  109177. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109178. videojs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  109179. stopLoaders(segmentLoader, mediaType);
  109180. var track = mediaType.activeTrack();
  109181. if (track) {
  109182. track.mode = "disabled";
  109183. }
  109184. mediaType.onTrackChanged();
  109185. };
  109186. }
  109187. };
  109188. var setupListeners = {
  109189. AUDIO: function AUDIO2(type2, playlistLoader, settings) {
  109190. if (!playlistLoader) {
  109191. return;
  109192. }
  109193. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2];
  109194. playlistLoader.on("loadedmetadata", function() {
  109195. var media = playlistLoader.media();
  109196. segmentLoader.playlist(media, requestOptions);
  109197. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109198. segmentLoader.load();
  109199. }
  109200. });
  109201. playlistLoader.on("loadedplaylist", function() {
  109202. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109203. if (!tech.paused()) {
  109204. segmentLoader.load();
  109205. }
  109206. });
  109207. playlistLoader.on("error", onError[type2](type2, settings));
  109208. },
  109209. SUBTITLES: function SUBTITLES2(type2, playlistLoader, settings) {
  109210. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109211. playlistLoader.on("loadedmetadata", function() {
  109212. var media = playlistLoader.media();
  109213. segmentLoader.playlist(media, requestOptions);
  109214. segmentLoader.track(mediaType.activeTrack());
  109215. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109216. segmentLoader.load();
  109217. }
  109218. });
  109219. playlistLoader.on("loadedplaylist", function() {
  109220. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109221. if (!tech.paused()) {
  109222. segmentLoader.load();
  109223. }
  109224. });
  109225. playlistLoader.on("error", onError[type2](type2, settings));
  109226. }
  109227. };
  109228. var initialize = {
  109229. "AUDIO": function AUDIO3(type2, settings) {
  109230. var vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$ = settings.mediaTypes[type2], groups = _settings$mediaTypes$.groups, tracks = _settings$mediaTypes$.tracks, logger_ = _settings$mediaTypes$.logger_, masterPlaylistLoader = settings.masterPlaylistLoader;
  109231. var audioOnlyMaster = isAudioOnly(masterPlaylistLoader.master);
  109232. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  109233. mediaGroups[type2] = {
  109234. main: {
  109235. "default": {
  109236. "default": true
  109237. }
  109238. }
  109239. };
  109240. if (audioOnlyMaster) {
  109241. mediaGroups[type2].main["default"].playlists = masterPlaylistLoader.master.playlists;
  109242. }
  109243. }
  109244. for (var groupId in mediaGroups[type2]) {
  109245. if (!groups[groupId]) {
  109246. groups[groupId] = [];
  109247. }
  109248. for (var variantLabel in mediaGroups[type2][groupId]) {
  109249. var properties = mediaGroups[type2][groupId][variantLabel];
  109250. var playlistLoader = void 0;
  109251. if (audioOnlyMaster) {
  109252. logger_("AUDIO group '" + groupId + "' label '" + variantLabel + "' is a master playlist");
  109253. properties.isMasterPlaylist = true;
  109254. playlistLoader = null;
  109255. } else if (sourceType === "vhs-json" && properties.playlists) {
  109256. playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);
  109257. } else if (properties.resolvedUri) {
  109258. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109259. } else if (properties.playlists && sourceType === "dash") {
  109260. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109261. } else {
  109262. playlistLoader = null;
  109263. }
  109264. properties = videojs.mergeOptions({
  109265. id: variantLabel,
  109266. playlistLoader
  109267. }, properties);
  109268. setupListeners[type2](type2, properties.playlistLoader, settings);
  109269. groups[groupId].push(properties);
  109270. if (typeof tracks[variantLabel] === "undefined") {
  109271. var track = new videojs.AudioTrack({
  109272. id: variantLabel,
  109273. kind: audioTrackKind_(properties),
  109274. enabled: false,
  109275. language: properties.language,
  109276. "default": properties["default"],
  109277. label: variantLabel
  109278. });
  109279. tracks[variantLabel] = track;
  109280. }
  109281. }
  109282. }
  109283. segmentLoader.on("error", onError[type2](type2, settings));
  109284. },
  109285. "SUBTITLES": function SUBTITLES3(type2, settings) {
  109286. var tech = settings.tech, vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$2 = settings.mediaTypes[type2], groups = _settings$mediaTypes$2.groups, tracks = _settings$mediaTypes$2.tracks, masterPlaylistLoader = settings.masterPlaylistLoader;
  109287. for (var groupId in mediaGroups[type2]) {
  109288. if (!groups[groupId]) {
  109289. groups[groupId] = [];
  109290. }
  109291. for (var variantLabel in mediaGroups[type2][groupId]) {
  109292. if (mediaGroups[type2][groupId][variantLabel].forced) {
  109293. continue;
  109294. }
  109295. var properties = mediaGroups[type2][groupId][variantLabel];
  109296. var playlistLoader = void 0;
  109297. if (sourceType === "hls") {
  109298. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109299. } else if (sourceType === "dash") {
  109300. var playlists = properties.playlists.filter(function(p) {
  109301. return p.excludeUntil !== Infinity;
  109302. });
  109303. if (!playlists.length) {
  109304. return;
  109305. }
  109306. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109307. } else if (sourceType === "vhs-json") {
  109308. playlistLoader = new PlaylistLoader(
  109309. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  109310. vhs,
  109311. requestOptions
  109312. );
  109313. }
  109314. properties = videojs.mergeOptions({
  109315. id: variantLabel,
  109316. playlistLoader
  109317. }, properties);
  109318. setupListeners[type2](type2, properties.playlistLoader, settings);
  109319. groups[groupId].push(properties);
  109320. if (typeof tracks[variantLabel] === "undefined") {
  109321. var track = tech.addRemoteTextTrack({
  109322. id: variantLabel,
  109323. kind: "subtitles",
  109324. "default": properties["default"] && properties.autoselect,
  109325. language: properties.language,
  109326. label: variantLabel
  109327. }, false).track;
  109328. tracks[variantLabel] = track;
  109329. }
  109330. }
  109331. }
  109332. segmentLoader.on("error", onError[type2](type2, settings));
  109333. },
  109334. "CLOSED-CAPTIONS": function CLOSEDCAPTIONS(type2, settings) {
  109335. var tech = settings.tech, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$3 = settings.mediaTypes[type2], groups = _settings$mediaTypes$3.groups, tracks = _settings$mediaTypes$3.tracks;
  109336. for (var groupId in mediaGroups[type2]) {
  109337. if (!groups[groupId]) {
  109338. groups[groupId] = [];
  109339. }
  109340. for (var variantLabel in mediaGroups[type2][groupId]) {
  109341. var properties = mediaGroups[type2][groupId][variantLabel];
  109342. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  109343. continue;
  109344. }
  109345. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  109346. var newProps = {
  109347. label: variantLabel,
  109348. language: properties.language,
  109349. instreamId: properties.instreamId,
  109350. "default": properties["default"] && properties.autoselect
  109351. };
  109352. if (captionServices[newProps.instreamId]) {
  109353. newProps = videojs.mergeOptions(newProps, captionServices[newProps.instreamId]);
  109354. }
  109355. if (newProps["default"] === void 0) {
  109356. delete newProps["default"];
  109357. }
  109358. groups[groupId].push(videojs.mergeOptions({
  109359. id: variantLabel
  109360. }, properties));
  109361. if (typeof tracks[variantLabel] === "undefined") {
  109362. var track = tech.addRemoteTextTrack({
  109363. id: newProps.instreamId,
  109364. kind: "captions",
  109365. "default": newProps["default"],
  109366. language: newProps.language,
  109367. label: newProps.label
  109368. }, false).track;
  109369. tracks[variantLabel] = track;
  109370. }
  109371. }
  109372. }
  109373. }
  109374. };
  109375. var groupMatch = function groupMatch2(list, media) {
  109376. for (var i2 = 0; i2 < list.length; i2++) {
  109377. if (playlistMatch(media, list[i2])) {
  109378. return true;
  109379. }
  109380. if (list[i2].playlists && groupMatch2(list[i2].playlists, media)) {
  109381. return true;
  109382. }
  109383. }
  109384. return false;
  109385. };
  109386. var activeGroup = function activeGroup2(type2, settings) {
  109387. return function(track) {
  109388. var masterPlaylistLoader = settings.masterPlaylistLoader, groups = settings.mediaTypes[type2].groups;
  109389. var media = masterPlaylistLoader.media();
  109390. if (!media) {
  109391. return null;
  109392. }
  109393. var variants = null;
  109394. if (media.attributes[type2]) {
  109395. variants = groups[media.attributes[type2]];
  109396. }
  109397. var groupKeys = Object.keys(groups);
  109398. if (!variants) {
  109399. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly(settings.master)) {
  109400. for (var i2 = 0; i2 < groupKeys.length; i2++) {
  109401. var groupPropertyList = groups[groupKeys[i2]];
  109402. if (groupMatch(groupPropertyList, media)) {
  109403. variants = groupPropertyList;
  109404. break;
  109405. }
  109406. }
  109407. } else if (groups.main) {
  109408. variants = groups.main;
  109409. } else if (groupKeys.length === 1) {
  109410. variants = groups[groupKeys[0]];
  109411. }
  109412. }
  109413. if (typeof track === "undefined") {
  109414. return variants;
  109415. }
  109416. if (track === null || !variants) {
  109417. return null;
  109418. }
  109419. return variants.filter(function(props) {
  109420. return props.id === track.id;
  109421. })[0] || null;
  109422. };
  109423. };
  109424. var activeTrack = {
  109425. AUDIO: function AUDIO4(type2, settings) {
  109426. return function() {
  109427. var tracks = settings.mediaTypes[type2].tracks;
  109428. for (var id in tracks) {
  109429. if (tracks[id].enabled) {
  109430. return tracks[id];
  109431. }
  109432. }
  109433. return null;
  109434. };
  109435. },
  109436. SUBTITLES: function SUBTITLES4(type2, settings) {
  109437. return function() {
  109438. var tracks = settings.mediaTypes[type2].tracks;
  109439. for (var id in tracks) {
  109440. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  109441. return tracks[id];
  109442. }
  109443. }
  109444. return null;
  109445. };
  109446. }
  109447. };
  109448. var getActiveGroup = function getActiveGroup2(type2, _ref) {
  109449. var mediaTypes2 = _ref.mediaTypes;
  109450. return function() {
  109451. var activeTrack_ = mediaTypes2[type2].activeTrack();
  109452. if (!activeTrack_) {
  109453. return null;
  109454. }
  109455. return mediaTypes2[type2].activeGroup(activeTrack_);
  109456. };
  109457. };
  109458. var setupMediaGroups = function setupMediaGroups2(settings) {
  109459. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109460. initialize[type2](type2, settings);
  109461. });
  109462. var mediaTypes2 = settings.mediaTypes, masterPlaylistLoader = settings.masterPlaylistLoader, tech = settings.tech, vhs = settings.vhs, _settings$segmentLoad3 = settings.segmentLoaders, audioSegmentLoader = _settings$segmentLoad3["AUDIO"], mainSegmentLoader = _settings$segmentLoad3.main;
  109463. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109464. mediaTypes2[type2].activeGroup = activeGroup(type2, settings);
  109465. mediaTypes2[type2].activeTrack = activeTrack[type2](type2, settings);
  109466. mediaTypes2[type2].onGroupChanged = onGroupChanged(type2, settings);
  109467. mediaTypes2[type2].onGroupChanging = onGroupChanging(type2, settings);
  109468. mediaTypes2[type2].onTrackChanged = onTrackChanged(type2, settings);
  109469. mediaTypes2[type2].getActiveGroup = getActiveGroup(type2, settings);
  109470. });
  109471. var audioGroup = mediaTypes2.AUDIO.activeGroup();
  109472. if (audioGroup) {
  109473. var groupId = (audioGroup.filter(function(group) {
  109474. return group["default"];
  109475. })[0] || audioGroup[0]).id;
  109476. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  109477. mediaTypes2.AUDIO.onGroupChanged();
  109478. mediaTypes2.AUDIO.onTrackChanged();
  109479. var activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  109480. if (!activeAudioGroup.playlistLoader) {
  109481. mainSegmentLoader.setAudio(true);
  109482. } else {
  109483. mainSegmentLoader.setAudio(false);
  109484. audioSegmentLoader.setAudio(true);
  109485. }
  109486. }
  109487. masterPlaylistLoader.on("mediachange", function() {
  109488. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109489. return mediaTypes2[type2].onGroupChanged();
  109490. });
  109491. });
  109492. masterPlaylistLoader.on("mediachanging", function() {
  109493. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109494. return mediaTypes2[type2].onGroupChanging();
  109495. });
  109496. });
  109497. var onAudioTrackChanged = function onAudioTrackChanged2() {
  109498. mediaTypes2.AUDIO.onTrackChanged();
  109499. tech.trigger({
  109500. type: "usage",
  109501. name: "vhs-audio-change"
  109502. });
  109503. tech.trigger({
  109504. type: "usage",
  109505. name: "hls-audio-change"
  109506. });
  109507. };
  109508. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  109509. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109510. vhs.on("dispose", function() {
  109511. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  109512. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109513. });
  109514. tech.clearTracks("audio");
  109515. for (var id in mediaTypes2.AUDIO.tracks) {
  109516. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  109517. }
  109518. };
  109519. var createMediaTypes = function createMediaTypes2() {
  109520. var mediaTypes2 = {};
  109521. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109522. mediaTypes2[type2] = {
  109523. groups: {},
  109524. tracks: {},
  109525. activePlaylistLoader: null,
  109526. activeGroup: noop,
  109527. activeTrack: noop,
  109528. getActiveGroup: noop,
  109529. onGroupChanged: noop,
  109530. onTrackChanged: noop,
  109531. lastTrack_: null,
  109532. logger_: logger("MediaGroups[" + type2 + "]")
  109533. };
  109534. });
  109535. return mediaTypes2;
  109536. };
  109537. var ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;
  109538. var Vhs$1;
  109539. var loaderStats = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  109540. var sumLoaderStat = function sumLoaderStat2(stat) {
  109541. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  109542. };
  109543. var shouldSwitchToMedia = function shouldSwitchToMedia2(_ref) {
  109544. var currentPlaylist = _ref.currentPlaylist, buffered = _ref.buffered, currentTime = _ref.currentTime, nextPlaylist = _ref.nextPlaylist, bufferLowWaterLine = _ref.bufferLowWaterLine, bufferHighWaterLine = _ref.bufferHighWaterLine, duration5 = _ref.duration, experimentalBufferBasedABR = _ref.experimentalBufferBasedABR, log2 = _ref.log;
  109545. if (!nextPlaylist) {
  109546. videojs.log.warn("We received no playlist to switch to. Please check your stream.");
  109547. return false;
  109548. }
  109549. var sharedLogLine = "allowing switch " + (currentPlaylist && currentPlaylist.id || "null") + " -> " + nextPlaylist.id;
  109550. if (!currentPlaylist) {
  109551. log2(sharedLogLine + " as current playlist is not set");
  109552. return true;
  109553. }
  109554. if (nextPlaylist.id === currentPlaylist.id) {
  109555. return false;
  109556. }
  109557. var isBuffered = Boolean(findRange(buffered, currentTime).length);
  109558. if (!currentPlaylist.endList) {
  109559. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  109560. log2("not " + sharedLogLine + " as current playlist is live llhls, but currentTime isn't in buffered.");
  109561. return false;
  109562. }
  109563. log2(sharedLogLine + " as current playlist is live");
  109564. return true;
  109565. }
  109566. var forwardBuffer = timeAheadOf(buffered, currentTime);
  109567. var maxBufferLowWaterLine = experimentalBufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE;
  109568. if (duration5 < maxBufferLowWaterLine) {
  109569. log2(sharedLogLine + " as duration < max low water line (" + duration5 + " < " + maxBufferLowWaterLine + ")");
  109570. return true;
  109571. }
  109572. var nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  109573. var currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  109574. if (nextBandwidth < currBandwidth && (!experimentalBufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  109575. var logLine = sharedLogLine + " as next bandwidth < current bandwidth (" + nextBandwidth + " < " + currBandwidth + ")";
  109576. if (experimentalBufferBasedABR) {
  109577. logLine += " and forwardBuffer < bufferHighWaterLine (" + forwardBuffer + " < " + bufferHighWaterLine + ")";
  109578. }
  109579. log2(logLine);
  109580. return true;
  109581. }
  109582. if ((!experimentalBufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  109583. var _logLine = sharedLogLine + " as forwardBuffer >= bufferLowWaterLine (" + forwardBuffer + " >= " + bufferLowWaterLine + ")";
  109584. if (experimentalBufferBasedABR) {
  109585. _logLine += " and next bandwidth > current bandwidth (" + nextBandwidth + " > " + currBandwidth + ")";
  109586. }
  109587. log2(_logLine);
  109588. return true;
  109589. }
  109590. log2("not " + sharedLogLine + " as no switching criteria met");
  109591. return false;
  109592. };
  109593. var MasterPlaylistController = /* @__PURE__ */ function(_videojs$EventTarget) {
  109594. _inheritsLoose(MasterPlaylistController2, _videojs$EventTarget);
  109595. function MasterPlaylistController2(options2) {
  109596. var _this;
  109597. _this = _videojs$EventTarget.call(this) || this;
  109598. var src = options2.src, handleManifestRedirects = options2.handleManifestRedirects, withCredentials = options2.withCredentials, tech = options2.tech, bandwidth2 = options2.bandwidth, externVhs = options2.externVhs, useCueTags = options2.useCueTags, blacklistDuration = options2.blacklistDuration, enableLowInitialPlaylist = options2.enableLowInitialPlaylist, sourceType = options2.sourceType, cacheEncryptionKeys = options2.cacheEncryptionKeys, experimentalBufferBasedABR = options2.experimentalBufferBasedABR, experimentalLeastPixelDiffSelector = options2.experimentalLeastPixelDiffSelector, captionServices = options2.captionServices;
  109599. if (!src) {
  109600. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  109601. }
  109602. var maxPlaylistRetries = options2.maxPlaylistRetries;
  109603. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  109604. maxPlaylistRetries = Infinity;
  109605. }
  109606. Vhs$1 = externVhs;
  109607. _this.experimentalBufferBasedABR = Boolean(experimentalBufferBasedABR);
  109608. _this.experimentalLeastPixelDiffSelector = Boolean(experimentalLeastPixelDiffSelector);
  109609. _this.withCredentials = withCredentials;
  109610. _this.tech_ = tech;
  109611. _this.vhs_ = tech.vhs;
  109612. _this.sourceType_ = sourceType;
  109613. _this.useCueTags_ = useCueTags;
  109614. _this.blacklistDuration = blacklistDuration;
  109615. _this.maxPlaylistRetries = maxPlaylistRetries;
  109616. _this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  109617. if (_this.useCueTags_) {
  109618. _this.cueTagsTrack_ = _this.tech_.addTextTrack("metadata", "ad-cues");
  109619. _this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  109620. }
  109621. _this.requestOptions_ = {
  109622. withCredentials,
  109623. handleManifestRedirects,
  109624. maxPlaylistRetries,
  109625. timeout: null
  109626. };
  109627. _this.on("error", _this.pauseLoading);
  109628. _this.mediaTypes_ = createMediaTypes();
  109629. _this.mediaSource = new window_1.MediaSource();
  109630. _this.handleDurationChange_ = _this.handleDurationChange_.bind(_assertThisInitialized(_this));
  109631. _this.handleSourceOpen_ = _this.handleSourceOpen_.bind(_assertThisInitialized(_this));
  109632. _this.handleSourceEnded_ = _this.handleSourceEnded_.bind(_assertThisInitialized(_this));
  109633. _this.mediaSource.addEventListener("durationchange", _this.handleDurationChange_);
  109634. _this.mediaSource.addEventListener("sourceopen", _this.handleSourceOpen_);
  109635. _this.mediaSource.addEventListener("sourceended", _this.handleSourceEnded_);
  109636. _this.seekable_ = videojs.createTimeRanges();
  109637. _this.hasPlayed_ = false;
  109638. _this.syncController_ = new SyncController(options2);
  109639. _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  109640. kind: "metadata",
  109641. label: "segment-metadata"
  109642. }, false).track;
  109643. _this.decrypter_ = new Decrypter();
  109644. _this.sourceUpdater_ = new SourceUpdater(_this.mediaSource);
  109645. _this.inbandTextTracks_ = {};
  109646. _this.timelineChangeController_ = new TimelineChangeController();
  109647. var segmentLoaderSettings = {
  109648. vhs: _this.vhs_,
  109649. parse708captions: options2.parse708captions,
  109650. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  109651. captionServices,
  109652. mediaSource: _this.mediaSource,
  109653. currentTime: _this.tech_.currentTime.bind(_this.tech_),
  109654. seekable: function seekable3() {
  109655. return _this.seekable();
  109656. },
  109657. seeking: function seeking() {
  109658. return _this.tech_.seeking();
  109659. },
  109660. duration: function duration5() {
  109661. return _this.duration();
  109662. },
  109663. hasPlayed: function hasPlayed() {
  109664. return _this.hasPlayed_;
  109665. },
  109666. goalBufferLength: function goalBufferLength() {
  109667. return _this.goalBufferLength();
  109668. },
  109669. bandwidth: bandwidth2,
  109670. syncController: _this.syncController_,
  109671. decrypter: _this.decrypter_,
  109672. sourceType: _this.sourceType_,
  109673. inbandTextTracks: _this.inbandTextTracks_,
  109674. cacheEncryptionKeys,
  109675. sourceUpdater: _this.sourceUpdater_,
  109676. timelineChangeController: _this.timelineChangeController_,
  109677. experimentalExactManifestTimings: options2.experimentalExactManifestTimings
  109678. };
  109679. _this.masterPlaylistLoader_ = _this.sourceType_ === "dash" ? new DashPlaylistLoader(src, _this.vhs_, _this.requestOptions_) : new PlaylistLoader(src, _this.vhs_, _this.requestOptions_);
  109680. _this.setupMasterPlaylistLoaderListeners_();
  109681. _this.mainSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109682. segmentMetadataTrack: _this.segmentMetadataTrack_,
  109683. loaderType: "main"
  109684. }), options2);
  109685. _this.audioSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109686. loaderType: "audio"
  109687. }), options2);
  109688. _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109689. loaderType: "vtt",
  109690. featuresNativeTextTracks: _this.tech_.featuresNativeTextTracks,
  109691. loadVttJs: function loadVttJs() {
  109692. return new Promise(function(resolve2, reject2) {
  109693. function onLoad() {
  109694. tech.off("vttjserror", onError2);
  109695. resolve2();
  109696. }
  109697. function onError2() {
  109698. tech.off("vttjsloaded", onLoad);
  109699. reject2();
  109700. }
  109701. tech.one("vttjsloaded", onLoad);
  109702. tech.one("vttjserror", onError2);
  109703. tech.addWebVttScript_();
  109704. });
  109705. }
  109706. }), options2);
  109707. _this.setupSegmentLoaderListeners_();
  109708. if (_this.experimentalBufferBasedABR) {
  109709. _this.masterPlaylistLoader_.one("loadedplaylist", function() {
  109710. return _this.startABRTimer_();
  109711. });
  109712. _this.tech_.on("pause", function() {
  109713. return _this.stopABRTimer_();
  109714. });
  109715. _this.tech_.on("play", function() {
  109716. return _this.startABRTimer_();
  109717. });
  109718. }
  109719. loaderStats.forEach(function(stat) {
  109720. _this[stat + "_"] = sumLoaderStat.bind(_assertThisInitialized(_this), stat);
  109721. });
  109722. _this.logger_ = logger("MPC");
  109723. _this.triggeredFmp4Usage = false;
  109724. if (_this.tech_.preload() === "none") {
  109725. _this.loadOnPlay_ = function() {
  109726. _this.loadOnPlay_ = null;
  109727. _this.masterPlaylistLoader_.load();
  109728. };
  109729. _this.tech_.one("play", _this.loadOnPlay_);
  109730. } else {
  109731. _this.masterPlaylistLoader_.load();
  109732. }
  109733. _this.timeToLoadedData__ = -1;
  109734. _this.mainAppendsToLoadedData__ = -1;
  109735. _this.audioAppendsToLoadedData__ = -1;
  109736. var event2 = _this.tech_.preload() === "none" ? "play" : "loadstart";
  109737. _this.tech_.one(event2, function() {
  109738. var timeToLoadedDataStart = Date.now();
  109739. _this.tech_.one("loadeddata", function() {
  109740. _this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  109741. _this.mainAppendsToLoadedData__ = _this.mainSegmentLoader_.mediaAppends;
  109742. _this.audioAppendsToLoadedData__ = _this.audioSegmentLoader_.mediaAppends;
  109743. });
  109744. });
  109745. return _this;
  109746. }
  109747. var _proto = MasterPlaylistController2.prototype;
  109748. _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() {
  109749. return this.mainAppendsToLoadedData__;
  109750. };
  109751. _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() {
  109752. return this.audioAppendsToLoadedData__;
  109753. };
  109754. _proto.appendsToLoadedData_ = function appendsToLoadedData_() {
  109755. var main = this.mainAppendsToLoadedData_();
  109756. var audio = this.audioAppendsToLoadedData_();
  109757. if (main === -1 || audio === -1) {
  109758. return -1;
  109759. }
  109760. return main + audio;
  109761. };
  109762. _proto.timeToLoadedData_ = function timeToLoadedData_() {
  109763. return this.timeToLoadedData__;
  109764. };
  109765. _proto.checkABR_ = function checkABR_(reason) {
  109766. if (reason === void 0) {
  109767. reason = "abr";
  109768. }
  109769. var nextPlaylist = this.selectPlaylist();
  109770. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  109771. this.switchMedia_(nextPlaylist, reason);
  109772. }
  109773. };
  109774. _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) {
  109775. var oldMedia = this.media();
  109776. var oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  109777. var newId = playlist.id || playlist.uri;
  109778. if (oldId && oldId !== newId) {
  109779. this.logger_("switch media " + oldId + " -> " + newId + " from " + cause);
  109780. this.tech_.trigger({
  109781. type: "usage",
  109782. name: "vhs-rendition-change-" + cause
  109783. });
  109784. }
  109785. this.masterPlaylistLoader_.media(playlist, delay);
  109786. };
  109787. _proto.startABRTimer_ = function startABRTimer_() {
  109788. var _this2 = this;
  109789. this.stopABRTimer_();
  109790. this.abrTimer_ = window_1.setInterval(function() {
  109791. return _this2.checkABR_();
  109792. }, 250);
  109793. };
  109794. _proto.stopABRTimer_ = function stopABRTimer_() {
  109795. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  109796. return;
  109797. }
  109798. window_1.clearInterval(this.abrTimer_);
  109799. this.abrTimer_ = null;
  109800. };
  109801. _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() {
  109802. var master = this.master();
  109803. var defaultPlaylists = master && master.playlists || [];
  109804. if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) {
  109805. return defaultPlaylists;
  109806. }
  109807. var AUDIO5 = master.mediaGroups.AUDIO;
  109808. var groupKeys = Object.keys(AUDIO5);
  109809. var track;
  109810. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  109811. track = this.mediaTypes_.AUDIO.activeTrack();
  109812. } else {
  109813. var defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  109814. for (var label2 in defaultGroup) {
  109815. if (defaultGroup[label2]["default"]) {
  109816. track = {
  109817. label: label2
  109818. };
  109819. break;
  109820. }
  109821. }
  109822. }
  109823. if (!track) {
  109824. return defaultPlaylists;
  109825. }
  109826. var playlists = [];
  109827. for (var group in AUDIO5) {
  109828. if (AUDIO5[group][track.label]) {
  109829. var properties = AUDIO5[group][track.label];
  109830. if (properties.playlists && properties.playlists.length) {
  109831. playlists.push.apply(playlists, properties.playlists);
  109832. } else if (properties.uri) {
  109833. playlists.push(properties);
  109834. } else if (master.playlists.length) {
  109835. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  109836. var playlist = master.playlists[i2];
  109837. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  109838. playlists.push(playlist);
  109839. }
  109840. }
  109841. }
  109842. }
  109843. }
  109844. if (!playlists.length) {
  109845. return defaultPlaylists;
  109846. }
  109847. return playlists;
  109848. };
  109849. _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() {
  109850. var _this3 = this;
  109851. this.masterPlaylistLoader_.on("loadedmetadata", function() {
  109852. var media = _this3.masterPlaylistLoader_.media();
  109853. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109854. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109855. _this3.requestOptions_.timeout = 0;
  109856. } else {
  109857. _this3.requestOptions_.timeout = requestTimeout;
  109858. }
  109859. if (media.endList && _this3.tech_.preload() !== "none") {
  109860. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109861. _this3.mainSegmentLoader_.load();
  109862. }
  109863. setupMediaGroups({
  109864. sourceType: _this3.sourceType_,
  109865. segmentLoaders: {
  109866. AUDIO: _this3.audioSegmentLoader_,
  109867. SUBTITLES: _this3.subtitleSegmentLoader_,
  109868. main: _this3.mainSegmentLoader_
  109869. },
  109870. tech: _this3.tech_,
  109871. requestOptions: _this3.requestOptions_,
  109872. masterPlaylistLoader: _this3.masterPlaylistLoader_,
  109873. vhs: _this3.vhs_,
  109874. master: _this3.master(),
  109875. mediaTypes: _this3.mediaTypes_,
  109876. blacklistCurrentPlaylist: _this3.blacklistCurrentPlaylist.bind(_this3)
  109877. });
  109878. _this3.triggerPresenceUsage_(_this3.master(), media);
  109879. _this3.setupFirstPlay();
  109880. if (!_this3.mediaTypes_.AUDIO.activePlaylistLoader || _this3.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  109881. _this3.trigger("selectedinitialmedia");
  109882. } else {
  109883. _this3.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", function() {
  109884. _this3.trigger("selectedinitialmedia");
  109885. });
  109886. }
  109887. });
  109888. this.masterPlaylistLoader_.on("loadedplaylist", function() {
  109889. if (_this3.loadOnPlay_) {
  109890. _this3.tech_.off("play", _this3.loadOnPlay_);
  109891. }
  109892. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109893. if (!updatedPlaylist) {
  109894. _this3.excludeUnsupportedVariants_();
  109895. var selectedMedia;
  109896. if (_this3.enableLowInitialPlaylist) {
  109897. selectedMedia = _this3.selectInitialPlaylist();
  109898. }
  109899. if (!selectedMedia) {
  109900. selectedMedia = _this3.selectPlaylist();
  109901. }
  109902. if (!selectedMedia || !_this3.shouldSwitchToMedia_(selectedMedia)) {
  109903. return;
  109904. }
  109905. _this3.initialMedia_ = selectedMedia;
  109906. _this3.switchMedia_(_this3.initialMedia_, "initial");
  109907. var haveJsonSource = _this3.sourceType_ === "vhs-json" && _this3.initialMedia_.segments;
  109908. if (!haveJsonSource) {
  109909. return;
  109910. }
  109911. updatedPlaylist = _this3.initialMedia_;
  109912. }
  109913. _this3.handleUpdatedMediaPlaylist(updatedPlaylist);
  109914. });
  109915. this.masterPlaylistLoader_.on("error", function() {
  109916. _this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error);
  109917. });
  109918. this.masterPlaylistLoader_.on("mediachanging", function() {
  109919. _this3.mainSegmentLoader_.abort();
  109920. _this3.mainSegmentLoader_.pause();
  109921. });
  109922. this.masterPlaylistLoader_.on("mediachange", function() {
  109923. var media = _this3.masterPlaylistLoader_.media();
  109924. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109925. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109926. _this3.requestOptions_.timeout = 0;
  109927. } else {
  109928. _this3.requestOptions_.timeout = requestTimeout;
  109929. }
  109930. _this3.masterPlaylistLoader_.load();
  109931. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109932. _this3.mainSegmentLoader_.load();
  109933. _this3.tech_.trigger({
  109934. type: "mediachange",
  109935. bubbles: true
  109936. });
  109937. });
  109938. this.masterPlaylistLoader_.on("playlistunchanged", function() {
  109939. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109940. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  109941. return;
  109942. }
  109943. var playlistOutdated = _this3.stuckAtPlaylistEnd_(updatedPlaylist);
  109944. if (playlistOutdated) {
  109945. _this3.blacklistCurrentPlaylist({
  109946. message: "Playlist no longer updating.",
  109947. reason: "playlist-unchanged"
  109948. });
  109949. _this3.tech_.trigger("playliststuck");
  109950. }
  109951. });
  109952. this.masterPlaylistLoader_.on("renditiondisabled", function() {
  109953. _this3.tech_.trigger({
  109954. type: "usage",
  109955. name: "vhs-rendition-disabled"
  109956. });
  109957. _this3.tech_.trigger({
  109958. type: "usage",
  109959. name: "hls-rendition-disabled"
  109960. });
  109961. });
  109962. this.masterPlaylistLoader_.on("renditionenabled", function() {
  109963. _this3.tech_.trigger({
  109964. type: "usage",
  109965. name: "vhs-rendition-enabled"
  109966. });
  109967. _this3.tech_.trigger({
  109968. type: "usage",
  109969. name: "hls-rendition-enabled"
  109970. });
  109971. });
  109972. };
  109973. _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) {
  109974. if (this.useCueTags_) {
  109975. this.updateAdCues_(updatedPlaylist);
  109976. }
  109977. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  109978. this.updateDuration(!updatedPlaylist.endList);
  109979. if (!this.tech_.paused()) {
  109980. this.mainSegmentLoader_.load();
  109981. if (this.audioSegmentLoader_) {
  109982. this.audioSegmentLoader_.load();
  109983. }
  109984. }
  109985. };
  109986. _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) {
  109987. var mediaGroups = master.mediaGroups || {};
  109988. var defaultDemuxed = true;
  109989. var audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  109990. for (var mediaGroup in mediaGroups.AUDIO) {
  109991. for (var label2 in mediaGroups.AUDIO[mediaGroup]) {
  109992. var properties = mediaGroups.AUDIO[mediaGroup][label2];
  109993. if (!properties.uri) {
  109994. defaultDemuxed = false;
  109995. }
  109996. }
  109997. }
  109998. if (defaultDemuxed) {
  109999. this.tech_.trigger({
  110000. type: "usage",
  110001. name: "vhs-demuxed"
  110002. });
  110003. this.tech_.trigger({
  110004. type: "usage",
  110005. name: "hls-demuxed"
  110006. });
  110007. }
  110008. if (Object.keys(mediaGroups.SUBTITLES).length) {
  110009. this.tech_.trigger({
  110010. type: "usage",
  110011. name: "vhs-webvtt"
  110012. });
  110013. this.tech_.trigger({
  110014. type: "usage",
  110015. name: "hls-webvtt"
  110016. });
  110017. }
  110018. if (Vhs$1.Playlist.isAes(media)) {
  110019. this.tech_.trigger({
  110020. type: "usage",
  110021. name: "vhs-aes"
  110022. });
  110023. this.tech_.trigger({
  110024. type: "usage",
  110025. name: "hls-aes"
  110026. });
  110027. }
  110028. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  110029. this.tech_.trigger({
  110030. type: "usage",
  110031. name: "vhs-alternate-audio"
  110032. });
  110033. this.tech_.trigger({
  110034. type: "usage",
  110035. name: "hls-alternate-audio"
  110036. });
  110037. }
  110038. if (this.useCueTags_) {
  110039. this.tech_.trigger({
  110040. type: "usage",
  110041. name: "vhs-playlist-cue-tags"
  110042. });
  110043. this.tech_.trigger({
  110044. type: "usage",
  110045. name: "hls-playlist-cue-tags"
  110046. });
  110047. }
  110048. };
  110049. _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) {
  110050. var currentPlaylist = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_;
  110051. var currentTime = this.tech_.currentTime();
  110052. var bufferLowWaterLine = this.bufferLowWaterLine();
  110053. var bufferHighWaterLine = this.bufferHighWaterLine();
  110054. var buffered = this.tech_.buffered();
  110055. return shouldSwitchToMedia({
  110056. buffered,
  110057. currentTime,
  110058. currentPlaylist,
  110059. nextPlaylist,
  110060. bufferLowWaterLine,
  110061. bufferHighWaterLine,
  110062. duration: this.duration(),
  110063. experimentalBufferBasedABR: this.experimentalBufferBasedABR,
  110064. log: this.logger_
  110065. });
  110066. };
  110067. _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() {
  110068. var _this4 = this;
  110069. this.mainSegmentLoader_.on("bandwidthupdate", function() {
  110070. _this4.checkABR_("bandwidthupdate");
  110071. _this4.tech_.trigger("bandwidthupdate");
  110072. });
  110073. this.mainSegmentLoader_.on("timeout", function() {
  110074. if (_this4.experimentalBufferBasedABR) {
  110075. _this4.mainSegmentLoader_.load();
  110076. }
  110077. });
  110078. if (!this.experimentalBufferBasedABR) {
  110079. this.mainSegmentLoader_.on("progress", function() {
  110080. _this4.trigger("progress");
  110081. });
  110082. }
  110083. this.mainSegmentLoader_.on("error", function() {
  110084. _this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error());
  110085. });
  110086. this.mainSegmentLoader_.on("appenderror", function() {
  110087. _this4.error = _this4.mainSegmentLoader_.error_;
  110088. _this4.trigger("error");
  110089. });
  110090. this.mainSegmentLoader_.on("syncinfoupdate", function() {
  110091. _this4.onSyncInfoUpdate_();
  110092. });
  110093. this.mainSegmentLoader_.on("timestampoffset", function() {
  110094. _this4.tech_.trigger({
  110095. type: "usage",
  110096. name: "vhs-timestamp-offset"
  110097. });
  110098. _this4.tech_.trigger({
  110099. type: "usage",
  110100. name: "hls-timestamp-offset"
  110101. });
  110102. });
  110103. this.audioSegmentLoader_.on("syncinfoupdate", function() {
  110104. _this4.onSyncInfoUpdate_();
  110105. });
  110106. this.audioSegmentLoader_.on("appenderror", function() {
  110107. _this4.error = _this4.audioSegmentLoader_.error_;
  110108. _this4.trigger("error");
  110109. });
  110110. this.mainSegmentLoader_.on("ended", function() {
  110111. _this4.logger_("main segment loader ended");
  110112. _this4.onEndOfStream();
  110113. });
  110114. this.mainSegmentLoader_.on("earlyabort", function(event2) {
  110115. if (_this4.experimentalBufferBasedABR) {
  110116. return;
  110117. }
  110118. _this4.delegateLoaders_("all", ["abort"]);
  110119. _this4.blacklistCurrentPlaylist({
  110120. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  110121. }, ABORT_EARLY_BLACKLIST_SECONDS);
  110122. });
  110123. var updateCodecs = function updateCodecs2() {
  110124. if (!_this4.sourceUpdater_.hasCreatedSourceBuffers()) {
  110125. return _this4.tryToCreateSourceBuffers_();
  110126. }
  110127. var codecs = _this4.getCodecsOrExclude_();
  110128. if (!codecs) {
  110129. return;
  110130. }
  110131. _this4.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  110132. };
  110133. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  110134. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  110135. this.mainSegmentLoader_.on("fmp4", function() {
  110136. if (!_this4.triggeredFmp4Usage) {
  110137. _this4.tech_.trigger({
  110138. type: "usage",
  110139. name: "vhs-fmp4"
  110140. });
  110141. _this4.tech_.trigger({
  110142. type: "usage",
  110143. name: "hls-fmp4"
  110144. });
  110145. _this4.triggeredFmp4Usage = true;
  110146. }
  110147. });
  110148. this.audioSegmentLoader_.on("fmp4", function() {
  110149. if (!_this4.triggeredFmp4Usage) {
  110150. _this4.tech_.trigger({
  110151. type: "usage",
  110152. name: "vhs-fmp4"
  110153. });
  110154. _this4.tech_.trigger({
  110155. type: "usage",
  110156. name: "hls-fmp4"
  110157. });
  110158. _this4.triggeredFmp4Usage = true;
  110159. }
  110160. });
  110161. this.audioSegmentLoader_.on("ended", function() {
  110162. _this4.logger_("audioSegmentLoader ended");
  110163. _this4.onEndOfStream();
  110164. });
  110165. };
  110166. _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() {
  110167. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  110168. };
  110169. _proto.load = function load() {
  110170. this.mainSegmentLoader_.load();
  110171. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110172. this.audioSegmentLoader_.load();
  110173. }
  110174. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110175. this.subtitleSegmentLoader_.load();
  110176. }
  110177. };
  110178. _proto.smoothQualityChange_ = function smoothQualityChange_(media) {
  110179. if (media === void 0) {
  110180. media = this.selectPlaylist();
  110181. }
  110182. this.fastQualityChange_(media);
  110183. };
  110184. _proto.fastQualityChange_ = function fastQualityChange_(media) {
  110185. var _this5 = this;
  110186. if (media === void 0) {
  110187. media = this.selectPlaylist();
  110188. }
  110189. if (media === this.masterPlaylistLoader_.media()) {
  110190. this.logger_("skipping fastQualityChange because new media is same as old");
  110191. return;
  110192. }
  110193. this.switchMedia_(media, "fast-quality");
  110194. this.mainSegmentLoader_.resetEverything(function() {
  110195. if (videojs.browser.IE_VERSION || videojs.browser.IS_EDGE) {
  110196. _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04);
  110197. } else {
  110198. _this5.tech_.setCurrentTime(_this5.tech_.currentTime());
  110199. }
  110200. });
  110201. };
  110202. _proto.play = function play() {
  110203. if (this.setupFirstPlay()) {
  110204. return;
  110205. }
  110206. if (this.tech_.ended()) {
  110207. this.tech_.setCurrentTime(0);
  110208. }
  110209. if (this.hasPlayed_) {
  110210. this.load();
  110211. }
  110212. var seekable3 = this.tech_.seekable();
  110213. if (this.tech_.duration() === Infinity) {
  110214. if (this.tech_.currentTime() < seekable3.start(0)) {
  110215. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  110216. }
  110217. }
  110218. };
  110219. _proto.setupFirstPlay = function setupFirstPlay() {
  110220. var _this6 = this;
  110221. var media = this.masterPlaylistLoader_.media();
  110222. if (!media || this.tech_.paused() || this.hasPlayed_) {
  110223. return false;
  110224. }
  110225. if (!media.endList) {
  110226. var seekable3 = this.seekable();
  110227. if (!seekable3.length) {
  110228. return false;
  110229. }
  110230. if (videojs.browser.IE_VERSION && this.tech_.readyState() === 0) {
  110231. this.tech_.one("loadedmetadata", function() {
  110232. _this6.trigger("firstplay");
  110233. _this6.tech_.setCurrentTime(seekable3.end(0));
  110234. _this6.hasPlayed_ = true;
  110235. });
  110236. return false;
  110237. }
  110238. this.trigger("firstplay");
  110239. this.tech_.setCurrentTime(seekable3.end(0));
  110240. }
  110241. this.hasPlayed_ = true;
  110242. this.load();
  110243. return true;
  110244. };
  110245. _proto.handleSourceOpen_ = function handleSourceOpen_() {
  110246. this.tryToCreateSourceBuffers_();
  110247. if (this.tech_.autoplay()) {
  110248. var playPromise = this.tech_.play();
  110249. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  110250. playPromise.then(null, function(e) {
  110251. });
  110252. }
  110253. }
  110254. this.trigger("sourceopen");
  110255. };
  110256. _proto.handleSourceEnded_ = function handleSourceEnded_() {
  110257. if (!this.inbandTextTracks_.metadataTrack_) {
  110258. return;
  110259. }
  110260. var cues = this.inbandTextTracks_.metadataTrack_.cues;
  110261. if (!cues || !cues.length) {
  110262. return;
  110263. }
  110264. var duration5 = this.duration();
  110265. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  110266. };
  110267. _proto.handleDurationChange_ = function handleDurationChange_() {
  110268. this.tech_.trigger("durationchange");
  110269. };
  110270. _proto.onEndOfStream = function onEndOfStream() {
  110271. var isEndOfStream = this.mainSegmentLoader_.ended_;
  110272. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110273. var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  110274. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  110275. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  110276. } else {
  110277. isEndOfStream = this.audioSegmentLoader_.ended_;
  110278. }
  110279. }
  110280. if (!isEndOfStream) {
  110281. return;
  110282. }
  110283. this.stopABRTimer_();
  110284. this.sourceUpdater_.endOfStream();
  110285. };
  110286. _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) {
  110287. var seekable3 = this.seekable();
  110288. if (!seekable3.length) {
  110289. return false;
  110290. }
  110291. var expired = this.syncController_.getExpiredTime(playlist, this.duration());
  110292. if (expired === null) {
  110293. return false;
  110294. }
  110295. var absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);
  110296. var currentTime = this.tech_.currentTime();
  110297. var buffered = this.tech_.buffered();
  110298. if (!buffered.length) {
  110299. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;
  110300. }
  110301. var bufferedEnd = buffered.end(buffered.length - 1);
  110302. return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;
  110303. };
  110304. _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) {
  110305. if (error === void 0) {
  110306. error = {};
  110307. }
  110308. var currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();
  110309. blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration;
  110310. if (!currentPlaylist) {
  110311. this.error = error;
  110312. if (this.mediaSource.readyState !== "open") {
  110313. this.trigger("error");
  110314. } else {
  110315. this.sourceUpdater_.endOfStream("network");
  110316. }
  110317. return;
  110318. }
  110319. currentPlaylist.playlistErrors_++;
  110320. var playlists = this.masterPlaylistLoader_.master.playlists;
  110321. var enabledPlaylists = playlists.filter(isEnabled);
  110322. var isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist;
  110323. if (playlists.length === 1 && blacklistDuration !== Infinity) {
  110324. videojs.log.warn("Problem encountered with playlist " + currentPlaylist.id + ". Trying again since it is the only playlist.");
  110325. this.tech_.trigger("retryplaylist");
  110326. return this.masterPlaylistLoader_.load(isFinalRendition);
  110327. }
  110328. if (isFinalRendition) {
  110329. var reincluded = false;
  110330. playlists.forEach(function(playlist) {
  110331. if (playlist === currentPlaylist) {
  110332. return;
  110333. }
  110334. var excludeUntil2 = playlist.excludeUntil;
  110335. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  110336. reincluded = true;
  110337. delete playlist.excludeUntil;
  110338. }
  110339. });
  110340. if (reincluded) {
  110341. videojs.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  110342. this.tech_.trigger("retryplaylist");
  110343. }
  110344. }
  110345. var excludeUntil;
  110346. if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) {
  110347. excludeUntil = Infinity;
  110348. } else {
  110349. excludeUntil = Date.now() + blacklistDuration * 1e3;
  110350. }
  110351. currentPlaylist.excludeUntil = excludeUntil;
  110352. if (error.reason) {
  110353. currentPlaylist.lastExcludeReason_ = error.reason;
  110354. }
  110355. this.tech_.trigger("blacklistplaylist");
  110356. this.tech_.trigger({
  110357. type: "usage",
  110358. name: "vhs-rendition-blacklisted"
  110359. });
  110360. this.tech_.trigger({
  110361. type: "usage",
  110362. name: "hls-rendition-blacklisted"
  110363. });
  110364. var nextPlaylist = this.selectPlaylist();
  110365. if (!nextPlaylist) {
  110366. this.error = "Playback cannot continue. No available working or supported playlists.";
  110367. this.trigger("error");
  110368. return;
  110369. }
  110370. var logFn2 = error.internal ? this.logger_ : videojs.log.warn;
  110371. var errorMessage = error.message ? " " + error.message : "";
  110372. logFn2((error.internal ? "Internal problem" : "Problem") + " encountered with playlist " + currentPlaylist.id + "." + (errorMessage + " Switching to playlist " + nextPlaylist.id + "."));
  110373. if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) {
  110374. this.delegateLoaders_("audio", ["abort", "pause"]);
  110375. }
  110376. if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) {
  110377. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  110378. }
  110379. this.delegateLoaders_("main", ["abort", "pause"]);
  110380. var delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  110381. var shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  110382. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  110383. };
  110384. _proto.pauseLoading = function pauseLoading() {
  110385. this.delegateLoaders_("all", ["abort", "pause"]);
  110386. this.stopABRTimer_();
  110387. };
  110388. _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) {
  110389. var _this7 = this;
  110390. var loaders = [];
  110391. var dontFilterPlaylist = filter === "all";
  110392. if (dontFilterPlaylist || filter === "main") {
  110393. loaders.push(this.masterPlaylistLoader_);
  110394. }
  110395. var mediaTypes2 = [];
  110396. if (dontFilterPlaylist || filter === "audio") {
  110397. mediaTypes2.push("AUDIO");
  110398. }
  110399. if (dontFilterPlaylist || filter === "subtitle") {
  110400. mediaTypes2.push("CLOSED-CAPTIONS");
  110401. mediaTypes2.push("SUBTITLES");
  110402. }
  110403. mediaTypes2.forEach(function(mediaType) {
  110404. var loader = _this7.mediaTypes_[mediaType] && _this7.mediaTypes_[mediaType].activePlaylistLoader;
  110405. if (loader) {
  110406. loaders.push(loader);
  110407. }
  110408. });
  110409. ["main", "audio", "subtitle"].forEach(function(name) {
  110410. var loader = _this7[name + "SegmentLoader_"];
  110411. if (loader && (filter === name || filter === "all")) {
  110412. loaders.push(loader);
  110413. }
  110414. });
  110415. loaders.forEach(function(loader) {
  110416. return fnNames.forEach(function(fnName) {
  110417. if (typeof loader[fnName] === "function") {
  110418. loader[fnName]();
  110419. }
  110420. });
  110421. });
  110422. };
  110423. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  110424. var buffered = findRange(this.tech_.buffered(), currentTime);
  110425. if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {
  110426. return 0;
  110427. }
  110428. if (!this.masterPlaylistLoader_.media().segments) {
  110429. return 0;
  110430. }
  110431. if (buffered && buffered.length) {
  110432. return currentTime;
  110433. }
  110434. this.mainSegmentLoader_.resetEverything();
  110435. this.mainSegmentLoader_.abort();
  110436. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110437. this.audioSegmentLoader_.resetEverything();
  110438. this.audioSegmentLoader_.abort();
  110439. }
  110440. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110441. this.subtitleSegmentLoader_.resetEverything();
  110442. this.subtitleSegmentLoader_.abort();
  110443. }
  110444. this.load();
  110445. };
  110446. _proto.duration = function duration5() {
  110447. if (!this.masterPlaylistLoader_) {
  110448. return 0;
  110449. }
  110450. var media = this.masterPlaylistLoader_.media();
  110451. if (!media) {
  110452. return 0;
  110453. }
  110454. if (!media.endList) {
  110455. return Infinity;
  110456. }
  110457. if (this.mediaSource) {
  110458. return this.mediaSource.duration;
  110459. }
  110460. return Vhs$1.Playlist.duration(media);
  110461. };
  110462. _proto.seekable = function seekable3() {
  110463. return this.seekable_;
  110464. };
  110465. _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() {
  110466. var audioSeekable;
  110467. if (!this.masterPlaylistLoader_) {
  110468. return;
  110469. }
  110470. var media = this.masterPlaylistLoader_.media();
  110471. if (!media) {
  110472. return;
  110473. }
  110474. var expired = this.syncController_.getExpiredTime(media, this.duration());
  110475. if (expired === null) {
  110476. return;
  110477. }
  110478. var master = this.masterPlaylistLoader_.master;
  110479. var mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110480. if (mainSeekable.length === 0) {
  110481. return;
  110482. }
  110483. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110484. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  110485. expired = this.syncController_.getExpiredTime(media, this.duration());
  110486. if (expired === null) {
  110487. return;
  110488. }
  110489. audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110490. if (audioSeekable.length === 0) {
  110491. return;
  110492. }
  110493. }
  110494. var oldEnd;
  110495. var oldStart;
  110496. if (this.seekable_ && this.seekable_.length) {
  110497. oldEnd = this.seekable_.end(0);
  110498. oldStart = this.seekable_.start(0);
  110499. }
  110500. if (!audioSeekable) {
  110501. this.seekable_ = mainSeekable;
  110502. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  110503. this.seekable_ = mainSeekable;
  110504. } else {
  110505. this.seekable_ = videojs.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  110506. }
  110507. if (this.seekable_ && this.seekable_.length) {
  110508. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  110509. return;
  110510. }
  110511. }
  110512. this.logger_("seekable updated [" + printableRange(this.seekable_) + "]");
  110513. this.tech_.trigger("seekablechanged");
  110514. };
  110515. _proto.updateDuration = function updateDuration(isLive) {
  110516. if (this.updateDuration_) {
  110517. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110518. this.updateDuration_ = null;
  110519. }
  110520. if (this.mediaSource.readyState !== "open") {
  110521. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  110522. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  110523. return;
  110524. }
  110525. if (isLive) {
  110526. var seekable3 = this.seekable();
  110527. if (!seekable3.length) {
  110528. return;
  110529. }
  110530. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  110531. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  110532. }
  110533. return;
  110534. }
  110535. var buffered = this.tech_.buffered();
  110536. var duration5 = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());
  110537. if (buffered.length > 0) {
  110538. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  110539. }
  110540. if (this.mediaSource.duration !== duration5) {
  110541. this.sourceUpdater_.setDuration(duration5);
  110542. }
  110543. };
  110544. _proto.dispose = function dispose() {
  110545. var _this8 = this;
  110546. this.trigger("dispose");
  110547. this.decrypter_.terminate();
  110548. this.masterPlaylistLoader_.dispose();
  110549. this.mainSegmentLoader_.dispose();
  110550. if (this.loadOnPlay_) {
  110551. this.tech_.off("play", this.loadOnPlay_);
  110552. }
  110553. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  110554. var groups = _this8.mediaTypes_[type2].groups;
  110555. for (var id in groups) {
  110556. groups[id].forEach(function(group) {
  110557. if (group.playlistLoader) {
  110558. group.playlistLoader.dispose();
  110559. }
  110560. });
  110561. }
  110562. });
  110563. this.audioSegmentLoader_.dispose();
  110564. this.subtitleSegmentLoader_.dispose();
  110565. this.sourceUpdater_.dispose();
  110566. this.timelineChangeController_.dispose();
  110567. this.stopABRTimer_();
  110568. if (this.updateDuration_) {
  110569. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110570. }
  110571. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  110572. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  110573. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  110574. this.off();
  110575. };
  110576. _proto.master = function master() {
  110577. return this.masterPlaylistLoader_.master;
  110578. };
  110579. _proto.media = function media() {
  110580. return this.masterPlaylistLoader_.media() || this.initialMedia_;
  110581. };
  110582. _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() {
  110583. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110584. var hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  110585. var hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  110586. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  110587. return false;
  110588. }
  110589. return true;
  110590. };
  110591. _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() {
  110592. var _this9 = this;
  110593. var media = {
  110594. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  110595. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  110596. };
  110597. var playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  110598. media.video = media.main;
  110599. var playlistCodecs = codecsForPlaylist(this.master(), playlist);
  110600. var codecs = {};
  110601. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110602. if (media.main.hasVideo) {
  110603. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;
  110604. }
  110605. if (media.main.isMuxed) {
  110606. codecs.video += "," + (playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC);
  110607. }
  110608. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  110609. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC;
  110610. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  110611. }
  110612. if (!codecs.audio && !codecs.video) {
  110613. this.blacklistCurrentPlaylist({
  110614. playlist,
  110615. message: "Could not determine codecs for playlist.",
  110616. blacklistDuration: Infinity
  110617. });
  110618. return;
  110619. }
  110620. var supportFunction = function supportFunction2(isFmp4, codec) {
  110621. return isFmp4 ? browserSupportsCodec2(codec) : muxerSupportsCodec2(codec);
  110622. };
  110623. var unsupportedCodecs = {};
  110624. var unsupportedAudio;
  110625. ["video", "audio"].forEach(function(type2) {
  110626. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  110627. var supporter = media[type2].isFmp4 ? "browser" : "muxer";
  110628. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  110629. unsupportedCodecs[supporter].push(codecs[type2]);
  110630. if (type2 === "audio") {
  110631. unsupportedAudio = supporter;
  110632. }
  110633. }
  110634. });
  110635. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  110636. var audioGroup = playlist.attributes.AUDIO;
  110637. this.master().playlists.forEach(function(variant) {
  110638. var variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  110639. if (variantAudioGroup === audioGroup && variant !== playlist) {
  110640. variant.excludeUntil = Infinity;
  110641. }
  110642. });
  110643. this.logger_("excluding audio group " + audioGroup + " as " + unsupportedAudio + ' does not support codec(s): "' + codecs.audio + '"');
  110644. }
  110645. if (Object.keys(unsupportedCodecs).length) {
  110646. var message = Object.keys(unsupportedCodecs).reduce(function(acc, supporter) {
  110647. if (acc) {
  110648. acc += ", ";
  110649. }
  110650. acc += supporter + ' does not support codec(s): "' + unsupportedCodecs[supporter].join(",") + '"';
  110651. return acc;
  110652. }, "") + ".";
  110653. this.blacklistCurrentPlaylist({
  110654. playlist,
  110655. internal: true,
  110656. message,
  110657. blacklistDuration: Infinity
  110658. });
  110659. return;
  110660. }
  110661. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  110662. var switchMessages = [];
  110663. ["video", "audio"].forEach(function(type2) {
  110664. var newCodec = (parseCodecs2(_this9.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  110665. var oldCodec = (parseCodecs2(codecs[type2] || "")[0] || {}).type;
  110666. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  110667. switchMessages.push('"' + _this9.sourceUpdater_.codecs[type2] + '" -> "' + codecs[type2] + '"');
  110668. }
  110669. });
  110670. if (switchMessages.length) {
  110671. this.blacklistCurrentPlaylist({
  110672. playlist,
  110673. message: "Codec switching not supported: " + switchMessages.join(", ") + ".",
  110674. blacklistDuration: Infinity,
  110675. internal: true
  110676. });
  110677. return;
  110678. }
  110679. }
  110680. return codecs;
  110681. };
  110682. _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() {
  110683. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  110684. return;
  110685. }
  110686. if (!this.areMediaTypesKnown_()) {
  110687. return;
  110688. }
  110689. var codecs = this.getCodecsOrExclude_();
  110690. if (!codecs) {
  110691. return;
  110692. }
  110693. this.sourceUpdater_.createSourceBuffers(codecs);
  110694. var codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  110695. this.excludeIncompatibleVariants_(codecString);
  110696. };
  110697. _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() {
  110698. var _this10 = this;
  110699. var playlists = this.master().playlists;
  110700. var ids = [];
  110701. Object.keys(playlists).forEach(function(key) {
  110702. var variant = playlists[key];
  110703. if (ids.indexOf(variant.id) !== -1) {
  110704. return;
  110705. }
  110706. ids.push(variant.id);
  110707. var codecs = codecsForPlaylist(_this10.master, variant);
  110708. var unsupported = [];
  110709. if (codecs.audio && !muxerSupportsCodec2(codecs.audio) && !browserSupportsCodec2(codecs.audio)) {
  110710. unsupported.push("audio codec " + codecs.audio);
  110711. }
  110712. if (codecs.video && !muxerSupportsCodec2(codecs.video) && !browserSupportsCodec2(codecs.video)) {
  110713. unsupported.push("video codec " + codecs.video);
  110714. }
  110715. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  110716. unsupported.push("text codec " + codecs.text);
  110717. }
  110718. if (unsupported.length) {
  110719. variant.excludeUntil = Infinity;
  110720. _this10.logger_("excluding " + variant.id + " for unsupported: " + unsupported.join(", "));
  110721. }
  110722. });
  110723. };
  110724. _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) {
  110725. var _this11 = this;
  110726. var ids = [];
  110727. var playlists = this.master().playlists;
  110728. var codecs = unwrapCodecList(parseCodecs2(codecString));
  110729. var codecCount_ = codecCount(codecs);
  110730. var videoDetails = codecs.video && parseCodecs2(codecs.video)[0] || null;
  110731. var audioDetails = codecs.audio && parseCodecs2(codecs.audio)[0] || null;
  110732. Object.keys(playlists).forEach(function(key) {
  110733. var variant = playlists[key];
  110734. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  110735. return;
  110736. }
  110737. ids.push(variant.id);
  110738. var blacklistReasons = [];
  110739. var variantCodecs = codecsForPlaylist(_this11.masterPlaylistLoader_.master, variant);
  110740. var variantCodecCount = codecCount(variantCodecs);
  110741. if (!variantCodecs.audio && !variantCodecs.video) {
  110742. return;
  110743. }
  110744. if (variantCodecCount !== codecCount_) {
  110745. blacklistReasons.push('codec count "' + variantCodecCount + '" !== "' + codecCount_ + '"');
  110746. }
  110747. if (!_this11.sourceUpdater_.canChangeType()) {
  110748. var variantVideoDetails = variantCodecs.video && parseCodecs2(variantCodecs.video)[0] || null;
  110749. var variantAudioDetails = variantCodecs.audio && parseCodecs2(variantCodecs.audio)[0] || null;
  110750. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  110751. blacklistReasons.push('video codec "' + variantVideoDetails.type + '" !== "' + videoDetails.type + '"');
  110752. }
  110753. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  110754. blacklistReasons.push('audio codec "' + variantAudioDetails.type + '" !== "' + audioDetails.type + '"');
  110755. }
  110756. }
  110757. if (blacklistReasons.length) {
  110758. variant.excludeUntil = Infinity;
  110759. _this11.logger_("blacklisting " + variant.id + ": " + blacklistReasons.join(" && "));
  110760. }
  110761. });
  110762. };
  110763. _proto.updateAdCues_ = function updateAdCues_(media) {
  110764. var offset = 0;
  110765. var seekable3 = this.seekable();
  110766. if (seekable3.length) {
  110767. offset = seekable3.start(0);
  110768. }
  110769. updateAdCues(media, this.cueTagsTrack_, offset);
  110770. };
  110771. _proto.goalBufferLength = function goalBufferLength() {
  110772. var currentTime = this.tech_.currentTime();
  110773. var initial = Config.GOAL_BUFFER_LENGTH;
  110774. var rate = Config.GOAL_BUFFER_LENGTH_RATE;
  110775. var max2 = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);
  110776. return Math.min(initial + currentTime * rate, max2);
  110777. };
  110778. _proto.bufferLowWaterLine = function bufferLowWaterLine() {
  110779. var currentTime = this.tech_.currentTime();
  110780. var initial = Config.BUFFER_LOW_WATER_LINE;
  110781. var rate = Config.BUFFER_LOW_WATER_LINE_RATE;
  110782. var max2 = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);
  110783. var newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  110784. return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max2);
  110785. };
  110786. _proto.bufferHighWaterLine = function bufferHighWaterLine() {
  110787. return Config.BUFFER_HIGH_WATER_LINE;
  110788. };
  110789. return MasterPlaylistController2;
  110790. }(videojs.EventTarget);
  110791. var enableFunction = function enableFunction2(loader, playlistID, changePlaylistFn) {
  110792. return function(enable) {
  110793. var playlist = loader.master.playlists[playlistID];
  110794. var incompatible = isIncompatible(playlist);
  110795. var currentlyEnabled = isEnabled(playlist);
  110796. if (typeof enable === "undefined") {
  110797. return currentlyEnabled;
  110798. }
  110799. if (enable) {
  110800. delete playlist.disabled;
  110801. } else {
  110802. playlist.disabled = true;
  110803. }
  110804. if (enable !== currentlyEnabled && !incompatible) {
  110805. changePlaylistFn();
  110806. if (enable) {
  110807. loader.trigger("renditionenabled");
  110808. } else {
  110809. loader.trigger("renditiondisabled");
  110810. }
  110811. }
  110812. return enable;
  110813. };
  110814. };
  110815. var Representation = function Representation2(vhsHandler, playlist, id) {
  110816. var mpc = vhsHandler.masterPlaylistController_, smoothQualityChange = vhsHandler.options_.smoothQualityChange;
  110817. var changeType2 = smoothQualityChange ? "smooth" : "fast";
  110818. var qualityChangeFunction = mpc[changeType2 + "QualityChange_"].bind(mpc);
  110819. if (playlist.attributes) {
  110820. var resolution = playlist.attributes.RESOLUTION;
  110821. this.width = resolution && resolution.width;
  110822. this.height = resolution && resolution.height;
  110823. this.bandwidth = playlist.attributes.BANDWIDTH;
  110824. this.frameRate = playlist.attributes["FRAME-RATE"];
  110825. }
  110826. this.codecs = codecsForPlaylist(mpc.master(), playlist);
  110827. this.playlist = playlist;
  110828. this.id = id;
  110829. this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  110830. };
  110831. var renditionSelectionMixin = function renditionSelectionMixin2(vhsHandler) {
  110832. vhsHandler.representations = function() {
  110833. var master = vhsHandler.masterPlaylistController_.master();
  110834. var playlists = isAudioOnly(master) ? vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_() : master.playlists;
  110835. if (!playlists) {
  110836. return [];
  110837. }
  110838. return playlists.filter(function(media) {
  110839. return !isIncompatible(media);
  110840. }).map(function(e, i2) {
  110841. return new Representation(vhsHandler, e, e.id);
  110842. });
  110843. };
  110844. };
  110845. var timerCancelEvents = ["seeking", "seeked", "pause", "playing", "error"];
  110846. var PlaybackWatcher = /* @__PURE__ */ function() {
  110847. function PlaybackWatcher2(options2) {
  110848. var _this = this;
  110849. this.masterPlaylistController_ = options2.masterPlaylistController;
  110850. this.tech_ = options2.tech;
  110851. this.seekable = options2.seekable;
  110852. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  110853. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  110854. this.media = options2.media;
  110855. this.consecutiveUpdates = 0;
  110856. this.lastRecordedTime = null;
  110857. this.timer_ = null;
  110858. this.checkCurrentTimeTimeout_ = null;
  110859. this.logger_ = logger("PlaybackWatcher");
  110860. this.logger_("initialize");
  110861. var playHandler = function playHandler2() {
  110862. return _this.monitorCurrentTime_();
  110863. };
  110864. var canPlayHandler = function canPlayHandler2() {
  110865. return _this.monitorCurrentTime_();
  110866. };
  110867. var waitingHandler = function waitingHandler2() {
  110868. return _this.techWaiting_();
  110869. };
  110870. var cancelTimerHandler = function cancelTimerHandler2() {
  110871. return _this.cancelTimer_();
  110872. };
  110873. var mpc = this.masterPlaylistController_;
  110874. var loaderTypes = ["main", "subtitle", "audio"];
  110875. var loaderChecks = {};
  110876. loaderTypes.forEach(function(type2) {
  110877. loaderChecks[type2] = {
  110878. reset: function reset3() {
  110879. return _this.resetSegmentDownloads_(type2);
  110880. },
  110881. updateend: function updateend() {
  110882. return _this.checkSegmentDownloads_(type2);
  110883. }
  110884. };
  110885. mpc[type2 + "SegmentLoader_"].on("appendsdone", loaderChecks[type2].updateend);
  110886. mpc[type2 + "SegmentLoader_"].on("playlistupdate", loaderChecks[type2].reset);
  110887. _this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  110888. });
  110889. var setSeekingHandlers = function setSeekingHandlers2(fn2) {
  110890. ["main", "audio"].forEach(function(type2) {
  110891. mpc[type2 + "SegmentLoader_"][fn2]("appended", _this.seekingAppendCheck_);
  110892. });
  110893. };
  110894. this.seekingAppendCheck_ = function() {
  110895. if (_this.fixesBadSeeks_()) {
  110896. _this.consecutiveUpdates = 0;
  110897. _this.lastRecordedTime = _this.tech_.currentTime();
  110898. setSeekingHandlers("off");
  110899. }
  110900. };
  110901. this.clearSeekingAppendCheck_ = function() {
  110902. return setSeekingHandlers("off");
  110903. };
  110904. this.watchForBadSeeking_ = function() {
  110905. _this.clearSeekingAppendCheck_();
  110906. setSeekingHandlers("on");
  110907. };
  110908. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  110909. this.tech_.on("seeking", this.watchForBadSeeking_);
  110910. this.tech_.on("waiting", waitingHandler);
  110911. this.tech_.on(timerCancelEvents, cancelTimerHandler);
  110912. this.tech_.on("canplay", canPlayHandler);
  110913. this.tech_.one("play", playHandler);
  110914. this.dispose = function() {
  110915. _this.clearSeekingAppendCheck_();
  110916. _this.logger_("dispose");
  110917. _this.tech_.off("waiting", waitingHandler);
  110918. _this.tech_.off(timerCancelEvents, cancelTimerHandler);
  110919. _this.tech_.off("canplay", canPlayHandler);
  110920. _this.tech_.off("play", playHandler);
  110921. _this.tech_.off("seeking", _this.watchForBadSeeking_);
  110922. _this.tech_.off("seeked", _this.clearSeekingAppendCheck_);
  110923. loaderTypes.forEach(function(type2) {
  110924. mpc[type2 + "SegmentLoader_"].off("appendsdone", loaderChecks[type2].updateend);
  110925. mpc[type2 + "SegmentLoader_"].off("playlistupdate", loaderChecks[type2].reset);
  110926. _this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  110927. });
  110928. if (_this.checkCurrentTimeTimeout_) {
  110929. window_1.clearTimeout(_this.checkCurrentTimeTimeout_);
  110930. }
  110931. _this.cancelTimer_();
  110932. };
  110933. }
  110934. var _proto = PlaybackWatcher2.prototype;
  110935. _proto.monitorCurrentTime_ = function monitorCurrentTime_() {
  110936. this.checkCurrentTime_();
  110937. if (this.checkCurrentTimeTimeout_) {
  110938. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  110939. }
  110940. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  110941. };
  110942. _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type2) {
  110943. var loader = this.masterPlaylistController_[type2 + "SegmentLoader_"];
  110944. if (this[type2 + "StalledDownloads_"] > 0) {
  110945. this.logger_("resetting possible stalled download count for " + type2 + " loader");
  110946. }
  110947. this[type2 + "StalledDownloads_"] = 0;
  110948. this[type2 + "Buffered_"] = loader.buffered_();
  110949. };
  110950. _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type2) {
  110951. var mpc = this.masterPlaylistController_;
  110952. var loader = mpc[type2 + "SegmentLoader_"];
  110953. var buffered = loader.buffered_();
  110954. var isBufferedDifferent = isRangeDifferent(this[type2 + "Buffered_"], buffered);
  110955. this[type2 + "Buffered_"] = buffered;
  110956. if (isBufferedDifferent) {
  110957. this.resetSegmentDownloads_(type2);
  110958. return;
  110959. }
  110960. this[type2 + "StalledDownloads_"]++;
  110961. this.logger_("found #" + this[type2 + "StalledDownloads_"] + " " + type2 + " appends that did not increase buffer (possible stalled download)", {
  110962. playlistId: loader.playlist_ && loader.playlist_.id,
  110963. buffered: timeRangesToArray(buffered)
  110964. });
  110965. if (this[type2 + "StalledDownloads_"] < 10) {
  110966. return;
  110967. }
  110968. this.logger_(type2 + " loader stalled download exclusion");
  110969. this.resetSegmentDownloads_(type2);
  110970. this.tech_.trigger({
  110971. type: "usage",
  110972. name: "vhs-" + type2 + "-download-exclusion"
  110973. });
  110974. if (type2 === "subtitle") {
  110975. return;
  110976. }
  110977. mpc.blacklistCurrentPlaylist({
  110978. message: "Excessive " + type2 + " segment downloading detected."
  110979. }, Infinity);
  110980. };
  110981. _proto.checkCurrentTime_ = function checkCurrentTime_() {
  110982. if (this.tech_.paused() || this.tech_.seeking()) {
  110983. return;
  110984. }
  110985. var currentTime = this.tech_.currentTime();
  110986. var buffered = this.tech_.buffered();
  110987. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {
  110988. return this.techWaiting_();
  110989. }
  110990. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  110991. this.consecutiveUpdates++;
  110992. this.waiting_();
  110993. } else if (currentTime === this.lastRecordedTime) {
  110994. this.consecutiveUpdates++;
  110995. } else {
  110996. this.consecutiveUpdates = 0;
  110997. this.lastRecordedTime = currentTime;
  110998. }
  110999. };
  111000. _proto.cancelTimer_ = function cancelTimer_() {
  111001. this.consecutiveUpdates = 0;
  111002. if (this.timer_) {
  111003. this.logger_("cancelTimer_");
  111004. clearTimeout(this.timer_);
  111005. }
  111006. this.timer_ = null;
  111007. };
  111008. _proto.fixesBadSeeks_ = function fixesBadSeeks_() {
  111009. var seeking = this.tech_.seeking();
  111010. if (!seeking) {
  111011. return false;
  111012. }
  111013. var seekable3 = this.seekable();
  111014. var currentTime = this.tech_.currentTime();
  111015. var isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  111016. var seekTo;
  111017. if (isAfterSeekableRange) {
  111018. var seekableEnd = seekable3.end(seekable3.length - 1);
  111019. seekTo = seekableEnd;
  111020. }
  111021. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  111022. var seekableStart = seekable3.start(0);
  111023. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA);
  111024. }
  111025. if (typeof seekTo !== "undefined") {
  111026. this.logger_("Trying to seek outside of seekable at time " + currentTime + " with " + ("seekable range " + printableRange(seekable3) + ". Seeking to ") + (seekTo + "."));
  111027. this.tech_.setCurrentTime(seekTo);
  111028. return true;
  111029. }
  111030. var sourceUpdater = this.masterPlaylistController_.sourceUpdater_;
  111031. var buffered = this.tech_.buffered();
  111032. var audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  111033. var videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  111034. var media = this.media();
  111035. var minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2;
  111036. var bufferedToCheck = [audioBuffered, videoBuffered];
  111037. for (var i2 = 0; i2 < bufferedToCheck.length; i2++) {
  111038. if (!bufferedToCheck[i2]) {
  111039. continue;
  111040. }
  111041. var timeAhead = timeAheadOf(bufferedToCheck[i2], currentTime);
  111042. if (timeAhead < minAppendedDuration) {
  111043. return false;
  111044. }
  111045. }
  111046. var nextRange = findNextRange(buffered, currentTime);
  111047. if (nextRange.length === 0) {
  111048. return false;
  111049. }
  111050. seekTo = nextRange.start(0) + SAFE_TIME_DELTA;
  111051. this.logger_("Buffered region starts (" + nextRange.start(0) + ") " + (" just beyond seek point (" + currentTime + "). Seeking to " + seekTo + "."));
  111052. this.tech_.setCurrentTime(seekTo);
  111053. return true;
  111054. };
  111055. _proto.waiting_ = function waiting_() {
  111056. if (this.techWaiting_()) {
  111057. return;
  111058. }
  111059. var currentTime = this.tech_.currentTime();
  111060. var buffered = this.tech_.buffered();
  111061. var currentRange = findRange(buffered, currentTime);
  111062. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  111063. this.cancelTimer_();
  111064. this.tech_.setCurrentTime(currentTime);
  111065. this.logger_("Stopped at " + currentTime + " while inside a buffered region " + ("[" + currentRange.start(0) + " -> " + currentRange.end(0) + "]. Attempting to resume ") + "playback by seeking to the current time.");
  111066. this.tech_.trigger({
  111067. type: "usage",
  111068. name: "vhs-unknown-waiting"
  111069. });
  111070. this.tech_.trigger({
  111071. type: "usage",
  111072. name: "hls-unknown-waiting"
  111073. });
  111074. return;
  111075. }
  111076. };
  111077. _proto.techWaiting_ = function techWaiting_() {
  111078. var seekable3 = this.seekable();
  111079. var currentTime = this.tech_.currentTime();
  111080. if (this.tech_.seeking() || this.timer_ !== null) {
  111081. return true;
  111082. }
  111083. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  111084. var livePoint = seekable3.end(seekable3.length - 1);
  111085. this.logger_("Fell out of live window at time " + currentTime + ". Seeking to " + ("live point (seekable end) " + livePoint));
  111086. this.cancelTimer_();
  111087. this.tech_.setCurrentTime(livePoint);
  111088. this.tech_.trigger({
  111089. type: "usage",
  111090. name: "vhs-live-resync"
  111091. });
  111092. this.tech_.trigger({
  111093. type: "usage",
  111094. name: "hls-live-resync"
  111095. });
  111096. return true;
  111097. }
  111098. var sourceUpdater = this.tech_.vhs.masterPlaylistController_.sourceUpdater_;
  111099. var buffered = this.tech_.buffered();
  111100. var videoUnderflow = this.videoUnderflow_({
  111101. audioBuffered: sourceUpdater.audioBuffered(),
  111102. videoBuffered: sourceUpdater.videoBuffered(),
  111103. currentTime
  111104. });
  111105. if (videoUnderflow) {
  111106. this.cancelTimer_();
  111107. this.tech_.setCurrentTime(currentTime);
  111108. this.tech_.trigger({
  111109. type: "usage",
  111110. name: "vhs-video-underflow"
  111111. });
  111112. this.tech_.trigger({
  111113. type: "usage",
  111114. name: "hls-video-underflow"
  111115. });
  111116. return true;
  111117. }
  111118. var nextRange = findNextRange(buffered, currentTime);
  111119. if (nextRange.length > 0) {
  111120. var difference = nextRange.start(0) - currentTime;
  111121. this.logger_("Stopped at " + currentTime + ", setting timer for " + difference + ", seeking " + ("to " + nextRange.start(0)));
  111122. this.cancelTimer_();
  111123. this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1e3, currentTime);
  111124. return true;
  111125. }
  111126. return false;
  111127. };
  111128. _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) {
  111129. if (allowSeeksWithinUnsafeLiveWindow === void 0) {
  111130. allowSeeksWithinUnsafeLiveWindow = false;
  111131. }
  111132. if (!seekable3.length) {
  111133. return false;
  111134. }
  111135. var allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA;
  111136. var isLive = !playlist.endList;
  111137. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  111138. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  111139. }
  111140. if (currentTime > allowedEnd) {
  111141. return true;
  111142. }
  111143. return false;
  111144. };
  111145. _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable3, currentTime) {
  111146. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  111147. return true;
  111148. }
  111149. return false;
  111150. };
  111151. _proto.videoUnderflow_ = function videoUnderflow_(_ref) {
  111152. var videoBuffered = _ref.videoBuffered, audioBuffered = _ref.audioBuffered, currentTime = _ref.currentTime;
  111153. if (!videoBuffered) {
  111154. return;
  111155. }
  111156. var gap;
  111157. if (videoBuffered.length && audioBuffered.length) {
  111158. var lastVideoRange = findRange(videoBuffered, currentTime - 3);
  111159. var videoRange = findRange(videoBuffered, currentTime);
  111160. var audioRange = findRange(audioBuffered, currentTime);
  111161. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  111162. gap = {
  111163. start: lastVideoRange.end(0),
  111164. end: audioRange.end(0)
  111165. };
  111166. }
  111167. } else {
  111168. var nextRange = findNextRange(videoBuffered, currentTime);
  111169. if (!nextRange.length) {
  111170. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  111171. }
  111172. }
  111173. if (gap) {
  111174. this.logger_("Encountered a gap in video from " + gap.start + " to " + gap.end + ". " + ("Seeking to current time " + currentTime));
  111175. return true;
  111176. }
  111177. return false;
  111178. };
  111179. _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) {
  111180. var buffered = this.tech_.buffered();
  111181. var currentTime = this.tech_.currentTime();
  111182. var nextRange = findNextRange(buffered, currentTime);
  111183. this.cancelTimer_();
  111184. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  111185. return;
  111186. }
  111187. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  111188. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);
  111189. this.tech_.trigger({
  111190. type: "usage",
  111191. name: "vhs-gap-skip"
  111192. });
  111193. this.tech_.trigger({
  111194. type: "usage",
  111195. name: "hls-gap-skip"
  111196. });
  111197. };
  111198. _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) {
  111199. var gaps = findGaps(buffered);
  111200. for (var i2 = 0; i2 < gaps.length; i2++) {
  111201. var start2 = gaps.start(i2);
  111202. var end = gaps.end(i2);
  111203. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  111204. return {
  111205. start: start2,
  111206. end
  111207. };
  111208. }
  111209. }
  111210. return null;
  111211. };
  111212. return PlaybackWatcher2;
  111213. }();
  111214. var defaultOptions = {
  111215. errorInterval: 30,
  111216. getSource: function getSource(next) {
  111217. var tech = this.tech({
  111218. IWillNotUseThisInPlugins: true
  111219. });
  111220. var sourceObj = tech.currentSource_ || this.currentSource();
  111221. return next(sourceObj);
  111222. }
  111223. };
  111224. var initPlugin = function initPlugin2(player, options2) {
  111225. var lastCalled = 0;
  111226. var seekTo = 0;
  111227. var localOptions = videojs.mergeOptions(defaultOptions, options2);
  111228. player.ready(function() {
  111229. player.trigger({
  111230. type: "usage",
  111231. name: "vhs-error-reload-initialized"
  111232. });
  111233. player.trigger({
  111234. type: "usage",
  111235. name: "hls-error-reload-initialized"
  111236. });
  111237. });
  111238. var loadedMetadataHandler = function loadedMetadataHandler2() {
  111239. if (seekTo) {
  111240. player.currentTime(seekTo);
  111241. }
  111242. };
  111243. var setSource2 = function setSource3(sourceObj) {
  111244. if (sourceObj === null || sourceObj === void 0) {
  111245. return;
  111246. }
  111247. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  111248. player.one("loadedmetadata", loadedMetadataHandler);
  111249. player.src(sourceObj);
  111250. player.trigger({
  111251. type: "usage",
  111252. name: "vhs-error-reload"
  111253. });
  111254. player.trigger({
  111255. type: "usage",
  111256. name: "hls-error-reload"
  111257. });
  111258. player.play();
  111259. };
  111260. var errorHandler = function errorHandler2() {
  111261. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  111262. player.trigger({
  111263. type: "usage",
  111264. name: "vhs-error-reload-canceled"
  111265. });
  111266. player.trigger({
  111267. type: "usage",
  111268. name: "hls-error-reload-canceled"
  111269. });
  111270. return;
  111271. }
  111272. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  111273. videojs.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  111274. return;
  111275. }
  111276. lastCalled = Date.now();
  111277. return localOptions.getSource.call(player, setSource2);
  111278. };
  111279. var cleanupEvents = function cleanupEvents2() {
  111280. player.off("loadedmetadata", loadedMetadataHandler);
  111281. player.off("error", errorHandler);
  111282. player.off("dispose", cleanupEvents2);
  111283. };
  111284. var reinitPlugin = function reinitPlugin2(newOptions) {
  111285. cleanupEvents();
  111286. initPlugin2(player, newOptions);
  111287. };
  111288. player.on("error", errorHandler);
  111289. player.on("dispose", cleanupEvents);
  111290. player.reloadSourceOnError = reinitPlugin;
  111291. };
  111292. var reloadSourceOnError = function reloadSourceOnError2(options2) {
  111293. initPlugin(this, options2);
  111294. };
  111295. var version$4 = "2.16.2";
  111296. var version$3 = "6.0.1";
  111297. var version$2 = "0.22.1";
  111298. var version$1$1 = "4.8.0";
  111299. var version$6 = "3.1.3";
  111300. var Vhs = {
  111301. PlaylistLoader,
  111302. Playlist,
  111303. utils,
  111304. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,
  111305. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,
  111306. lastBandwidthSelector,
  111307. movingAverageBandwidthSelector,
  111308. comparePlaylistBandwidth,
  111309. comparePlaylistResolution,
  111310. xhr: xhrFactory()
  111311. };
  111312. Object.keys(Config).forEach(function(prop) {
  111313. Object.defineProperty(Vhs, prop, {
  111314. get: function get7() {
  111315. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111316. return Config[prop];
  111317. },
  111318. set: function set4(value) {
  111319. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111320. if (typeof value !== "number" || value < 0) {
  111321. videojs.log.warn("value of Vhs." + prop + " must be greater than or equal to 0");
  111322. return;
  111323. }
  111324. Config[prop] = value;
  111325. }
  111326. });
  111327. });
  111328. var LOCAL_STORAGE_KEY = "videojs-vhs";
  111329. var handleVhsMediaChange = function handleVhsMediaChange2(qualityLevels2, playlistLoader) {
  111330. var newPlaylist = playlistLoader.media();
  111331. var selectedIndex = -1;
  111332. for (var i2 = 0; i2 < qualityLevels2.length; i2++) {
  111333. if (qualityLevels2[i2].id === newPlaylist.id) {
  111334. selectedIndex = i2;
  111335. break;
  111336. }
  111337. }
  111338. qualityLevels2.selectedIndex_ = selectedIndex;
  111339. qualityLevels2.trigger({
  111340. selectedIndex,
  111341. type: "change"
  111342. });
  111343. };
  111344. var handleVhsLoadedMetadata = function handleVhsLoadedMetadata2(qualityLevels2, vhs) {
  111345. vhs.representations().forEach(function(rep2) {
  111346. qualityLevels2.addQualityLevel(rep2);
  111347. });
  111348. handleVhsMediaChange(qualityLevels2, vhs.playlists);
  111349. };
  111350. Vhs.canPlaySource = function() {
  111351. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111352. };
  111353. var emeKeySystems = function emeKeySystems2(keySystemOptions, mainPlaylist, audioPlaylist) {
  111354. if (!keySystemOptions) {
  111355. return keySystemOptions;
  111356. }
  111357. var codecs = {};
  111358. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  111359. codecs = unwrapCodecList(parseCodecs2(mainPlaylist.attributes.CODECS));
  111360. }
  111361. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  111362. codecs.audio = audioPlaylist.attributes.CODECS;
  111363. }
  111364. var videoContentType = getMimeForCodec2(codecs.video);
  111365. var audioContentType = getMimeForCodec2(codecs.audio);
  111366. var keySystemContentTypes = {};
  111367. for (var keySystem in keySystemOptions) {
  111368. keySystemContentTypes[keySystem] = {};
  111369. if (audioContentType) {
  111370. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  111371. }
  111372. if (videoContentType) {
  111373. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  111374. }
  111375. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  111376. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  111377. }
  111378. if (typeof keySystemOptions[keySystem] === "string") {
  111379. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  111380. }
  111381. }
  111382. return videojs.mergeOptions(keySystemOptions, keySystemContentTypes);
  111383. };
  111384. var getAllPsshKeySystemsOptions = function getAllPsshKeySystemsOptions2(playlists, keySystems) {
  111385. return playlists.reduce(function(keySystemsArr, playlist) {
  111386. if (!playlist.contentProtection) {
  111387. return keySystemsArr;
  111388. }
  111389. var keySystemsOptions = keySystems.reduce(function(keySystemsObj, keySystem) {
  111390. var keySystemOptions = playlist.contentProtection[keySystem];
  111391. if (keySystemOptions && keySystemOptions.pssh) {
  111392. keySystemsObj[keySystem] = {
  111393. pssh: keySystemOptions.pssh
  111394. };
  111395. }
  111396. return keySystemsObj;
  111397. }, {});
  111398. if (Object.keys(keySystemsOptions).length) {
  111399. keySystemsArr.push(keySystemsOptions);
  111400. }
  111401. return keySystemsArr;
  111402. }, []);
  111403. };
  111404. var waitForKeySessionCreation = function waitForKeySessionCreation2(_ref) {
  111405. var player = _ref.player, sourceKeySystems = _ref.sourceKeySystems, audioMedia = _ref.audioMedia, mainPlaylists = _ref.mainPlaylists;
  111406. if (!player.eme.initializeMediaKeys) {
  111407. return Promise.resolve();
  111408. }
  111409. var playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  111410. var keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));
  111411. var initializationFinishedPromises = [];
  111412. var keySessionCreatedPromises = [];
  111413. keySystemsOptionsArr.forEach(function(keySystemsOptions) {
  111414. keySessionCreatedPromises.push(new Promise(function(resolve2, reject2) {
  111415. player.tech_.one("keysessioncreated", resolve2);
  111416. }));
  111417. initializationFinishedPromises.push(new Promise(function(resolve2, reject2) {
  111418. player.eme.initializeMediaKeys({
  111419. keySystems: keySystemsOptions
  111420. }, function(err) {
  111421. if (err) {
  111422. reject2(err);
  111423. return;
  111424. }
  111425. resolve2();
  111426. });
  111427. }));
  111428. });
  111429. return Promise.race([
  111430. Promise.all(initializationFinishedPromises),
  111431. Promise.race(keySessionCreatedPromises)
  111432. ]);
  111433. };
  111434. var setupEmeOptions = function setupEmeOptions2(_ref2) {
  111435. var player = _ref2.player, sourceKeySystems = _ref2.sourceKeySystems, media = _ref2.media, audioMedia = _ref2.audioMedia;
  111436. var sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);
  111437. if (!sourceOptions) {
  111438. return false;
  111439. }
  111440. player.currentSource().keySystems = sourceOptions;
  111441. if (sourceOptions && !player.eme) {
  111442. videojs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  111443. return false;
  111444. }
  111445. return true;
  111446. };
  111447. var getVhsLocalStorage = function getVhsLocalStorage2() {
  111448. if (!window_1.localStorage) {
  111449. return null;
  111450. }
  111451. var storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY);
  111452. if (!storedObject) {
  111453. return null;
  111454. }
  111455. try {
  111456. return JSON.parse(storedObject);
  111457. } catch (e) {
  111458. return null;
  111459. }
  111460. };
  111461. var updateVhsLocalStorage = function updateVhsLocalStorage2(options2) {
  111462. if (!window_1.localStorage) {
  111463. return false;
  111464. }
  111465. var objectToStore = getVhsLocalStorage();
  111466. objectToStore = objectToStore ? videojs.mergeOptions(objectToStore, options2) : options2;
  111467. try {
  111468. window_1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));
  111469. } catch (e) {
  111470. return false;
  111471. }
  111472. return objectToStore;
  111473. };
  111474. var expandDataUri = function expandDataUri2(dataUri) {
  111475. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  111476. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  111477. }
  111478. return dataUri;
  111479. };
  111480. Vhs.supportsNativeHls = function() {
  111481. if (!document_1 || !document_1.createElement) {
  111482. return false;
  111483. }
  111484. var video = document_1.createElement("video");
  111485. if (!videojs.getTech("Html5").isSupported()) {
  111486. return false;
  111487. }
  111488. var canPlay = [
  111489. "application/vnd.apple.mpegurl",
  111490. "audio/mpegurl",
  111491. "audio/x-mpegurl",
  111492. "application/x-mpegurl",
  111493. "video/x-mpegurl",
  111494. "video/mpegurl",
  111495. "application/mpegurl"
  111496. ];
  111497. return canPlay.some(function(canItPlay) {
  111498. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  111499. });
  111500. }();
  111501. Vhs.supportsNativeDash = function() {
  111502. if (!document_1 || !document_1.createElement || !videojs.getTech("Html5").isSupported()) {
  111503. return false;
  111504. }
  111505. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  111506. }();
  111507. Vhs.supportsTypeNatively = function(type2) {
  111508. if (type2 === "hls") {
  111509. return Vhs.supportsNativeHls;
  111510. }
  111511. if (type2 === "dash") {
  111512. return Vhs.supportsNativeDash;
  111513. }
  111514. return false;
  111515. };
  111516. Vhs.isSupported = function() {
  111517. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111518. };
  111519. var Component = videojs.getComponent("Component");
  111520. var VhsHandler = /* @__PURE__ */ function(_Component) {
  111521. _inheritsLoose(VhsHandler2, _Component);
  111522. function VhsHandler2(source, tech, options2) {
  111523. var _this;
  111524. _this = _Component.call(this, tech, videojs.mergeOptions(options2.hls, options2.vhs)) || this;
  111525. if (options2.hls && Object.keys(options2.hls).length) {
  111526. videojs.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object.");
  111527. }
  111528. if (typeof options2.initialBandwidth === "number") {
  111529. _this.options_.bandwidth = options2.initialBandwidth;
  111530. }
  111531. _this.logger_ = logger("VhsHandler");
  111532. if (tech.options_ && tech.options_.playerId) {
  111533. var _player = videojs(tech.options_.playerId);
  111534. if (!_player.hasOwnProperty("hls")) {
  111535. Object.defineProperty(_player, "hls", {
  111536. get: function get7() {
  111537. videojs.log.warn("player.hls is deprecated. Use player.tech().vhs instead.");
  111538. tech.trigger({
  111539. type: "usage",
  111540. name: "hls-player-access"
  111541. });
  111542. return _assertThisInitialized(_this);
  111543. },
  111544. configurable: true
  111545. });
  111546. }
  111547. if (!_player.hasOwnProperty("vhs")) {
  111548. Object.defineProperty(_player, "vhs", {
  111549. get: function get7() {
  111550. videojs.log.warn("player.vhs is deprecated. Use player.tech().vhs instead.");
  111551. tech.trigger({
  111552. type: "usage",
  111553. name: "vhs-player-access"
  111554. });
  111555. return _assertThisInitialized(_this);
  111556. },
  111557. configurable: true
  111558. });
  111559. }
  111560. if (!_player.hasOwnProperty("dash")) {
  111561. Object.defineProperty(_player, "dash", {
  111562. get: function get7() {
  111563. videojs.log.warn("player.dash is deprecated. Use player.tech().vhs instead.");
  111564. return _assertThisInitialized(_this);
  111565. },
  111566. configurable: true
  111567. });
  111568. }
  111569. _this.player_ = _player;
  111570. }
  111571. _this.tech_ = tech;
  111572. _this.source_ = source;
  111573. _this.stats = {};
  111574. _this.ignoreNextSeekingEvent_ = false;
  111575. _this.setOptions_();
  111576. if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  111577. tech.overrideNativeAudioTracks(true);
  111578. tech.overrideNativeVideoTracks(true);
  111579. } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  111580. throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");
  111581. }
  111582. _this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], function(event2) {
  111583. var fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  111584. if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {
  111585. _this.masterPlaylistController_.fastQualityChange_();
  111586. } else {
  111587. _this.masterPlaylistController_.checkABR_();
  111588. }
  111589. });
  111590. _this.on(_this.tech_, "seeking", function() {
  111591. if (this.ignoreNextSeekingEvent_) {
  111592. this.ignoreNextSeekingEvent_ = false;
  111593. return;
  111594. }
  111595. this.setCurrentTime(this.tech_.currentTime());
  111596. });
  111597. _this.on(_this.tech_, "error", function() {
  111598. if (this.tech_.error() && this.masterPlaylistController_) {
  111599. this.masterPlaylistController_.pauseLoading();
  111600. }
  111601. });
  111602. _this.on(_this.tech_, "play", _this.play);
  111603. return _this;
  111604. }
  111605. var _proto = VhsHandler2.prototype;
  111606. _proto.setOptions_ = function setOptions_() {
  111607. var _this2 = this;
  111608. this.options_.withCredentials = this.options_.withCredentials || false;
  111609. this.options_.handleManifestRedirects = this.options_.handleManifestRedirects === false ? false : true;
  111610. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  111611. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  111612. this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;
  111613. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  111614. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  111615. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  111616. this.options_.customTagParsers = this.options_.customTagParsers || [];
  111617. this.options_.customTagMappers = this.options_.customTagMappers || [];
  111618. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  111619. if (typeof this.options_.blacklistDuration !== "number") {
  111620. this.options_.blacklistDuration = 5 * 60;
  111621. }
  111622. if (typeof this.options_.bandwidth !== "number") {
  111623. if (this.options_.useBandwidthFromLocalStorage) {
  111624. var storedObject = getVhsLocalStorage();
  111625. if (storedObject && storedObject.bandwidth) {
  111626. this.options_.bandwidth = storedObject.bandwidth;
  111627. this.tech_.trigger({
  111628. type: "usage",
  111629. name: "vhs-bandwidth-from-local-storage"
  111630. });
  111631. this.tech_.trigger({
  111632. type: "usage",
  111633. name: "hls-bandwidth-from-local-storage"
  111634. });
  111635. }
  111636. if (storedObject && storedObject.throughput) {
  111637. this.options_.throughput = storedObject.throughput;
  111638. this.tech_.trigger({
  111639. type: "usage",
  111640. name: "vhs-throughput-from-local-storage"
  111641. });
  111642. this.tech_.trigger({
  111643. type: "usage",
  111644. name: "hls-throughput-from-local-storage"
  111645. });
  111646. }
  111647. }
  111648. }
  111649. if (typeof this.options_.bandwidth !== "number") {
  111650. this.options_.bandwidth = Config.INITIAL_BANDWIDTH;
  111651. }
  111652. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH;
  111653. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "smoothQualityChange", "customTagParsers", "customTagMappers", "handleManifestRedirects", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "experimentalBufferBasedABR", "liveRangeSafeTimeDelta", "experimentalLLHLS", "useNetworkInformationApi", "useDtsForTimestampOffset", "experimentalExactManifestTimings", "experimentalLeastPixelDiffSelector"].forEach(function(option) {
  111654. if (typeof _this2.source_[option] !== "undefined") {
  111655. _this2.options_[option] = _this2.source_[option];
  111656. }
  111657. });
  111658. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  111659. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  111660. };
  111661. _proto.src = function src(_src, type2) {
  111662. var _this3 = this;
  111663. if (!_src) {
  111664. return;
  111665. }
  111666. this.setOptions_();
  111667. this.options_.src = expandDataUri(this.source_.src);
  111668. this.options_.tech = this.tech_;
  111669. this.options_.externVhs = Vhs;
  111670. this.options_.sourceType = simpleTypeFromSourceType2(type2);
  111671. this.options_.seekTo = function(time) {
  111672. _this3.tech_.setCurrentTime(time);
  111673. };
  111674. if (this.options_.smoothQualityChange) {
  111675. videojs.log.warn("smoothQualityChange is deprecated and will be removed in the next major version");
  111676. }
  111677. this.masterPlaylistController_ = new MasterPlaylistController(this.options_);
  111678. var playbackWatcherOptions = videojs.mergeOptions({
  111679. liveRangeSafeTimeDelta: SAFE_TIME_DELTA
  111680. }, this.options_, {
  111681. seekable: function seekable3() {
  111682. return _this3.seekable();
  111683. },
  111684. media: function media() {
  111685. return _this3.masterPlaylistController_.media();
  111686. },
  111687. masterPlaylistController: this.masterPlaylistController_
  111688. });
  111689. this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);
  111690. this.masterPlaylistController_.on("error", function() {
  111691. var player = videojs.players[_this3.tech_.options_.playerId];
  111692. var error = _this3.masterPlaylistController_.error;
  111693. if (typeof error === "object" && !error.code) {
  111694. error.code = 3;
  111695. } else if (typeof error === "string") {
  111696. error = {
  111697. message: error,
  111698. code: 3
  111699. };
  111700. }
  111701. player.error(error);
  111702. });
  111703. var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR;
  111704. this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  111705. this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this);
  111706. this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;
  111707. this.mediaSource = this.masterPlaylistController_.mediaSource;
  111708. Object.defineProperties(this, {
  111709. selectPlaylist: {
  111710. get: function get7() {
  111711. return this.masterPlaylistController_.selectPlaylist;
  111712. },
  111713. set: function set4(selectPlaylist) {
  111714. this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);
  111715. }
  111716. },
  111717. throughput: {
  111718. get: function get7() {
  111719. return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;
  111720. },
  111721. set: function set4(throughput) {
  111722. this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput;
  111723. this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;
  111724. }
  111725. },
  111726. bandwidth: {
  111727. get: function get7() {
  111728. var playerBandwidthEst = this.masterPlaylistController_.mainSegmentLoader_.bandwidth;
  111729. var networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  111730. var tenMbpsAsBitsPerSecond = 1e7;
  111731. if (this.options_.useNetworkInformationApi && networkInformation) {
  111732. var networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  111733. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  111734. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  111735. } else {
  111736. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  111737. }
  111738. }
  111739. return playerBandwidthEst;
  111740. },
  111741. set: function set4(bandwidth2) {
  111742. this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  111743. this.masterPlaylistController_.mainSegmentLoader_.throughput = {
  111744. rate: 0,
  111745. count: 0
  111746. };
  111747. }
  111748. },
  111749. systemBandwidth: {
  111750. get: function get7() {
  111751. var invBandwidth = 1 / (this.bandwidth || 1);
  111752. var invThroughput;
  111753. if (this.throughput > 0) {
  111754. invThroughput = 1 / this.throughput;
  111755. } else {
  111756. invThroughput = 0;
  111757. }
  111758. var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  111759. return systemBitrate;
  111760. },
  111761. set: function set4() {
  111762. videojs.log.error('The "systemBandwidth" property is read-only');
  111763. }
  111764. }
  111765. });
  111766. if (this.options_.bandwidth) {
  111767. this.bandwidth = this.options_.bandwidth;
  111768. }
  111769. if (this.options_.throughput) {
  111770. this.throughput = this.options_.throughput;
  111771. }
  111772. Object.defineProperties(this.stats, {
  111773. bandwidth: {
  111774. get: function get7() {
  111775. return _this3.bandwidth || 0;
  111776. },
  111777. enumerable: true
  111778. },
  111779. mediaRequests: {
  111780. get: function get7() {
  111781. return _this3.masterPlaylistController_.mediaRequests_() || 0;
  111782. },
  111783. enumerable: true
  111784. },
  111785. mediaRequestsAborted: {
  111786. get: function get7() {
  111787. return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;
  111788. },
  111789. enumerable: true
  111790. },
  111791. mediaRequestsTimedout: {
  111792. get: function get7() {
  111793. return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;
  111794. },
  111795. enumerable: true
  111796. },
  111797. mediaRequestsErrored: {
  111798. get: function get7() {
  111799. return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;
  111800. },
  111801. enumerable: true
  111802. },
  111803. mediaTransferDuration: {
  111804. get: function get7() {
  111805. return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;
  111806. },
  111807. enumerable: true
  111808. },
  111809. mediaBytesTransferred: {
  111810. get: function get7() {
  111811. return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;
  111812. },
  111813. enumerable: true
  111814. },
  111815. mediaSecondsLoaded: {
  111816. get: function get7() {
  111817. return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;
  111818. },
  111819. enumerable: true
  111820. },
  111821. mediaAppends: {
  111822. get: function get7() {
  111823. return _this3.masterPlaylistController_.mediaAppends_() || 0;
  111824. },
  111825. enumerable: true
  111826. },
  111827. mainAppendsToLoadedData: {
  111828. get: function get7() {
  111829. return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0;
  111830. },
  111831. enumerable: true
  111832. },
  111833. audioAppendsToLoadedData: {
  111834. get: function get7() {
  111835. return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0;
  111836. },
  111837. enumerable: true
  111838. },
  111839. appendsToLoadedData: {
  111840. get: function get7() {
  111841. return _this3.masterPlaylistController_.appendsToLoadedData_() || 0;
  111842. },
  111843. enumerable: true
  111844. },
  111845. timeToLoadedData: {
  111846. get: function get7() {
  111847. return _this3.masterPlaylistController_.timeToLoadedData_() || 0;
  111848. },
  111849. enumerable: true
  111850. },
  111851. buffered: {
  111852. get: function get7() {
  111853. return timeRangesToArray(_this3.tech_.buffered());
  111854. },
  111855. enumerable: true
  111856. },
  111857. currentTime: {
  111858. get: function get7() {
  111859. return _this3.tech_.currentTime();
  111860. },
  111861. enumerable: true
  111862. },
  111863. currentSource: {
  111864. get: function get7() {
  111865. return _this3.tech_.currentSource_;
  111866. },
  111867. enumerable: true
  111868. },
  111869. currentTech: {
  111870. get: function get7() {
  111871. return _this3.tech_.name_;
  111872. },
  111873. enumerable: true
  111874. },
  111875. duration: {
  111876. get: function get7() {
  111877. return _this3.tech_.duration();
  111878. },
  111879. enumerable: true
  111880. },
  111881. master: {
  111882. get: function get7() {
  111883. return _this3.playlists.master;
  111884. },
  111885. enumerable: true
  111886. },
  111887. playerDimensions: {
  111888. get: function get7() {
  111889. return _this3.tech_.currentDimensions();
  111890. },
  111891. enumerable: true
  111892. },
  111893. seekable: {
  111894. get: function get7() {
  111895. return timeRangesToArray(_this3.tech_.seekable());
  111896. },
  111897. enumerable: true
  111898. },
  111899. timestamp: {
  111900. get: function get7() {
  111901. return Date.now();
  111902. },
  111903. enumerable: true
  111904. },
  111905. videoPlaybackQuality: {
  111906. get: function get7() {
  111907. return _this3.tech_.getVideoPlaybackQuality();
  111908. },
  111909. enumerable: true
  111910. }
  111911. });
  111912. this.tech_.one("canplay", this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));
  111913. this.tech_.on("bandwidthupdate", function() {
  111914. if (_this3.options_.useBandwidthFromLocalStorage) {
  111915. updateVhsLocalStorage({
  111916. bandwidth: _this3.bandwidth,
  111917. throughput: Math.round(_this3.throughput)
  111918. });
  111919. }
  111920. });
  111921. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  111922. renditionSelectionMixin(_this3);
  111923. });
  111924. this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers", function() {
  111925. _this3.setupEme_();
  111926. });
  111927. this.on(this.masterPlaylistController_, "progress", function() {
  111928. this.tech_.trigger("progress");
  111929. });
  111930. this.on(this.masterPlaylistController_, "firstplay", function() {
  111931. this.ignoreNextSeekingEvent_ = true;
  111932. });
  111933. this.setupQualityLevels_();
  111934. if (!this.tech_.el()) {
  111935. return;
  111936. }
  111937. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.masterPlaylistController_.mediaSource);
  111938. this.tech_.src(this.mediaSourceUrl_);
  111939. };
  111940. _proto.createKeySessions_ = function createKeySessions_() {
  111941. var _this4 = this;
  111942. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111943. this.logger_("waiting for EME key session creation");
  111944. waitForKeySessionCreation({
  111945. player: this.player_,
  111946. sourceKeySystems: this.source_.keySystems,
  111947. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  111948. mainPlaylists: this.playlists.master.playlists
  111949. }).then(function() {
  111950. _this4.logger_("created EME key session");
  111951. _this4.masterPlaylistController_.sourceUpdater_.initializedEme();
  111952. })["catch"](function(err) {
  111953. _this4.logger_("error while creating EME key session", err);
  111954. _this4.player_.error({
  111955. message: "Failed to initialize media keys for EME",
  111956. code: 3
  111957. });
  111958. });
  111959. };
  111960. _proto.handleWaitingForKey_ = function handleWaitingForKey_() {
  111961. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  111962. this.createKeySessions_();
  111963. };
  111964. _proto.setupEme_ = function setupEme_() {
  111965. var _this5 = this;
  111966. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111967. var didSetupEmeOptions = setupEmeOptions({
  111968. player: this.player_,
  111969. sourceKeySystems: this.source_.keySystems,
  111970. media: this.playlists.media(),
  111971. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  111972. });
  111973. this.player_.tech_.on("keystatuschange", function(e) {
  111974. if (e.status !== "output-restricted") {
  111975. return;
  111976. }
  111977. var masterPlaylist = _this5.masterPlaylistController_.master();
  111978. if (!masterPlaylist || !masterPlaylist.playlists) {
  111979. return;
  111980. }
  111981. var excludedHDPlaylists = [];
  111982. masterPlaylist.playlists.forEach(function(playlist) {
  111983. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  111984. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  111985. playlist.excludeUntil = Infinity;
  111986. excludedHDPlaylists.push(playlist);
  111987. }
  111988. }
  111989. });
  111990. if (excludedHDPlaylists.length) {
  111991. var _videojs$log;
  111992. (_videojs$log = videojs.log).warn.apply(_videojs$log, ['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(excludedHDPlaylists));
  111993. _this5.masterPlaylistController_.fastQualityChange_();
  111994. }
  111995. });
  111996. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  111997. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  111998. if (videojs.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  111999. this.masterPlaylistController_.sourceUpdater_.initializedEme();
  112000. return;
  112001. }
  112002. this.createKeySessions_();
  112003. };
  112004. _proto.setupQualityLevels_ = function setupQualityLevels_() {
  112005. var _this6 = this;
  112006. var player = videojs.players[this.tech_.options_.playerId];
  112007. if (!player || !player.qualityLevels || this.qualityLevels_) {
  112008. return;
  112009. }
  112010. this.qualityLevels_ = player.qualityLevels();
  112011. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  112012. handleVhsLoadedMetadata(_this6.qualityLevels_, _this6);
  112013. });
  112014. this.playlists.on("mediachange", function() {
  112015. handleVhsMediaChange(_this6.qualityLevels_, _this6.playlists);
  112016. });
  112017. };
  112018. VhsHandler2.version = function version$52() {
  112019. return {
  112020. "@videojs/http-streaming": version$4,
  112021. "mux.js": version$3,
  112022. "mpd-parser": version$2,
  112023. "m3u8-parser": version$1$1,
  112024. "aes-decrypter": version$6
  112025. };
  112026. };
  112027. _proto.version = function version2() {
  112028. return this.constructor.version();
  112029. };
  112030. _proto.canChangeType = function canChangeType() {
  112031. return SourceUpdater.canChangeType();
  112032. };
  112033. _proto.play = function play() {
  112034. this.masterPlaylistController_.play();
  112035. };
  112036. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  112037. this.masterPlaylistController_.setCurrentTime(currentTime);
  112038. };
  112039. _proto.duration = function duration5() {
  112040. return this.masterPlaylistController_.duration();
  112041. };
  112042. _proto.seekable = function seekable3() {
  112043. return this.masterPlaylistController_.seekable();
  112044. };
  112045. _proto.dispose = function dispose() {
  112046. if (this.playbackWatcher_) {
  112047. this.playbackWatcher_.dispose();
  112048. }
  112049. if (this.masterPlaylistController_) {
  112050. this.masterPlaylistController_.dispose();
  112051. }
  112052. if (this.qualityLevels_) {
  112053. this.qualityLevels_.dispose();
  112054. }
  112055. if (this.player_) {
  112056. delete this.player_.vhs;
  112057. delete this.player_.dash;
  112058. delete this.player_.hls;
  112059. }
  112060. if (this.tech_ && this.tech_.vhs) {
  112061. delete this.tech_.vhs;
  112062. }
  112063. if (this.tech_) {
  112064. delete this.tech_.hls;
  112065. }
  112066. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  112067. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  112068. this.mediaSourceUrl_ = null;
  112069. }
  112070. if (this.tech_) {
  112071. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  112072. }
  112073. _Component.prototype.dispose.call(this);
  112074. };
  112075. _proto.convertToProgramTime = function convertToProgramTime(time, callback2) {
  112076. return getProgramTime({
  112077. playlist: this.masterPlaylistController_.media(),
  112078. time,
  112079. callback: callback2
  112080. });
  112081. };
  112082. _proto.seekToProgramTime = function seekToProgramTime$12(programTime, callback2, pauseAfterSeek, retryCount) {
  112083. if (pauseAfterSeek === void 0) {
  112084. pauseAfterSeek = true;
  112085. }
  112086. if (retryCount === void 0) {
  112087. retryCount = 2;
  112088. }
  112089. return seekToProgramTime({
  112090. programTime,
  112091. playlist: this.masterPlaylistController_.media(),
  112092. retryCount,
  112093. pauseAfterSeek,
  112094. seekTo: this.options_.seekTo,
  112095. tech: this.options_.tech,
  112096. callback: callback2
  112097. });
  112098. };
  112099. return VhsHandler2;
  112100. }(Component);
  112101. var VhsSourceHandler = {
  112102. name: "videojs-http-streaming",
  112103. VERSION: version$4,
  112104. canHandleSource: function canHandleSource(srcObj, options2) {
  112105. if (options2 === void 0) {
  112106. options2 = {};
  112107. }
  112108. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112109. return VhsSourceHandler.canPlayType(srcObj.type, localOptions);
  112110. },
  112111. handleSource: function handleSource(source, tech, options2) {
  112112. if (options2 === void 0) {
  112113. options2 = {};
  112114. }
  112115. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112116. tech.vhs = new VhsHandler(source, tech, localOptions);
  112117. if (!videojs.hasOwnProperty("hls")) {
  112118. Object.defineProperty(tech, "hls", {
  112119. get: function get7() {
  112120. videojs.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead.");
  112121. return tech.vhs;
  112122. },
  112123. configurable: true
  112124. });
  112125. }
  112126. tech.vhs.xhr = xhrFactory();
  112127. tech.vhs.src(source.src, source.type);
  112128. return tech.vhs;
  112129. },
  112130. canPlayType: function canPlayType2(type2, options2) {
  112131. var simpleType = simpleTypeFromSourceType2(type2);
  112132. if (!simpleType) {
  112133. return "";
  112134. }
  112135. var overrideNative = VhsSourceHandler.getOverrideNative(options2);
  112136. var supportsTypeNatively = Vhs.supportsTypeNatively(simpleType);
  112137. var canUseMsePlayback = !supportsTypeNatively || overrideNative;
  112138. return canUseMsePlayback ? "maybe" : "";
  112139. },
  112140. getOverrideNative: function getOverrideNative(options2) {
  112141. if (options2 === void 0) {
  112142. options2 = {};
  112143. }
  112144. var _options = options2, _options$vhs = _options.vhs, vhs = _options$vhs === void 0 ? {} : _options$vhs, _options$hls = _options.hls, hls = _options$hls === void 0 ? {} : _options$hls;
  112145. var defaultOverrideNative = !(videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS);
  112146. var _vhs$overrideNative = vhs.overrideNative, overrideNative = _vhs$overrideNative === void 0 ? defaultOverrideNative : _vhs$overrideNative;
  112147. var _hls$overrideNative = hls.overrideNative, legacyOverrideNative = _hls$overrideNative === void 0 ? false : _hls$overrideNative;
  112148. return legacyOverrideNative || overrideNative;
  112149. }
  112150. };
  112151. var supportsNativeMediaSources = function supportsNativeMediaSources2() {
  112152. return browserSupportsCodec2("avc1.4d400d,mp4a.40.2");
  112153. };
  112154. if (supportsNativeMediaSources()) {
  112155. videojs.getTech("Html5").registerSourceHandler(VhsSourceHandler, 0);
  112156. }
  112157. videojs.VhsHandler = VhsHandler;
  112158. Object.defineProperty(videojs, "HlsHandler", {
  112159. get: function get4() {
  112160. videojs.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.");
  112161. return VhsHandler;
  112162. },
  112163. configurable: true
  112164. });
  112165. videojs.VhsSourceHandler = VhsSourceHandler;
  112166. Object.defineProperty(videojs, "HlsSourceHandler", {
  112167. get: function get5() {
  112168. videojs.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead.");
  112169. return VhsSourceHandler;
  112170. },
  112171. configurable: true
  112172. });
  112173. videojs.Vhs = Vhs;
  112174. Object.defineProperty(videojs, "Hls", {
  112175. get: function get6() {
  112176. videojs.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead.");
  112177. return Vhs;
  112178. },
  112179. configurable: true
  112180. });
  112181. if (!videojs.use) {
  112182. videojs.registerComponent("Hls", Vhs);
  112183. videojs.registerComponent("Vhs", Vhs);
  112184. }
  112185. videojs.options.vhs = videojs.options.vhs || {};
  112186. videojs.options.hls = videojs.options.hls || {};
  112187. if (!videojs.getPlugin || !videojs.getPlugin("reloadSourceOnError")) {
  112188. var registerPlugin = videojs.registerPlugin || videojs.plugin;
  112189. registerPlugin("reloadSourceOnError", reloadSourceOnError);
  112190. }
  112191. const version = "5.4.2";
  112192. var version$1 = "2.2.1";
  112193. function FlashRtmpDecorator(Flash2) {
  112194. Flash2.streamingFormats = {
  112195. "rtmp/mp4": "MP4",
  112196. "rtmp/flv": "FLV"
  112197. };
  112198. Flash2.streamFromParts = function(connection, stream) {
  112199. return connection + "&" + stream;
  112200. };
  112201. Flash2.streamToParts = function(src) {
  112202. var parts = {
  112203. connection: "",
  112204. stream: ""
  112205. };
  112206. if (!src) {
  112207. return parts;
  112208. }
  112209. var connEnd = src.search(/&(?![\w-]+=)/);
  112210. var streamBegin = void 0;
  112211. if (connEnd !== -1) {
  112212. streamBegin = connEnd + 1;
  112213. } else {
  112214. connEnd = streamBegin = src.lastIndexOf("/") + 1;
  112215. if (connEnd === 0) {
  112216. connEnd = streamBegin = src.length;
  112217. }
  112218. }
  112219. parts.connection = src.substring(0, connEnd);
  112220. parts.stream = src.substring(streamBegin, src.length);
  112221. return parts;
  112222. };
  112223. Flash2.isStreamingType = function(srcType) {
  112224. return srcType in Flash2.streamingFormats;
  112225. };
  112226. Flash2.RTMP_RE = /^rtmp[set]?:\/\//i;
  112227. Flash2.isStreamingSrc = function(src) {
  112228. return Flash2.RTMP_RE.test(src);
  112229. };
  112230. Flash2.rtmpSourceHandler = {};
  112231. Flash2.rtmpSourceHandler.canPlayType = function(type2) {
  112232. if (Flash2.isStreamingType(type2)) {
  112233. return "maybe";
  112234. }
  112235. return "";
  112236. };
  112237. Flash2.rtmpSourceHandler.canHandleSource = function(source, options2) {
  112238. var can = Flash2.rtmpSourceHandler.canPlayType(source.type);
  112239. if (can) {
  112240. return can;
  112241. }
  112242. if (Flash2.isStreamingSrc(source.src)) {
  112243. return "maybe";
  112244. }
  112245. return "";
  112246. };
  112247. Flash2.rtmpSourceHandler.handleSource = function(source, tech, options2) {
  112248. var srcParts = Flash2.streamToParts(source.src);
  112249. tech.setRtmpConnection(srcParts.connection);
  112250. tech.setRtmpStream(srcParts.stream);
  112251. };
  112252. Flash2.registerSourceHandler(Flash2.rtmpSourceHandler);
  112253. return Flash2;
  112254. }
  112255. var classCallCheck = function(instance, Constructor) {
  112256. if (!(instance instanceof Constructor)) {
  112257. throw new TypeError("Cannot call a class as a function");
  112258. }
  112259. };
  112260. var inherits = function(subClass, superClass) {
  112261. if (typeof superClass !== "function" && superClass !== null) {
  112262. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  112263. }
  112264. subClass.prototype = Object.create(superClass && superClass.prototype, {
  112265. constructor: {
  112266. value: subClass,
  112267. enumerable: false,
  112268. writable: true,
  112269. configurable: true
  112270. }
  112271. });
  112272. if (superClass)
  112273. Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  112274. };
  112275. var possibleConstructorReturn = function(self2, call) {
  112276. if (!self2) {
  112277. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  112278. }
  112279. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  112280. };
  112281. var Tech = videojs.getComponent("Tech");
  112282. var Dom = videojs.dom;
  112283. var Url = videojs.url;
  112284. var createTimeRange = videojs.createTimeRange;
  112285. var mergeOptions$1 = videojs.mergeOptions;
  112286. var navigator$1 = window_1 && window_1.navigator || {};
  112287. var Flash = function(_Tech) {
  112288. inherits(Flash2, _Tech);
  112289. function Flash2(options2, ready) {
  112290. classCallCheck(this, Flash2);
  112291. var _this = possibleConstructorReturn(this, _Tech.call(this, options2, ready));
  112292. if (options2.source) {
  112293. _this.ready(function() {
  112294. this.setSource(options2.source);
  112295. }, true);
  112296. }
  112297. if (options2.startTime) {
  112298. _this.ready(function() {
  112299. this.load();
  112300. this.play();
  112301. this.currentTime(options2.startTime);
  112302. }, true);
  112303. }
  112304. window_1.videojs = window_1.videojs || {};
  112305. window_1.videojs.Flash = window_1.videojs.Flash || {};
  112306. window_1.videojs.Flash.onReady = Flash2.onReady;
  112307. window_1.videojs.Flash.onEvent = Flash2.onEvent;
  112308. window_1.videojs.Flash.onError = Flash2.onError;
  112309. _this.on("seeked", function() {
  112310. this.lastSeekTarget_ = void 0;
  112311. });
  112312. return _this;
  112313. }
  112314. Flash2.prototype.createEl = function createEl2() {
  112315. var options2 = this.options_;
  112316. if (!options2.swf) {
  112317. options2.swf = "https://vjs.zencdn.net/swf/" + version + "/video-js.swf";
  112318. }
  112319. var objId = options2.techId;
  112320. var flashVars = mergeOptions$1({
  112321. readyFunction: "videojs.Flash.onReady",
  112322. eventProxyFunction: "videojs.Flash.onEvent",
  112323. errorEventProxyFunction: "videojs.Flash.onError",
  112324. autoplay: options2.autoplay,
  112325. preload: options2.preload,
  112326. loop: options2.loop,
  112327. muted: options2.muted
  112328. }, options2.flashVars);
  112329. var params = mergeOptions$1({
  112330. wmode: "opaque",
  112331. bgcolor: "#000000"
  112332. }, options2.params);
  112333. var attributes = mergeOptions$1({
  112334. id: objId,
  112335. name: objId,
  112336. "class": "vjs-tech"
  112337. }, options2.attributes);
  112338. this.el_ = Flash2.embed(options2.swf, flashVars, params, attributes);
  112339. this.el_.tech = this;
  112340. return this.el_;
  112341. };
  112342. Flash2.prototype.play = function play() {
  112343. if (this.ended()) {
  112344. this.setCurrentTime(0);
  112345. }
  112346. this.el_.vjs_play();
  112347. };
  112348. Flash2.prototype.pause = function pause() {
  112349. this.el_.vjs_pause();
  112350. };
  112351. Flash2.prototype.src = function src(_src) {
  112352. if (_src === void 0) {
  112353. return this.currentSrc();
  112354. }
  112355. return this.setSrc(_src);
  112356. };
  112357. Flash2.prototype.setSrc = function setSrc(src) {
  112358. var _this2 = this;
  112359. src = Url.getAbsoluteURL(src);
  112360. this.el_.vjs_src(src);
  112361. if (this.autoplay()) {
  112362. this.setTimeout(function() {
  112363. return _this2.play();
  112364. }, 0);
  112365. }
  112366. };
  112367. Flash2.prototype.seeking = function seeking() {
  112368. return this.lastSeekTarget_ !== void 0;
  112369. };
  112370. Flash2.prototype.setCurrentTime = function setCurrentTime(time) {
  112371. var seekable3 = this.seekable();
  112372. if (seekable3.length) {
  112373. time = time > seekable3.start(0) ? time : seekable3.start(0);
  112374. time = time < seekable3.end(seekable3.length - 1) ? time : seekable3.end(seekable3.length - 1);
  112375. this.lastSeekTarget_ = time;
  112376. this.trigger("seeking");
  112377. this.el_.vjs_setProperty("currentTime", time);
  112378. _Tech.prototype.setCurrentTime.call(this);
  112379. }
  112380. };
  112381. Flash2.prototype.currentTime = function currentTime() {
  112382. if (this.seeking()) {
  112383. return this.lastSeekTarget_ || 0;
  112384. }
  112385. return this.el_.vjs_getProperty("currentTime");
  112386. };
  112387. Flash2.prototype.currentSrc = function currentSrc() {
  112388. if (this.currentSource_) {
  112389. return this.currentSource_.src;
  112390. }
  112391. return this.el_.vjs_getProperty("currentSrc");
  112392. };
  112393. Flash2.prototype.duration = function duration5() {
  112394. if (this.readyState() === 0) {
  112395. return NaN;
  112396. }
  112397. var duration6 = this.el_.vjs_getProperty("duration");
  112398. return duration6 >= 0 ? duration6 : Infinity;
  112399. };
  112400. Flash2.prototype.load = function load() {
  112401. this.el_.vjs_load();
  112402. };
  112403. Flash2.prototype.poster = function poster() {
  112404. this.el_.vjs_getProperty("poster");
  112405. };
  112406. Flash2.prototype.setPoster = function setPoster() {
  112407. };
  112408. Flash2.prototype.seekable = function seekable3() {
  112409. var duration5 = this.duration();
  112410. if (duration5 === 0) {
  112411. return createTimeRange();
  112412. }
  112413. return createTimeRange(0, duration5);
  112414. };
  112415. Flash2.prototype.buffered = function buffered() {
  112416. var ranges = this.el_.vjs_getProperty("buffered");
  112417. if (ranges.length === 0) {
  112418. return createTimeRange();
  112419. }
  112420. return createTimeRange(ranges[0][0], ranges[0][1]);
  112421. };
  112422. Flash2.prototype.supportsFullScreen = function supportsFullScreen() {
  112423. return false;
  112424. };
  112425. Flash2.prototype.enterFullScreen = function enterFullScreen() {
  112426. return false;
  112427. };
  112428. Flash2.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  112429. var videoPlaybackQuality = this.el_.vjs_getProperty("getVideoPlaybackQuality");
  112430. if (window_1.performance && typeof window_1.performance.now === "function") {
  112431. videoPlaybackQuality.creationTime = window_1.performance.now();
  112432. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  112433. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  112434. }
  112435. return videoPlaybackQuality;
  112436. };
  112437. return Flash2;
  112438. }(Tech);
  112439. var _readWrite = ["rtmpConnection", "rtmpStream", "preload", "defaultPlaybackRate", "playbackRate", "autoplay", "loop", "controls", "volume", "muted", "defaultMuted"];
  112440. var _readOnly = ["networkState", "readyState", "initialTime", "startOffsetTime", "paused", "ended", "videoWidth", "videoHeight"];
  112441. var _api = Flash.prototype;
  112442. function _createSetter(attr) {
  112443. var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1);
  112444. _api["set" + attrUpper] = function(val) {
  112445. return this.el_.vjs_setProperty(attr, val);
  112446. };
  112447. }
  112448. function _createGetter(attr) {
  112449. _api[attr] = function() {
  112450. return this.el_.vjs_getProperty(attr);
  112451. };
  112452. }
  112453. for (var i$1 = 0; i$1 < _readWrite.length; i$1++) {
  112454. _createGetter(_readWrite[i$1]);
  112455. _createSetter(_readWrite[i$1]);
  112456. }
  112457. for (var _i = 0; _i < _readOnly.length; _i++) {
  112458. _createGetter(_readOnly[_i]);
  112459. }
  112460. Flash.isSupported = function() {
  112461. if (videojs.browser.IS_CHROME && (!videojs.browser.IS_ANDROID || !videojs.browser.IS_IOS) || videojs.browser.IS_SAFARI && !videojs.browser.IS_IOS || videojs.browser.IS_EDGE) {
  112462. return true;
  112463. }
  112464. return Flash.version()[0] >= 10;
  112465. };
  112466. Tech.withSourceHandlers(Flash);
  112467. Flash.nativeSourceHandler = {};
  112468. Flash.nativeSourceHandler.canPlayType = function(type2) {
  112469. if (type2 in Flash.formats) {
  112470. return "maybe";
  112471. }
  112472. return "";
  112473. };
  112474. Flash.nativeSourceHandler.canHandleSource = function(source, options2) {
  112475. var type2 = void 0;
  112476. function guessMimeType(src) {
  112477. var ext = Url.getFileExtension(src);
  112478. if (ext) {
  112479. return "video/" + ext;
  112480. }
  112481. return "";
  112482. }
  112483. if (!source.type) {
  112484. type2 = guessMimeType(source.src);
  112485. } else {
  112486. type2 = source.type.replace(/;.*/, "").toLowerCase();
  112487. }
  112488. return Flash.nativeSourceHandler.canPlayType(type2);
  112489. };
  112490. Flash.nativeSourceHandler.handleSource = function(source, tech, options2) {
  112491. tech.setSrc(source.src);
  112492. };
  112493. Flash.nativeSourceHandler.dispose = function() {
  112494. };
  112495. Flash.registerSourceHandler(Flash.nativeSourceHandler);
  112496. Flash.formats = {
  112497. "video/flv": "FLV",
  112498. "video/x-flv": "FLV",
  112499. "video/mp4": "MP4",
  112500. "video/m4v": "MP4"
  112501. };
  112502. Flash.onReady = function(currSwf) {
  112503. var el = Dom.$("#" + currSwf);
  112504. var tech = el && el.tech;
  112505. if (tech && tech.el()) {
  112506. Flash.checkReady(tech);
  112507. }
  112508. };
  112509. Flash.checkReady = function(tech) {
  112510. if (!tech.el()) {
  112511. return;
  112512. }
  112513. if (tech.el().vjs_getProperty) {
  112514. tech.triggerReady();
  112515. } else {
  112516. this.setTimeout(function() {
  112517. Flash.checkReady(tech);
  112518. }, 50);
  112519. }
  112520. };
  112521. Flash.onEvent = function(swfID, eventName) {
  112522. var tech = Dom.$("#" + swfID).tech;
  112523. var args = Array.prototype.slice.call(arguments, 2);
  112524. tech.setTimeout(function() {
  112525. tech.trigger(eventName, args);
  112526. }, 1);
  112527. };
  112528. Flash.onError = function(swfID, err) {
  112529. var tech = Dom.$("#" + swfID).tech;
  112530. if (err === "srcnotfound") {
  112531. return tech.error(4);
  112532. }
  112533. if (typeof err === "string") {
  112534. tech.error("FLASH: " + err);
  112535. } else {
  112536. err.origin = "flash";
  112537. tech.error(err);
  112538. }
  112539. };
  112540. Flash.version = function() {
  112541. var version$$1 = "0,0,0";
  112542. try {
  112543. version$$1 = new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112544. } catch (e) {
  112545. try {
  112546. if (navigator$1.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  112547. version$$1 = (navigator$1.plugins["Shockwave Flash 2.0"] || navigator$1.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112548. }
  112549. } catch (err) {
  112550. }
  112551. }
  112552. return version$$1.split(",");
  112553. };
  112554. Flash.embed = function(swf, flashVars, params, attributes) {
  112555. var code = Flash.getEmbedCode(swf, flashVars, params, attributes);
  112556. var obj = Dom.createEl("div", { innerHTML: code }).childNodes[0];
  112557. return obj;
  112558. };
  112559. Flash.getEmbedCode = function(swf, flashVars, params, attributes) {
  112560. var objTag = '<object type="application/x-shockwave-flash" ';
  112561. var flashVarsString = "";
  112562. var paramsString = "";
  112563. var attrsString = "";
  112564. if (flashVars) {
  112565. Object.getOwnPropertyNames(flashVars).forEach(function(key) {
  112566. flashVarsString += key + "=" + flashVars[key] + "&amp;";
  112567. });
  112568. }
  112569. params = mergeOptions$1({
  112570. movie: swf,
  112571. flashvars: flashVarsString,
  112572. allowScriptAccess: "always",
  112573. allowNetworking: "all"
  112574. }, params);
  112575. Object.getOwnPropertyNames(params).forEach(function(key) {
  112576. paramsString += '<param name="' + key + '" value="' + params[key] + '" />';
  112577. });
  112578. attributes = mergeOptions$1({
  112579. data: swf,
  112580. width: "100%",
  112581. height: "100%"
  112582. }, attributes);
  112583. Object.getOwnPropertyNames(attributes).forEach(function(key) {
  112584. attrsString += key + '="' + attributes[key] + '" ';
  112585. });
  112586. return "" + objTag + attrsString + ">" + paramsString + "</object>";
  112587. };
  112588. FlashRtmpDecorator(Flash);
  112589. if (Tech.getTech("Flash")) {
  112590. videojs.log.warn("Not using videojs-flash as it appears to already be registered");
  112591. videojs.log.warn("videojs-flash should only be used with video.js@6 and above");
  112592. } else {
  112593. videojs.registerTech("Flash", Flash);
  112594. }
  112595. Flash.VERSION = version$1;
  112596. var flv = { exports: {} };
  112597. (function(module2, exports2) {
  112598. (function webpackUniversalModuleDefinition(root2, factory3) {
  112599. module2.exports = factory3();
  112600. })(self, function() {
  112601. return function() {
  112602. var __webpack_modules__ = {
  112603. "./node_modules/es6-promise/dist/es6-promise.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  112604. /*!
  112605. * @overview es6-promise - a tiny implementation of Promises/A+.
  112606. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  112607. * @license Licensed under MIT license
  112608. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  112609. * @version v4.2.8+1e68dce6
  112610. */
  112611. (function(global2, factory3) {
  112612. module3.exports = factory3();
  112613. })(this, function() {
  112614. function objectOrFunction(x) {
  112615. var type2 = typeof x;
  112616. return x !== null && (type2 === "object" || type2 === "function");
  112617. }
  112618. function isFunction2(x) {
  112619. return typeof x === "function";
  112620. }
  112621. var _isArray = void 0;
  112622. if (Array.isArray) {
  112623. _isArray = Array.isArray;
  112624. } else {
  112625. _isArray = function(x) {
  112626. return Object.prototype.toString.call(x) === "[object Array]";
  112627. };
  112628. }
  112629. var isArray2 = _isArray;
  112630. var len = 0;
  112631. var vertxNext = void 0;
  112632. var customSchedulerFn = void 0;
  112633. var asap = function asap2(callback2, arg) {
  112634. queue[len] = callback2;
  112635. queue[len + 1] = arg;
  112636. len += 2;
  112637. if (len === 2) {
  112638. if (customSchedulerFn) {
  112639. customSchedulerFn(flush);
  112640. } else {
  112641. scheduleFlush();
  112642. }
  112643. }
  112644. };
  112645. function setScheduler(scheduleFn) {
  112646. customSchedulerFn = scheduleFn;
  112647. }
  112648. function setAsap(asapFn) {
  112649. asap = asapFn;
  112650. }
  112651. var browserWindow = typeof window !== "undefined" ? window : void 0;
  112652. var browserGlobal = browserWindow || {};
  112653. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  112654. var isNode = typeof self === "undefined" && typeof process !== "undefined" && {}.toString.call(process) === "[object process]";
  112655. var isWorker = typeof Uint8ClampedArray !== "undefined" && typeof importScripts !== "undefined" && typeof MessageChannel !== "undefined";
  112656. function useNextTick() {
  112657. return function() {
  112658. return process.nextTick(flush);
  112659. };
  112660. }
  112661. function useVertxTimer() {
  112662. if (typeof vertxNext !== "undefined") {
  112663. return function() {
  112664. vertxNext(flush);
  112665. };
  112666. }
  112667. return useSetTimeout();
  112668. }
  112669. function useMutationObserver() {
  112670. var iterations = 0;
  112671. var observer = new BrowserMutationObserver(flush);
  112672. var node = document.createTextNode("");
  112673. observer.observe(node, { characterData: true });
  112674. return function() {
  112675. node.data = iterations = ++iterations % 2;
  112676. };
  112677. }
  112678. function useMessageChannel() {
  112679. var channel = new MessageChannel();
  112680. channel.port1.onmessage = flush;
  112681. return function() {
  112682. return channel.port2.postMessage(0);
  112683. };
  112684. }
  112685. function useSetTimeout() {
  112686. var globalSetTimeout = setTimeout;
  112687. return function() {
  112688. return globalSetTimeout(flush, 1);
  112689. };
  112690. }
  112691. var queue = new Array(1e3);
  112692. function flush() {
  112693. for (var i2 = 0; i2 < len; i2 += 2) {
  112694. var callback2 = queue[i2];
  112695. var arg = queue[i2 + 1];
  112696. callback2(arg);
  112697. queue[i2] = void 0;
  112698. queue[i2 + 1] = void 0;
  112699. }
  112700. len = 0;
  112701. }
  112702. function attemptVertx() {
  112703. try {
  112704. var vertx = Function("return this")().require("vertx");
  112705. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  112706. return useVertxTimer();
  112707. } catch (e) {
  112708. return useSetTimeout();
  112709. }
  112710. }
  112711. var scheduleFlush = void 0;
  112712. if (isNode) {
  112713. scheduleFlush = useNextTick();
  112714. } else if (BrowserMutationObserver) {
  112715. scheduleFlush = useMutationObserver();
  112716. } else if (isWorker) {
  112717. scheduleFlush = useMessageChannel();
  112718. } else if (browserWindow === void 0 && true) {
  112719. scheduleFlush = attemptVertx();
  112720. } else {
  112721. scheduleFlush = useSetTimeout();
  112722. }
  112723. function then(onFulfillment, onRejection) {
  112724. var parent = this;
  112725. var child = new this.constructor(noop2);
  112726. if (child[PROMISE_ID] === void 0) {
  112727. makePromise(child);
  112728. }
  112729. var _state = parent._state;
  112730. if (_state) {
  112731. var callback2 = arguments[_state - 1];
  112732. asap(function() {
  112733. return invokeCallback(_state, child, callback2, parent._result);
  112734. });
  112735. } else {
  112736. subscribe(parent, child, onFulfillment, onRejection);
  112737. }
  112738. return child;
  112739. }
  112740. function resolve$1(object) {
  112741. var Constructor = this;
  112742. if (object && typeof object === "object" && object.constructor === Constructor) {
  112743. return object;
  112744. }
  112745. var promise = new Constructor(noop2);
  112746. resolve2(promise, object);
  112747. return promise;
  112748. }
  112749. var PROMISE_ID = Math.random().toString(36).substring(2);
  112750. function noop2() {
  112751. }
  112752. var PENDING = void 0;
  112753. var FULFILLED = 1;
  112754. var REJECTED = 2;
  112755. function selfFulfillment() {
  112756. return new TypeError("You cannot resolve a promise with itself");
  112757. }
  112758. function cannotReturnOwn() {
  112759. return new TypeError("A promises callback cannot return that same promise.");
  112760. }
  112761. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  112762. try {
  112763. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  112764. } catch (e) {
  112765. return e;
  112766. }
  112767. }
  112768. function handleForeignThenable(promise, thenable, then$$1) {
  112769. asap(function(promise2) {
  112770. var sealed = false;
  112771. var error = tryThen(then$$1, thenable, function(value) {
  112772. if (sealed) {
  112773. return;
  112774. }
  112775. sealed = true;
  112776. if (thenable !== value) {
  112777. resolve2(promise2, value);
  112778. } else {
  112779. fulfill(promise2, value);
  112780. }
  112781. }, function(reason) {
  112782. if (sealed) {
  112783. return;
  112784. }
  112785. sealed = true;
  112786. reject2(promise2, reason);
  112787. }, "Settle: " + (promise2._label || " unknown promise"));
  112788. if (!sealed && error) {
  112789. sealed = true;
  112790. reject2(promise2, error);
  112791. }
  112792. }, promise);
  112793. }
  112794. function handleOwnThenable(promise, thenable) {
  112795. if (thenable._state === FULFILLED) {
  112796. fulfill(promise, thenable._result);
  112797. } else if (thenable._state === REJECTED) {
  112798. reject2(promise, thenable._result);
  112799. } else {
  112800. subscribe(thenable, void 0, function(value) {
  112801. return resolve2(promise, value);
  112802. }, function(reason) {
  112803. return reject2(promise, reason);
  112804. });
  112805. }
  112806. }
  112807. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  112808. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  112809. handleOwnThenable(promise, maybeThenable);
  112810. } else {
  112811. if (then$$1 === void 0) {
  112812. fulfill(promise, maybeThenable);
  112813. } else if (isFunction2(then$$1)) {
  112814. handleForeignThenable(promise, maybeThenable, then$$1);
  112815. } else {
  112816. fulfill(promise, maybeThenable);
  112817. }
  112818. }
  112819. }
  112820. function resolve2(promise, value) {
  112821. if (promise === value) {
  112822. reject2(promise, selfFulfillment());
  112823. } else if (objectOrFunction(value)) {
  112824. var then$$1 = void 0;
  112825. try {
  112826. then$$1 = value.then;
  112827. } catch (error) {
  112828. reject2(promise, error);
  112829. return;
  112830. }
  112831. handleMaybeThenable(promise, value, then$$1);
  112832. } else {
  112833. fulfill(promise, value);
  112834. }
  112835. }
  112836. function publishRejection(promise) {
  112837. if (promise._onerror) {
  112838. promise._onerror(promise._result);
  112839. }
  112840. publish(promise);
  112841. }
  112842. function fulfill(promise, value) {
  112843. if (promise._state !== PENDING) {
  112844. return;
  112845. }
  112846. promise._result = value;
  112847. promise._state = FULFILLED;
  112848. if (promise._subscribers.length !== 0) {
  112849. asap(publish, promise);
  112850. }
  112851. }
  112852. function reject2(promise, reason) {
  112853. if (promise._state !== PENDING) {
  112854. return;
  112855. }
  112856. promise._state = REJECTED;
  112857. promise._result = reason;
  112858. asap(publishRejection, promise);
  112859. }
  112860. function subscribe(parent, child, onFulfillment, onRejection) {
  112861. var _subscribers = parent._subscribers;
  112862. var length = _subscribers.length;
  112863. parent._onerror = null;
  112864. _subscribers[length] = child;
  112865. _subscribers[length + FULFILLED] = onFulfillment;
  112866. _subscribers[length + REJECTED] = onRejection;
  112867. if (length === 0 && parent._state) {
  112868. asap(publish, parent);
  112869. }
  112870. }
  112871. function publish(promise) {
  112872. var subscribers = promise._subscribers;
  112873. var settled = promise._state;
  112874. if (subscribers.length === 0) {
  112875. return;
  112876. }
  112877. var child = void 0, callback2 = void 0, detail = promise._result;
  112878. for (var i2 = 0; i2 < subscribers.length; i2 += 3) {
  112879. child = subscribers[i2];
  112880. callback2 = subscribers[i2 + settled];
  112881. if (child) {
  112882. invokeCallback(settled, child, callback2, detail);
  112883. } else {
  112884. callback2(detail);
  112885. }
  112886. }
  112887. promise._subscribers.length = 0;
  112888. }
  112889. function invokeCallback(settled, promise, callback2, detail) {
  112890. var hasCallback = isFunction2(callback2), value = void 0, error = void 0, succeeded = true;
  112891. if (hasCallback) {
  112892. try {
  112893. value = callback2(detail);
  112894. } catch (e) {
  112895. succeeded = false;
  112896. error = e;
  112897. }
  112898. if (promise === value) {
  112899. reject2(promise, cannotReturnOwn());
  112900. return;
  112901. }
  112902. } else {
  112903. value = detail;
  112904. }
  112905. if (promise._state !== PENDING)
  112906. ;
  112907. else if (hasCallback && succeeded) {
  112908. resolve2(promise, value);
  112909. } else if (succeeded === false) {
  112910. reject2(promise, error);
  112911. } else if (settled === FULFILLED) {
  112912. fulfill(promise, value);
  112913. } else if (settled === REJECTED) {
  112914. reject2(promise, value);
  112915. }
  112916. }
  112917. function initializePromise(promise, resolver) {
  112918. try {
  112919. resolver(function resolvePromise(value) {
  112920. resolve2(promise, value);
  112921. }, function rejectPromise(reason) {
  112922. reject2(promise, reason);
  112923. });
  112924. } catch (e) {
  112925. reject2(promise, e);
  112926. }
  112927. }
  112928. var id = 0;
  112929. function nextId() {
  112930. return id++;
  112931. }
  112932. function makePromise(promise) {
  112933. promise[PROMISE_ID] = id++;
  112934. promise._state = void 0;
  112935. promise._result = void 0;
  112936. promise._subscribers = [];
  112937. }
  112938. function validationError() {
  112939. return new Error("Array Methods must be provided an Array");
  112940. }
  112941. var Enumerator = function() {
  112942. function Enumerator2(Constructor, input) {
  112943. this._instanceConstructor = Constructor;
  112944. this.promise = new Constructor(noop2);
  112945. if (!this.promise[PROMISE_ID]) {
  112946. makePromise(this.promise);
  112947. }
  112948. if (isArray2(input)) {
  112949. this.length = input.length;
  112950. this._remaining = input.length;
  112951. this._result = new Array(this.length);
  112952. if (this.length === 0) {
  112953. fulfill(this.promise, this._result);
  112954. } else {
  112955. this.length = this.length || 0;
  112956. this._enumerate(input);
  112957. if (this._remaining === 0) {
  112958. fulfill(this.promise, this._result);
  112959. }
  112960. }
  112961. } else {
  112962. reject2(this.promise, validationError());
  112963. }
  112964. }
  112965. Enumerator2.prototype._enumerate = function _enumerate(input) {
  112966. for (var i2 = 0; this._state === PENDING && i2 < input.length; i2++) {
  112967. this._eachEntry(input[i2], i2);
  112968. }
  112969. };
  112970. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i2) {
  112971. var c = this._instanceConstructor;
  112972. var resolve$$1 = c.resolve;
  112973. if (resolve$$1 === resolve$1) {
  112974. var _then = void 0;
  112975. var error = void 0;
  112976. var didError = false;
  112977. try {
  112978. _then = entry.then;
  112979. } catch (e) {
  112980. didError = true;
  112981. error = e;
  112982. }
  112983. if (_then === then && entry._state !== PENDING) {
  112984. this._settledAt(entry._state, i2, entry._result);
  112985. } else if (typeof _then !== "function") {
  112986. this._remaining--;
  112987. this._result[i2] = entry;
  112988. } else if (c === Promise$12) {
  112989. var promise = new c(noop2);
  112990. if (didError) {
  112991. reject2(promise, error);
  112992. } else {
  112993. handleMaybeThenable(promise, entry, _then);
  112994. }
  112995. this._willSettleAt(promise, i2);
  112996. } else {
  112997. this._willSettleAt(new c(function(resolve$$12) {
  112998. return resolve$$12(entry);
  112999. }), i2);
  113000. }
  113001. } else {
  113002. this._willSettleAt(resolve$$1(entry), i2);
  113003. }
  113004. };
  113005. Enumerator2.prototype._settledAt = function _settledAt(state, i2, value) {
  113006. var promise = this.promise;
  113007. if (promise._state === PENDING) {
  113008. this._remaining--;
  113009. if (state === REJECTED) {
  113010. reject2(promise, value);
  113011. } else {
  113012. this._result[i2] = value;
  113013. }
  113014. }
  113015. if (this._remaining === 0) {
  113016. fulfill(promise, this._result);
  113017. }
  113018. };
  113019. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i2) {
  113020. var enumerator = this;
  113021. subscribe(promise, void 0, function(value) {
  113022. return enumerator._settledAt(FULFILLED, i2, value);
  113023. }, function(reason) {
  113024. return enumerator._settledAt(REJECTED, i2, reason);
  113025. });
  113026. };
  113027. return Enumerator2;
  113028. }();
  113029. function all(entries) {
  113030. return new Enumerator(this, entries).promise;
  113031. }
  113032. function race(entries) {
  113033. var Constructor = this;
  113034. if (!isArray2(entries)) {
  113035. return new Constructor(function(_, reject3) {
  113036. return reject3(new TypeError("You must pass an array to race."));
  113037. });
  113038. } else {
  113039. return new Constructor(function(resolve3, reject3) {
  113040. var length = entries.length;
  113041. for (var i2 = 0; i2 < length; i2++) {
  113042. Constructor.resolve(entries[i2]).then(resolve3, reject3);
  113043. }
  113044. });
  113045. }
  113046. }
  113047. function reject$1(reason) {
  113048. var Constructor = this;
  113049. var promise = new Constructor(noop2);
  113050. reject2(promise, reason);
  113051. return promise;
  113052. }
  113053. function needsResolver() {
  113054. throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
  113055. }
  113056. function needsNew() {
  113057. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  113058. }
  113059. var Promise$12 = function() {
  113060. function Promise2(resolver) {
  113061. this[PROMISE_ID] = nextId();
  113062. this._result = this._state = void 0;
  113063. this._subscribers = [];
  113064. if (noop2 !== resolver) {
  113065. typeof resolver !== "function" && needsResolver();
  113066. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  113067. }
  113068. }
  113069. Promise2.prototype.catch = function _catch(onRejection) {
  113070. return this.then(null, onRejection);
  113071. };
  113072. Promise2.prototype.finally = function _finally(callback2) {
  113073. var promise = this;
  113074. var constructor = promise.constructor;
  113075. if (isFunction2(callback2)) {
  113076. return promise.then(function(value) {
  113077. return constructor.resolve(callback2()).then(function() {
  113078. return value;
  113079. });
  113080. }, function(reason) {
  113081. return constructor.resolve(callback2()).then(function() {
  113082. throw reason;
  113083. });
  113084. });
  113085. }
  113086. return promise.then(callback2, callback2);
  113087. };
  113088. return Promise2;
  113089. }();
  113090. Promise$12.prototype.then = then;
  113091. Promise$12.all = all;
  113092. Promise$12.race = race;
  113093. Promise$12.resolve = resolve$1;
  113094. Promise$12.reject = reject$1;
  113095. Promise$12._setScheduler = setScheduler;
  113096. Promise$12._setAsap = setAsap;
  113097. Promise$12._asap = asap;
  113098. function polyfill() {
  113099. var local = void 0;
  113100. if (typeof __webpack_require__2.g !== "undefined") {
  113101. local = __webpack_require__2.g;
  113102. } else if (typeof self !== "undefined") {
  113103. local = self;
  113104. } else {
  113105. try {
  113106. local = Function("return this")();
  113107. } catch (e) {
  113108. throw new Error("polyfill failed because global object is unavailable in this environment");
  113109. }
  113110. }
  113111. var P2 = local.Promise;
  113112. if (P2) {
  113113. var promiseToString = null;
  113114. try {
  113115. promiseToString = Object.prototype.toString.call(P2.resolve());
  113116. } catch (e) {
  113117. }
  113118. if (promiseToString === "[object Promise]" && !P2.cast) {
  113119. return;
  113120. }
  113121. }
  113122. local.Promise = Promise$12;
  113123. }
  113124. Promise$12.polyfill = polyfill;
  113125. Promise$12.Promise = Promise$12;
  113126. return Promise$12;
  113127. });
  113128. },
  113129. "./node_modules/events/events.js": function(module3) {
  113130. var R2 = typeof Reflect === "object" ? Reflect : null;
  113131. var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
  113132. return Function.prototype.apply.call(target, receiver, args);
  113133. };
  113134. var ReflectOwnKeys;
  113135. if (R2 && typeof R2.ownKeys === "function") {
  113136. ReflectOwnKeys = R2.ownKeys;
  113137. } else if (Object.getOwnPropertySymbols) {
  113138. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113139. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  113140. };
  113141. } else {
  113142. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113143. return Object.getOwnPropertyNames(target);
  113144. };
  113145. }
  113146. function ProcessEmitWarning(warning) {
  113147. if (console && console.warn)
  113148. console.warn(warning);
  113149. }
  113150. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  113151. return value !== value;
  113152. };
  113153. function EventEmitter() {
  113154. EventEmitter.init.call(this);
  113155. }
  113156. module3.exports = EventEmitter;
  113157. module3.exports.once = once;
  113158. EventEmitter.EventEmitter = EventEmitter;
  113159. EventEmitter.prototype._events = void 0;
  113160. EventEmitter.prototype._eventsCount = 0;
  113161. EventEmitter.prototype._maxListeners = void 0;
  113162. var defaultMaxListeners = 10;
  113163. function checkListener(listener) {
  113164. if (typeof listener !== "function") {
  113165. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  113166. }
  113167. }
  113168. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  113169. enumerable: true,
  113170. get: function() {
  113171. return defaultMaxListeners;
  113172. },
  113173. set: function(arg) {
  113174. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  113175. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  113176. }
  113177. defaultMaxListeners = arg;
  113178. }
  113179. });
  113180. EventEmitter.init = function() {
  113181. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  113182. this._events = /* @__PURE__ */ Object.create(null);
  113183. this._eventsCount = 0;
  113184. }
  113185. this._maxListeners = this._maxListeners || void 0;
  113186. };
  113187. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  113188. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  113189. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  113190. }
  113191. this._maxListeners = n;
  113192. return this;
  113193. };
  113194. function _getMaxListeners(that) {
  113195. if (that._maxListeners === void 0)
  113196. return EventEmitter.defaultMaxListeners;
  113197. return that._maxListeners;
  113198. }
  113199. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  113200. return _getMaxListeners(this);
  113201. };
  113202. EventEmitter.prototype.emit = function emit(type2) {
  113203. var args = [];
  113204. for (var i2 = 1; i2 < arguments.length; i2++)
  113205. args.push(arguments[i2]);
  113206. var doError = type2 === "error";
  113207. var events = this._events;
  113208. if (events !== void 0)
  113209. doError = doError && events.error === void 0;
  113210. else if (!doError)
  113211. return false;
  113212. if (doError) {
  113213. var er;
  113214. if (args.length > 0)
  113215. er = args[0];
  113216. if (er instanceof Error) {
  113217. throw er;
  113218. }
  113219. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  113220. err.context = er;
  113221. throw err;
  113222. }
  113223. var handler = events[type2];
  113224. if (handler === void 0)
  113225. return false;
  113226. if (typeof handler === "function") {
  113227. ReflectApply(handler, this, args);
  113228. } else {
  113229. var len = handler.length;
  113230. var listeners = arrayClone(handler, len);
  113231. for (var i2 = 0; i2 < len; ++i2)
  113232. ReflectApply(listeners[i2], this, args);
  113233. }
  113234. return true;
  113235. };
  113236. function _addListener(target, type2, listener, prepend) {
  113237. var m;
  113238. var events;
  113239. var existing;
  113240. checkListener(listener);
  113241. events = target._events;
  113242. if (events === void 0) {
  113243. events = target._events = /* @__PURE__ */ Object.create(null);
  113244. target._eventsCount = 0;
  113245. } else {
  113246. if (events.newListener !== void 0) {
  113247. target.emit("newListener", type2, listener.listener ? listener.listener : listener);
  113248. events = target._events;
  113249. }
  113250. existing = events[type2];
  113251. }
  113252. if (existing === void 0) {
  113253. existing = events[type2] = listener;
  113254. ++target._eventsCount;
  113255. } else {
  113256. if (typeof existing === "function") {
  113257. existing = events[type2] = prepend ? [listener, existing] : [existing, listener];
  113258. } else if (prepend) {
  113259. existing.unshift(listener);
  113260. } else {
  113261. existing.push(listener);
  113262. }
  113263. m = _getMaxListeners(target);
  113264. if (m > 0 && existing.length > m && !existing.warned) {
  113265. existing.warned = true;
  113266. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  113267. w.name = "MaxListenersExceededWarning";
  113268. w.emitter = target;
  113269. w.type = type2;
  113270. w.count = existing.length;
  113271. ProcessEmitWarning(w);
  113272. }
  113273. }
  113274. return target;
  113275. }
  113276. EventEmitter.prototype.addListener = function addListener(type2, listener) {
  113277. return _addListener(this, type2, listener, false);
  113278. };
  113279. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  113280. EventEmitter.prototype.prependListener = function prependListener(type2, listener) {
  113281. return _addListener(this, type2, listener, true);
  113282. };
  113283. function onceWrapper() {
  113284. if (!this.fired) {
  113285. this.target.removeListener(this.type, this.wrapFn);
  113286. this.fired = true;
  113287. if (arguments.length === 0)
  113288. return this.listener.call(this.target);
  113289. return this.listener.apply(this.target, arguments);
  113290. }
  113291. }
  113292. function _onceWrap(target, type2, listener) {
  113293. var state = { fired: false, wrapFn: void 0, target, type: type2, listener };
  113294. var wrapped = onceWrapper.bind(state);
  113295. wrapped.listener = listener;
  113296. state.wrapFn = wrapped;
  113297. return wrapped;
  113298. }
  113299. EventEmitter.prototype.once = function once2(type2, listener) {
  113300. checkListener(listener);
  113301. this.on(type2, _onceWrap(this, type2, listener));
  113302. return this;
  113303. };
  113304. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) {
  113305. checkListener(listener);
  113306. this.prependListener(type2, _onceWrap(this, type2, listener));
  113307. return this;
  113308. };
  113309. EventEmitter.prototype.removeListener = function removeListener(type2, listener) {
  113310. var list, events, position2, i2, originalListener;
  113311. checkListener(listener);
  113312. events = this._events;
  113313. if (events === void 0)
  113314. return this;
  113315. list = events[type2];
  113316. if (list === void 0)
  113317. return this;
  113318. if (list === listener || list.listener === listener) {
  113319. if (--this._eventsCount === 0)
  113320. this._events = /* @__PURE__ */ Object.create(null);
  113321. else {
  113322. delete events[type2];
  113323. if (events.removeListener)
  113324. this.emit("removeListener", type2, list.listener || listener);
  113325. }
  113326. } else if (typeof list !== "function") {
  113327. position2 = -1;
  113328. for (i2 = list.length - 1; i2 >= 0; i2--) {
  113329. if (list[i2] === listener || list[i2].listener === listener) {
  113330. originalListener = list[i2].listener;
  113331. position2 = i2;
  113332. break;
  113333. }
  113334. }
  113335. if (position2 < 0)
  113336. return this;
  113337. if (position2 === 0)
  113338. list.shift();
  113339. else {
  113340. spliceOne(list, position2);
  113341. }
  113342. if (list.length === 1)
  113343. events[type2] = list[0];
  113344. if (events.removeListener !== void 0)
  113345. this.emit("removeListener", type2, originalListener || listener);
  113346. }
  113347. return this;
  113348. };
  113349. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  113350. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) {
  113351. var listeners, events, i2;
  113352. events = this._events;
  113353. if (events === void 0)
  113354. return this;
  113355. if (events.removeListener === void 0) {
  113356. if (arguments.length === 0) {
  113357. this._events = /* @__PURE__ */ Object.create(null);
  113358. this._eventsCount = 0;
  113359. } else if (events[type2] !== void 0) {
  113360. if (--this._eventsCount === 0)
  113361. this._events = /* @__PURE__ */ Object.create(null);
  113362. else
  113363. delete events[type2];
  113364. }
  113365. return this;
  113366. }
  113367. if (arguments.length === 0) {
  113368. var keys3 = Object.keys(events);
  113369. var key;
  113370. for (i2 = 0; i2 < keys3.length; ++i2) {
  113371. key = keys3[i2];
  113372. if (key === "removeListener")
  113373. continue;
  113374. this.removeAllListeners(key);
  113375. }
  113376. this.removeAllListeners("removeListener");
  113377. this._events = /* @__PURE__ */ Object.create(null);
  113378. this._eventsCount = 0;
  113379. return this;
  113380. }
  113381. listeners = events[type2];
  113382. if (typeof listeners === "function") {
  113383. this.removeListener(type2, listeners);
  113384. } else if (listeners !== void 0) {
  113385. for (i2 = listeners.length - 1; i2 >= 0; i2--) {
  113386. this.removeListener(type2, listeners[i2]);
  113387. }
  113388. }
  113389. return this;
  113390. };
  113391. function _listeners(target, type2, unwrap) {
  113392. var events = target._events;
  113393. if (events === void 0)
  113394. return [];
  113395. var evlistener = events[type2];
  113396. if (evlistener === void 0)
  113397. return [];
  113398. if (typeof evlistener === "function")
  113399. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  113400. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  113401. }
  113402. EventEmitter.prototype.listeners = function listeners(type2) {
  113403. return _listeners(this, type2, true);
  113404. };
  113405. EventEmitter.prototype.rawListeners = function rawListeners(type2) {
  113406. return _listeners(this, type2, false);
  113407. };
  113408. EventEmitter.listenerCount = function(emitter, type2) {
  113409. if (typeof emitter.listenerCount === "function") {
  113410. return emitter.listenerCount(type2);
  113411. } else {
  113412. return listenerCount.call(emitter, type2);
  113413. }
  113414. };
  113415. EventEmitter.prototype.listenerCount = listenerCount;
  113416. function listenerCount(type2) {
  113417. var events = this._events;
  113418. if (events !== void 0) {
  113419. var evlistener = events[type2];
  113420. if (typeof evlistener === "function") {
  113421. return 1;
  113422. } else if (evlistener !== void 0) {
  113423. return evlistener.length;
  113424. }
  113425. }
  113426. return 0;
  113427. }
  113428. EventEmitter.prototype.eventNames = function eventNames() {
  113429. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  113430. };
  113431. function arrayClone(arr, n) {
  113432. var copy2 = new Array(n);
  113433. for (var i2 = 0; i2 < n; ++i2)
  113434. copy2[i2] = arr[i2];
  113435. return copy2;
  113436. }
  113437. function spliceOne(list, index2) {
  113438. for (; index2 + 1 < list.length; index2++)
  113439. list[index2] = list[index2 + 1];
  113440. list.pop();
  113441. }
  113442. function unwrapListeners(arr) {
  113443. var ret = new Array(arr.length);
  113444. for (var i2 = 0; i2 < ret.length; ++i2) {
  113445. ret[i2] = arr[i2].listener || arr[i2];
  113446. }
  113447. return ret;
  113448. }
  113449. function once(emitter, name) {
  113450. return new Promise(function(resolve2, reject2) {
  113451. function errorListener(err) {
  113452. emitter.removeListener(name, resolver);
  113453. reject2(err);
  113454. }
  113455. function resolver() {
  113456. if (typeof emitter.removeListener === "function") {
  113457. emitter.removeListener("error", errorListener);
  113458. }
  113459. resolve2([].slice.call(arguments));
  113460. }
  113461. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  113462. if (name !== "error") {
  113463. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  113464. }
  113465. });
  113466. }
  113467. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  113468. if (typeof emitter.on === "function") {
  113469. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  113470. }
  113471. }
  113472. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  113473. if (typeof emitter.on === "function") {
  113474. if (flags.once) {
  113475. emitter.once(name, listener);
  113476. } else {
  113477. emitter.on(name, listener);
  113478. }
  113479. } else if (typeof emitter.addEventListener === "function") {
  113480. emitter.addEventListener(name, function wrapListener(arg) {
  113481. if (flags.once) {
  113482. emitter.removeEventListener(name, wrapListener);
  113483. }
  113484. listener(arg);
  113485. });
  113486. } else {
  113487. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  113488. }
  113489. }
  113490. },
  113491. "./node_modules/webworkify-webpack/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  113492. function webpackBootstrapFunc(modules) {
  113493. var installedModules = {};
  113494. function __nested_webpack_require_164__(moduleId) {
  113495. if (installedModules[moduleId])
  113496. return installedModules[moduleId].exports;
  113497. var module4 = installedModules[moduleId] = {
  113498. i: moduleId,
  113499. l: false,
  113500. exports: {}
  113501. };
  113502. modules[moduleId].call(module4.exports, module4, module4.exports, __nested_webpack_require_164__);
  113503. module4.l = true;
  113504. return module4.exports;
  113505. }
  113506. __nested_webpack_require_164__.m = modules;
  113507. __nested_webpack_require_164__.c = installedModules;
  113508. __nested_webpack_require_164__.i = function(value) {
  113509. return value;
  113510. };
  113511. __nested_webpack_require_164__.d = function(exports3, name, getter) {
  113512. if (!__nested_webpack_require_164__.o(exports3, name)) {
  113513. Object.defineProperty(exports3, name, {
  113514. configurable: false,
  113515. enumerable: true,
  113516. get: getter
  113517. });
  113518. }
  113519. };
  113520. __nested_webpack_require_164__.r = function(exports3) {
  113521. Object.defineProperty(exports3, "__esModule", { value: true });
  113522. };
  113523. __nested_webpack_require_164__.n = function(module4) {
  113524. var getter = module4 && module4.__esModule ? function getDefault() {
  113525. return module4["default"];
  113526. } : function getModuleExports() {
  113527. return module4;
  113528. };
  113529. __nested_webpack_require_164__.d(getter, "a", getter);
  113530. return getter;
  113531. };
  113532. __nested_webpack_require_164__.o = function(object, property) {
  113533. return Object.prototype.hasOwnProperty.call(object, property);
  113534. };
  113535. __nested_webpack_require_164__.p = "/";
  113536. __nested_webpack_require_164__.oe = function(err) {
  113537. console.error(err);
  113538. throw err;
  113539. };
  113540. var f = __nested_webpack_require_164__(__nested_webpack_require_164__.s = ENTRY_MODULE);
  113541. return f.default || f;
  113542. }
  113543. var moduleNameReqExp = "[\\.|\\-|\\+|\\w|/|@]+";
  113544. var dependencyRegExp = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + moduleNameReqExp + ").*?\\)";
  113545. function quoteRegExp(str) {
  113546. return (str + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
  113547. }
  113548. function isNumeric(n) {
  113549. return !isNaN(1 * n);
  113550. }
  113551. function getModuleDependencies(sources, module4, queueName) {
  113552. var retval = {};
  113553. retval[queueName] = [];
  113554. var fnString = module4.toString();
  113555. var wrapperSignature = fnString.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
  113556. if (!wrapperSignature)
  113557. return retval;
  113558. var webpackRequireName = wrapperSignature[1];
  113559. var re = new RegExp("(\\\\n|\\W)" + quoteRegExp(webpackRequireName) + dependencyRegExp, "g");
  113560. var match;
  113561. while (match = re.exec(fnString)) {
  113562. if (match[3] === "dll-reference")
  113563. continue;
  113564. retval[queueName].push(match[3]);
  113565. }
  113566. re = new RegExp("\\(" + quoteRegExp(webpackRequireName) + '\\("(dll-reference\\s(' + moduleNameReqExp + '))"\\)\\)' + dependencyRegExp, "g");
  113567. while (match = re.exec(fnString)) {
  113568. if (!sources[match[2]]) {
  113569. retval[queueName].push(match[1]);
  113570. sources[match[2]] = __webpack_require__2(match[1]).m;
  113571. }
  113572. retval[match[2]] = retval[match[2]] || [];
  113573. retval[match[2]].push(match[4]);
  113574. }
  113575. var keys3 = Object.keys(retval);
  113576. for (var i2 = 0; i2 < keys3.length; i2++) {
  113577. for (var j = 0; j < retval[keys3[i2]].length; j++) {
  113578. if (isNumeric(retval[keys3[i2]][j])) {
  113579. retval[keys3[i2]][j] = 1 * retval[keys3[i2]][j];
  113580. }
  113581. }
  113582. }
  113583. return retval;
  113584. }
  113585. function hasValuesInQueues(queues) {
  113586. var keys3 = Object.keys(queues);
  113587. return keys3.reduce(function(hasValues, key) {
  113588. return hasValues || queues[key].length > 0;
  113589. }, false);
  113590. }
  113591. function getRequiredModules(sources, moduleId) {
  113592. var modulesQueue = {
  113593. main: [moduleId]
  113594. };
  113595. var requiredModules = {
  113596. main: []
  113597. };
  113598. var seenModules = {
  113599. main: {}
  113600. };
  113601. while (hasValuesInQueues(modulesQueue)) {
  113602. var queues = Object.keys(modulesQueue);
  113603. for (var i2 = 0; i2 < queues.length; i2++) {
  113604. var queueName = queues[i2];
  113605. var queue = modulesQueue[queueName];
  113606. var moduleToCheck = queue.pop();
  113607. seenModules[queueName] = seenModules[queueName] || {};
  113608. if (seenModules[queueName][moduleToCheck] || !sources[queueName][moduleToCheck])
  113609. continue;
  113610. seenModules[queueName][moduleToCheck] = true;
  113611. requiredModules[queueName] = requiredModules[queueName] || [];
  113612. requiredModules[queueName].push(moduleToCheck);
  113613. var newModules = getModuleDependencies(sources, sources[queueName][moduleToCheck], queueName);
  113614. var newModulesKeys = Object.keys(newModules);
  113615. for (var j = 0; j < newModulesKeys.length; j++) {
  113616. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]] || [];
  113617. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]].concat(newModules[newModulesKeys[j]]);
  113618. }
  113619. }
  113620. }
  113621. return requiredModules;
  113622. }
  113623. module3.exports = function(moduleId, options2) {
  113624. options2 = options2 || {};
  113625. var sources = {
  113626. main: __webpack_require__2.m
  113627. };
  113628. var requiredModules = options2.all ? { main: Object.keys(sources.main) } : getRequiredModules(sources, moduleId);
  113629. var src = "";
  113630. Object.keys(requiredModules).filter(function(m) {
  113631. return m !== "main";
  113632. }).forEach(function(module4) {
  113633. var entryModule = 0;
  113634. while (requiredModules[module4][entryModule]) {
  113635. entryModule++;
  113636. }
  113637. requiredModules[module4].push(entryModule);
  113638. sources[module4][entryModule] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })";
  113639. src = src + "var " + module4 + " = (" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(entryModule)) + ")({" + requiredModules[module4].map(function(id) {
  113640. return "" + JSON.stringify(id) + ": " + sources[module4][id].toString();
  113641. }).join(",") + "});\n";
  113642. });
  113643. src = src + "new ((" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(moduleId)) + ")({" + requiredModules.main.map(function(id) {
  113644. return "" + JSON.stringify(id) + ": " + sources.main[id].toString();
  113645. }).join(",") + "}))(self);";
  113646. var blob = new window.Blob([src], { type: "text/javascript" });
  113647. if (options2.bare) {
  113648. return blob;
  113649. }
  113650. var URL2 = window.URL || window.webkitURL || window.mozURL || window.msURL;
  113651. var workerUrl = URL2.createObjectURL(blob);
  113652. var worker = new window.Worker(workerUrl);
  113653. worker.objectURL = workerUrl;
  113654. return worker;
  113655. };
  113656. },
  113657. "./src/config.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113658. __webpack_require__2.r(__webpack_exports__2);
  113659. __webpack_require__2.d(__webpack_exports__2, {
  113660. "defaultConfig": function() {
  113661. return defaultConfig;
  113662. },
  113663. "createDefaultConfig": function() {
  113664. return createDefaultConfig;
  113665. }
  113666. });
  113667. var defaultConfig = {
  113668. enableWorker: false,
  113669. enableStashBuffer: true,
  113670. stashInitialSize: void 0,
  113671. isLive: false,
  113672. lazyLoad: true,
  113673. lazyLoadMaxDuration: 3 * 60,
  113674. lazyLoadRecoverDuration: 30,
  113675. deferLoadAfterSourceOpen: true,
  113676. autoCleanupMaxBackwardDuration: 3 * 60,
  113677. autoCleanupMinBackwardDuration: 2 * 60,
  113678. statisticsInfoReportInterval: 600,
  113679. fixAudioTimestampGap: true,
  113680. accurateSeek: false,
  113681. seekType: "range",
  113682. seekParamStart: "bstart",
  113683. seekParamEnd: "bend",
  113684. rangeLoadZeroStart: false,
  113685. customSeekHandler: void 0,
  113686. reuseRedirectedURL: false,
  113687. headers: void 0,
  113688. customLoader: void 0
  113689. };
  113690. function createDefaultConfig() {
  113691. return Object.assign({}, defaultConfig);
  113692. }
  113693. },
  113694. "./src/core/features.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113695. __webpack_require__2.r(__webpack_exports__2);
  113696. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/io-controller.js");
  113697. var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/config.js");
  113698. var Features = function() {
  113699. function Features2() {
  113700. }
  113701. Features2.supportMSEH264Playback = function() {
  113702. return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
  113703. };
  113704. Features2.supportNetworkStreamIO = function() {
  113705. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113706. var loaderType = ioctl.loaderType;
  113707. ioctl.destroy();
  113708. return loaderType == "fetch-stream-loader" || loaderType == "xhr-moz-chunked-loader";
  113709. };
  113710. Features2.getNetworkLoaderTypeName = function() {
  113711. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113712. var loaderType = ioctl.loaderType;
  113713. ioctl.destroy();
  113714. return loaderType;
  113715. };
  113716. Features2.supportNativeMediaPlayback = function(mimeType) {
  113717. if (Features2.videoElement == void 0) {
  113718. Features2.videoElement = window.document.createElement("video");
  113719. }
  113720. var canPlay = Features2.videoElement.canPlayType(mimeType);
  113721. return canPlay === "probably" || canPlay == "maybe";
  113722. };
  113723. Features2.getFeatureList = function() {
  113724. var features = {
  113725. mseFlvPlayback: false,
  113726. mseLiveFlvPlayback: false,
  113727. networkStreamIO: false,
  113728. networkLoaderName: "",
  113729. nativeMP4H264Playback: false,
  113730. nativeWebmVP8Playback: false,
  113731. nativeWebmVP9Playback: false
  113732. };
  113733. features.mseFlvPlayback = Features2.supportMSEH264Playback();
  113734. features.networkStreamIO = Features2.supportNetworkStreamIO();
  113735. features.networkLoaderName = Features2.getNetworkLoaderTypeName();
  113736. features.mseLiveFlvPlayback = features.mseFlvPlayback && features.networkStreamIO;
  113737. features.nativeMP4H264Playback = Features2.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"');
  113738. features.nativeWebmVP8Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"');
  113739. features.nativeWebmVP9Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp9"');
  113740. return features;
  113741. };
  113742. return Features2;
  113743. }();
  113744. __webpack_exports__2["default"] = Features;
  113745. },
  113746. "./src/core/media-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113747. __webpack_require__2.r(__webpack_exports__2);
  113748. var MediaInfo = function() {
  113749. function MediaInfo2() {
  113750. this.mimeType = null;
  113751. this.duration = null;
  113752. this.hasAudio = null;
  113753. this.hasVideo = null;
  113754. this.audioCodec = null;
  113755. this.videoCodec = null;
  113756. this.audioDataRate = null;
  113757. this.videoDataRate = null;
  113758. this.audioSampleRate = null;
  113759. this.audioChannelCount = null;
  113760. this.width = null;
  113761. this.height = null;
  113762. this.fps = null;
  113763. this.profile = null;
  113764. this.level = null;
  113765. this.refFrames = null;
  113766. this.chromaFormat = null;
  113767. this.sarNum = null;
  113768. this.sarDen = null;
  113769. this.metadata = null;
  113770. this.segments = null;
  113771. this.segmentCount = null;
  113772. this.hasKeyframesIndex = null;
  113773. this.keyframesIndex = null;
  113774. }
  113775. MediaInfo2.prototype.isComplete = function() {
  113776. var audioInfoComplete = this.hasAudio === false || this.hasAudio === true && this.audioCodec != null && this.audioSampleRate != null && this.audioChannelCount != null;
  113777. var videoInfoComplete = this.hasVideo === false || this.hasVideo === true && this.videoCodec != null && this.width != null && this.height != null && this.fps != null && this.profile != null && this.level != null && this.refFrames != null && this.chromaFormat != null && this.sarNum != null && this.sarDen != null;
  113778. return this.mimeType != null && this.duration != null && this.metadata != null && this.hasKeyframesIndex != null && audioInfoComplete && videoInfoComplete;
  113779. };
  113780. MediaInfo2.prototype.isSeekable = function() {
  113781. return this.hasKeyframesIndex === true;
  113782. };
  113783. MediaInfo2.prototype.getNearestKeyframe = function(milliseconds) {
  113784. if (this.keyframesIndex == null) {
  113785. return null;
  113786. }
  113787. var table = this.keyframesIndex;
  113788. var keyframeIdx = this._search(table.times, milliseconds);
  113789. return {
  113790. index: keyframeIdx,
  113791. milliseconds: table.times[keyframeIdx],
  113792. fileposition: table.filepositions[keyframeIdx]
  113793. };
  113794. };
  113795. MediaInfo2.prototype._search = function(list, value) {
  113796. var idx = 0;
  113797. var last = list.length - 1;
  113798. var mid = 0;
  113799. var lbound = 0;
  113800. var ubound = last;
  113801. if (value < list[0]) {
  113802. idx = 0;
  113803. lbound = ubound + 1;
  113804. }
  113805. while (lbound <= ubound) {
  113806. mid = lbound + Math.floor((ubound - lbound) / 2);
  113807. if (mid === last || value >= list[mid] && value < list[mid + 1]) {
  113808. idx = mid;
  113809. break;
  113810. } else if (list[mid] < value) {
  113811. lbound = mid + 1;
  113812. } else {
  113813. ubound = mid - 1;
  113814. }
  113815. }
  113816. return idx;
  113817. };
  113818. return MediaInfo2;
  113819. }();
  113820. __webpack_exports__2["default"] = MediaInfo;
  113821. },
  113822. "./src/core/media-segment-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113823. __webpack_require__2.r(__webpack_exports__2);
  113824. __webpack_require__2.d(__webpack_exports__2, {
  113825. "SampleInfo": function() {
  113826. return SampleInfo;
  113827. },
  113828. "MediaSegmentInfo": function() {
  113829. return MediaSegmentInfo;
  113830. },
  113831. "IDRSampleList": function() {
  113832. return IDRSampleList;
  113833. },
  113834. "MediaSegmentInfoList": function() {
  113835. return MediaSegmentInfoList;
  113836. }
  113837. });
  113838. var SampleInfo = function() {
  113839. function SampleInfo2(dts, pts, duration5, originalDts, isSync) {
  113840. this.dts = dts;
  113841. this.pts = pts;
  113842. this.duration = duration5;
  113843. this.originalDts = originalDts;
  113844. this.isSyncPoint = isSync;
  113845. this.fileposition = null;
  113846. }
  113847. return SampleInfo2;
  113848. }();
  113849. var MediaSegmentInfo = function() {
  113850. function MediaSegmentInfo2() {
  113851. this.beginDts = 0;
  113852. this.endDts = 0;
  113853. this.beginPts = 0;
  113854. this.endPts = 0;
  113855. this.originalBeginDts = 0;
  113856. this.originalEndDts = 0;
  113857. this.syncPoints = [];
  113858. this.firstSample = null;
  113859. this.lastSample = null;
  113860. }
  113861. MediaSegmentInfo2.prototype.appendSyncPoint = function(sampleInfo) {
  113862. sampleInfo.isSyncPoint = true;
  113863. this.syncPoints.push(sampleInfo);
  113864. };
  113865. return MediaSegmentInfo2;
  113866. }();
  113867. var IDRSampleList = function() {
  113868. function IDRSampleList2() {
  113869. this._list = [];
  113870. }
  113871. IDRSampleList2.prototype.clear = function() {
  113872. this._list = [];
  113873. };
  113874. IDRSampleList2.prototype.appendArray = function(syncPoints) {
  113875. var list = this._list;
  113876. if (syncPoints.length === 0) {
  113877. return;
  113878. }
  113879. if (list.length > 0 && syncPoints[0].originalDts < list[list.length - 1].originalDts) {
  113880. this.clear();
  113881. }
  113882. Array.prototype.push.apply(list, syncPoints);
  113883. };
  113884. IDRSampleList2.prototype.getLastSyncPointBeforeDts = function(dts) {
  113885. if (this._list.length == 0) {
  113886. return null;
  113887. }
  113888. var list = this._list;
  113889. var idx = 0;
  113890. var last = list.length - 1;
  113891. var mid = 0;
  113892. var lbound = 0;
  113893. var ubound = last;
  113894. if (dts < list[0].dts) {
  113895. idx = 0;
  113896. lbound = ubound + 1;
  113897. }
  113898. while (lbound <= ubound) {
  113899. mid = lbound + Math.floor((ubound - lbound) / 2);
  113900. if (mid === last || dts >= list[mid].dts && dts < list[mid + 1].dts) {
  113901. idx = mid;
  113902. break;
  113903. } else if (list[mid].dts < dts) {
  113904. lbound = mid + 1;
  113905. } else {
  113906. ubound = mid - 1;
  113907. }
  113908. }
  113909. return this._list[idx];
  113910. };
  113911. return IDRSampleList2;
  113912. }();
  113913. var MediaSegmentInfoList = function() {
  113914. function MediaSegmentInfoList2(type2) {
  113915. this._type = type2;
  113916. this._list = [];
  113917. this._lastAppendLocation = -1;
  113918. }
  113919. Object.defineProperty(MediaSegmentInfoList2.prototype, "type", {
  113920. get: function() {
  113921. return this._type;
  113922. },
  113923. enumerable: false,
  113924. configurable: true
  113925. });
  113926. Object.defineProperty(MediaSegmentInfoList2.prototype, "length", {
  113927. get: function() {
  113928. return this._list.length;
  113929. },
  113930. enumerable: false,
  113931. configurable: true
  113932. });
  113933. MediaSegmentInfoList2.prototype.isEmpty = function() {
  113934. return this._list.length === 0;
  113935. };
  113936. MediaSegmentInfoList2.prototype.clear = function() {
  113937. this._list = [];
  113938. this._lastAppendLocation = -1;
  113939. };
  113940. MediaSegmentInfoList2.prototype._searchNearestSegmentBefore = function(originalBeginDts) {
  113941. var list = this._list;
  113942. if (list.length === 0) {
  113943. return -2;
  113944. }
  113945. var last = list.length - 1;
  113946. var mid = 0;
  113947. var lbound = 0;
  113948. var ubound = last;
  113949. var idx = 0;
  113950. if (originalBeginDts < list[0].originalBeginDts) {
  113951. idx = -1;
  113952. return idx;
  113953. }
  113954. while (lbound <= ubound) {
  113955. mid = lbound + Math.floor((ubound - lbound) / 2);
  113956. if (mid === last || originalBeginDts > list[mid].lastSample.originalDts && originalBeginDts < list[mid + 1].originalBeginDts) {
  113957. idx = mid;
  113958. break;
  113959. } else if (list[mid].originalBeginDts < originalBeginDts) {
  113960. lbound = mid + 1;
  113961. } else {
  113962. ubound = mid - 1;
  113963. }
  113964. }
  113965. return idx;
  113966. };
  113967. MediaSegmentInfoList2.prototype._searchNearestSegmentAfter = function(originalBeginDts) {
  113968. return this._searchNearestSegmentBefore(originalBeginDts) + 1;
  113969. };
  113970. MediaSegmentInfoList2.prototype.append = function(mediaSegmentInfo) {
  113971. var list = this._list;
  113972. var msi = mediaSegmentInfo;
  113973. var lastAppendIdx = this._lastAppendLocation;
  113974. var insertIdx = 0;
  113975. if (lastAppendIdx !== -1 && lastAppendIdx < list.length && msi.originalBeginDts >= list[lastAppendIdx].lastSample.originalDts && (lastAppendIdx === list.length - 1 || lastAppendIdx < list.length - 1 && msi.originalBeginDts < list[lastAppendIdx + 1].originalBeginDts)) {
  113976. insertIdx = lastAppendIdx + 1;
  113977. } else {
  113978. if (list.length > 0) {
  113979. insertIdx = this._searchNearestSegmentBefore(msi.originalBeginDts) + 1;
  113980. }
  113981. }
  113982. this._lastAppendLocation = insertIdx;
  113983. this._list.splice(insertIdx, 0, msi);
  113984. };
  113985. MediaSegmentInfoList2.prototype.getLastSegmentBefore = function(originalBeginDts) {
  113986. var idx = this._searchNearestSegmentBefore(originalBeginDts);
  113987. if (idx >= 0) {
  113988. return this._list[idx];
  113989. } else {
  113990. return null;
  113991. }
  113992. };
  113993. MediaSegmentInfoList2.prototype.getLastSampleBefore = function(originalBeginDts) {
  113994. var segment = this.getLastSegmentBefore(originalBeginDts);
  113995. if (segment != null) {
  113996. return segment.lastSample;
  113997. } else {
  113998. return null;
  113999. }
  114000. };
  114001. MediaSegmentInfoList2.prototype.getLastSyncPointBefore = function(originalBeginDts) {
  114002. var segmentIdx = this._searchNearestSegmentBefore(originalBeginDts);
  114003. var syncPoints = this._list[segmentIdx].syncPoints;
  114004. while (syncPoints.length === 0 && segmentIdx > 0) {
  114005. segmentIdx--;
  114006. syncPoints = this._list[segmentIdx].syncPoints;
  114007. }
  114008. if (syncPoints.length > 0) {
  114009. return syncPoints[syncPoints.length - 1];
  114010. } else {
  114011. return null;
  114012. }
  114013. };
  114014. return MediaSegmentInfoList2;
  114015. }();
  114016. },
  114017. "./src/core/mse-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114018. __webpack_require__2.r(__webpack_exports__2);
  114019. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114020. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114021. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  114022. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  114023. var _mse_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/mse-events.js");
  114024. var _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  114025. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  114026. var MSEController = function() {
  114027. function MSEController2(config) {
  114028. this.TAG = "MSEController";
  114029. this._config = config;
  114030. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114031. if (this._config.isLive && this._config.autoCleanupSourceBuffer == void 0) {
  114032. this._config.autoCleanupSourceBuffer = true;
  114033. }
  114034. this.e = {
  114035. onSourceOpen: this._onSourceOpen.bind(this),
  114036. onSourceEnded: this._onSourceEnded.bind(this),
  114037. onSourceClose: this._onSourceClose.bind(this),
  114038. onSourceBufferError: this._onSourceBufferError.bind(this),
  114039. onSourceBufferUpdateEnd: this._onSourceBufferUpdateEnd.bind(this)
  114040. };
  114041. this._mediaSource = null;
  114042. this._mediaSourceObjectURL = null;
  114043. this._mediaElement = null;
  114044. this._isBufferFull = false;
  114045. this._hasPendingEos = false;
  114046. this._requireSetMediaDuration = false;
  114047. this._pendingMediaDuration = 0;
  114048. this._pendingSourceBufferInit = [];
  114049. this._mimeTypes = {
  114050. video: null,
  114051. audio: null
  114052. };
  114053. this._sourceBuffers = {
  114054. video: null,
  114055. audio: null
  114056. };
  114057. this._lastInitSegments = {
  114058. video: null,
  114059. audio: null
  114060. };
  114061. this._pendingSegments = {
  114062. video: [],
  114063. audio: []
  114064. };
  114065. this._pendingRemoveRanges = {
  114066. video: [],
  114067. audio: []
  114068. };
  114069. this._idrList = new _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.IDRSampleList();
  114070. }
  114071. MSEController2.prototype.destroy = function() {
  114072. if (this._mediaElement || this._mediaSource) {
  114073. this.detachMediaElement();
  114074. }
  114075. this.e = null;
  114076. this._emitter.removeAllListeners();
  114077. this._emitter = null;
  114078. };
  114079. MSEController2.prototype.on = function(event2, listener) {
  114080. this._emitter.addListener(event2, listener);
  114081. };
  114082. MSEController2.prototype.off = function(event2, listener) {
  114083. this._emitter.removeListener(event2, listener);
  114084. };
  114085. MSEController2.prototype.attachMediaElement = function(mediaElement) {
  114086. if (this._mediaSource) {
  114087. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");
  114088. }
  114089. var ms = this._mediaSource = new window.MediaSource();
  114090. ms.addEventListener("sourceopen", this.e.onSourceOpen);
  114091. ms.addEventListener("sourceended", this.e.onSourceEnded);
  114092. ms.addEventListener("sourceclose", this.e.onSourceClose);
  114093. this._mediaElement = mediaElement;
  114094. this._mediaSourceObjectURL = window.URL.createObjectURL(this._mediaSource);
  114095. mediaElement.src = this._mediaSourceObjectURL;
  114096. };
  114097. MSEController2.prototype.detachMediaElement = function() {
  114098. if (this._mediaSource) {
  114099. var ms = this._mediaSource;
  114100. for (var type2 in this._sourceBuffers) {
  114101. var ps = this._pendingSegments[type2];
  114102. ps.splice(0, ps.length);
  114103. this._pendingSegments[type2] = null;
  114104. this._pendingRemoveRanges[type2] = null;
  114105. this._lastInitSegments[type2] = null;
  114106. var sb = this._sourceBuffers[type2];
  114107. if (sb) {
  114108. if (ms.readyState !== "closed") {
  114109. try {
  114110. ms.removeSourceBuffer(sb);
  114111. } catch (error) {
  114112. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114113. }
  114114. sb.removeEventListener("error", this.e.onSourceBufferError);
  114115. sb.removeEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114116. }
  114117. this._mimeTypes[type2] = null;
  114118. this._sourceBuffers[type2] = null;
  114119. }
  114120. }
  114121. if (ms.readyState === "open") {
  114122. try {
  114123. ms.endOfStream();
  114124. } catch (error) {
  114125. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114126. }
  114127. }
  114128. ms.removeEventListener("sourceopen", this.e.onSourceOpen);
  114129. ms.removeEventListener("sourceended", this.e.onSourceEnded);
  114130. ms.removeEventListener("sourceclose", this.e.onSourceClose);
  114131. this._pendingSourceBufferInit = [];
  114132. this._isBufferFull = false;
  114133. this._idrList.clear();
  114134. this._mediaSource = null;
  114135. }
  114136. if (this._mediaElement) {
  114137. this._mediaElement.src = "";
  114138. this._mediaElement.removeAttribute("src");
  114139. this._mediaElement = null;
  114140. }
  114141. if (this._mediaSourceObjectURL) {
  114142. window.URL.revokeObjectURL(this._mediaSourceObjectURL);
  114143. this._mediaSourceObjectURL = null;
  114144. }
  114145. };
  114146. MSEController2.prototype.appendInitSegment = function(initSegment, deferred) {
  114147. if (!this._mediaSource || this._mediaSource.readyState !== "open") {
  114148. this._pendingSourceBufferInit.push(initSegment);
  114149. this._pendingSegments[initSegment.type].push(initSegment);
  114150. return;
  114151. }
  114152. var is = initSegment;
  114153. var mimeType = "" + is.container;
  114154. if (is.codec && is.codec.length > 0) {
  114155. mimeType += ";codecs=" + is.codec;
  114156. }
  114157. var firstInitSegment = false;
  114158. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Received Initialization Segment, mimeType: " + mimeType);
  114159. this._lastInitSegments[is.type] = is;
  114160. if (mimeType !== this._mimeTypes[is.type]) {
  114161. if (!this._mimeTypes[is.type]) {
  114162. firstInitSegment = true;
  114163. try {
  114164. var sb = this._sourceBuffers[is.type] = this._mediaSource.addSourceBuffer(mimeType);
  114165. sb.addEventListener("error", this.e.onSourceBufferError);
  114166. sb.addEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114167. } catch (error) {
  114168. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114169. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114170. return;
  114171. }
  114172. } else {
  114173. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Notice: " + is.type + " mimeType changed, origin: " + this._mimeTypes[is.type] + ", target: " + mimeType);
  114174. }
  114175. this._mimeTypes[is.type] = mimeType;
  114176. }
  114177. if (!deferred) {
  114178. this._pendingSegments[is.type].push(is);
  114179. }
  114180. if (!firstInitSegment) {
  114181. if (this._sourceBuffers[is.type] && !this._sourceBuffers[is.type].updating) {
  114182. this._doAppendSegments();
  114183. }
  114184. }
  114185. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && is.container === "audio/mpeg" && is.mediaDuration > 0) {
  114186. this._requireSetMediaDuration = true;
  114187. this._pendingMediaDuration = is.mediaDuration / 1e3;
  114188. this._updateMediaSourceDuration();
  114189. }
  114190. };
  114191. MSEController2.prototype.appendMediaSegment = function(mediaSegment) {
  114192. var ms = mediaSegment;
  114193. this._pendingSegments[ms.type].push(ms);
  114194. if (this._config.autoCleanupSourceBuffer && this._needCleanupSourceBuffer()) {
  114195. this._doCleanupSourceBuffer();
  114196. }
  114197. var sb = this._sourceBuffers[ms.type];
  114198. if (sb && !sb.updating && !this._hasPendingRemoveRanges()) {
  114199. this._doAppendSegments();
  114200. }
  114201. };
  114202. MSEController2.prototype.seek = function(seconds) {
  114203. for (var type2 in this._sourceBuffers) {
  114204. if (!this._sourceBuffers[type2]) {
  114205. continue;
  114206. }
  114207. var sb = this._sourceBuffers[type2];
  114208. if (this._mediaSource.readyState === "open") {
  114209. try {
  114210. sb.abort();
  114211. } catch (error) {
  114212. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114213. }
  114214. }
  114215. this._idrList.clear();
  114216. var ps = this._pendingSegments[type2];
  114217. ps.splice(0, ps.length);
  114218. if (this._mediaSource.readyState === "closed") {
  114219. continue;
  114220. }
  114221. for (var i2 = 0; i2 < sb.buffered.length; i2++) {
  114222. var start2 = sb.buffered.start(i2);
  114223. var end = sb.buffered.end(i2);
  114224. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114225. }
  114226. if (!sb.updating) {
  114227. this._doRemoveRanges();
  114228. }
  114229. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  114230. var lastInitSegment = this._lastInitSegments[type2];
  114231. if (lastInitSegment) {
  114232. this._pendingSegments[type2].push(lastInitSegment);
  114233. if (!sb.updating) {
  114234. this._doAppendSegments();
  114235. }
  114236. }
  114237. }
  114238. }
  114239. };
  114240. MSEController2.prototype.endOfStream = function() {
  114241. var ms = this._mediaSource;
  114242. var sb = this._sourceBuffers;
  114243. if (!ms || ms.readyState !== "open") {
  114244. if (ms && ms.readyState === "closed" && this._hasPendingSegments()) {
  114245. this._hasPendingEos = true;
  114246. }
  114247. return;
  114248. }
  114249. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114250. this._hasPendingEos = true;
  114251. } else {
  114252. this._hasPendingEos = false;
  114253. ms.endOfStream();
  114254. }
  114255. };
  114256. MSEController2.prototype.getNearestKeyframe = function(dts) {
  114257. return this._idrList.getLastSyncPointBeforeDts(dts);
  114258. };
  114259. MSEController2.prototype._needCleanupSourceBuffer = function() {
  114260. if (!this._config.autoCleanupSourceBuffer) {
  114261. return false;
  114262. }
  114263. var currentTime = this._mediaElement.currentTime;
  114264. for (var type2 in this._sourceBuffers) {
  114265. var sb = this._sourceBuffers[type2];
  114266. if (sb) {
  114267. var buffered = sb.buffered;
  114268. if (buffered.length >= 1) {
  114269. if (currentTime - buffered.start(0) >= this._config.autoCleanupMaxBackwardDuration) {
  114270. return true;
  114271. }
  114272. }
  114273. }
  114274. }
  114275. return false;
  114276. };
  114277. MSEController2.prototype._doCleanupSourceBuffer = function() {
  114278. var currentTime = this._mediaElement.currentTime;
  114279. for (var type2 in this._sourceBuffers) {
  114280. var sb = this._sourceBuffers[type2];
  114281. if (sb) {
  114282. var buffered = sb.buffered;
  114283. var doRemove = false;
  114284. for (var i2 = 0; i2 < buffered.length; i2++) {
  114285. var start2 = buffered.start(i2);
  114286. var end = buffered.end(i2);
  114287. if (start2 <= currentTime && currentTime < end + 3) {
  114288. if (currentTime - start2 >= this._config.autoCleanupMaxBackwardDuration) {
  114289. doRemove = true;
  114290. var removeEnd = currentTime - this._config.autoCleanupMinBackwardDuration;
  114291. this._pendingRemoveRanges[type2].push({ start: start2, end: removeEnd });
  114292. }
  114293. } else if (end < currentTime) {
  114294. doRemove = true;
  114295. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114296. }
  114297. }
  114298. if (doRemove && !sb.updating) {
  114299. this._doRemoveRanges();
  114300. }
  114301. }
  114302. }
  114303. };
  114304. MSEController2.prototype._updateMediaSourceDuration = function() {
  114305. var sb = this._sourceBuffers;
  114306. if (this._mediaElement.readyState === 0 || this._mediaSource.readyState !== "open") {
  114307. return;
  114308. }
  114309. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114310. return;
  114311. }
  114312. var current = this._mediaSource.duration;
  114313. var target = this._pendingMediaDuration;
  114314. if (target > 0 && (isNaN(current) || target > current)) {
  114315. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MediaSource duration from " + current + " to " + target);
  114316. this._mediaSource.duration = target;
  114317. }
  114318. this._requireSetMediaDuration = false;
  114319. this._pendingMediaDuration = 0;
  114320. };
  114321. MSEController2.prototype._doRemoveRanges = function() {
  114322. for (var type2 in this._pendingRemoveRanges) {
  114323. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114324. continue;
  114325. }
  114326. var sb = this._sourceBuffers[type2];
  114327. var ranges = this._pendingRemoveRanges[type2];
  114328. while (ranges.length && !sb.updating) {
  114329. var range3 = ranges.shift();
  114330. sb.remove(range3.start, range3.end);
  114331. }
  114332. }
  114333. };
  114334. MSEController2.prototype._doAppendSegments = function() {
  114335. var pendingSegments = this._pendingSegments;
  114336. for (var type2 in pendingSegments) {
  114337. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114338. continue;
  114339. }
  114340. if (pendingSegments[type2].length > 0) {
  114341. var segment = pendingSegments[type2].shift();
  114342. if (segment.timestampOffset) {
  114343. var currentOffset = this._sourceBuffers[type2].timestampOffset;
  114344. var targetOffset = segment.timestampOffset / 1e3;
  114345. var delta = Math.abs(currentOffset - targetOffset);
  114346. if (delta > 0.1) {
  114347. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MPEG audio timestampOffset from " + currentOffset + " to " + targetOffset);
  114348. this._sourceBuffers[type2].timestampOffset = targetOffset;
  114349. }
  114350. delete segment.timestampOffset;
  114351. }
  114352. if (!segment.data || segment.data.byteLength === 0) {
  114353. continue;
  114354. }
  114355. try {
  114356. this._sourceBuffers[type2].appendBuffer(segment.data);
  114357. this._isBufferFull = false;
  114358. if (type2 === "video" && segment.hasOwnProperty("info")) {
  114359. this._idrList.appendArray(segment.info.syncPoints);
  114360. }
  114361. } catch (error) {
  114362. this._pendingSegments[type2].unshift(segment);
  114363. if (error.code === 22) {
  114364. if (!this._isBufferFull) {
  114365. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.BUFFER_FULL);
  114366. }
  114367. this._isBufferFull = true;
  114368. } else {
  114369. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114370. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114371. }
  114372. }
  114373. }
  114374. }
  114375. };
  114376. MSEController2.prototype._onSourceOpen = function() {
  114377. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceOpen");
  114378. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114379. if (this._pendingSourceBufferInit.length > 0) {
  114380. var pendings = this._pendingSourceBufferInit;
  114381. while (pendings.length) {
  114382. var segment = pendings.shift();
  114383. this.appendInitSegment(segment, true);
  114384. }
  114385. }
  114386. if (this._hasPendingSegments()) {
  114387. this._doAppendSegments();
  114388. }
  114389. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SOURCE_OPEN);
  114390. };
  114391. MSEController2.prototype._onSourceEnded = function() {
  114392. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceEnded");
  114393. };
  114394. MSEController2.prototype._onSourceClose = function() {
  114395. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceClose");
  114396. if (this._mediaSource && this.e != null) {
  114397. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114398. this._mediaSource.removeEventListener("sourceended", this.e.onSourceEnded);
  114399. this._mediaSource.removeEventListener("sourceclose", this.e.onSourceClose);
  114400. }
  114401. };
  114402. MSEController2.prototype._hasPendingSegments = function() {
  114403. var ps = this._pendingSegments;
  114404. return ps.video.length > 0 || ps.audio.length > 0;
  114405. };
  114406. MSEController2.prototype._hasPendingRemoveRanges = function() {
  114407. var prr = this._pendingRemoveRanges;
  114408. return prr.video.length > 0 || prr.audio.length > 0;
  114409. };
  114410. MSEController2.prototype._onSourceBufferUpdateEnd = function() {
  114411. if (this._requireSetMediaDuration) {
  114412. this._updateMediaSourceDuration();
  114413. } else if (this._hasPendingRemoveRanges()) {
  114414. this._doRemoveRanges();
  114415. } else if (this._hasPendingSegments()) {
  114416. this._doAppendSegments();
  114417. } else if (this._hasPendingEos) {
  114418. this.endOfStream();
  114419. }
  114420. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.UPDATE_END);
  114421. };
  114422. MSEController2.prototype._onSourceBufferError = function(e) {
  114423. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "SourceBuffer Error: " + e);
  114424. };
  114425. return MSEController2;
  114426. }();
  114427. __webpack_exports__2["default"] = MSEController;
  114428. },
  114429. "./src/core/mse-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114430. __webpack_require__2.r(__webpack_exports__2);
  114431. var MSEEvents = {
  114432. ERROR: "error",
  114433. SOURCE_OPEN: "source_open",
  114434. UPDATE_END: "update_end",
  114435. BUFFER_FULL: "buffer_full"
  114436. };
  114437. __webpack_exports__2["default"] = MSEEvents;
  114438. },
  114439. "./src/core/transmuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114440. __webpack_require__2.r(__webpack_exports__2);
  114441. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114442. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114443. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./node_modules/webworkify-webpack/index.js");
  114444. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default = /* @__PURE__ */ __webpack_require__2.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__);
  114445. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/logger.js");
  114446. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/logging-control.js");
  114447. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  114448. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114449. var _media_info_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/media-info.js");
  114450. var Transmuxer = function() {
  114451. function Transmuxer2(mediaDataSource, config) {
  114452. this.TAG = "Transmuxer";
  114453. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114454. if (config.enableWorker && typeof Worker !== "undefined") {
  114455. try {
  114456. this._worker = webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default()("./src/core/transmuxing-worker.js");
  114457. this._workerDestroying = false;
  114458. this._worker.addEventListener("message", this._onWorkerMessage.bind(this));
  114459. this._worker.postMessage({ cmd: "init", param: [mediaDataSource, config] });
  114460. this.e = {
  114461. onLoggingConfigChanged: this._onLoggingConfigChanged.bind(this)
  114462. };
  114463. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.registerListener(this.e.onLoggingConfigChanged);
  114464. this._worker.postMessage({ cmd: "logging_config", param: _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.getConfig() });
  114465. } catch (error) {
  114466. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing");
  114467. this._worker = null;
  114468. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114469. }
  114470. } else {
  114471. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114472. }
  114473. if (this._controller) {
  114474. var ctl = this._controller;
  114475. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, this._onIOError.bind(this));
  114476. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, this._onDemuxError.bind(this));
  114477. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, this._onInitSegment.bind(this));
  114478. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, this._onMediaSegment.bind(this));
  114479. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, this._onLoadingComplete.bind(this));
  114480. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, this._onRecoveredEarlyEof.bind(this));
  114481. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, this._onMediaInfo.bind(this));
  114482. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, this._onMetaDataArrived.bind(this));
  114483. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, this._onScriptDataArrived.bind(this));
  114484. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, this._onStatisticsInfo.bind(this));
  114485. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this));
  114486. }
  114487. }
  114488. Transmuxer2.prototype.destroy = function() {
  114489. if (this._worker) {
  114490. if (!this._workerDestroying) {
  114491. this._workerDestroying = true;
  114492. this._worker.postMessage({ cmd: "destroy" });
  114493. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.removeListener(this.e.onLoggingConfigChanged);
  114494. this.e = null;
  114495. }
  114496. } else {
  114497. this._controller.destroy();
  114498. this._controller = null;
  114499. }
  114500. this._emitter.removeAllListeners();
  114501. this._emitter = null;
  114502. };
  114503. Transmuxer2.prototype.on = function(event2, listener) {
  114504. this._emitter.addListener(event2, listener);
  114505. };
  114506. Transmuxer2.prototype.off = function(event2, listener) {
  114507. this._emitter.removeListener(event2, listener);
  114508. };
  114509. Transmuxer2.prototype.hasWorker = function() {
  114510. return this._worker != null;
  114511. };
  114512. Transmuxer2.prototype.open = function() {
  114513. if (this._worker) {
  114514. this._worker.postMessage({ cmd: "start" });
  114515. } else {
  114516. this._controller.start();
  114517. }
  114518. };
  114519. Transmuxer2.prototype.close = function() {
  114520. if (this._worker) {
  114521. this._worker.postMessage({ cmd: "stop" });
  114522. } else {
  114523. this._controller.stop();
  114524. }
  114525. };
  114526. Transmuxer2.prototype.seek = function(milliseconds) {
  114527. if (this._worker) {
  114528. this._worker.postMessage({ cmd: "seek", param: milliseconds });
  114529. } else {
  114530. this._controller.seek(milliseconds);
  114531. }
  114532. };
  114533. Transmuxer2.prototype.pause = function() {
  114534. if (this._worker) {
  114535. this._worker.postMessage({ cmd: "pause" });
  114536. } else {
  114537. this._controller.pause();
  114538. }
  114539. };
  114540. Transmuxer2.prototype.resume = function() {
  114541. if (this._worker) {
  114542. this._worker.postMessage({ cmd: "resume" });
  114543. } else {
  114544. this._controller.resume();
  114545. }
  114546. };
  114547. Transmuxer2.prototype._onInitSegment = function(type2, initSegment) {
  114548. var _this = this;
  114549. Promise.resolve().then(function() {
  114550. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, type2, initSegment);
  114551. });
  114552. };
  114553. Transmuxer2.prototype._onMediaSegment = function(type2, mediaSegment) {
  114554. var _this = this;
  114555. Promise.resolve().then(function() {
  114556. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114557. });
  114558. };
  114559. Transmuxer2.prototype._onLoadingComplete = function() {
  114560. var _this = this;
  114561. Promise.resolve().then(function() {
  114562. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE);
  114563. });
  114564. };
  114565. Transmuxer2.prototype._onRecoveredEarlyEof = function() {
  114566. var _this = this;
  114567. Promise.resolve().then(function() {
  114568. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF);
  114569. });
  114570. };
  114571. Transmuxer2.prototype._onMediaInfo = function(mediaInfo) {
  114572. var _this = this;
  114573. Promise.resolve().then(function() {
  114574. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, mediaInfo);
  114575. });
  114576. };
  114577. Transmuxer2.prototype._onMetaDataArrived = function(metadata) {
  114578. var _this = this;
  114579. Promise.resolve().then(function() {
  114580. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, metadata);
  114581. });
  114582. };
  114583. Transmuxer2.prototype._onScriptDataArrived = function(data) {
  114584. var _this = this;
  114585. Promise.resolve().then(function() {
  114586. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, data);
  114587. });
  114588. };
  114589. Transmuxer2.prototype._onStatisticsInfo = function(statisticsInfo) {
  114590. var _this = this;
  114591. Promise.resolve().then(function() {
  114592. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, statisticsInfo);
  114593. });
  114594. };
  114595. Transmuxer2.prototype._onIOError = function(type2, info) {
  114596. var _this = this;
  114597. Promise.resolve().then(function() {
  114598. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, type2, info);
  114599. });
  114600. };
  114601. Transmuxer2.prototype._onDemuxError = function(type2, info) {
  114602. var _this = this;
  114603. Promise.resolve().then(function() {
  114604. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, type2, info);
  114605. });
  114606. };
  114607. Transmuxer2.prototype._onRecommendSeekpoint = function(milliseconds) {
  114608. var _this = this;
  114609. Promise.resolve().then(function() {
  114610. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, milliseconds);
  114611. });
  114612. };
  114613. Transmuxer2.prototype._onLoggingConfigChanged = function(config) {
  114614. if (this._worker) {
  114615. this._worker.postMessage({ cmd: "logging_config", param: config });
  114616. }
  114617. };
  114618. Transmuxer2.prototype._onWorkerMessage = function(e) {
  114619. var message = e.data;
  114620. var data = message.data;
  114621. if (message.msg === "destroyed" || this._workerDestroying) {
  114622. this._workerDestroying = false;
  114623. this._worker.terminate();
  114624. this._worker = null;
  114625. return;
  114626. }
  114627. switch (message.msg) {
  114628. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT:
  114629. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT:
  114630. this._emitter.emit(message.msg, data.type, data.data);
  114631. break;
  114632. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE:
  114633. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF:
  114634. this._emitter.emit(message.msg);
  114635. break;
  114636. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO:
  114637. Object.setPrototypeOf(data, _media_info_js__WEBPACK_IMPORTED_MODULE_6__.default.prototype);
  114638. this._emitter.emit(message.msg, data);
  114639. break;
  114640. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED:
  114641. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED:
  114642. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO:
  114643. this._emitter.emit(message.msg, data);
  114644. break;
  114645. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR:
  114646. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR:
  114647. this._emitter.emit(message.msg, data.type, data.info);
  114648. break;
  114649. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT:
  114650. this._emitter.emit(message.msg, data);
  114651. break;
  114652. case "logcat_callback":
  114653. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.emitter.emit("log", data.type, data.logcat);
  114654. break;
  114655. }
  114656. };
  114657. return Transmuxer2;
  114658. }();
  114659. __webpack_exports__2["default"] = Transmuxer;
  114660. },
  114661. "./src/core/transmuxing-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114662. __webpack_require__2.r(__webpack_exports__2);
  114663. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114664. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114665. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  114666. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  114667. var _media_info_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/media-info.js");
  114668. var _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/demux/flv-demuxer.js");
  114669. var _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/remux/mp4-remuxer.js");
  114670. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/demux/demux-errors.js");
  114671. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/io-controller.js");
  114672. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114673. var TransmuxingController = function() {
  114674. function TransmuxingController2(mediaDataSource, config) {
  114675. this.TAG = "TransmuxingController";
  114676. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114677. this._config = config;
  114678. if (!mediaDataSource.segments) {
  114679. mediaDataSource.segments = [{
  114680. duration: mediaDataSource.duration,
  114681. filesize: mediaDataSource.filesize,
  114682. url: mediaDataSource.url
  114683. }];
  114684. }
  114685. if (typeof mediaDataSource.cors !== "boolean") {
  114686. mediaDataSource.cors = true;
  114687. }
  114688. if (typeof mediaDataSource.withCredentials !== "boolean") {
  114689. mediaDataSource.withCredentials = false;
  114690. }
  114691. this._mediaDataSource = mediaDataSource;
  114692. this._currentSegmentIndex = 0;
  114693. var totalDuration = 0;
  114694. this._mediaDataSource.segments.forEach(function(segment) {
  114695. segment.timestampBase = totalDuration;
  114696. totalDuration += segment.duration;
  114697. segment.cors = mediaDataSource.cors;
  114698. segment.withCredentials = mediaDataSource.withCredentials;
  114699. if (config.referrerPolicy) {
  114700. segment.referrerPolicy = config.referrerPolicy;
  114701. }
  114702. });
  114703. if (!isNaN(totalDuration) && this._mediaDataSource.duration !== totalDuration) {
  114704. this._mediaDataSource.duration = totalDuration;
  114705. }
  114706. this._mediaInfo = null;
  114707. this._demuxer = null;
  114708. this._remuxer = null;
  114709. this._ioctl = null;
  114710. this._pendingSeekTime = null;
  114711. this._pendingResolveSeekPoint = null;
  114712. this._statisticsReporter = null;
  114713. }
  114714. TransmuxingController2.prototype.destroy = function() {
  114715. this._mediaInfo = null;
  114716. this._mediaDataSource = null;
  114717. if (this._statisticsReporter) {
  114718. this._disableStatisticsReporter();
  114719. }
  114720. if (this._ioctl) {
  114721. this._ioctl.destroy();
  114722. this._ioctl = null;
  114723. }
  114724. if (this._demuxer) {
  114725. this._demuxer.destroy();
  114726. this._demuxer = null;
  114727. }
  114728. if (this._remuxer) {
  114729. this._remuxer.destroy();
  114730. this._remuxer = null;
  114731. }
  114732. this._emitter.removeAllListeners();
  114733. this._emitter = null;
  114734. };
  114735. TransmuxingController2.prototype.on = function(event2, listener) {
  114736. this._emitter.addListener(event2, listener);
  114737. };
  114738. TransmuxingController2.prototype.off = function(event2, listener) {
  114739. this._emitter.removeListener(event2, listener);
  114740. };
  114741. TransmuxingController2.prototype.start = function() {
  114742. this._loadSegment(0);
  114743. this._enableStatisticsReporter();
  114744. };
  114745. TransmuxingController2.prototype._loadSegment = function(segmentIndex, optionalFrom) {
  114746. this._currentSegmentIndex = segmentIndex;
  114747. var dataSource = this._mediaDataSource.segments[segmentIndex];
  114748. var ioctl = this._ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__.default(dataSource, this._config, segmentIndex);
  114749. ioctl.onError = this._onIOException.bind(this);
  114750. ioctl.onSeeked = this._onIOSeeked.bind(this);
  114751. ioctl.onComplete = this._onIOComplete.bind(this);
  114752. ioctl.onRedirect = this._onIORedirect.bind(this);
  114753. ioctl.onRecoveredEarlyEof = this._onIORecoveredEarlyEof.bind(this);
  114754. if (optionalFrom) {
  114755. this._demuxer.bindDataSource(this._ioctl);
  114756. } else {
  114757. ioctl.onDataArrival = this._onInitChunkArrival.bind(this);
  114758. }
  114759. ioctl.open(optionalFrom);
  114760. };
  114761. TransmuxingController2.prototype.stop = function() {
  114762. this._internalAbort();
  114763. this._disableStatisticsReporter();
  114764. };
  114765. TransmuxingController2.prototype._internalAbort = function() {
  114766. if (this._ioctl) {
  114767. this._ioctl.destroy();
  114768. this._ioctl = null;
  114769. }
  114770. };
  114771. TransmuxingController2.prototype.pause = function() {
  114772. if (this._ioctl && this._ioctl.isWorking()) {
  114773. this._ioctl.pause();
  114774. this._disableStatisticsReporter();
  114775. }
  114776. };
  114777. TransmuxingController2.prototype.resume = function() {
  114778. if (this._ioctl && this._ioctl.isPaused()) {
  114779. this._ioctl.resume();
  114780. this._enableStatisticsReporter();
  114781. }
  114782. };
  114783. TransmuxingController2.prototype.seek = function(milliseconds) {
  114784. if (this._mediaInfo == null || !this._mediaInfo.isSeekable()) {
  114785. return;
  114786. }
  114787. var targetSegmentIndex = this._searchSegmentIndexContains(milliseconds);
  114788. if (targetSegmentIndex === this._currentSegmentIndex) {
  114789. var segmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114790. if (segmentInfo == void 0) {
  114791. this._pendingSeekTime = milliseconds;
  114792. } else {
  114793. var keyframe = segmentInfo.getNearestKeyframe(milliseconds);
  114794. this._remuxer.seek(keyframe.milliseconds);
  114795. this._ioctl.seek(keyframe.fileposition);
  114796. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114797. }
  114798. } else {
  114799. var targetSegmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114800. if (targetSegmentInfo == void 0) {
  114801. this._pendingSeekTime = milliseconds;
  114802. this._internalAbort();
  114803. this._remuxer.seek();
  114804. this._remuxer.insertDiscontinuity();
  114805. this._loadSegment(targetSegmentIndex);
  114806. } else {
  114807. var keyframe = targetSegmentInfo.getNearestKeyframe(milliseconds);
  114808. this._internalAbort();
  114809. this._remuxer.seek(milliseconds);
  114810. this._remuxer.insertDiscontinuity();
  114811. this._demuxer.resetMediaInfo();
  114812. this._demuxer.timestampBase = this._mediaDataSource.segments[targetSegmentIndex].timestampBase;
  114813. this._loadSegment(targetSegmentIndex, keyframe.fileposition);
  114814. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114815. this._reportSegmentMediaInfo(targetSegmentIndex);
  114816. }
  114817. }
  114818. this._enableStatisticsReporter();
  114819. };
  114820. TransmuxingController2.prototype._searchSegmentIndexContains = function(milliseconds) {
  114821. var segments = this._mediaDataSource.segments;
  114822. var idx = segments.length - 1;
  114823. for (var i2 = 0; i2 < segments.length; i2++) {
  114824. if (milliseconds < segments[i2].timestampBase) {
  114825. idx = i2 - 1;
  114826. break;
  114827. }
  114828. }
  114829. return idx;
  114830. };
  114831. TransmuxingController2.prototype._onInitChunkArrival = function(data, byteStart) {
  114832. var _this = this;
  114833. var probeData = null;
  114834. var consumed = 0;
  114835. if (byteStart > 0) {
  114836. this._demuxer.bindDataSource(this._ioctl);
  114837. this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase;
  114838. consumed = this._demuxer.parseChunks(data, byteStart);
  114839. } else if ((probeData = _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default.probe(data)).match) {
  114840. this._demuxer = new _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(probeData, this._config);
  114841. if (!this._remuxer) {
  114842. this._remuxer = new _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__.default(this._config);
  114843. }
  114844. var mds = this._mediaDataSource;
  114845. if (mds.duration != void 0 && !isNaN(mds.duration)) {
  114846. this._demuxer.overridedDuration = mds.duration;
  114847. }
  114848. if (typeof mds.hasAudio === "boolean") {
  114849. this._demuxer.overridedHasAudio = mds.hasAudio;
  114850. }
  114851. if (typeof mds.hasVideo === "boolean") {
  114852. this._demuxer.overridedHasVideo = mds.hasVideo;
  114853. }
  114854. this._demuxer.timestampBase = mds.segments[this._currentSegmentIndex].timestampBase;
  114855. this._demuxer.onError = this._onDemuxException.bind(this);
  114856. this._demuxer.onMediaInfo = this._onMediaInfo.bind(this);
  114857. this._demuxer.onMetaDataArrived = this._onMetaDataArrived.bind(this);
  114858. this._demuxer.onScriptDataArrived = this._onScriptDataArrived.bind(this);
  114859. this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl));
  114860. this._remuxer.onInitSegment = this._onRemuxerInitSegmentArrival.bind(this);
  114861. this._remuxer.onMediaSegment = this._onRemuxerMediaSegmentArrival.bind(this);
  114862. consumed = this._demuxer.parseChunks(data, byteStart);
  114863. } else {
  114864. probeData = null;
  114865. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "Non-FLV, Unsupported media type!");
  114866. Promise.resolve().then(function() {
  114867. _this._internalAbort();
  114868. });
  114869. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__.default.FORMAT_UNSUPPORTED, "Non-FLV, Unsupported media type");
  114870. consumed = 0;
  114871. }
  114872. return consumed;
  114873. };
  114874. TransmuxingController2.prototype._onMediaInfo = function(mediaInfo) {
  114875. var _this = this;
  114876. if (this._mediaInfo == null) {
  114877. this._mediaInfo = Object.assign({}, mediaInfo);
  114878. this._mediaInfo.keyframesIndex = null;
  114879. this._mediaInfo.segments = [];
  114880. this._mediaInfo.segmentCount = this._mediaDataSource.segments.length;
  114881. Object.setPrototypeOf(this._mediaInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114882. }
  114883. var segmentInfo = Object.assign({}, mediaInfo);
  114884. Object.setPrototypeOf(segmentInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114885. this._mediaInfo.segments[this._currentSegmentIndex] = segmentInfo;
  114886. this._reportSegmentMediaInfo(this._currentSegmentIndex);
  114887. if (this._pendingSeekTime != null) {
  114888. Promise.resolve().then(function() {
  114889. var target = _this._pendingSeekTime;
  114890. _this._pendingSeekTime = null;
  114891. _this.seek(target);
  114892. });
  114893. }
  114894. };
  114895. TransmuxingController2.prototype._onMetaDataArrived = function(metadata) {
  114896. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.METADATA_ARRIVED, metadata);
  114897. };
  114898. TransmuxingController2.prototype._onScriptDataArrived = function(data) {
  114899. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.SCRIPTDATA_ARRIVED, data);
  114900. };
  114901. TransmuxingController2.prototype._onIOSeeked = function() {
  114902. this._remuxer.insertDiscontinuity();
  114903. };
  114904. TransmuxingController2.prototype._onIOComplete = function(extraData) {
  114905. var segmentIndex = extraData;
  114906. var nextSegmentIndex = segmentIndex + 1;
  114907. if (nextSegmentIndex < this._mediaDataSource.segments.length) {
  114908. this._internalAbort();
  114909. this._remuxer.flushStashedSamples();
  114910. this._loadSegment(nextSegmentIndex);
  114911. } else {
  114912. this._remuxer.flushStashedSamples();
  114913. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.LOADING_COMPLETE);
  114914. this._disableStatisticsReporter();
  114915. }
  114916. };
  114917. TransmuxingController2.prototype._onIORedirect = function(redirectedURL) {
  114918. var segmentIndex = this._ioctl.extraData;
  114919. this._mediaDataSource.segments[segmentIndex].redirectedURL = redirectedURL;
  114920. };
  114921. TransmuxingController2.prototype._onIORecoveredEarlyEof = function() {
  114922. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOVERED_EARLY_EOF);
  114923. };
  114924. TransmuxingController2.prototype._onIOException = function(type2, info) {
  114925. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "IOException: type = " + type2 + ", code = " + info.code + ", msg = " + info.msg);
  114926. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.IO_ERROR, type2, info);
  114927. this._disableStatisticsReporter();
  114928. };
  114929. TransmuxingController2.prototype._onDemuxException = function(type2, info) {
  114930. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "DemuxException: type = " + type2 + ", info = " + info);
  114931. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, type2, info);
  114932. };
  114933. TransmuxingController2.prototype._onRemuxerInitSegmentArrival = function(type2, initSegment) {
  114934. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.INIT_SEGMENT, type2, initSegment);
  114935. };
  114936. TransmuxingController2.prototype._onRemuxerMediaSegmentArrival = function(type2, mediaSegment) {
  114937. if (this._pendingSeekTime != null) {
  114938. return;
  114939. }
  114940. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114941. if (this._pendingResolveSeekPoint != null && type2 === "video") {
  114942. var syncPoints = mediaSegment.info.syncPoints;
  114943. var seekpoint = this._pendingResolveSeekPoint;
  114944. this._pendingResolveSeekPoint = null;
  114945. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && syncPoints.length > 0 && syncPoints[0].originalDts === seekpoint) {
  114946. seekpoint = syncPoints[0].pts;
  114947. }
  114948. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOMMEND_SEEKPOINT, seekpoint);
  114949. }
  114950. };
  114951. TransmuxingController2.prototype._enableStatisticsReporter = function() {
  114952. if (this._statisticsReporter == null) {
  114953. this._statisticsReporter = self.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  114954. }
  114955. };
  114956. TransmuxingController2.prototype._disableStatisticsReporter = function() {
  114957. if (this._statisticsReporter) {
  114958. self.clearInterval(this._statisticsReporter);
  114959. this._statisticsReporter = null;
  114960. }
  114961. };
  114962. TransmuxingController2.prototype._reportSegmentMediaInfo = function(segmentIndex) {
  114963. var segmentInfo = this._mediaInfo.segments[segmentIndex];
  114964. var exportInfo = Object.assign({}, segmentInfo);
  114965. exportInfo.duration = this._mediaInfo.duration;
  114966. exportInfo.segmentCount = this._mediaInfo.segmentCount;
  114967. delete exportInfo.segments;
  114968. delete exportInfo.keyframesIndex;
  114969. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_INFO, exportInfo);
  114970. };
  114971. TransmuxingController2.prototype._reportStatisticsInfo = function() {
  114972. var info = {};
  114973. info.url = this._ioctl.currentURL;
  114974. info.hasRedirect = this._ioctl.hasRedirect;
  114975. if (info.hasRedirect) {
  114976. info.redirectedURL = this._ioctl.currentRedirectedURL;
  114977. }
  114978. info.speed = this._ioctl.currentSpeed;
  114979. info.loaderType = this._ioctl.loaderType;
  114980. info.currentSegmentIndex = this._currentSegmentIndex;
  114981. info.totalSegmentCount = this._mediaDataSource.segments.length;
  114982. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.STATISTICS_INFO, info);
  114983. };
  114984. return TransmuxingController2;
  114985. }();
  114986. __webpack_exports__2["default"] = TransmuxingController;
  114987. },
  114988. "./src/core/transmuxing-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114989. __webpack_require__2.r(__webpack_exports__2);
  114990. var TransmuxingEvents = {
  114991. IO_ERROR: "io_error",
  114992. DEMUX_ERROR: "demux_error",
  114993. INIT_SEGMENT: "init_segment",
  114994. MEDIA_SEGMENT: "media_segment",
  114995. LOADING_COMPLETE: "loading_complete",
  114996. RECOVERED_EARLY_EOF: "recovered_early_eof",
  114997. MEDIA_INFO: "media_info",
  114998. METADATA_ARRIVED: "metadata_arrived",
  114999. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  115000. STATISTICS_INFO: "statistics_info",
  115001. RECOMMEND_SEEKPOINT: "recommend_seekpoint"
  115002. };
  115003. __webpack_exports__2["default"] = TransmuxingEvents;
  115004. },
  115005. "./src/core/transmuxing-worker.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115006. __webpack_require__2.r(__webpack_exports__2);
  115007. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logging-control.js");
  115008. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/polyfill.js");
  115009. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  115010. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/transmuxing-events.js");
  115011. var TransmuxingWorker = function(self2) {
  115012. var controller = null;
  115013. var logcatListener = onLogcatCallback.bind(this);
  115014. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__.default.install();
  115015. self2.addEventListener("message", function(e) {
  115016. switch (e.data.cmd) {
  115017. case "init":
  115018. controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__.default(e.data.param[0], e.data.param[1]);
  115019. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR, onIOError.bind(this));
  115020. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR, onDemuxError.bind(this));
  115021. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT, onInitSegment.bind(this));
  115022. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT, onMediaSegment.bind(this));
  115023. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE, onLoadingComplete.bind(this));
  115024. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF, onRecoveredEarlyEof.bind(this));
  115025. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, onMediaInfo.bind(this));
  115026. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, onMetaDataArrived.bind(this));
  115027. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, onScriptDataArrived.bind(this));
  115028. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, onStatisticsInfo.bind(this));
  115029. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT, onRecommendSeekpoint.bind(this));
  115030. break;
  115031. case "destroy":
  115032. if (controller) {
  115033. controller.destroy();
  115034. controller = null;
  115035. }
  115036. self2.postMessage({ msg: "destroyed" });
  115037. break;
  115038. case "start":
  115039. controller.start();
  115040. break;
  115041. case "stop":
  115042. controller.stop();
  115043. break;
  115044. case "seek":
  115045. controller.seek(e.data.param);
  115046. break;
  115047. case "pause":
  115048. controller.pause();
  115049. break;
  115050. case "resume":
  115051. controller.resume();
  115052. break;
  115053. case "logging_config": {
  115054. var config = e.data.param;
  115055. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.applyConfig(config);
  115056. if (config.enableCallback === true) {
  115057. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.addLogListener(logcatListener);
  115058. } else {
  115059. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.removeLogListener(logcatListener);
  115060. }
  115061. break;
  115062. }
  115063. }
  115064. });
  115065. function onInitSegment(type2, initSegment) {
  115066. var obj = {
  115067. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT,
  115068. data: {
  115069. type: type2,
  115070. data: initSegment
  115071. }
  115072. };
  115073. self2.postMessage(obj, [initSegment.data]);
  115074. }
  115075. function onMediaSegment(type2, mediaSegment) {
  115076. var obj = {
  115077. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT,
  115078. data: {
  115079. type: type2,
  115080. data: mediaSegment
  115081. }
  115082. };
  115083. self2.postMessage(obj, [mediaSegment.data]);
  115084. }
  115085. function onLoadingComplete() {
  115086. var obj = {
  115087. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE
  115088. };
  115089. self2.postMessage(obj);
  115090. }
  115091. function onRecoveredEarlyEof() {
  115092. var obj = {
  115093. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF
  115094. };
  115095. self2.postMessage(obj);
  115096. }
  115097. function onMediaInfo(mediaInfo) {
  115098. var obj = {
  115099. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO,
  115100. data: mediaInfo
  115101. };
  115102. self2.postMessage(obj);
  115103. }
  115104. function onMetaDataArrived(metadata) {
  115105. var obj = {
  115106. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED,
  115107. data: metadata
  115108. };
  115109. self2.postMessage(obj);
  115110. }
  115111. function onScriptDataArrived(data) {
  115112. var obj = {
  115113. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED,
  115114. data
  115115. };
  115116. self2.postMessage(obj);
  115117. }
  115118. function onStatisticsInfo(statInfo) {
  115119. var obj = {
  115120. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO,
  115121. data: statInfo
  115122. };
  115123. self2.postMessage(obj);
  115124. }
  115125. function onIOError(type2, info) {
  115126. self2.postMessage({
  115127. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR,
  115128. data: {
  115129. type: type2,
  115130. info
  115131. }
  115132. });
  115133. }
  115134. function onDemuxError(type2, info) {
  115135. self2.postMessage({
  115136. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR,
  115137. data: {
  115138. type: type2,
  115139. info
  115140. }
  115141. });
  115142. }
  115143. function onRecommendSeekpoint(milliseconds) {
  115144. self2.postMessage({
  115145. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT,
  115146. data: milliseconds
  115147. });
  115148. }
  115149. function onLogcatCallback(type2, str) {
  115150. self2.postMessage({
  115151. msg: "logcat_callback",
  115152. data: {
  115153. type: type2,
  115154. logcat: str
  115155. }
  115156. });
  115157. }
  115158. };
  115159. __webpack_exports__2["default"] = TransmuxingWorker;
  115160. },
  115161. "./src/demux/amf-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115162. __webpack_require__2.r(__webpack_exports__2);
  115163. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115164. var _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/utf8-conv.js");
  115165. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  115166. var le = function() {
  115167. var buf = new ArrayBuffer(2);
  115168. new DataView(buf).setInt16(0, 256, true);
  115169. return new Int16Array(buf)[0] === 256;
  115170. }();
  115171. var AMF = function() {
  115172. function AMF2() {
  115173. }
  115174. AMF2.parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115175. var data = {};
  115176. try {
  115177. var name_1 = AMF2.parseValue(arrayBuffer, dataOffset, dataSize);
  115178. var value = AMF2.parseValue(arrayBuffer, dataOffset + name_1.size, dataSize - name_1.size);
  115179. data[name_1.data] = value.data;
  115180. } catch (e) {
  115181. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115182. }
  115183. return data;
  115184. };
  115185. AMF2.parseObject = function(arrayBuffer, dataOffset, dataSize) {
  115186. if (dataSize < 3) {
  115187. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse ScriptDataObject");
  115188. }
  115189. var name = AMF2.parseString(arrayBuffer, dataOffset, dataSize);
  115190. var value = AMF2.parseValue(arrayBuffer, dataOffset + name.size, dataSize - name.size);
  115191. var isObjectEnd = value.objectEnd;
  115192. return {
  115193. data: {
  115194. name: name.data,
  115195. value: value.data
  115196. },
  115197. size: name.size + value.size,
  115198. objectEnd: isObjectEnd
  115199. };
  115200. };
  115201. AMF2.parseVariable = function(arrayBuffer, dataOffset, dataSize) {
  115202. return AMF2.parseObject(arrayBuffer, dataOffset, dataSize);
  115203. };
  115204. AMF2.parseString = function(arrayBuffer, dataOffset, dataSize) {
  115205. if (dataSize < 2) {
  115206. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse String");
  115207. }
  115208. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115209. var length = v.getUint16(0, !le);
  115210. var str;
  115211. if (length > 0) {
  115212. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 2, length));
  115213. } else {
  115214. str = "";
  115215. }
  115216. return {
  115217. data: str,
  115218. size: 2 + length
  115219. };
  115220. };
  115221. AMF2.parseLongString = function(arrayBuffer, dataOffset, dataSize) {
  115222. if (dataSize < 4) {
  115223. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse LongString");
  115224. }
  115225. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115226. var length = v.getUint32(0, !le);
  115227. var str;
  115228. if (length > 0) {
  115229. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 4, length));
  115230. } else {
  115231. str = "";
  115232. }
  115233. return {
  115234. data: str,
  115235. size: 4 + length
  115236. };
  115237. };
  115238. AMF2.parseDate = function(arrayBuffer, dataOffset, dataSize) {
  115239. if (dataSize < 10) {
  115240. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data size invalid when parse Date");
  115241. }
  115242. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115243. var timestamp = v.getFloat64(0, !le);
  115244. var localTimeOffset = v.getInt16(8, !le);
  115245. timestamp += localTimeOffset * 60 * 1e3;
  115246. return {
  115247. data: new Date(timestamp),
  115248. size: 8 + 2
  115249. };
  115250. };
  115251. AMF2.parseValue = function(arrayBuffer, dataOffset, dataSize) {
  115252. if (dataSize < 1) {
  115253. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse Value");
  115254. }
  115255. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115256. var offset = 1;
  115257. var type2 = v.getUint8(0);
  115258. var value;
  115259. var objectEnd = false;
  115260. try {
  115261. switch (type2) {
  115262. case 0:
  115263. value = v.getFloat64(1, !le);
  115264. offset += 8;
  115265. break;
  115266. case 1: {
  115267. var b = v.getUint8(1);
  115268. value = b ? true : false;
  115269. offset += 1;
  115270. break;
  115271. }
  115272. case 2: {
  115273. var amfstr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115274. value = amfstr.data;
  115275. offset += amfstr.size;
  115276. break;
  115277. }
  115278. case 3: {
  115279. value = {};
  115280. var terminal = 0;
  115281. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115282. terminal = 3;
  115283. }
  115284. while (offset < dataSize - 4) {
  115285. var amfobj = AMF2.parseObject(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115286. if (amfobj.objectEnd)
  115287. break;
  115288. value[amfobj.data.name] = amfobj.data.value;
  115289. offset += amfobj.size;
  115290. }
  115291. if (offset <= dataSize - 3) {
  115292. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115293. if (marker === 9) {
  115294. offset += 3;
  115295. }
  115296. }
  115297. break;
  115298. }
  115299. case 8: {
  115300. value = {};
  115301. offset += 4;
  115302. var terminal = 0;
  115303. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115304. terminal = 3;
  115305. }
  115306. while (offset < dataSize - 8) {
  115307. var amfvar = AMF2.parseVariable(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115308. if (amfvar.objectEnd)
  115309. break;
  115310. value[amfvar.data.name] = amfvar.data.value;
  115311. offset += amfvar.size;
  115312. }
  115313. if (offset <= dataSize - 3) {
  115314. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115315. if (marker === 9) {
  115316. offset += 3;
  115317. }
  115318. }
  115319. break;
  115320. }
  115321. case 9:
  115322. value = void 0;
  115323. offset = 1;
  115324. objectEnd = true;
  115325. break;
  115326. case 10: {
  115327. value = [];
  115328. var strictArrayLength = v.getUint32(1, !le);
  115329. offset += 4;
  115330. for (var i2 = 0; i2 < strictArrayLength; i2++) {
  115331. var val = AMF2.parseValue(arrayBuffer, dataOffset + offset, dataSize - offset);
  115332. value.push(val.data);
  115333. offset += val.size;
  115334. }
  115335. break;
  115336. }
  115337. case 11: {
  115338. var date = AMF2.parseDate(arrayBuffer, dataOffset + 1, dataSize - 1);
  115339. value = date.data;
  115340. offset += date.size;
  115341. break;
  115342. }
  115343. case 12: {
  115344. var amfLongStr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115345. value = amfLongStr.data;
  115346. offset += amfLongStr.size;
  115347. break;
  115348. }
  115349. default:
  115350. offset = dataSize;
  115351. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("AMF", "Unsupported AMF value type " + type2);
  115352. }
  115353. } catch (e) {
  115354. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115355. }
  115356. return {
  115357. data: value,
  115358. size: offset,
  115359. objectEnd
  115360. };
  115361. };
  115362. return AMF2;
  115363. }();
  115364. __webpack_exports__2["default"] = AMF;
  115365. },
  115366. "./src/demux/demux-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115367. __webpack_require__2.r(__webpack_exports__2);
  115368. var DemuxErrors = {
  115369. OK: "OK",
  115370. FORMAT_ERROR: "FormatError",
  115371. FORMAT_UNSUPPORTED: "FormatUnsupported",
  115372. CODEC_UNSUPPORTED: "CodecUnsupported"
  115373. };
  115374. __webpack_exports__2["default"] = DemuxErrors;
  115375. },
  115376. "./src/demux/exp-golomb.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115377. __webpack_require__2.r(__webpack_exports__2);
  115378. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  115379. var ExpGolomb = function() {
  115380. function ExpGolomb2(uint8array) {
  115381. this.TAG = "ExpGolomb";
  115382. this._buffer = uint8array;
  115383. this._buffer_index = 0;
  115384. this._total_bytes = uint8array.byteLength;
  115385. this._total_bits = uint8array.byteLength * 8;
  115386. this._current_word = 0;
  115387. this._current_word_bits_left = 0;
  115388. }
  115389. ExpGolomb2.prototype.destroy = function() {
  115390. this._buffer = null;
  115391. };
  115392. ExpGolomb2.prototype._fillCurrentWord = function() {
  115393. var buffer_bytes_left = this._total_bytes - this._buffer_index;
  115394. if (buffer_bytes_left <= 0)
  115395. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");
  115396. var bytes_read = Math.min(4, buffer_bytes_left);
  115397. var word = new Uint8Array(4);
  115398. word.set(this._buffer.subarray(this._buffer_index, this._buffer_index + bytes_read));
  115399. this._current_word = new DataView(word.buffer).getUint32(0, false);
  115400. this._buffer_index += bytes_read;
  115401. this._current_word_bits_left = bytes_read * 8;
  115402. };
  115403. ExpGolomb2.prototype.readBits = function(bits) {
  115404. if (bits > 32)
  115405. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");
  115406. if (bits <= this._current_word_bits_left) {
  115407. var result_1 = this._current_word >>> 32 - bits;
  115408. this._current_word <<= bits;
  115409. this._current_word_bits_left -= bits;
  115410. return result_1;
  115411. }
  115412. var result = this._current_word_bits_left ? this._current_word : 0;
  115413. result = result >>> 32 - this._current_word_bits_left;
  115414. var bits_need_left = bits - this._current_word_bits_left;
  115415. this._fillCurrentWord();
  115416. var bits_read_next = Math.min(bits_need_left, this._current_word_bits_left);
  115417. var result2 = this._current_word >>> 32 - bits_read_next;
  115418. this._current_word <<= bits_read_next;
  115419. this._current_word_bits_left -= bits_read_next;
  115420. result = result << bits_read_next | result2;
  115421. return result;
  115422. };
  115423. ExpGolomb2.prototype.readBool = function() {
  115424. return this.readBits(1) === 1;
  115425. };
  115426. ExpGolomb2.prototype.readByte = function() {
  115427. return this.readBits(8);
  115428. };
  115429. ExpGolomb2.prototype._skipLeadingZero = function() {
  115430. var zero_count;
  115431. for (zero_count = 0; zero_count < this._current_word_bits_left; zero_count++) {
  115432. if (0 !== (this._current_word & 2147483648 >>> zero_count)) {
  115433. this._current_word <<= zero_count;
  115434. this._current_word_bits_left -= zero_count;
  115435. return zero_count;
  115436. }
  115437. }
  115438. this._fillCurrentWord();
  115439. return zero_count + this._skipLeadingZero();
  115440. };
  115441. ExpGolomb2.prototype.readUEG = function() {
  115442. var leading_zeros = this._skipLeadingZero();
  115443. return this.readBits(leading_zeros + 1) - 1;
  115444. };
  115445. ExpGolomb2.prototype.readSEG = function() {
  115446. var value = this.readUEG();
  115447. if (value & 1) {
  115448. return value + 1 >>> 1;
  115449. } else {
  115450. return -1 * (value >>> 1);
  115451. }
  115452. };
  115453. return ExpGolomb2;
  115454. }();
  115455. __webpack_exports__2["default"] = ExpGolomb;
  115456. },
  115457. "./src/demux/flv-demuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115458. __webpack_require__2.r(__webpack_exports__2);
  115459. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115460. var _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/amf-parser.js");
  115461. var _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/demux/sps-parser.js");
  115462. var _demux_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/demux/demux-errors.js");
  115463. var _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-info.js");
  115464. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  115465. function ReadBig32(array, index2) {
  115466. return array[index2] << 24 | array[index2 + 1] << 16 | array[index2 + 2] << 8 | array[index2 + 3];
  115467. }
  115468. var FLVDemuxer = function() {
  115469. function FLVDemuxer2(probeData, config) {
  115470. this.TAG = "FLVDemuxer";
  115471. this._config = config;
  115472. this._onError = null;
  115473. this._onMediaInfo = null;
  115474. this._onMetaDataArrived = null;
  115475. this._onScriptDataArrived = null;
  115476. this._onTrackMetadata = null;
  115477. this._onDataAvailable = null;
  115478. this._dataOffset = probeData.dataOffset;
  115479. this._firstParse = true;
  115480. this._dispatch = false;
  115481. this._hasAudio = probeData.hasAudioTrack;
  115482. this._hasVideo = probeData.hasVideoTrack;
  115483. this._hasAudioFlagOverrided = false;
  115484. this._hasVideoFlagOverrided = false;
  115485. this._audioInitialMetadataDispatched = false;
  115486. this._videoInitialMetadataDispatched = false;
  115487. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115488. this._mediaInfo.hasAudio = this._hasAudio;
  115489. this._mediaInfo.hasVideo = this._hasVideo;
  115490. this._metadata = null;
  115491. this._audioMetadata = null;
  115492. this._videoMetadata = null;
  115493. this._naluLengthSize = 4;
  115494. this._timestampBase = 0;
  115495. this._timescale = 1e3;
  115496. this._duration = 0;
  115497. this._durationOverrided = false;
  115498. this._referenceFrameRate = {
  115499. fixed: true,
  115500. fps: 23.976,
  115501. fps_num: 23976,
  115502. fps_den: 1e3
  115503. };
  115504. this._flvSoundRateTable = [5500, 11025, 22050, 44100, 48e3];
  115505. this._mpegSamplingRates = [
  115506. 96e3,
  115507. 88200,
  115508. 64e3,
  115509. 48e3,
  115510. 44100,
  115511. 32e3,
  115512. 24e3,
  115513. 22050,
  115514. 16e3,
  115515. 12e3,
  115516. 11025,
  115517. 8e3,
  115518. 7350
  115519. ];
  115520. this._mpegAudioV10SampleRateTable = [44100, 48e3, 32e3, 0];
  115521. this._mpegAudioV20SampleRateTable = [22050, 24e3, 16e3, 0];
  115522. this._mpegAudioV25SampleRateTable = [11025, 12e3, 8e3, 0];
  115523. this._mpegAudioL1BitRateTable = [0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1];
  115524. this._mpegAudioL2BitRateTable = [0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1];
  115525. this._mpegAudioL3BitRateTable = [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1];
  115526. this._videoTrack = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 };
  115527. this._audioTrack = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 };
  115528. this._littleEndian = function() {
  115529. var buf = new ArrayBuffer(2);
  115530. new DataView(buf).setInt16(0, 256, true);
  115531. return new Int16Array(buf)[0] === 256;
  115532. }();
  115533. }
  115534. FLVDemuxer2.prototype.destroy = function() {
  115535. this._mediaInfo = null;
  115536. this._metadata = null;
  115537. this._audioMetadata = null;
  115538. this._videoMetadata = null;
  115539. this._videoTrack = null;
  115540. this._audioTrack = null;
  115541. this._onError = null;
  115542. this._onMediaInfo = null;
  115543. this._onMetaDataArrived = null;
  115544. this._onScriptDataArrived = null;
  115545. this._onTrackMetadata = null;
  115546. this._onDataAvailable = null;
  115547. };
  115548. FLVDemuxer2.probe = function(buffer) {
  115549. var data = new Uint8Array(buffer);
  115550. var mismatch = { match: false };
  115551. if (data[0] !== 70 || data[1] !== 76 || data[2] !== 86 || data[3] !== 1) {
  115552. return mismatch;
  115553. }
  115554. var hasAudio = (data[4] & 4) >>> 2 !== 0;
  115555. var hasVideo = (data[4] & 1) !== 0;
  115556. var offset = ReadBig32(data, 5);
  115557. if (offset < 9) {
  115558. return mismatch;
  115559. }
  115560. return {
  115561. match: true,
  115562. consumed: offset,
  115563. dataOffset: offset,
  115564. hasAudioTrack: hasAudio,
  115565. hasVideoTrack: hasVideo
  115566. };
  115567. };
  115568. FLVDemuxer2.prototype.bindDataSource = function(loader) {
  115569. loader.onDataArrival = this.parseChunks.bind(this);
  115570. return this;
  115571. };
  115572. Object.defineProperty(FLVDemuxer2.prototype, "onTrackMetadata", {
  115573. get: function() {
  115574. return this._onTrackMetadata;
  115575. },
  115576. set: function(callback2) {
  115577. this._onTrackMetadata = callback2;
  115578. },
  115579. enumerable: false,
  115580. configurable: true
  115581. });
  115582. Object.defineProperty(FLVDemuxer2.prototype, "onMediaInfo", {
  115583. get: function() {
  115584. return this._onMediaInfo;
  115585. },
  115586. set: function(callback2) {
  115587. this._onMediaInfo = callback2;
  115588. },
  115589. enumerable: false,
  115590. configurable: true
  115591. });
  115592. Object.defineProperty(FLVDemuxer2.prototype, "onMetaDataArrived", {
  115593. get: function() {
  115594. return this._onMetaDataArrived;
  115595. },
  115596. set: function(callback2) {
  115597. this._onMetaDataArrived = callback2;
  115598. },
  115599. enumerable: false,
  115600. configurable: true
  115601. });
  115602. Object.defineProperty(FLVDemuxer2.prototype, "onScriptDataArrived", {
  115603. get: function() {
  115604. return this._onScriptDataArrived;
  115605. },
  115606. set: function(callback2) {
  115607. this._onScriptDataArrived = callback2;
  115608. },
  115609. enumerable: false,
  115610. configurable: true
  115611. });
  115612. Object.defineProperty(FLVDemuxer2.prototype, "onError", {
  115613. get: function() {
  115614. return this._onError;
  115615. },
  115616. set: function(callback2) {
  115617. this._onError = callback2;
  115618. },
  115619. enumerable: false,
  115620. configurable: true
  115621. });
  115622. Object.defineProperty(FLVDemuxer2.prototype, "onDataAvailable", {
  115623. get: function() {
  115624. return this._onDataAvailable;
  115625. },
  115626. set: function(callback2) {
  115627. this._onDataAvailable = callback2;
  115628. },
  115629. enumerable: false,
  115630. configurable: true
  115631. });
  115632. Object.defineProperty(FLVDemuxer2.prototype, "timestampBase", {
  115633. get: function() {
  115634. return this._timestampBase;
  115635. },
  115636. set: function(base2) {
  115637. this._timestampBase = base2;
  115638. },
  115639. enumerable: false,
  115640. configurable: true
  115641. });
  115642. Object.defineProperty(FLVDemuxer2.prototype, "overridedDuration", {
  115643. get: function() {
  115644. return this._duration;
  115645. },
  115646. set: function(duration5) {
  115647. this._durationOverrided = true;
  115648. this._duration = duration5;
  115649. this._mediaInfo.duration = duration5;
  115650. },
  115651. enumerable: false,
  115652. configurable: true
  115653. });
  115654. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasAudio", {
  115655. set: function(hasAudio) {
  115656. this._hasAudioFlagOverrided = true;
  115657. this._hasAudio = hasAudio;
  115658. this._mediaInfo.hasAudio = hasAudio;
  115659. },
  115660. enumerable: false,
  115661. configurable: true
  115662. });
  115663. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasVideo", {
  115664. set: function(hasVideo) {
  115665. this._hasVideoFlagOverrided = true;
  115666. this._hasVideo = hasVideo;
  115667. this._mediaInfo.hasVideo = hasVideo;
  115668. },
  115669. enumerable: false,
  115670. configurable: true
  115671. });
  115672. FLVDemuxer2.prototype.resetMediaInfo = function() {
  115673. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115674. };
  115675. FLVDemuxer2.prototype._isInitialMetadataDispatched = function() {
  115676. if (this._hasAudio && this._hasVideo) {
  115677. return this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched;
  115678. }
  115679. if (this._hasAudio && !this._hasVideo) {
  115680. return this._audioInitialMetadataDispatched;
  115681. }
  115682. if (!this._hasAudio && this._hasVideo) {
  115683. return this._videoInitialMetadataDispatched;
  115684. }
  115685. return false;
  115686. };
  115687. FLVDemuxer2.prototype.parseChunks = function(chunk, byteStart) {
  115688. if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {
  115689. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
  115690. }
  115691. var offset = 0;
  115692. var le = this._littleEndian;
  115693. if (byteStart === 0) {
  115694. if (chunk.byteLength > 13) {
  115695. var probeData = FLVDemuxer2.probe(chunk);
  115696. offset = probeData.dataOffset;
  115697. } else {
  115698. return 0;
  115699. }
  115700. }
  115701. if (this._firstParse) {
  115702. this._firstParse = false;
  115703. if (byteStart + offset !== this._dataOffset) {
  115704. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "First time parsing but chunk byteStart invalid!");
  115705. }
  115706. var v = new DataView(chunk, offset);
  115707. var prevTagSize0 = v.getUint32(0, !le);
  115708. if (prevTagSize0 !== 0) {
  115709. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "PrevTagSize0 !== 0 !!!");
  115710. }
  115711. offset += 4;
  115712. }
  115713. while (offset < chunk.byteLength) {
  115714. this._dispatch = true;
  115715. var v = new DataView(chunk, offset);
  115716. if (offset + 11 + 4 > chunk.byteLength) {
  115717. break;
  115718. }
  115719. var tagType = v.getUint8(0);
  115720. var dataSize = v.getUint32(0, !le) & 16777215;
  115721. if (offset + 11 + dataSize + 4 > chunk.byteLength) {
  115722. break;
  115723. }
  115724. if (tagType !== 8 && tagType !== 9 && tagType !== 18) {
  115725. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unsupported tag type " + tagType + ", skipped");
  115726. offset += 11 + dataSize + 4;
  115727. continue;
  115728. }
  115729. var ts22 = v.getUint8(4);
  115730. var ts1 = v.getUint8(5);
  115731. var ts0 = v.getUint8(6);
  115732. var ts3 = v.getUint8(7);
  115733. var timestamp = ts0 | ts1 << 8 | ts22 << 16 | ts3 << 24;
  115734. var streamId = v.getUint32(7, !le) & 16777215;
  115735. if (streamId !== 0) {
  115736. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Meet tag which has StreamID != 0!");
  115737. }
  115738. var dataOffset = offset + 11;
  115739. switch (tagType) {
  115740. case 8:
  115741. this._parseAudioData(chunk, dataOffset, dataSize, timestamp);
  115742. break;
  115743. case 9:
  115744. this._parseVideoData(chunk, dataOffset, dataSize, timestamp, byteStart + offset);
  115745. break;
  115746. case 18:
  115747. this._parseScriptData(chunk, dataOffset, dataSize);
  115748. break;
  115749. }
  115750. var prevTagSize = v.getUint32(11 + dataSize, !le);
  115751. if (prevTagSize !== 11 + dataSize) {
  115752. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid PrevTagSize " + prevTagSize);
  115753. }
  115754. offset += 11 + dataSize + 4;
  115755. }
  115756. if (this._isInitialMetadataDispatched()) {
  115757. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115758. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115759. }
  115760. }
  115761. return offset;
  115762. };
  115763. FLVDemuxer2.prototype._parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115764. var scriptData = _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__.default.parseScriptData(arrayBuffer, dataOffset, dataSize);
  115765. if (scriptData.hasOwnProperty("onMetaData")) {
  115766. if (scriptData.onMetaData == null || typeof scriptData.onMetaData !== "object") {
  115767. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid onMetaData structure!");
  115768. return;
  115769. }
  115770. if (this._metadata) {
  115771. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another onMetaData tag!");
  115772. }
  115773. this._metadata = scriptData;
  115774. var onMetaData = this._metadata.onMetaData;
  115775. if (this._onMetaDataArrived) {
  115776. this._onMetaDataArrived(Object.assign({}, onMetaData));
  115777. }
  115778. if (typeof onMetaData.hasAudio === "boolean") {
  115779. if (this._hasAudioFlagOverrided === false) {
  115780. this._hasAudio = onMetaData.hasAudio;
  115781. this._mediaInfo.hasAudio = this._hasAudio;
  115782. }
  115783. }
  115784. if (typeof onMetaData.hasVideo === "boolean") {
  115785. if (this._hasVideoFlagOverrided === false) {
  115786. this._hasVideo = onMetaData.hasVideo;
  115787. this._mediaInfo.hasVideo = this._hasVideo;
  115788. }
  115789. }
  115790. if (typeof onMetaData.audiodatarate === "number") {
  115791. this._mediaInfo.audioDataRate = onMetaData.audiodatarate;
  115792. }
  115793. if (typeof onMetaData.videodatarate === "number") {
  115794. this._mediaInfo.videoDataRate = onMetaData.videodatarate;
  115795. }
  115796. if (typeof onMetaData.width === "number") {
  115797. this._mediaInfo.width = onMetaData.width;
  115798. }
  115799. if (typeof onMetaData.height === "number") {
  115800. this._mediaInfo.height = onMetaData.height;
  115801. }
  115802. if (typeof onMetaData.duration === "number") {
  115803. if (!this._durationOverrided) {
  115804. var duration5 = Math.floor(onMetaData.duration * this._timescale);
  115805. this._duration = duration5;
  115806. this._mediaInfo.duration = duration5;
  115807. }
  115808. } else {
  115809. this._mediaInfo.duration = 0;
  115810. }
  115811. if (typeof onMetaData.framerate === "number") {
  115812. var fps_num = Math.floor(onMetaData.framerate * 1e3);
  115813. if (fps_num > 0) {
  115814. var fps = fps_num / 1e3;
  115815. this._referenceFrameRate.fixed = true;
  115816. this._referenceFrameRate.fps = fps;
  115817. this._referenceFrameRate.fps_num = fps_num;
  115818. this._referenceFrameRate.fps_den = 1e3;
  115819. this._mediaInfo.fps = fps;
  115820. }
  115821. }
  115822. if (typeof onMetaData.keyframes === "object") {
  115823. this._mediaInfo.hasKeyframesIndex = true;
  115824. var keyframes = onMetaData.keyframes;
  115825. this._mediaInfo.keyframesIndex = this._parseKeyframesIndex(keyframes);
  115826. onMetaData.keyframes = null;
  115827. } else {
  115828. this._mediaInfo.hasKeyframesIndex = false;
  115829. }
  115830. this._dispatch = false;
  115831. this._mediaInfo.metadata = onMetaData;
  115832. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed onMetaData");
  115833. if (this._mediaInfo.isComplete()) {
  115834. this._onMediaInfo(this._mediaInfo);
  115835. }
  115836. }
  115837. if (Object.keys(scriptData).length > 0) {
  115838. if (this._onScriptDataArrived) {
  115839. this._onScriptDataArrived(Object.assign({}, scriptData));
  115840. }
  115841. }
  115842. };
  115843. FLVDemuxer2.prototype._parseKeyframesIndex = function(keyframes) {
  115844. var times = [];
  115845. var filepositions = [];
  115846. for (var i2 = 1; i2 < keyframes.times.length; i2++) {
  115847. var time = this._timestampBase + Math.floor(keyframes.times[i2] * 1e3);
  115848. times.push(time);
  115849. filepositions.push(keyframes.filepositions[i2]);
  115850. }
  115851. return {
  115852. times,
  115853. filepositions
  115854. };
  115855. };
  115856. FLVDemuxer2.prototype._parseAudioData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp) {
  115857. if (dataSize <= 1) {
  115858. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid audio packet, missing SoundData payload!");
  115859. return;
  115860. }
  115861. if (this._hasAudioFlagOverrided === true && this._hasAudio === false) {
  115862. return;
  115863. }
  115864. this._littleEndian;
  115865. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115866. var soundSpec = v.getUint8(0);
  115867. var soundFormat = soundSpec >>> 4;
  115868. if (soundFormat !== 2 && soundFormat !== 10) {
  115869. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " + soundFormat);
  115870. return;
  115871. }
  115872. var soundRate = 0;
  115873. var soundRateIndex = (soundSpec & 12) >>> 2;
  115874. if (soundRateIndex >= 0 && soundRateIndex <= 4) {
  115875. soundRate = this._flvSoundRateTable[soundRateIndex];
  115876. } else {
  115877. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid audio sample rate idx: " + soundRateIndex);
  115878. return;
  115879. }
  115880. var soundType = soundSpec & 1;
  115881. var meta2 = this._audioMetadata;
  115882. var track = this._audioTrack;
  115883. if (!meta2) {
  115884. if (this._hasAudio === false && this._hasAudioFlagOverrided === false) {
  115885. this._hasAudio = true;
  115886. this._mediaInfo.hasAudio = true;
  115887. }
  115888. meta2 = this._audioMetadata = {};
  115889. meta2.type = "audio";
  115890. meta2.id = track.id;
  115891. meta2.timescale = this._timescale;
  115892. meta2.duration = this._duration;
  115893. meta2.audioSampleRate = soundRate;
  115894. meta2.channelCount = soundType === 0 ? 1 : 2;
  115895. }
  115896. if (soundFormat === 10) {
  115897. var aacData = this._parseAACAudioData(arrayBuffer, dataOffset + 1, dataSize - 1);
  115898. if (aacData == void 0) {
  115899. return;
  115900. }
  115901. if (aacData.packetType === 0) {
  115902. if (meta2.config) {
  115903. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AudioSpecificConfig!");
  115904. }
  115905. var misc = aacData.data;
  115906. meta2.audioSampleRate = misc.samplingRate;
  115907. meta2.channelCount = misc.channelCount;
  115908. meta2.codec = misc.codec;
  115909. meta2.originalCodec = misc.originalCodec;
  115910. meta2.config = misc.config;
  115911. meta2.refSampleDuration = 1024 / meta2.audioSampleRate * meta2.timescale;
  115912. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AudioSpecificConfig");
  115913. if (this._isInitialMetadataDispatched()) {
  115914. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115915. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115916. }
  115917. } else {
  115918. this._audioInitialMetadataDispatched = true;
  115919. }
  115920. this._dispatch = false;
  115921. this._onTrackMetadata("audio", meta2);
  115922. var mi = this._mediaInfo;
  115923. mi.audioCodec = meta2.originalCodec;
  115924. mi.audioSampleRate = meta2.audioSampleRate;
  115925. mi.audioChannelCount = meta2.channelCount;
  115926. if (mi.hasVideo) {
  115927. if (mi.videoCodec != null) {
  115928. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115929. }
  115930. } else {
  115931. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115932. }
  115933. if (mi.isComplete()) {
  115934. this._onMediaInfo(mi);
  115935. }
  115936. } else if (aacData.packetType === 1) {
  115937. var dts = this._timestampBase + tagTimestamp;
  115938. var aacSample = { unit: aacData.data, length: aacData.data.byteLength, dts, pts: dts };
  115939. track.samples.push(aacSample);
  115940. track.length += aacData.data.length;
  115941. } else {
  115942. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Flv: Unsupported AAC data type " + aacData.packetType);
  115943. }
  115944. } else if (soundFormat === 2) {
  115945. if (!meta2.codec) {
  115946. var misc = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, true);
  115947. if (misc == void 0) {
  115948. return;
  115949. }
  115950. meta2.audioSampleRate = misc.samplingRate;
  115951. meta2.channelCount = misc.channelCount;
  115952. meta2.codec = misc.codec;
  115953. meta2.originalCodec = misc.originalCodec;
  115954. meta2.refSampleDuration = 1152 / meta2.audioSampleRate * meta2.timescale;
  115955. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed MPEG Audio Frame Header");
  115956. this._audioInitialMetadataDispatched = true;
  115957. this._onTrackMetadata("audio", meta2);
  115958. var mi = this._mediaInfo;
  115959. mi.audioCodec = meta2.codec;
  115960. mi.audioSampleRate = meta2.audioSampleRate;
  115961. mi.audioChannelCount = meta2.channelCount;
  115962. mi.audioDataRate = misc.bitRate;
  115963. if (mi.hasVideo) {
  115964. if (mi.videoCodec != null) {
  115965. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115966. }
  115967. } else {
  115968. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115969. }
  115970. if (mi.isComplete()) {
  115971. this._onMediaInfo(mi);
  115972. }
  115973. }
  115974. var data = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, false);
  115975. if (data == void 0) {
  115976. return;
  115977. }
  115978. var dts = this._timestampBase + tagTimestamp;
  115979. var mp3Sample = { unit: data, length: data.byteLength, dts, pts: dts };
  115980. track.samples.push(mp3Sample);
  115981. track.length += data.length;
  115982. }
  115983. };
  115984. FLVDemuxer2.prototype._parseAACAudioData = function(arrayBuffer, dataOffset, dataSize) {
  115985. if (dataSize <= 1) {
  115986. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AAC packet, missing AACPacketType or/and Data!");
  115987. return;
  115988. }
  115989. var result = {};
  115990. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  115991. result.packetType = array[0];
  115992. if (array[0] === 0) {
  115993. result.data = this._parseAACAudioSpecificConfig(arrayBuffer, dataOffset + 1, dataSize - 1);
  115994. } else {
  115995. result.data = array.subarray(1);
  115996. }
  115997. return result;
  115998. };
  115999. FLVDemuxer2.prototype._parseAACAudioSpecificConfig = function(arrayBuffer, dataOffset, dataSize) {
  116000. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  116001. var config = null;
  116002. var audioObjectType = 0;
  116003. var originalAudioObjectType = 0;
  116004. var samplingIndex = 0;
  116005. var extensionSamplingIndex = null;
  116006. audioObjectType = originalAudioObjectType = array[0] >>> 3;
  116007. samplingIndex = (array[0] & 7) << 1 | array[1] >>> 7;
  116008. if (samplingIndex < 0 || samplingIndex >= this._mpegSamplingRates.length) {
  116009. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid sampling frequency index!");
  116010. return;
  116011. }
  116012. var samplingFrequence = this._mpegSamplingRates[samplingIndex];
  116013. var channelConfig = (array[1] & 120) >>> 3;
  116014. if (channelConfig < 0 || channelConfig >= 8) {
  116015. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid channel configuration");
  116016. return;
  116017. }
  116018. if (audioObjectType === 5) {
  116019. extensionSamplingIndex = (array[1] & 7) << 1 | array[2] >>> 7;
  116020. (array[2] & 124) >>> 2;
  116021. }
  116022. var userAgent = self.navigator.userAgent.toLowerCase();
  116023. if (userAgent.indexOf("firefox") !== -1) {
  116024. if (samplingIndex >= 6) {
  116025. audioObjectType = 5;
  116026. config = new Array(4);
  116027. extensionSamplingIndex = samplingIndex - 3;
  116028. } else {
  116029. audioObjectType = 2;
  116030. config = new Array(2);
  116031. extensionSamplingIndex = samplingIndex;
  116032. }
  116033. } else if (userAgent.indexOf("android") !== -1) {
  116034. audioObjectType = 2;
  116035. config = new Array(2);
  116036. extensionSamplingIndex = samplingIndex;
  116037. } else {
  116038. audioObjectType = 5;
  116039. extensionSamplingIndex = samplingIndex;
  116040. config = new Array(4);
  116041. if (samplingIndex >= 6) {
  116042. extensionSamplingIndex = samplingIndex - 3;
  116043. } else if (channelConfig === 1) {
  116044. audioObjectType = 2;
  116045. config = new Array(2);
  116046. extensionSamplingIndex = samplingIndex;
  116047. }
  116048. }
  116049. config[0] = audioObjectType << 3;
  116050. config[0] |= (samplingIndex & 15) >>> 1;
  116051. config[1] = (samplingIndex & 15) << 7;
  116052. config[1] |= (channelConfig & 15) << 3;
  116053. if (audioObjectType === 5) {
  116054. config[1] |= (extensionSamplingIndex & 15) >>> 1;
  116055. config[2] = (extensionSamplingIndex & 1) << 7;
  116056. config[2] |= 2 << 2;
  116057. config[3] = 0;
  116058. }
  116059. return {
  116060. config,
  116061. samplingRate: samplingFrequence,
  116062. channelCount: channelConfig,
  116063. codec: "mp4a.40." + audioObjectType,
  116064. originalCodec: "mp4a.40." + originalAudioObjectType
  116065. };
  116066. };
  116067. FLVDemuxer2.prototype._parseMP3AudioData = function(arrayBuffer, dataOffset, dataSize, requestHeader) {
  116068. if (dataSize < 4) {
  116069. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid MP3 packet, header missing!");
  116070. return;
  116071. }
  116072. this._littleEndian;
  116073. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  116074. var result = null;
  116075. if (requestHeader) {
  116076. if (array[0] !== 255) {
  116077. return;
  116078. }
  116079. var ver = array[1] >>> 3 & 3;
  116080. var layer = (array[1] & 6) >> 1;
  116081. var bitrate_index = (array[2] & 240) >>> 4;
  116082. var sampling_freq_index = (array[2] & 12) >>> 2;
  116083. var channel_mode = array[3] >>> 6 & 3;
  116084. var channel_count = channel_mode !== 3 ? 2 : 1;
  116085. var sample_rate = 0;
  116086. var bit_rate = 0;
  116087. var codec = "mp3";
  116088. switch (ver) {
  116089. case 0:
  116090. sample_rate = this._mpegAudioV25SampleRateTable[sampling_freq_index];
  116091. break;
  116092. case 2:
  116093. sample_rate = this._mpegAudioV20SampleRateTable[sampling_freq_index];
  116094. break;
  116095. case 3:
  116096. sample_rate = this._mpegAudioV10SampleRateTable[sampling_freq_index];
  116097. break;
  116098. }
  116099. switch (layer) {
  116100. case 1:
  116101. if (bitrate_index < this._mpegAudioL3BitRateTable.length) {
  116102. bit_rate = this._mpegAudioL3BitRateTable[bitrate_index];
  116103. }
  116104. break;
  116105. case 2:
  116106. if (bitrate_index < this._mpegAudioL2BitRateTable.length) {
  116107. bit_rate = this._mpegAudioL2BitRateTable[bitrate_index];
  116108. }
  116109. break;
  116110. case 3:
  116111. if (bitrate_index < this._mpegAudioL1BitRateTable.length) {
  116112. bit_rate = this._mpegAudioL1BitRateTable[bitrate_index];
  116113. }
  116114. break;
  116115. }
  116116. result = {
  116117. bitRate: bit_rate,
  116118. samplingRate: sample_rate,
  116119. channelCount: channel_count,
  116120. codec,
  116121. originalCodec: codec
  116122. };
  116123. } else {
  116124. result = array;
  116125. }
  116126. return result;
  116127. };
  116128. FLVDemuxer2.prototype._parseVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition) {
  116129. if (dataSize <= 1) {
  116130. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid video packet, missing VideoData payload!");
  116131. return;
  116132. }
  116133. if (this._hasVideoFlagOverrided === true && this._hasVideo === false) {
  116134. return;
  116135. }
  116136. var spec = new Uint8Array(arrayBuffer, dataOffset, dataSize)[0];
  116137. var frameType = (spec & 240) >>> 4;
  116138. var codecId = spec & 15;
  116139. if (codecId !== 7) {
  116140. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + codecId);
  116141. return;
  116142. }
  116143. this._parseAVCVideoPacket(arrayBuffer, dataOffset + 1, dataSize - 1, tagTimestamp, tagPosition, frameType);
  116144. };
  116145. FLVDemuxer2.prototype._parseAVCVideoPacket = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType) {
  116146. if (dataSize < 4) {
  116147. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");
  116148. return;
  116149. }
  116150. var le = this._littleEndian;
  116151. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116152. var packetType = v.getUint8(0);
  116153. var cts_unsigned = v.getUint32(0, !le) & 16777215;
  116154. var cts = cts_unsigned << 8 >> 8;
  116155. if (packetType === 0) {
  116156. this._parseAVCDecoderConfigurationRecord(arrayBuffer, dataOffset + 4, dataSize - 4);
  116157. } else if (packetType === 1) {
  116158. this._parseAVCVideoData(arrayBuffer, dataOffset + 4, dataSize - 4, tagTimestamp, tagPosition, frameType, cts);
  116159. } else if (packetType === 2)
  116160. ;
  116161. else {
  116162. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid video packet type " + packetType);
  116163. return;
  116164. }
  116165. };
  116166. FLVDemuxer2.prototype._parseAVCDecoderConfigurationRecord = function(arrayBuffer, dataOffset, dataSize) {
  116167. if (dataSize < 7) {
  116168. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");
  116169. return;
  116170. }
  116171. var meta2 = this._videoMetadata;
  116172. var track = this._videoTrack;
  116173. var le = this._littleEndian;
  116174. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116175. if (!meta2) {
  116176. if (this._hasVideo === false && this._hasVideoFlagOverrided === false) {
  116177. this._hasVideo = true;
  116178. this._mediaInfo.hasVideo = true;
  116179. }
  116180. meta2 = this._videoMetadata = {};
  116181. meta2.type = "video";
  116182. meta2.id = track.id;
  116183. meta2.timescale = this._timescale;
  116184. meta2.duration = this._duration;
  116185. } else {
  116186. if (typeof meta2.avcc !== "undefined") {
  116187. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AVCDecoderConfigurationRecord!");
  116188. }
  116189. }
  116190. var version2 = v.getUint8(0);
  116191. var avcProfile = v.getUint8(1);
  116192. v.getUint8(2);
  116193. v.getUint8(3);
  116194. if (version2 !== 1 || avcProfile === 0) {
  116195. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord");
  116196. return;
  116197. }
  116198. this._naluLengthSize = (v.getUint8(4) & 3) + 1;
  116199. if (this._naluLengthSize !== 3 && this._naluLengthSize !== 4) {
  116200. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
  116201. return;
  116202. }
  116203. var spsCount = v.getUint8(5) & 31;
  116204. if (spsCount === 0) {
  116205. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No SPS");
  116206. return;
  116207. } else if (spsCount > 1) {
  116208. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: SPS Count = " + spsCount);
  116209. }
  116210. var offset = 6;
  116211. for (var i2 = 0; i2 < spsCount; i2++) {
  116212. var len = v.getUint16(offset, !le);
  116213. offset += 2;
  116214. if (len === 0) {
  116215. continue;
  116216. }
  116217. var sps = new Uint8Array(arrayBuffer, dataOffset + offset, len);
  116218. offset += len;
  116219. var config = _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__.default.parseSPS(sps);
  116220. if (i2 !== 0) {
  116221. continue;
  116222. }
  116223. meta2.codecWidth = config.codec_size.width;
  116224. meta2.codecHeight = config.codec_size.height;
  116225. meta2.presentWidth = config.present_size.width;
  116226. meta2.presentHeight = config.present_size.height;
  116227. meta2.profile = config.profile_string;
  116228. meta2.level = config.level_string;
  116229. meta2.bitDepth = config.bit_depth;
  116230. meta2.chromaFormat = config.chroma_format;
  116231. meta2.sarRatio = config.sar_ratio;
  116232. meta2.frameRate = config.frame_rate;
  116233. if (config.frame_rate.fixed === false || config.frame_rate.fps_num === 0 || config.frame_rate.fps_den === 0) {
  116234. meta2.frameRate = this._referenceFrameRate;
  116235. }
  116236. var fps_den = meta2.frameRate.fps_den;
  116237. var fps_num = meta2.frameRate.fps_num;
  116238. meta2.refSampleDuration = meta2.timescale * (fps_den / fps_num);
  116239. var codecArray = sps.subarray(1, 4);
  116240. var codecString = "avc1.";
  116241. for (var j = 0; j < 3; j++) {
  116242. var h2 = codecArray[j].toString(16);
  116243. if (h2.length < 2) {
  116244. h2 = "0" + h2;
  116245. }
  116246. codecString += h2;
  116247. }
  116248. meta2.codec = codecString;
  116249. var mi = this._mediaInfo;
  116250. mi.width = meta2.codecWidth;
  116251. mi.height = meta2.codecHeight;
  116252. mi.fps = meta2.frameRate.fps;
  116253. mi.profile = meta2.profile;
  116254. mi.level = meta2.level;
  116255. mi.refFrames = config.ref_frames;
  116256. mi.chromaFormat = config.chroma_format_string;
  116257. mi.sarNum = meta2.sarRatio.width;
  116258. mi.sarDen = meta2.sarRatio.height;
  116259. mi.videoCodec = codecString;
  116260. if (mi.hasAudio) {
  116261. if (mi.audioCodec != null) {
  116262. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  116263. }
  116264. } else {
  116265. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + '"';
  116266. }
  116267. if (mi.isComplete()) {
  116268. this._onMediaInfo(mi);
  116269. }
  116270. }
  116271. var ppsCount = v.getUint8(offset);
  116272. if (ppsCount === 0) {
  116273. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No PPS");
  116274. return;
  116275. } else if (ppsCount > 1) {
  116276. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: PPS Count = " + ppsCount);
  116277. }
  116278. offset++;
  116279. for (var i2 = 0; i2 < ppsCount; i2++) {
  116280. var len = v.getUint16(offset, !le);
  116281. offset += 2;
  116282. if (len === 0) {
  116283. continue;
  116284. }
  116285. offset += len;
  116286. }
  116287. meta2.avcc = new Uint8Array(dataSize);
  116288. meta2.avcc.set(new Uint8Array(arrayBuffer, dataOffset, dataSize), 0);
  116289. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AVCDecoderConfigurationRecord");
  116290. if (this._isInitialMetadataDispatched()) {
  116291. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  116292. this._onDataAvailable(this._audioTrack, this._videoTrack);
  116293. }
  116294. } else {
  116295. this._videoInitialMetadataDispatched = true;
  116296. }
  116297. this._dispatch = false;
  116298. this._onTrackMetadata("video", meta2);
  116299. };
  116300. FLVDemuxer2.prototype._parseAVCVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType, cts) {
  116301. var le = this._littleEndian;
  116302. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116303. var units = [], length = 0;
  116304. var offset = 0;
  116305. var lengthSize = this._naluLengthSize;
  116306. var dts = this._timestampBase + tagTimestamp;
  116307. var keyframe = frameType === 1;
  116308. while (offset < dataSize) {
  116309. if (offset + 4 >= dataSize) {
  116310. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalu near timestamp " + dts + ", offset = " + offset + ", dataSize = " + dataSize);
  116311. break;
  116312. }
  116313. var naluSize = v.getUint32(offset, !le);
  116314. if (lengthSize === 3) {
  116315. naluSize >>>= 8;
  116316. }
  116317. if (naluSize > dataSize - lengthSize) {
  116318. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalus near timestamp " + dts + ", NaluSize > DataSize!");
  116319. return;
  116320. }
  116321. var unitType = v.getUint8(offset + lengthSize) & 31;
  116322. if (unitType === 5) {
  116323. keyframe = true;
  116324. }
  116325. var data = new Uint8Array(arrayBuffer, dataOffset + offset, lengthSize + naluSize);
  116326. var unit = { type: unitType, data };
  116327. units.push(unit);
  116328. length += data.byteLength;
  116329. offset += lengthSize + naluSize;
  116330. }
  116331. if (units.length) {
  116332. var track = this._videoTrack;
  116333. var avcSample = {
  116334. units,
  116335. length,
  116336. isKeyframe: keyframe,
  116337. dts,
  116338. cts,
  116339. pts: dts + cts
  116340. };
  116341. if (keyframe) {
  116342. avcSample.fileposition = tagPosition;
  116343. }
  116344. track.samples.push(avcSample);
  116345. track.length += length;
  116346. }
  116347. };
  116348. return FLVDemuxer2;
  116349. }();
  116350. __webpack_exports__2["default"] = FLVDemuxer;
  116351. },
  116352. "./src/demux/sps-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116353. __webpack_require__2.r(__webpack_exports__2);
  116354. var _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/demux/exp-golomb.js");
  116355. var SPSParser = function() {
  116356. function SPSParser2() {
  116357. }
  116358. SPSParser2._ebsp2rbsp = function(uint8array) {
  116359. var src = uint8array;
  116360. var src_length = src.byteLength;
  116361. var dst = new Uint8Array(src_length);
  116362. var dst_idx = 0;
  116363. for (var i2 = 0; i2 < src_length; i2++) {
  116364. if (i2 >= 2) {
  116365. if (src[i2] === 3 && src[i2 - 1] === 0 && src[i2 - 2] === 0) {
  116366. continue;
  116367. }
  116368. }
  116369. dst[dst_idx] = src[i2];
  116370. dst_idx++;
  116371. }
  116372. return new Uint8Array(dst.buffer, 0, dst_idx);
  116373. };
  116374. SPSParser2.parseSPS = function(uint8array) {
  116375. var rbsp = SPSParser2._ebsp2rbsp(uint8array);
  116376. var gb = new _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__.default(rbsp);
  116377. gb.readByte();
  116378. var profile_idc = gb.readByte();
  116379. gb.readByte();
  116380. var level_idc = gb.readByte();
  116381. gb.readUEG();
  116382. var profile_string = SPSParser2.getProfileString(profile_idc);
  116383. var level_string = SPSParser2.getLevelString(level_idc);
  116384. var chroma_format_idc = 1;
  116385. var chroma_format = 420;
  116386. var chroma_format_table = [0, 420, 422, 444];
  116387. var bit_depth = 8;
  116388. if (profile_idc === 100 || profile_idc === 110 || profile_idc === 122 || profile_idc === 244 || profile_idc === 44 || profile_idc === 83 || profile_idc === 86 || profile_idc === 118 || profile_idc === 128 || profile_idc === 138 || profile_idc === 144) {
  116389. chroma_format_idc = gb.readUEG();
  116390. if (chroma_format_idc === 3) {
  116391. gb.readBits(1);
  116392. }
  116393. if (chroma_format_idc <= 3) {
  116394. chroma_format = chroma_format_table[chroma_format_idc];
  116395. }
  116396. bit_depth = gb.readUEG() + 8;
  116397. gb.readUEG();
  116398. gb.readBits(1);
  116399. if (gb.readBool()) {
  116400. var scaling_list_count = chroma_format_idc !== 3 ? 8 : 12;
  116401. for (var i2 = 0; i2 < scaling_list_count; i2++) {
  116402. if (gb.readBool()) {
  116403. if (i2 < 6) {
  116404. SPSParser2._skipScalingList(gb, 16);
  116405. } else {
  116406. SPSParser2._skipScalingList(gb, 64);
  116407. }
  116408. }
  116409. }
  116410. }
  116411. }
  116412. gb.readUEG();
  116413. var pic_order_cnt_type = gb.readUEG();
  116414. if (pic_order_cnt_type === 0) {
  116415. gb.readUEG();
  116416. } else if (pic_order_cnt_type === 1) {
  116417. gb.readBits(1);
  116418. gb.readSEG();
  116419. gb.readSEG();
  116420. var num_ref_frames_in_pic_order_cnt_cycle = gb.readUEG();
  116421. for (var i2 = 0; i2 < num_ref_frames_in_pic_order_cnt_cycle; i2++) {
  116422. gb.readSEG();
  116423. }
  116424. }
  116425. var ref_frames = gb.readUEG();
  116426. gb.readBits(1);
  116427. var pic_width_in_mbs_minus1 = gb.readUEG();
  116428. var pic_height_in_map_units_minus1 = gb.readUEG();
  116429. var frame_mbs_only_flag = gb.readBits(1);
  116430. if (frame_mbs_only_flag === 0) {
  116431. gb.readBits(1);
  116432. }
  116433. gb.readBits(1);
  116434. var frame_crop_left_offset = 0;
  116435. var frame_crop_right_offset = 0;
  116436. var frame_crop_top_offset = 0;
  116437. var frame_crop_bottom_offset = 0;
  116438. var frame_cropping_flag = gb.readBool();
  116439. if (frame_cropping_flag) {
  116440. frame_crop_left_offset = gb.readUEG();
  116441. frame_crop_right_offset = gb.readUEG();
  116442. frame_crop_top_offset = gb.readUEG();
  116443. frame_crop_bottom_offset = gb.readUEG();
  116444. }
  116445. var sar_width = 1, sar_height = 1;
  116446. var fps = 0, fps_fixed = true, fps_num = 0, fps_den = 0;
  116447. var vui_parameters_present_flag = gb.readBool();
  116448. if (vui_parameters_present_flag) {
  116449. if (gb.readBool()) {
  116450. var aspect_ratio_idc = gb.readByte();
  116451. var sar_w_table = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2];
  116452. var sar_h_table = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
  116453. if (aspect_ratio_idc > 0 && aspect_ratio_idc < 16) {
  116454. sar_width = sar_w_table[aspect_ratio_idc - 1];
  116455. sar_height = sar_h_table[aspect_ratio_idc - 1];
  116456. } else if (aspect_ratio_idc === 255) {
  116457. sar_width = gb.readByte() << 8 | gb.readByte();
  116458. sar_height = gb.readByte() << 8 | gb.readByte();
  116459. }
  116460. }
  116461. if (gb.readBool()) {
  116462. gb.readBool();
  116463. }
  116464. if (gb.readBool()) {
  116465. gb.readBits(4);
  116466. if (gb.readBool()) {
  116467. gb.readBits(24);
  116468. }
  116469. }
  116470. if (gb.readBool()) {
  116471. gb.readUEG();
  116472. gb.readUEG();
  116473. }
  116474. if (gb.readBool()) {
  116475. var num_units_in_tick = gb.readBits(32);
  116476. var time_scale = gb.readBits(32);
  116477. fps_fixed = gb.readBool();
  116478. fps_num = time_scale;
  116479. fps_den = num_units_in_tick * 2;
  116480. fps = fps_num / fps_den;
  116481. }
  116482. }
  116483. var sarScale = 1;
  116484. if (sar_width !== 1 || sar_height !== 1) {
  116485. sarScale = sar_width / sar_height;
  116486. }
  116487. var crop_unit_x = 0, crop_unit_y = 0;
  116488. if (chroma_format_idc === 0) {
  116489. crop_unit_x = 1;
  116490. crop_unit_y = 2 - frame_mbs_only_flag;
  116491. } else {
  116492. var sub_wc = chroma_format_idc === 3 ? 1 : 2;
  116493. var sub_hc = chroma_format_idc === 1 ? 2 : 1;
  116494. crop_unit_x = sub_wc;
  116495. crop_unit_y = sub_hc * (2 - frame_mbs_only_flag);
  116496. }
  116497. var codec_width = (pic_width_in_mbs_minus1 + 1) * 16;
  116498. var codec_height = (2 - frame_mbs_only_flag) * ((pic_height_in_map_units_minus1 + 1) * 16);
  116499. codec_width -= (frame_crop_left_offset + frame_crop_right_offset) * crop_unit_x;
  116500. codec_height -= (frame_crop_top_offset + frame_crop_bottom_offset) * crop_unit_y;
  116501. var present_width = Math.ceil(codec_width * sarScale);
  116502. gb.destroy();
  116503. gb = null;
  116504. return {
  116505. profile_string,
  116506. level_string,
  116507. bit_depth,
  116508. ref_frames,
  116509. chroma_format,
  116510. chroma_format_string: SPSParser2.getChromaFormatString(chroma_format),
  116511. frame_rate: {
  116512. fixed: fps_fixed,
  116513. fps,
  116514. fps_den,
  116515. fps_num
  116516. },
  116517. sar_ratio: {
  116518. width: sar_width,
  116519. height: sar_height
  116520. },
  116521. codec_size: {
  116522. width: codec_width,
  116523. height: codec_height
  116524. },
  116525. present_size: {
  116526. width: present_width,
  116527. height: codec_height
  116528. }
  116529. };
  116530. };
  116531. SPSParser2._skipScalingList = function(gb, count) {
  116532. var last_scale = 8, next_scale = 8;
  116533. var delta_scale = 0;
  116534. for (var i2 = 0; i2 < count; i2++) {
  116535. if (next_scale !== 0) {
  116536. delta_scale = gb.readSEG();
  116537. next_scale = (last_scale + delta_scale + 256) % 256;
  116538. }
  116539. last_scale = next_scale === 0 ? last_scale : next_scale;
  116540. }
  116541. };
  116542. SPSParser2.getProfileString = function(profile_idc) {
  116543. switch (profile_idc) {
  116544. case 66:
  116545. return "Baseline";
  116546. case 77:
  116547. return "Main";
  116548. case 88:
  116549. return "Extended";
  116550. case 100:
  116551. return "High";
  116552. case 110:
  116553. return "High10";
  116554. case 122:
  116555. return "High422";
  116556. case 244:
  116557. return "High444";
  116558. default:
  116559. return "Unknown";
  116560. }
  116561. };
  116562. SPSParser2.getLevelString = function(level_idc) {
  116563. return (level_idc / 10).toFixed(1);
  116564. };
  116565. SPSParser2.getChromaFormatString = function(chroma) {
  116566. switch (chroma) {
  116567. case 420:
  116568. return "4:2:0";
  116569. case 422:
  116570. return "4:2:2";
  116571. case 444:
  116572. return "4:4:4";
  116573. default:
  116574. return "Unknown";
  116575. }
  116576. };
  116577. return SPSParser2;
  116578. }();
  116579. __webpack_exports__2["default"] = SPSParser;
  116580. },
  116581. "./src/flv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116582. __webpack_require__2.r(__webpack_exports__2);
  116583. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/polyfill.js");
  116584. var _core_features_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/core/features.js");
  116585. var _io_loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116586. var _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/flv-player.js");
  116587. var _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/player/native-player.js");
  116588. var _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/player/player-events.js");
  116589. var _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/player/player-errors.js");
  116590. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/utils/logging-control.js");
  116591. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/utils/exception.js");
  116592. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__.default.install();
  116593. function createPlayer(mediaDataSource, optionalConfig) {
  116594. var mds = mediaDataSource;
  116595. if (mds == null || typeof mds !== "object") {
  116596. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must be an javascript object!");
  116597. }
  116598. if (!mds.hasOwnProperty("type")) {
  116599. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");
  116600. }
  116601. switch (mds.type) {
  116602. case "flv":
  116603. return new _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default(mds, optionalConfig);
  116604. default:
  116605. return new _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default(mds, optionalConfig);
  116606. }
  116607. }
  116608. function isSupported() {
  116609. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.supportMSEH264Playback();
  116610. }
  116611. function getFeatureList() {
  116612. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.getFeatureList();
  116613. }
  116614. var flvjs2 = {};
  116615. flvjs2.createPlayer = createPlayer;
  116616. flvjs2.isSupported = isSupported;
  116617. flvjs2.getFeatureList = getFeatureList;
  116618. flvjs2.BaseLoader = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader;
  116619. flvjs2.LoaderStatus = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus;
  116620. flvjs2.LoaderErrors = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors;
  116621. flvjs2.Events = _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__.default;
  116622. flvjs2.ErrorTypes = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorTypes;
  116623. flvjs2.ErrorDetails = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorDetails;
  116624. flvjs2.FlvPlayer = _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default;
  116625. flvjs2.NativePlayer = _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default;
  116626. flvjs2.LoggingControl = _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__.default;
  116627. Object.defineProperty(flvjs2, "version", {
  116628. enumerable: true,
  116629. get: function() {
  116630. return "1.6.2";
  116631. }
  116632. });
  116633. __webpack_exports__2["default"] = flvjs2;
  116634. },
  116635. "./src/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  116636. module3.exports = __webpack_require__2("./src/flv.js").default;
  116637. },
  116638. "./src/io/fetch-stream-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116639. __webpack_require__2.r(__webpack_exports__2);
  116640. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/browser.js");
  116641. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  116642. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  116643. var __extends = function() {
  116644. var extendStatics = function(d2, b) {
  116645. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  116646. d3.__proto__ = b2;
  116647. } || function(d3, b2) {
  116648. for (var p in b2)
  116649. if (Object.prototype.hasOwnProperty.call(b2, p))
  116650. d3[p] = b2[p];
  116651. };
  116652. return extendStatics(d2, b);
  116653. };
  116654. return function(d2, b) {
  116655. if (typeof b !== "function" && b !== null)
  116656. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  116657. extendStatics(d2, b);
  116658. function __() {
  116659. this.constructor = d2;
  116660. }
  116661. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116662. };
  116663. }();
  116664. var FetchStreamLoader = function(_super) {
  116665. __extends(FetchStreamLoader2, _super);
  116666. function FetchStreamLoader2(seekHandler, config) {
  116667. var _this = _super.call(this, "fetch-stream-loader") || this;
  116668. _this.TAG = "FetchStreamLoader";
  116669. _this._seekHandler = seekHandler;
  116670. _this._config = config;
  116671. _this._needStash = true;
  116672. _this._requestAbort = false;
  116673. _this._contentLength = null;
  116674. _this._receivedLength = 0;
  116675. return _this;
  116676. }
  116677. FetchStreamLoader2.isSupported = function() {
  116678. try {
  116679. var isWorkWellEdge = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.version.minor >= 15048;
  116680. var browserNotBlacklisted = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge ? isWorkWellEdge : true;
  116681. return self.fetch && self.ReadableStream && browserNotBlacklisted;
  116682. } catch (e) {
  116683. return false;
  116684. }
  116685. };
  116686. FetchStreamLoader2.prototype.destroy = function() {
  116687. if (this.isWorking()) {
  116688. this.abort();
  116689. }
  116690. _super.prototype.destroy.call(this);
  116691. };
  116692. FetchStreamLoader2.prototype.open = function(dataSource, range3) {
  116693. var _this = this;
  116694. this._dataSource = dataSource;
  116695. this._range = range3;
  116696. var sourceURL = dataSource.url;
  116697. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  116698. sourceURL = dataSource.redirectedURL;
  116699. }
  116700. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  116701. var headers = new self.Headers();
  116702. if (typeof seekConfig.headers === "object") {
  116703. var configHeaders = seekConfig.headers;
  116704. for (var key in configHeaders) {
  116705. if (configHeaders.hasOwnProperty(key)) {
  116706. headers.append(key, configHeaders[key]);
  116707. }
  116708. }
  116709. }
  116710. var params = {
  116711. method: "GET",
  116712. headers,
  116713. mode: "cors",
  116714. cache: "default",
  116715. referrerPolicy: "no-referrer-when-downgrade"
  116716. };
  116717. if (typeof this._config.headers === "object") {
  116718. for (var key in this._config.headers) {
  116719. headers.append(key, this._config.headers[key]);
  116720. }
  116721. }
  116722. if (dataSource.cors === false) {
  116723. params.mode = "same-origin";
  116724. }
  116725. if (dataSource.withCredentials) {
  116726. params.credentials = "include";
  116727. }
  116728. if (dataSource.referrerPolicy) {
  116729. params.referrerPolicy = dataSource.referrerPolicy;
  116730. }
  116731. if (self.AbortController) {
  116732. this._abortController = new self.AbortController();
  116733. params.signal = this._abortController.signal;
  116734. }
  116735. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  116736. self.fetch(seekConfig.url, params).then(function(res) {
  116737. if (_this._requestAbort) {
  116738. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kIdle;
  116739. res.body.cancel();
  116740. return;
  116741. }
  116742. if (res.ok && (res.status >= 200 && res.status <= 299)) {
  116743. if (res.url !== seekConfig.url) {
  116744. if (_this._onURLRedirect) {
  116745. var redirectedURL = _this._seekHandler.removeURLParameters(res.url);
  116746. _this._onURLRedirect(redirectedURL);
  116747. }
  116748. }
  116749. var lengthHeader = res.headers.get("Content-Length");
  116750. if (lengthHeader != null) {
  116751. _this._contentLength = parseInt(lengthHeader);
  116752. if (_this._contentLength !== 0) {
  116753. if (_this._onContentLengthKnown) {
  116754. _this._onContentLengthKnown(_this._contentLength);
  116755. }
  116756. }
  116757. }
  116758. return _this._pump.call(_this, res.body.getReader());
  116759. } else {
  116760. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116761. if (_this._onError) {
  116762. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: res.status, msg: res.statusText });
  116763. } else {
  116764. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("FetchStreamLoader: Http code invalid, " + res.status + " " + res.statusText);
  116765. }
  116766. }
  116767. }).catch(function(e) {
  116768. if (_this._abortController && _this._abortController.signal.aborted) {
  116769. return;
  116770. }
  116771. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116772. if (_this._onError) {
  116773. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION, { code: -1, msg: e.message });
  116774. } else {
  116775. throw e;
  116776. }
  116777. });
  116778. };
  116779. FetchStreamLoader2.prototype.abort = function() {
  116780. this._requestAbort = true;
  116781. if (this._status !== _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering || !_utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.chrome) {
  116782. if (this._abortController) {
  116783. try {
  116784. this._abortController.abort();
  116785. } catch (e) {
  116786. }
  116787. }
  116788. }
  116789. };
  116790. FetchStreamLoader2.prototype._pump = function(reader) {
  116791. var _this = this;
  116792. return reader.read().then(function(result) {
  116793. if (result.done) {
  116794. if (_this._contentLength !== null && _this._receivedLength < _this._contentLength) {
  116795. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116796. var type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116797. var info = { code: -1, msg: "Fetch stream meet Early-EOF" };
  116798. if (_this._onError) {
  116799. _this._onError(type2, info);
  116800. } else {
  116801. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116802. }
  116803. } else {
  116804. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116805. if (_this._onComplete) {
  116806. _this._onComplete(_this._range.from, _this._range.from + _this._receivedLength - 1);
  116807. }
  116808. }
  116809. } else {
  116810. if (_this._abortController && _this._abortController.signal.aborted) {
  116811. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116812. return;
  116813. } else if (_this._requestAbort === true) {
  116814. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116815. return reader.cancel();
  116816. }
  116817. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  116818. var chunk = result.value.buffer;
  116819. var byteStart = _this._range.from + _this._receivedLength;
  116820. _this._receivedLength += chunk.byteLength;
  116821. if (_this._onDataArrival) {
  116822. _this._onDataArrival(chunk, byteStart, _this._receivedLength);
  116823. }
  116824. _this._pump(reader);
  116825. }
  116826. }).catch(function(e) {
  116827. if (_this._abortController && _this._abortController.signal.aborted) {
  116828. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116829. return;
  116830. }
  116831. if (e.code === 11 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge) {
  116832. return;
  116833. }
  116834. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116835. var type2 = 0;
  116836. var info = null;
  116837. if ((e.code === 19 || e.message === "network error") && (_this._contentLength === null || _this._contentLength !== null && _this._receivedLength < _this._contentLength)) {
  116838. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116839. info = { code: e.code, msg: "Fetch stream meet Early-EOF" };
  116840. } else {
  116841. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  116842. info = { code: e.code, msg: e.message };
  116843. }
  116844. if (_this._onError) {
  116845. _this._onError(type2, info);
  116846. } else {
  116847. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116848. }
  116849. });
  116850. };
  116851. return FetchStreamLoader2;
  116852. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  116853. __webpack_exports__2["default"] = FetchStreamLoader;
  116854. },
  116855. "./src/io/io-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116856. __webpack_require__2.r(__webpack_exports__2);
  116857. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  116858. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  116859. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116860. var _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/io/fetch-stream-loader.js");
  116861. var _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/io/xhr-moz-chunked-loader.js");
  116862. var _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/io/xhr-range-loader.js");
  116863. var _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/io/websocket-loader.js");
  116864. var _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/range-seek-handler.js");
  116865. var _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/io/param-seek-handler.js");
  116866. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/utils/exception.js");
  116867. var IOController = function() {
  116868. function IOController2(dataSource, config, extraData) {
  116869. this.TAG = "IOController";
  116870. this._config = config;
  116871. this._extraData = extraData;
  116872. this._stashInitialSize = 1024 * 384;
  116873. if (config.stashInitialSize != void 0 && config.stashInitialSize > 0) {
  116874. this._stashInitialSize = config.stashInitialSize;
  116875. }
  116876. this._stashUsed = 0;
  116877. this._stashSize = this._stashInitialSize;
  116878. this._bufferSize = 1024 * 1024 * 3;
  116879. this._stashBuffer = new ArrayBuffer(this._bufferSize);
  116880. this._stashByteStart = 0;
  116881. this._enableStash = true;
  116882. if (config.enableStashBuffer === false) {
  116883. this._enableStash = false;
  116884. }
  116885. this._loader = null;
  116886. this._loaderClass = null;
  116887. this._seekHandler = null;
  116888. this._dataSource = dataSource;
  116889. this._isWebSocketURL = /wss?:\/\/(.+?)/.test(dataSource.url);
  116890. this._refTotalLength = dataSource.filesize ? dataSource.filesize : null;
  116891. this._totalLength = this._refTotalLength;
  116892. this._fullRequestFlag = false;
  116893. this._currentRange = null;
  116894. this._redirectedURL = null;
  116895. this._speedNormalized = 0;
  116896. this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  116897. this._speedNormalizeList = [64, 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096];
  116898. this._isEarlyEofReconnecting = false;
  116899. this._paused = false;
  116900. this._resumeFrom = 0;
  116901. this._onDataArrival = null;
  116902. this._onSeeked = null;
  116903. this._onError = null;
  116904. this._onComplete = null;
  116905. this._onRedirect = null;
  116906. this._onRecoveredEarlyEof = null;
  116907. this._selectSeekHandler();
  116908. this._selectLoader();
  116909. this._createLoader();
  116910. }
  116911. IOController2.prototype.destroy = function() {
  116912. if (this._loader.isWorking()) {
  116913. this._loader.abort();
  116914. }
  116915. this._loader.destroy();
  116916. this._loader = null;
  116917. this._loaderClass = null;
  116918. this._dataSource = null;
  116919. this._stashBuffer = null;
  116920. this._stashUsed = this._stashSize = this._bufferSize = this._stashByteStart = 0;
  116921. this._currentRange = null;
  116922. this._speedSampler = null;
  116923. this._isEarlyEofReconnecting = false;
  116924. this._onDataArrival = null;
  116925. this._onSeeked = null;
  116926. this._onError = null;
  116927. this._onComplete = null;
  116928. this._onRedirect = null;
  116929. this._onRecoveredEarlyEof = null;
  116930. this._extraData = null;
  116931. };
  116932. IOController2.prototype.isWorking = function() {
  116933. return this._loader && this._loader.isWorking() && !this._paused;
  116934. };
  116935. IOController2.prototype.isPaused = function() {
  116936. return this._paused;
  116937. };
  116938. Object.defineProperty(IOController2.prototype, "status", {
  116939. get: function() {
  116940. return this._loader.status;
  116941. },
  116942. enumerable: false,
  116943. configurable: true
  116944. });
  116945. Object.defineProperty(IOController2.prototype, "extraData", {
  116946. get: function() {
  116947. return this._extraData;
  116948. },
  116949. set: function(data) {
  116950. this._extraData = data;
  116951. },
  116952. enumerable: false,
  116953. configurable: true
  116954. });
  116955. Object.defineProperty(IOController2.prototype, "onDataArrival", {
  116956. get: function() {
  116957. return this._onDataArrival;
  116958. },
  116959. set: function(callback2) {
  116960. this._onDataArrival = callback2;
  116961. },
  116962. enumerable: false,
  116963. configurable: true
  116964. });
  116965. Object.defineProperty(IOController2.prototype, "onSeeked", {
  116966. get: function() {
  116967. return this._onSeeked;
  116968. },
  116969. set: function(callback2) {
  116970. this._onSeeked = callback2;
  116971. },
  116972. enumerable: false,
  116973. configurable: true
  116974. });
  116975. Object.defineProperty(IOController2.prototype, "onError", {
  116976. get: function() {
  116977. return this._onError;
  116978. },
  116979. set: function(callback2) {
  116980. this._onError = callback2;
  116981. },
  116982. enumerable: false,
  116983. configurable: true
  116984. });
  116985. Object.defineProperty(IOController2.prototype, "onComplete", {
  116986. get: function() {
  116987. return this._onComplete;
  116988. },
  116989. set: function(callback2) {
  116990. this._onComplete = callback2;
  116991. },
  116992. enumerable: false,
  116993. configurable: true
  116994. });
  116995. Object.defineProperty(IOController2.prototype, "onRedirect", {
  116996. get: function() {
  116997. return this._onRedirect;
  116998. },
  116999. set: function(callback2) {
  117000. this._onRedirect = callback2;
  117001. },
  117002. enumerable: false,
  117003. configurable: true
  117004. });
  117005. Object.defineProperty(IOController2.prototype, "onRecoveredEarlyEof", {
  117006. get: function() {
  117007. return this._onRecoveredEarlyEof;
  117008. },
  117009. set: function(callback2) {
  117010. this._onRecoveredEarlyEof = callback2;
  117011. },
  117012. enumerable: false,
  117013. configurable: true
  117014. });
  117015. Object.defineProperty(IOController2.prototype, "currentURL", {
  117016. get: function() {
  117017. return this._dataSource.url;
  117018. },
  117019. enumerable: false,
  117020. configurable: true
  117021. });
  117022. Object.defineProperty(IOController2.prototype, "hasRedirect", {
  117023. get: function() {
  117024. return this._redirectedURL != null || this._dataSource.redirectedURL != void 0;
  117025. },
  117026. enumerable: false,
  117027. configurable: true
  117028. });
  117029. Object.defineProperty(IOController2.prototype, "currentRedirectedURL", {
  117030. get: function() {
  117031. return this._redirectedURL || this._dataSource.redirectedURL;
  117032. },
  117033. enumerable: false,
  117034. configurable: true
  117035. });
  117036. Object.defineProperty(IOController2.prototype, "currentSpeed", {
  117037. get: function() {
  117038. if (this._loaderClass === _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default) {
  117039. return this._loader.currentSpeed;
  117040. }
  117041. return this._speedSampler.lastSecondKBps;
  117042. },
  117043. enumerable: false,
  117044. configurable: true
  117045. });
  117046. Object.defineProperty(IOController2.prototype, "loaderType", {
  117047. get: function() {
  117048. return this._loader.type;
  117049. },
  117050. enumerable: false,
  117051. configurable: true
  117052. });
  117053. IOController2.prototype._selectSeekHandler = function() {
  117054. var config = this._config;
  117055. if (config.seekType === "range") {
  117056. this._seekHandler = new _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__.default(this._config.rangeLoadZeroStart);
  117057. } else if (config.seekType === "param") {
  117058. var paramStart = config.seekParamStart || "bstart";
  117059. var paramEnd = config.seekParamEnd || "bend";
  117060. this._seekHandler = new _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__.default(paramStart, paramEnd);
  117061. } else if (config.seekType === "custom") {
  117062. if (typeof config.customSeekHandler !== "function") {
  117063. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");
  117064. }
  117065. this._seekHandler = new config.customSeekHandler();
  117066. } else {
  117067. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Invalid seekType in config: " + config.seekType);
  117068. }
  117069. };
  117070. IOController2.prototype._selectLoader = function() {
  117071. if (this._config.customLoader != null) {
  117072. this._loaderClass = this._config.customLoader;
  117073. } else if (this._isWebSocketURL) {
  117074. this._loaderClass = _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__.default;
  117075. } else if (_fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default.isSupported()) {
  117076. this._loaderClass = _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default;
  117077. } else if (_xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default.isSupported()) {
  117078. this._loaderClass = _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default;
  117079. } else if (_xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default.isSupported()) {
  117080. this._loaderClass = _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default;
  117081. } else {
  117082. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");
  117083. }
  117084. };
  117085. IOController2.prototype._createLoader = function() {
  117086. this._loader = new this._loaderClass(this._seekHandler, this._config);
  117087. if (this._loader.needStashBuffer === false) {
  117088. this._enableStash = false;
  117089. }
  117090. this._loader.onContentLengthKnown = this._onContentLengthKnown.bind(this);
  117091. this._loader.onURLRedirect = this._onURLRedirect.bind(this);
  117092. this._loader.onDataArrival = this._onLoaderChunkArrival.bind(this);
  117093. this._loader.onComplete = this._onLoaderComplete.bind(this);
  117094. this._loader.onError = this._onLoaderError.bind(this);
  117095. };
  117096. IOController2.prototype.open = function(optionalFrom) {
  117097. this._currentRange = { from: 0, to: -1 };
  117098. if (optionalFrom) {
  117099. this._currentRange.from = optionalFrom;
  117100. }
  117101. this._speedSampler.reset();
  117102. if (!optionalFrom) {
  117103. this._fullRequestFlag = true;
  117104. }
  117105. this._loader.open(this._dataSource, Object.assign({}, this._currentRange));
  117106. };
  117107. IOController2.prototype.abort = function() {
  117108. this._loader.abort();
  117109. if (this._paused) {
  117110. this._paused = false;
  117111. this._resumeFrom = 0;
  117112. }
  117113. };
  117114. IOController2.prototype.pause = function() {
  117115. if (this.isWorking()) {
  117116. this._loader.abort();
  117117. if (this._stashUsed !== 0) {
  117118. this._resumeFrom = this._stashByteStart;
  117119. this._currentRange.to = this._stashByteStart - 1;
  117120. } else {
  117121. this._resumeFrom = this._currentRange.to + 1;
  117122. }
  117123. this._stashUsed = 0;
  117124. this._stashByteStart = 0;
  117125. this._paused = true;
  117126. }
  117127. };
  117128. IOController2.prototype.resume = function() {
  117129. if (this._paused) {
  117130. this._paused = false;
  117131. var bytes = this._resumeFrom;
  117132. this._resumeFrom = 0;
  117133. this._internalSeek(bytes, true);
  117134. }
  117135. };
  117136. IOController2.prototype.seek = function(bytes) {
  117137. this._paused = false;
  117138. this._stashUsed = 0;
  117139. this._stashByteStart = 0;
  117140. this._internalSeek(bytes, true);
  117141. };
  117142. IOController2.prototype._internalSeek = function(bytes, dropUnconsumed) {
  117143. if (this._loader.isWorking()) {
  117144. this._loader.abort();
  117145. }
  117146. this._flushStashBuffer(dropUnconsumed);
  117147. this._loader.destroy();
  117148. this._loader = null;
  117149. var requestRange = { from: bytes, to: -1 };
  117150. this._currentRange = { from: requestRange.from, to: -1 };
  117151. this._speedSampler.reset();
  117152. this._stashSize = this._stashInitialSize;
  117153. this._createLoader();
  117154. this._loader.open(this._dataSource, requestRange);
  117155. if (this._onSeeked) {
  117156. this._onSeeked();
  117157. }
  117158. };
  117159. IOController2.prototype.updateUrl = function(url) {
  117160. if (!url || typeof url !== "string" || url.length === 0) {
  117161. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Url must be a non-empty string!");
  117162. }
  117163. this._dataSource.url = url;
  117164. };
  117165. IOController2.prototype._expandBuffer = function(expectedBytes) {
  117166. var bufferNewSize = this._stashSize;
  117167. while (bufferNewSize + 1024 * 1024 * 1 < expectedBytes) {
  117168. bufferNewSize *= 2;
  117169. }
  117170. bufferNewSize += 1024 * 1024 * 1;
  117171. if (bufferNewSize === this._bufferSize) {
  117172. return;
  117173. }
  117174. var newBuffer = new ArrayBuffer(bufferNewSize);
  117175. if (this._stashUsed > 0) {
  117176. var stashOldArray = new Uint8Array(this._stashBuffer, 0, this._stashUsed);
  117177. var stashNewArray = new Uint8Array(newBuffer, 0, bufferNewSize);
  117178. stashNewArray.set(stashOldArray, 0);
  117179. }
  117180. this._stashBuffer = newBuffer;
  117181. this._bufferSize = bufferNewSize;
  117182. };
  117183. IOController2.prototype._normalizeSpeed = function(input) {
  117184. var list = this._speedNormalizeList;
  117185. var last = list.length - 1;
  117186. var mid = 0;
  117187. var lbound = 0;
  117188. var ubound = last;
  117189. if (input < list[0]) {
  117190. return list[0];
  117191. }
  117192. while (lbound <= ubound) {
  117193. mid = lbound + Math.floor((ubound - lbound) / 2);
  117194. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  117195. return list[mid];
  117196. } else if (list[mid] < input) {
  117197. lbound = mid + 1;
  117198. } else {
  117199. ubound = mid - 1;
  117200. }
  117201. }
  117202. };
  117203. IOController2.prototype._adjustStashSize = function(normalized) {
  117204. var stashSizeKB = 0;
  117205. if (this._config.isLive) {
  117206. stashSizeKB = normalized;
  117207. } else {
  117208. if (normalized < 512) {
  117209. stashSizeKB = normalized;
  117210. } else if (normalized >= 512 && normalized <= 1024) {
  117211. stashSizeKB = Math.floor(normalized * 1.5);
  117212. } else {
  117213. stashSizeKB = normalized * 2;
  117214. }
  117215. }
  117216. if (stashSizeKB > 8192) {
  117217. stashSizeKB = 8192;
  117218. }
  117219. var bufferSize = stashSizeKB * 1024 + 1024 * 1024 * 1;
  117220. if (this._bufferSize < bufferSize) {
  117221. this._expandBuffer(bufferSize);
  117222. }
  117223. this._stashSize = stashSizeKB * 1024;
  117224. };
  117225. IOController2.prototype._dispatchChunks = function(chunks, byteStart) {
  117226. this._currentRange.to = byteStart + chunks.byteLength - 1;
  117227. return this._onDataArrival(chunks, byteStart);
  117228. };
  117229. IOController2.prototype._onURLRedirect = function(redirectedURL) {
  117230. this._redirectedURL = redirectedURL;
  117231. if (this._onRedirect) {
  117232. this._onRedirect(redirectedURL);
  117233. }
  117234. };
  117235. IOController2.prototype._onContentLengthKnown = function(contentLength) {
  117236. if (contentLength && this._fullRequestFlag) {
  117237. this._totalLength = contentLength;
  117238. this._fullRequestFlag = false;
  117239. }
  117240. };
  117241. IOController2.prototype._onLoaderChunkArrival = function(chunk, byteStart, receivedLength) {
  117242. if (!this._onDataArrival) {
  117243. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");
  117244. }
  117245. if (this._paused) {
  117246. return;
  117247. }
  117248. if (this._isEarlyEofReconnecting) {
  117249. this._isEarlyEofReconnecting = false;
  117250. if (this._onRecoveredEarlyEof) {
  117251. this._onRecoveredEarlyEof();
  117252. }
  117253. }
  117254. this._speedSampler.addBytes(chunk.byteLength);
  117255. var KBps = this._speedSampler.lastSecondKBps;
  117256. if (KBps !== 0) {
  117257. var normalized = this._normalizeSpeed(KBps);
  117258. if (this._speedNormalized !== normalized) {
  117259. this._speedNormalized = normalized;
  117260. this._adjustStashSize(normalized);
  117261. }
  117262. }
  117263. if (!this._enableStash) {
  117264. if (this._stashUsed === 0) {
  117265. var consumed = this._dispatchChunks(chunk, byteStart);
  117266. if (consumed < chunk.byteLength) {
  117267. var remain = chunk.byteLength - consumed;
  117268. if (remain > this._bufferSize) {
  117269. this._expandBuffer(remain);
  117270. }
  117271. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117272. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117273. this._stashUsed += remain;
  117274. this._stashByteStart = byteStart + consumed;
  117275. }
  117276. } else {
  117277. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117278. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117279. }
  117280. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117281. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117282. this._stashUsed += chunk.byteLength;
  117283. var consumed = this._dispatchChunks(this._stashBuffer.slice(0, this._stashUsed), this._stashByteStart);
  117284. if (consumed < this._stashUsed && consumed > 0) {
  117285. var remainArray = new Uint8Array(this._stashBuffer, consumed);
  117286. stashArray.set(remainArray, 0);
  117287. }
  117288. this._stashUsed -= consumed;
  117289. this._stashByteStart += consumed;
  117290. }
  117291. } else {
  117292. if (this._stashUsed === 0 && this._stashByteStart === 0) {
  117293. this._stashByteStart = byteStart;
  117294. }
  117295. if (this._stashUsed + chunk.byteLength <= this._stashSize) {
  117296. var stashArray = new Uint8Array(this._stashBuffer, 0, this._stashSize);
  117297. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117298. this._stashUsed += chunk.byteLength;
  117299. } else {
  117300. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117301. if (this._stashUsed > 0) {
  117302. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117303. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117304. if (consumed < buffer.byteLength) {
  117305. if (consumed > 0) {
  117306. var remainArray = new Uint8Array(buffer, consumed);
  117307. stashArray.set(remainArray, 0);
  117308. this._stashUsed = remainArray.byteLength;
  117309. this._stashByteStart += consumed;
  117310. }
  117311. } else {
  117312. this._stashUsed = 0;
  117313. this._stashByteStart += consumed;
  117314. }
  117315. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117316. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117317. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117318. }
  117319. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117320. this._stashUsed += chunk.byteLength;
  117321. } else {
  117322. var consumed = this._dispatchChunks(chunk, byteStart);
  117323. if (consumed < chunk.byteLength) {
  117324. var remain = chunk.byteLength - consumed;
  117325. if (remain > this._bufferSize) {
  117326. this._expandBuffer(remain);
  117327. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117328. }
  117329. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117330. this._stashUsed += remain;
  117331. this._stashByteStart = byteStart + consumed;
  117332. }
  117333. }
  117334. }
  117335. }
  117336. };
  117337. IOController2.prototype._flushStashBuffer = function(dropUnconsumed) {
  117338. if (this._stashUsed > 0) {
  117339. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117340. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117341. var remain = buffer.byteLength - consumed;
  117342. if (consumed < buffer.byteLength) {
  117343. if (dropUnconsumed) {
  117344. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, remain + " bytes unconsumed data remain when flush buffer, dropped");
  117345. } else {
  117346. if (consumed > 0) {
  117347. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117348. var remainArray = new Uint8Array(buffer, consumed);
  117349. stashArray.set(remainArray, 0);
  117350. this._stashUsed = remainArray.byteLength;
  117351. this._stashByteStart += consumed;
  117352. }
  117353. return 0;
  117354. }
  117355. }
  117356. this._stashUsed = 0;
  117357. this._stashByteStart = 0;
  117358. return remain;
  117359. }
  117360. return 0;
  117361. };
  117362. IOController2.prototype._onLoaderComplete = function(from3, to) {
  117363. this._flushStashBuffer(true);
  117364. if (this._onComplete) {
  117365. this._onComplete(this._extraData);
  117366. }
  117367. };
  117368. IOController2.prototype._onLoaderError = function(type2, data) {
  117369. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Loader error, code = " + data.code + ", msg = " + data.msg);
  117370. this._flushStashBuffer(false);
  117371. if (this._isEarlyEofReconnecting) {
  117372. this._isEarlyEofReconnecting = false;
  117373. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117374. }
  117375. switch (type2) {
  117376. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF: {
  117377. if (!this._config.isLive) {
  117378. if (this._totalLength) {
  117379. var nextFrom = this._currentRange.to + 1;
  117380. if (nextFrom < this._totalLength) {
  117381. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Connection lost, trying reconnect...");
  117382. this._isEarlyEofReconnecting = true;
  117383. this._internalSeek(nextFrom, false);
  117384. }
  117385. return;
  117386. }
  117387. }
  117388. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117389. break;
  117390. }
  117391. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF:
  117392. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.CONNECTING_TIMEOUT:
  117393. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID:
  117394. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION:
  117395. break;
  117396. }
  117397. if (this._onError) {
  117398. this._onError(type2, data);
  117399. } else {
  117400. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("IOException: " + data.msg);
  117401. }
  117402. };
  117403. return IOController2;
  117404. }();
  117405. __webpack_exports__2["default"] = IOController;
  117406. },
  117407. "./src/io/loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117408. __webpack_require__2.r(__webpack_exports__2);
  117409. __webpack_require__2.d(__webpack_exports__2, {
  117410. "LoaderStatus": function() {
  117411. return LoaderStatus;
  117412. },
  117413. "LoaderErrors": function() {
  117414. return LoaderErrors;
  117415. },
  117416. "BaseLoader": function() {
  117417. return BaseLoader;
  117418. }
  117419. });
  117420. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  117421. var LoaderStatus = {
  117422. kIdle: 0,
  117423. kConnecting: 1,
  117424. kBuffering: 2,
  117425. kError: 3,
  117426. kComplete: 4
  117427. };
  117428. var LoaderErrors = {
  117429. OK: "OK",
  117430. EXCEPTION: "Exception",
  117431. HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid",
  117432. CONNECTING_TIMEOUT: "ConnectingTimeout",
  117433. EARLY_EOF: "EarlyEof",
  117434. UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof"
  117435. };
  117436. var BaseLoader = function() {
  117437. function BaseLoader2(typeName) {
  117438. this._type = typeName || "undefined";
  117439. this._status = LoaderStatus.kIdle;
  117440. this._needStash = false;
  117441. this._onContentLengthKnown = null;
  117442. this._onURLRedirect = null;
  117443. this._onDataArrival = null;
  117444. this._onError = null;
  117445. this._onComplete = null;
  117446. }
  117447. BaseLoader2.prototype.destroy = function() {
  117448. this._status = LoaderStatus.kIdle;
  117449. this._onContentLengthKnown = null;
  117450. this._onURLRedirect = null;
  117451. this._onDataArrival = null;
  117452. this._onError = null;
  117453. this._onComplete = null;
  117454. };
  117455. BaseLoader2.prototype.isWorking = function() {
  117456. return this._status === LoaderStatus.kConnecting || this._status === LoaderStatus.kBuffering;
  117457. };
  117458. Object.defineProperty(BaseLoader2.prototype, "type", {
  117459. get: function() {
  117460. return this._type;
  117461. },
  117462. enumerable: false,
  117463. configurable: true
  117464. });
  117465. Object.defineProperty(BaseLoader2.prototype, "status", {
  117466. get: function() {
  117467. return this._status;
  117468. },
  117469. enumerable: false,
  117470. configurable: true
  117471. });
  117472. Object.defineProperty(BaseLoader2.prototype, "needStashBuffer", {
  117473. get: function() {
  117474. return this._needStash;
  117475. },
  117476. enumerable: false,
  117477. configurable: true
  117478. });
  117479. Object.defineProperty(BaseLoader2.prototype, "onContentLengthKnown", {
  117480. get: function() {
  117481. return this._onContentLengthKnown;
  117482. },
  117483. set: function(callback2) {
  117484. this._onContentLengthKnown = callback2;
  117485. },
  117486. enumerable: false,
  117487. configurable: true
  117488. });
  117489. Object.defineProperty(BaseLoader2.prototype, "onURLRedirect", {
  117490. get: function() {
  117491. return this._onURLRedirect;
  117492. },
  117493. set: function(callback2) {
  117494. this._onURLRedirect = callback2;
  117495. },
  117496. enumerable: false,
  117497. configurable: true
  117498. });
  117499. Object.defineProperty(BaseLoader2.prototype, "onDataArrival", {
  117500. get: function() {
  117501. return this._onDataArrival;
  117502. },
  117503. set: function(callback2) {
  117504. this._onDataArrival = callback2;
  117505. },
  117506. enumerable: false,
  117507. configurable: true
  117508. });
  117509. Object.defineProperty(BaseLoader2.prototype, "onError", {
  117510. get: function() {
  117511. return this._onError;
  117512. },
  117513. set: function(callback2) {
  117514. this._onError = callback2;
  117515. },
  117516. enumerable: false,
  117517. configurable: true
  117518. });
  117519. Object.defineProperty(BaseLoader2.prototype, "onComplete", {
  117520. get: function() {
  117521. return this._onComplete;
  117522. },
  117523. set: function(callback2) {
  117524. this._onComplete = callback2;
  117525. },
  117526. enumerable: false,
  117527. configurable: true
  117528. });
  117529. BaseLoader2.prototype.open = function(dataSource, range3) {
  117530. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117531. };
  117532. BaseLoader2.prototype.abort = function() {
  117533. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117534. };
  117535. return BaseLoader2;
  117536. }();
  117537. },
  117538. "./src/io/param-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117539. __webpack_require__2.r(__webpack_exports__2);
  117540. var ParamSeekHandler = function() {
  117541. function ParamSeekHandler2(paramStart, paramEnd) {
  117542. this._startName = paramStart;
  117543. this._endName = paramEnd;
  117544. }
  117545. ParamSeekHandler2.prototype.getConfig = function(baseUrl, range3) {
  117546. var url = baseUrl;
  117547. if (range3.from !== 0 || range3.to !== -1) {
  117548. var needAnd = true;
  117549. if (url.indexOf("?") === -1) {
  117550. url += "?";
  117551. needAnd = false;
  117552. }
  117553. if (needAnd) {
  117554. url += "&";
  117555. }
  117556. url += this._startName + "=" + range3.from.toString();
  117557. if (range3.to !== -1) {
  117558. url += "&" + this._endName + "=" + range3.to.toString();
  117559. }
  117560. }
  117561. return {
  117562. url,
  117563. headers: {}
  117564. };
  117565. };
  117566. ParamSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117567. var baseURL = seekedURL.split("?")[0];
  117568. var params = void 0;
  117569. var queryIndex = seekedURL.indexOf("?");
  117570. if (queryIndex !== -1) {
  117571. params = seekedURL.substring(queryIndex + 1);
  117572. }
  117573. var resultParams = "";
  117574. if (params != void 0 && params.length > 0) {
  117575. var pairs = params.split("&");
  117576. for (var i2 = 0; i2 < pairs.length; i2++) {
  117577. var pair = pairs[i2].split("=");
  117578. var requireAnd = i2 > 0;
  117579. if (pair[0] !== this._startName && pair[0] !== this._endName) {
  117580. if (requireAnd) {
  117581. resultParams += "&";
  117582. }
  117583. resultParams += pairs[i2];
  117584. }
  117585. }
  117586. }
  117587. return resultParams.length === 0 ? baseURL : baseURL + "?" + resultParams;
  117588. };
  117589. return ParamSeekHandler2;
  117590. }();
  117591. __webpack_exports__2["default"] = ParamSeekHandler;
  117592. },
  117593. "./src/io/range-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117594. __webpack_require__2.r(__webpack_exports__2);
  117595. var RangeSeekHandler = function() {
  117596. function RangeSeekHandler2(zeroStart) {
  117597. this._zeroStart = zeroStart || false;
  117598. }
  117599. RangeSeekHandler2.prototype.getConfig = function(url, range3) {
  117600. var headers = {};
  117601. if (range3.from !== 0 || range3.to !== -1) {
  117602. var param = void 0;
  117603. if (range3.to !== -1) {
  117604. param = "bytes=" + range3.from.toString() + "-" + range3.to.toString();
  117605. } else {
  117606. param = "bytes=" + range3.from.toString() + "-";
  117607. }
  117608. headers["Range"] = param;
  117609. } else if (this._zeroStart) {
  117610. headers["Range"] = "bytes=0-";
  117611. }
  117612. return {
  117613. url,
  117614. headers
  117615. };
  117616. };
  117617. RangeSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117618. return seekedURL;
  117619. };
  117620. return RangeSeekHandler2;
  117621. }();
  117622. __webpack_exports__2["default"] = RangeSeekHandler;
  117623. },
  117624. "./src/io/speed-sampler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117625. __webpack_require__2.r(__webpack_exports__2);
  117626. var SpeedSampler = function() {
  117627. function SpeedSampler2() {
  117628. this._firstCheckpoint = 0;
  117629. this._lastCheckpoint = 0;
  117630. this._intervalBytes = 0;
  117631. this._totalBytes = 0;
  117632. this._lastSecondBytes = 0;
  117633. if (self.performance && self.performance.now) {
  117634. this._now = self.performance.now.bind(self.performance);
  117635. } else {
  117636. this._now = Date.now;
  117637. }
  117638. }
  117639. SpeedSampler2.prototype.reset = function() {
  117640. this._firstCheckpoint = this._lastCheckpoint = 0;
  117641. this._totalBytes = this._intervalBytes = 0;
  117642. this._lastSecondBytes = 0;
  117643. };
  117644. SpeedSampler2.prototype.addBytes = function(bytes) {
  117645. if (this._firstCheckpoint === 0) {
  117646. this._firstCheckpoint = this._now();
  117647. this._lastCheckpoint = this._firstCheckpoint;
  117648. this._intervalBytes += bytes;
  117649. this._totalBytes += bytes;
  117650. } else if (this._now() - this._lastCheckpoint < 1e3) {
  117651. this._intervalBytes += bytes;
  117652. this._totalBytes += bytes;
  117653. } else {
  117654. this._lastSecondBytes = this._intervalBytes;
  117655. this._intervalBytes = bytes;
  117656. this._totalBytes += bytes;
  117657. this._lastCheckpoint = this._now();
  117658. }
  117659. };
  117660. Object.defineProperty(SpeedSampler2.prototype, "currentKBps", {
  117661. get: function() {
  117662. this.addBytes(0);
  117663. var durationSeconds = (this._now() - this._lastCheckpoint) / 1e3;
  117664. if (durationSeconds == 0)
  117665. durationSeconds = 1;
  117666. return this._intervalBytes / durationSeconds / 1024;
  117667. },
  117668. enumerable: false,
  117669. configurable: true
  117670. });
  117671. Object.defineProperty(SpeedSampler2.prototype, "lastSecondKBps", {
  117672. get: function() {
  117673. this.addBytes(0);
  117674. if (this._lastSecondBytes !== 0) {
  117675. return this._lastSecondBytes / 1024;
  117676. } else {
  117677. if (this._now() - this._lastCheckpoint >= 500) {
  117678. return this.currentKBps;
  117679. } else {
  117680. return 0;
  117681. }
  117682. }
  117683. },
  117684. enumerable: false,
  117685. configurable: true
  117686. });
  117687. Object.defineProperty(SpeedSampler2.prototype, "averageKBps", {
  117688. get: function() {
  117689. var durationSeconds = (this._now() - this._firstCheckpoint) / 1e3;
  117690. return this._totalBytes / durationSeconds / 1024;
  117691. },
  117692. enumerable: false,
  117693. configurable: true
  117694. });
  117695. return SpeedSampler2;
  117696. }();
  117697. __webpack_exports__2["default"] = SpeedSampler;
  117698. },
  117699. "./src/io/websocket-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117700. __webpack_require__2.r(__webpack_exports__2);
  117701. var _loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  117702. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/exception.js");
  117703. var __extends = function() {
  117704. var extendStatics = function(d2, b) {
  117705. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117706. d3.__proto__ = b2;
  117707. } || function(d3, b2) {
  117708. for (var p in b2)
  117709. if (Object.prototype.hasOwnProperty.call(b2, p))
  117710. d3[p] = b2[p];
  117711. };
  117712. return extendStatics(d2, b);
  117713. };
  117714. return function(d2, b) {
  117715. if (typeof b !== "function" && b !== null)
  117716. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117717. extendStatics(d2, b);
  117718. function __() {
  117719. this.constructor = d2;
  117720. }
  117721. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117722. };
  117723. }();
  117724. var WebSocketLoader = function(_super) {
  117725. __extends(WebSocketLoader2, _super);
  117726. function WebSocketLoader2() {
  117727. var _this = _super.call(this, "websocket-loader") || this;
  117728. _this.TAG = "WebSocketLoader";
  117729. _this._needStash = true;
  117730. _this._ws = null;
  117731. _this._requestAbort = false;
  117732. _this._receivedLength = 0;
  117733. return _this;
  117734. }
  117735. WebSocketLoader2.isSupported = function() {
  117736. try {
  117737. return typeof self.WebSocket !== "undefined";
  117738. } catch (e) {
  117739. return false;
  117740. }
  117741. };
  117742. WebSocketLoader2.prototype.destroy = function() {
  117743. if (this._ws) {
  117744. this.abort();
  117745. }
  117746. _super.prototype.destroy.call(this);
  117747. };
  117748. WebSocketLoader2.prototype.open = function(dataSource) {
  117749. try {
  117750. var ws = this._ws = new self.WebSocket(dataSource.url);
  117751. ws.binaryType = "arraybuffer";
  117752. ws.onopen = this._onWebSocketOpen.bind(this);
  117753. ws.onclose = this._onWebSocketClose.bind(this);
  117754. ws.onmessage = this._onWebSocketMessage.bind(this);
  117755. ws.onerror = this._onWebSocketError.bind(this);
  117756. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kConnecting;
  117757. } catch (e) {
  117758. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117759. var info = { code: e.code, msg: e.message };
  117760. if (this._onError) {
  117761. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117762. } else {
  117763. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117764. }
  117765. }
  117766. };
  117767. WebSocketLoader2.prototype.abort = function() {
  117768. var ws = this._ws;
  117769. if (ws && (ws.readyState === 0 || ws.readyState === 1)) {
  117770. this._requestAbort = true;
  117771. ws.close();
  117772. }
  117773. this._ws = null;
  117774. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117775. };
  117776. WebSocketLoader2.prototype._onWebSocketOpen = function(e) {
  117777. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kBuffering;
  117778. };
  117779. WebSocketLoader2.prototype._onWebSocketClose = function(e) {
  117780. if (this._requestAbort === true) {
  117781. this._requestAbort = false;
  117782. return;
  117783. }
  117784. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117785. if (this._onComplete) {
  117786. this._onComplete(0, this._receivedLength - 1);
  117787. }
  117788. };
  117789. WebSocketLoader2.prototype._onWebSocketMessage = function(e) {
  117790. var _this = this;
  117791. if (e.data instanceof ArrayBuffer) {
  117792. this._dispatchArrayBuffer(e.data);
  117793. } else if (e.data instanceof Blob) {
  117794. var reader_1 = new FileReader();
  117795. reader_1.onload = function() {
  117796. _this._dispatchArrayBuffer(reader_1.result);
  117797. };
  117798. reader_1.readAsArrayBuffer(e.data);
  117799. } else {
  117800. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117801. var info = { code: -1, msg: "Unsupported WebSocket message type: " + e.data.constructor.name };
  117802. if (this._onError) {
  117803. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117804. } else {
  117805. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117806. }
  117807. }
  117808. };
  117809. WebSocketLoader2.prototype._dispatchArrayBuffer = function(arraybuffer) {
  117810. var chunk = arraybuffer;
  117811. var byteStart = this._receivedLength;
  117812. this._receivedLength += chunk.byteLength;
  117813. if (this._onDataArrival) {
  117814. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117815. }
  117816. };
  117817. WebSocketLoader2.prototype._onWebSocketError = function(e) {
  117818. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117819. var info = {
  117820. code: e.code,
  117821. msg: e.message
  117822. };
  117823. if (this._onError) {
  117824. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117825. } else {
  117826. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117827. }
  117828. };
  117829. return WebSocketLoader2;
  117830. }(_loader_js__WEBPACK_IMPORTED_MODULE_0__.BaseLoader);
  117831. __webpack_exports__2["default"] = WebSocketLoader;
  117832. },
  117833. "./src/io/xhr-moz-chunked-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117834. __webpack_require__2.r(__webpack_exports__2);
  117835. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  117836. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  117837. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  117838. var __extends = function() {
  117839. var extendStatics = function(d2, b) {
  117840. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117841. d3.__proto__ = b2;
  117842. } || function(d3, b2) {
  117843. for (var p in b2)
  117844. if (Object.prototype.hasOwnProperty.call(b2, p))
  117845. d3[p] = b2[p];
  117846. };
  117847. return extendStatics(d2, b);
  117848. };
  117849. return function(d2, b) {
  117850. if (typeof b !== "function" && b !== null)
  117851. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117852. extendStatics(d2, b);
  117853. function __() {
  117854. this.constructor = d2;
  117855. }
  117856. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117857. };
  117858. }();
  117859. var MozChunkedLoader = function(_super) {
  117860. __extends(MozChunkedLoader2, _super);
  117861. function MozChunkedLoader2(seekHandler, config) {
  117862. var _this = _super.call(this, "xhr-moz-chunked-loader") || this;
  117863. _this.TAG = "MozChunkedLoader";
  117864. _this._seekHandler = seekHandler;
  117865. _this._config = config;
  117866. _this._needStash = true;
  117867. _this._xhr = null;
  117868. _this._requestAbort = false;
  117869. _this._contentLength = null;
  117870. _this._receivedLength = 0;
  117871. return _this;
  117872. }
  117873. MozChunkedLoader2.isSupported = function() {
  117874. try {
  117875. var xhr = new XMLHttpRequest();
  117876. xhr.open("GET", "https://example.com", true);
  117877. xhr.responseType = "moz-chunked-arraybuffer";
  117878. return xhr.responseType === "moz-chunked-arraybuffer";
  117879. } catch (e) {
  117880. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("MozChunkedLoader", e.message);
  117881. return false;
  117882. }
  117883. };
  117884. MozChunkedLoader2.prototype.destroy = function() {
  117885. if (this.isWorking()) {
  117886. this.abort();
  117887. }
  117888. if (this._xhr) {
  117889. this._xhr.onreadystatechange = null;
  117890. this._xhr.onprogress = null;
  117891. this._xhr.onloadend = null;
  117892. this._xhr.onerror = null;
  117893. this._xhr = null;
  117894. }
  117895. _super.prototype.destroy.call(this);
  117896. };
  117897. MozChunkedLoader2.prototype.open = function(dataSource, range3) {
  117898. this._dataSource = dataSource;
  117899. this._range = range3;
  117900. var sourceURL = dataSource.url;
  117901. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  117902. sourceURL = dataSource.redirectedURL;
  117903. }
  117904. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  117905. this._requestURL = seekConfig.url;
  117906. var xhr = this._xhr = new XMLHttpRequest();
  117907. xhr.open("GET", seekConfig.url, true);
  117908. xhr.responseType = "moz-chunked-arraybuffer";
  117909. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  117910. xhr.onprogress = this._onProgress.bind(this);
  117911. xhr.onloadend = this._onLoadEnd.bind(this);
  117912. xhr.onerror = this._onXhrError.bind(this);
  117913. if (dataSource.withCredentials) {
  117914. xhr.withCredentials = true;
  117915. }
  117916. if (typeof seekConfig.headers === "object") {
  117917. var headers = seekConfig.headers;
  117918. for (var key in headers) {
  117919. if (headers.hasOwnProperty(key)) {
  117920. xhr.setRequestHeader(key, headers[key]);
  117921. }
  117922. }
  117923. }
  117924. if (typeof this._config.headers === "object") {
  117925. var headers = this._config.headers;
  117926. for (var key in headers) {
  117927. if (headers.hasOwnProperty(key)) {
  117928. xhr.setRequestHeader(key, headers[key]);
  117929. }
  117930. }
  117931. }
  117932. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  117933. xhr.send();
  117934. };
  117935. MozChunkedLoader2.prototype.abort = function() {
  117936. this._requestAbort = true;
  117937. if (this._xhr) {
  117938. this._xhr.abort();
  117939. }
  117940. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117941. };
  117942. MozChunkedLoader2.prototype._onReadyStateChange = function(e) {
  117943. var xhr = e.target;
  117944. if (xhr.readyState === 2) {
  117945. if (xhr.responseURL != void 0 && xhr.responseURL !== this._requestURL) {
  117946. if (this._onURLRedirect) {
  117947. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  117948. this._onURLRedirect(redirectedURL);
  117949. }
  117950. }
  117951. if (xhr.status !== 0 && (xhr.status < 200 || xhr.status > 299)) {
  117952. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117953. if (this._onError) {
  117954. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  117955. } else {
  117956. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("MozChunkedLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  117957. }
  117958. } else {
  117959. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  117960. }
  117961. }
  117962. };
  117963. MozChunkedLoader2.prototype._onProgress = function(e) {
  117964. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117965. return;
  117966. }
  117967. if (this._contentLength === null) {
  117968. if (e.total !== null && e.total !== 0) {
  117969. this._contentLength = e.total;
  117970. if (this._onContentLengthKnown) {
  117971. this._onContentLengthKnown(this._contentLength);
  117972. }
  117973. }
  117974. }
  117975. var chunk = e.target.response;
  117976. var byteStart = this._range.from + this._receivedLength;
  117977. this._receivedLength += chunk.byteLength;
  117978. if (this._onDataArrival) {
  117979. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117980. }
  117981. };
  117982. MozChunkedLoader2.prototype._onLoadEnd = function(e) {
  117983. if (this._requestAbort === true) {
  117984. this._requestAbort = false;
  117985. return;
  117986. } else if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117987. return;
  117988. }
  117989. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117990. if (this._onComplete) {
  117991. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  117992. }
  117993. };
  117994. MozChunkedLoader2.prototype._onXhrError = function(e) {
  117995. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117996. var type2 = 0;
  117997. var info = null;
  117998. if (this._contentLength && e.loaded < this._contentLength) {
  117999. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  118000. info = { code: -1, msg: "Moz-Chunked stream meet Early-Eof" };
  118001. } else {
  118002. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  118003. info = { code: -1, msg: e.constructor.name + " " + e.type };
  118004. }
  118005. if (this._onError) {
  118006. this._onError(type2, info);
  118007. } else {
  118008. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  118009. }
  118010. };
  118011. return MozChunkedLoader2;
  118012. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  118013. __webpack_exports__2["default"] = MozChunkedLoader;
  118014. },
  118015. "./src/io/xhr-range-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118016. __webpack_require__2.r(__webpack_exports__2);
  118017. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  118018. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  118019. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  118020. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  118021. var __extends = function() {
  118022. var extendStatics = function(d2, b) {
  118023. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  118024. d3.__proto__ = b2;
  118025. } || function(d3, b2) {
  118026. for (var p in b2)
  118027. if (Object.prototype.hasOwnProperty.call(b2, p))
  118028. d3[p] = b2[p];
  118029. };
  118030. return extendStatics(d2, b);
  118031. };
  118032. return function(d2, b) {
  118033. if (typeof b !== "function" && b !== null)
  118034. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  118035. extendStatics(d2, b);
  118036. function __() {
  118037. this.constructor = d2;
  118038. }
  118039. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  118040. };
  118041. }();
  118042. var RangeLoader = function(_super) {
  118043. __extends(RangeLoader2, _super);
  118044. function RangeLoader2(seekHandler, config) {
  118045. var _this = _super.call(this, "xhr-range-loader") || this;
  118046. _this.TAG = "RangeLoader";
  118047. _this._seekHandler = seekHandler;
  118048. _this._config = config;
  118049. _this._needStash = false;
  118050. _this._chunkSizeKBList = [
  118051. 128,
  118052. 256,
  118053. 384,
  118054. 512,
  118055. 768,
  118056. 1024,
  118057. 1536,
  118058. 2048,
  118059. 3072,
  118060. 4096,
  118061. 5120,
  118062. 6144,
  118063. 7168,
  118064. 8192
  118065. ];
  118066. _this._currentChunkSizeKB = 384;
  118067. _this._currentSpeedNormalized = 0;
  118068. _this._zeroSpeedChunkCount = 0;
  118069. _this._xhr = null;
  118070. _this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  118071. _this._requestAbort = false;
  118072. _this._waitForTotalLength = false;
  118073. _this._totalLengthReceived = false;
  118074. _this._currentRequestURL = null;
  118075. _this._currentRedirectedURL = null;
  118076. _this._currentRequestRange = null;
  118077. _this._totalLength = null;
  118078. _this._contentLength = null;
  118079. _this._receivedLength = 0;
  118080. _this._lastTimeLoaded = 0;
  118081. return _this;
  118082. }
  118083. RangeLoader2.isSupported = function() {
  118084. try {
  118085. var xhr = new XMLHttpRequest();
  118086. xhr.open("GET", "https://example.com", true);
  118087. xhr.responseType = "arraybuffer";
  118088. return xhr.responseType === "arraybuffer";
  118089. } catch (e) {
  118090. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("RangeLoader", e.message);
  118091. return false;
  118092. }
  118093. };
  118094. RangeLoader2.prototype.destroy = function() {
  118095. if (this.isWorking()) {
  118096. this.abort();
  118097. }
  118098. if (this._xhr) {
  118099. this._xhr.onreadystatechange = null;
  118100. this._xhr.onprogress = null;
  118101. this._xhr.onload = null;
  118102. this._xhr.onerror = null;
  118103. this._xhr = null;
  118104. }
  118105. _super.prototype.destroy.call(this);
  118106. };
  118107. Object.defineProperty(RangeLoader2.prototype, "currentSpeed", {
  118108. get: function() {
  118109. return this._speedSampler.lastSecondKBps;
  118110. },
  118111. enumerable: false,
  118112. configurable: true
  118113. });
  118114. RangeLoader2.prototype.open = function(dataSource, range3) {
  118115. this._dataSource = dataSource;
  118116. this._range = range3;
  118117. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kConnecting;
  118118. var useRefTotalLength = false;
  118119. if (this._dataSource.filesize != void 0 && this._dataSource.filesize !== 0) {
  118120. useRefTotalLength = true;
  118121. this._totalLength = this._dataSource.filesize;
  118122. }
  118123. if (!this._totalLengthReceived && !useRefTotalLength) {
  118124. this._waitForTotalLength = true;
  118125. this._internalOpen(this._dataSource, { from: 0, to: -1 });
  118126. } else {
  118127. this._openSubRange();
  118128. }
  118129. };
  118130. RangeLoader2.prototype._openSubRange = function() {
  118131. var chunkSize = this._currentChunkSizeKB * 1024;
  118132. var from3 = this._range.from + this._receivedLength;
  118133. var to = from3 + chunkSize;
  118134. if (this._contentLength != null) {
  118135. if (to - this._range.from >= this._contentLength) {
  118136. to = this._range.from + this._contentLength - 1;
  118137. }
  118138. }
  118139. this._currentRequestRange = { from: from3, to };
  118140. this._internalOpen(this._dataSource, this._currentRequestRange);
  118141. };
  118142. RangeLoader2.prototype._internalOpen = function(dataSource, range3) {
  118143. this._lastTimeLoaded = 0;
  118144. var sourceURL = dataSource.url;
  118145. if (this._config.reuseRedirectedURL) {
  118146. if (this._currentRedirectedURL != void 0) {
  118147. sourceURL = this._currentRedirectedURL;
  118148. } else if (dataSource.redirectedURL != void 0) {
  118149. sourceURL = dataSource.redirectedURL;
  118150. }
  118151. }
  118152. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  118153. this._currentRequestURL = seekConfig.url;
  118154. var xhr = this._xhr = new XMLHttpRequest();
  118155. xhr.open("GET", seekConfig.url, true);
  118156. xhr.responseType = "arraybuffer";
  118157. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  118158. xhr.onprogress = this._onProgress.bind(this);
  118159. xhr.onload = this._onLoad.bind(this);
  118160. xhr.onerror = this._onXhrError.bind(this);
  118161. if (dataSource.withCredentials) {
  118162. xhr.withCredentials = true;
  118163. }
  118164. if (typeof seekConfig.headers === "object") {
  118165. var headers = seekConfig.headers;
  118166. for (var key in headers) {
  118167. if (headers.hasOwnProperty(key)) {
  118168. xhr.setRequestHeader(key, headers[key]);
  118169. }
  118170. }
  118171. }
  118172. if (typeof this._config.headers === "object") {
  118173. var headers = this._config.headers;
  118174. for (var key in headers) {
  118175. if (headers.hasOwnProperty(key)) {
  118176. xhr.setRequestHeader(key, headers[key]);
  118177. }
  118178. }
  118179. }
  118180. xhr.send();
  118181. };
  118182. RangeLoader2.prototype.abort = function() {
  118183. this._requestAbort = true;
  118184. this._internalAbort();
  118185. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118186. };
  118187. RangeLoader2.prototype._internalAbort = function() {
  118188. if (this._xhr) {
  118189. this._xhr.onreadystatechange = null;
  118190. this._xhr.onprogress = null;
  118191. this._xhr.onload = null;
  118192. this._xhr.onerror = null;
  118193. this._xhr.abort();
  118194. this._xhr = null;
  118195. }
  118196. };
  118197. RangeLoader2.prototype._onReadyStateChange = function(e) {
  118198. var xhr = e.target;
  118199. if (xhr.readyState === 2) {
  118200. if (xhr.responseURL != void 0) {
  118201. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  118202. if (xhr.responseURL !== this._currentRequestURL && redirectedURL !== this._currentRedirectedURL) {
  118203. this._currentRedirectedURL = redirectedURL;
  118204. if (this._onURLRedirect) {
  118205. this._onURLRedirect(redirectedURL);
  118206. }
  118207. }
  118208. }
  118209. if (xhr.status >= 200 && xhr.status <= 299) {
  118210. if (this._waitForTotalLength) {
  118211. return;
  118212. }
  118213. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kBuffering;
  118214. } else {
  118215. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118216. if (this._onError) {
  118217. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  118218. } else {
  118219. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException("RangeLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  118220. }
  118221. }
  118222. }
  118223. };
  118224. RangeLoader2.prototype._onProgress = function(e) {
  118225. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118226. return;
  118227. }
  118228. if (this._contentLength === null) {
  118229. var openNextRange = false;
  118230. if (this._waitForTotalLength) {
  118231. this._waitForTotalLength = false;
  118232. this._totalLengthReceived = true;
  118233. openNextRange = true;
  118234. var total = e.total;
  118235. this._internalAbort();
  118236. if (total != null & total !== 0) {
  118237. this._totalLength = total;
  118238. }
  118239. }
  118240. if (this._range.to === -1) {
  118241. this._contentLength = this._totalLength - this._range.from;
  118242. } else {
  118243. this._contentLength = this._range.to - this._range.from + 1;
  118244. }
  118245. if (openNextRange) {
  118246. this._openSubRange();
  118247. return;
  118248. }
  118249. if (this._onContentLengthKnown) {
  118250. this._onContentLengthKnown(this._contentLength);
  118251. }
  118252. }
  118253. var delta = e.loaded - this._lastTimeLoaded;
  118254. this._lastTimeLoaded = e.loaded;
  118255. this._speedSampler.addBytes(delta);
  118256. };
  118257. RangeLoader2.prototype._normalizeSpeed = function(input) {
  118258. var list = this._chunkSizeKBList;
  118259. var last = list.length - 1;
  118260. var mid = 0;
  118261. var lbound = 0;
  118262. var ubound = last;
  118263. if (input < list[0]) {
  118264. return list[0];
  118265. }
  118266. while (lbound <= ubound) {
  118267. mid = lbound + Math.floor((ubound - lbound) / 2);
  118268. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  118269. return list[mid];
  118270. } else if (list[mid] < input) {
  118271. lbound = mid + 1;
  118272. } else {
  118273. ubound = mid - 1;
  118274. }
  118275. }
  118276. };
  118277. RangeLoader2.prototype._onLoad = function(e) {
  118278. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118279. return;
  118280. }
  118281. if (this._waitForTotalLength) {
  118282. this._waitForTotalLength = false;
  118283. return;
  118284. }
  118285. this._lastTimeLoaded = 0;
  118286. var KBps = this._speedSampler.lastSecondKBps;
  118287. if (KBps === 0) {
  118288. this._zeroSpeedChunkCount++;
  118289. if (this._zeroSpeedChunkCount >= 3) {
  118290. KBps = this._speedSampler.currentKBps;
  118291. }
  118292. }
  118293. if (KBps !== 0) {
  118294. var normalized = this._normalizeSpeed(KBps);
  118295. if (this._currentSpeedNormalized !== normalized) {
  118296. this._currentSpeedNormalized = normalized;
  118297. this._currentChunkSizeKB = normalized;
  118298. }
  118299. }
  118300. var chunk = e.target.response;
  118301. var byteStart = this._range.from + this._receivedLength;
  118302. this._receivedLength += chunk.byteLength;
  118303. var reportComplete = false;
  118304. if (this._contentLength != null && this._receivedLength < this._contentLength) {
  118305. this._openSubRange();
  118306. } else {
  118307. reportComplete = true;
  118308. }
  118309. if (this._onDataArrival) {
  118310. this._onDataArrival(chunk, byteStart, this._receivedLength);
  118311. }
  118312. if (reportComplete) {
  118313. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118314. if (this._onComplete) {
  118315. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  118316. }
  118317. }
  118318. };
  118319. RangeLoader2.prototype._onXhrError = function(e) {
  118320. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118321. var type2 = 0;
  118322. var info = null;
  118323. if (this._contentLength && this._receivedLength > 0 && this._receivedLength < this._contentLength) {
  118324. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF;
  118325. info = { code: -1, msg: "RangeLoader meet Early-Eof" };
  118326. } else {
  118327. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION;
  118328. info = { code: -1, msg: e.constructor.name + " " + e.type };
  118329. }
  118330. if (this._onError) {
  118331. this._onError(type2, info);
  118332. } else {
  118333. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException(info.msg);
  118334. }
  118335. };
  118336. return RangeLoader2;
  118337. }(_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader);
  118338. __webpack_exports__2["default"] = RangeLoader;
  118339. },
  118340. "./src/player/flv-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118341. __webpack_require__2.r(__webpack_exports__2);
  118342. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118343. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118344. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  118345. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  118346. var _player_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/player-events.js");
  118347. var _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxer.js");
  118348. var _core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  118349. var _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/mse-controller.js");
  118350. var _core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/core/mse-events.js");
  118351. var _player_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/player/player-errors.js");
  118352. var _config_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/config.js");
  118353. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__2("./src/utils/exception.js");
  118354. var FlvPlayer = function() {
  118355. function FlvPlayer2(mediaDataSource, config) {
  118356. this.TAG = "FlvPlayer";
  118357. this._type = "FlvPlayer";
  118358. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118359. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_9__.createDefaultConfig)();
  118360. if (typeof config === "object") {
  118361. Object.assign(this._config, config);
  118362. }
  118363. if (mediaDataSource.type.toLowerCase() !== "flv") {
  118364. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");
  118365. }
  118366. if (mediaDataSource.isLive === true) {
  118367. this._config.isLive = true;
  118368. }
  118369. this.e = {
  118370. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  118371. onvSeeking: this._onvSeeking.bind(this),
  118372. onvCanPlay: this._onvCanPlay.bind(this),
  118373. onvStalled: this._onvStalled.bind(this),
  118374. onvProgress: this._onvProgress.bind(this)
  118375. };
  118376. if (self.performance && self.performance.now) {
  118377. this._now = self.performance.now.bind(self.performance);
  118378. } else {
  118379. this._now = Date.now;
  118380. }
  118381. this._pendingSeekTime = null;
  118382. this._requestSetTime = false;
  118383. this._seekpointRecord = null;
  118384. this._progressChecker = null;
  118385. this._mediaDataSource = mediaDataSource;
  118386. this._mediaElement = null;
  118387. this._msectl = null;
  118388. this._transmuxer = null;
  118389. this._mseSourceOpened = false;
  118390. this._hasPendingLoad = false;
  118391. this._receivedCanPlay = false;
  118392. this._mediaInfo = null;
  118393. this._statisticsInfo = null;
  118394. var chromeNeedIDRFix = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.build < 2661);
  118395. this._alwaysSeekKeyframe = chromeNeedIDRFix || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msie ? true : false;
  118396. if (this._alwaysSeekKeyframe) {
  118397. this._config.accurateSeek = false;
  118398. }
  118399. }
  118400. FlvPlayer2.prototype.destroy = function() {
  118401. if (this._progressChecker != null) {
  118402. window.clearInterval(this._progressChecker);
  118403. this._progressChecker = null;
  118404. }
  118405. if (this._transmuxer) {
  118406. this.unload();
  118407. }
  118408. if (this._mediaElement) {
  118409. this.detachMediaElement();
  118410. }
  118411. this.e = null;
  118412. this._mediaDataSource = null;
  118413. this._emitter.removeAllListeners();
  118414. this._emitter = null;
  118415. };
  118416. FlvPlayer2.prototype.on = function(event2, listener) {
  118417. var _this = this;
  118418. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO) {
  118419. if (this._mediaInfo != null) {
  118420. Promise.resolve().then(function() {
  118421. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, _this.mediaInfo);
  118422. });
  118423. }
  118424. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO) {
  118425. if (this._statisticsInfo != null) {
  118426. Promise.resolve().then(function() {
  118427. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, _this.statisticsInfo);
  118428. });
  118429. }
  118430. }
  118431. this._emitter.addListener(event2, listener);
  118432. };
  118433. FlvPlayer2.prototype.off = function(event2, listener) {
  118434. this._emitter.removeListener(event2, listener);
  118435. };
  118436. FlvPlayer2.prototype.attachMediaElement = function(mediaElement) {
  118437. var _this = this;
  118438. this._mediaElement = mediaElement;
  118439. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118440. mediaElement.addEventListener("seeking", this.e.onvSeeking);
  118441. mediaElement.addEventListener("canplay", this.e.onvCanPlay);
  118442. mediaElement.addEventListener("stalled", this.e.onvStalled);
  118443. mediaElement.addEventListener("progress", this.e.onvProgress);
  118444. this._msectl = new _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__.default(this._config);
  118445. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.UPDATE_END, this._onmseUpdateEnd.bind(this));
  118446. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.BUFFER_FULL, this._onmseBufferFull.bind(this));
  118447. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.SOURCE_OPEN, function() {
  118448. _this._mseSourceOpened = true;
  118449. if (_this._hasPendingLoad) {
  118450. _this._hasPendingLoad = false;
  118451. _this.load();
  118452. }
  118453. });
  118454. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.ERROR, function(info) {
  118455. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorDetails.MEDIA_MSE_ERROR, info);
  118456. });
  118457. this._msectl.attachMediaElement(mediaElement);
  118458. if (this._pendingSeekTime != null) {
  118459. try {
  118460. mediaElement.currentTime = this._pendingSeekTime;
  118461. this._pendingSeekTime = null;
  118462. } catch (e) {
  118463. }
  118464. }
  118465. };
  118466. FlvPlayer2.prototype.detachMediaElement = function() {
  118467. if (this._mediaElement) {
  118468. this._msectl.detachMediaElement();
  118469. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118470. this._mediaElement.removeEventListener("seeking", this.e.onvSeeking);
  118471. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118472. this._mediaElement.removeEventListener("stalled", this.e.onvStalled);
  118473. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118474. this._mediaElement = null;
  118475. }
  118476. if (this._msectl) {
  118477. this._msectl.destroy();
  118478. this._msectl = null;
  118479. }
  118480. };
  118481. FlvPlayer2.prototype.load = function() {
  118482. var _this = this;
  118483. if (!this._mediaElement) {
  118484. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118485. }
  118486. if (this._transmuxer) {
  118487. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");
  118488. }
  118489. if (this._hasPendingLoad) {
  118490. return;
  118491. }
  118492. if (this._config.deferLoadAfterSourceOpen && this._mseSourceOpened === false) {
  118493. this._hasPendingLoad = true;
  118494. return;
  118495. }
  118496. if (this._mediaElement.readyState > 0) {
  118497. this._requestSetTime = true;
  118498. this._mediaElement.currentTime = 0;
  118499. }
  118500. this._transmuxer = new _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(this._mediaDataSource, this._config);
  118501. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, function(type2, is) {
  118502. _this._msectl.appendInitSegment(is);
  118503. });
  118504. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, function(type2, ms) {
  118505. _this._msectl.appendMediaSegment(ms);
  118506. if (_this._config.lazyLoad && !_this._config.isLive) {
  118507. var currentTime = _this._mediaElement.currentTime;
  118508. if (ms.info.endDts >= (currentTime + _this._config.lazyLoadMaxDuration) * 1e3) {
  118509. if (_this._progressChecker == null) {
  118510. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(_this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118511. _this._suspendTransmuxer();
  118512. }
  118513. }
  118514. }
  118515. });
  118516. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, function() {
  118517. _this._msectl.endOfStream();
  118518. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE);
  118519. });
  118520. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, function() {
  118521. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF);
  118522. });
  118523. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, function(detail, info) {
  118524. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.NETWORK_ERROR, detail, info);
  118525. });
  118526. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, function(detail, info) {
  118527. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, detail, { code: -1, msg: info });
  118528. });
  118529. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, function(mediaInfo) {
  118530. _this._mediaInfo = mediaInfo;
  118531. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, Object.assign({}, mediaInfo));
  118532. });
  118533. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, function(metadata) {
  118534. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, metadata);
  118535. });
  118536. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, function(data) {
  118537. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, data);
  118538. });
  118539. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, function(statInfo) {
  118540. _this._statisticsInfo = _this._fillStatisticsInfo(statInfo);
  118541. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, Object.assign({}, _this._statisticsInfo));
  118542. });
  118543. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, function(milliseconds) {
  118544. if (_this._mediaElement && !_this._config.accurateSeek) {
  118545. _this._requestSetTime = true;
  118546. _this._mediaElement.currentTime = milliseconds / 1e3;
  118547. }
  118548. });
  118549. this._transmuxer.open();
  118550. };
  118551. FlvPlayer2.prototype.unload = function() {
  118552. if (this._mediaElement) {
  118553. this._mediaElement.pause();
  118554. }
  118555. if (this._msectl) {
  118556. this._msectl.seek(0);
  118557. }
  118558. if (this._transmuxer) {
  118559. this._transmuxer.close();
  118560. this._transmuxer.destroy();
  118561. this._transmuxer = null;
  118562. }
  118563. };
  118564. FlvPlayer2.prototype.play = function() {
  118565. return this._mediaElement.play();
  118566. };
  118567. FlvPlayer2.prototype.pause = function() {
  118568. this._mediaElement.pause();
  118569. };
  118570. Object.defineProperty(FlvPlayer2.prototype, "type", {
  118571. get: function() {
  118572. return this._type;
  118573. },
  118574. enumerable: false,
  118575. configurable: true
  118576. });
  118577. Object.defineProperty(FlvPlayer2.prototype, "buffered", {
  118578. get: function() {
  118579. return this._mediaElement.buffered;
  118580. },
  118581. enumerable: false,
  118582. configurable: true
  118583. });
  118584. Object.defineProperty(FlvPlayer2.prototype, "duration", {
  118585. get: function() {
  118586. return this._mediaElement.duration;
  118587. },
  118588. enumerable: false,
  118589. configurable: true
  118590. });
  118591. Object.defineProperty(FlvPlayer2.prototype, "volume", {
  118592. get: function() {
  118593. return this._mediaElement.volume;
  118594. },
  118595. set: function(value) {
  118596. this._mediaElement.volume = value;
  118597. },
  118598. enumerable: false,
  118599. configurable: true
  118600. });
  118601. Object.defineProperty(FlvPlayer2.prototype, "muted", {
  118602. get: function() {
  118603. return this._mediaElement.muted;
  118604. },
  118605. set: function(muted) {
  118606. this._mediaElement.muted = muted;
  118607. },
  118608. enumerable: false,
  118609. configurable: true
  118610. });
  118611. Object.defineProperty(FlvPlayer2.prototype, "currentTime", {
  118612. get: function() {
  118613. if (this._mediaElement) {
  118614. return this._mediaElement.currentTime;
  118615. }
  118616. return 0;
  118617. },
  118618. set: function(seconds) {
  118619. if (this._mediaElement) {
  118620. this._internalSeek(seconds);
  118621. } else {
  118622. this._pendingSeekTime = seconds;
  118623. }
  118624. },
  118625. enumerable: false,
  118626. configurable: true
  118627. });
  118628. Object.defineProperty(FlvPlayer2.prototype, "mediaInfo", {
  118629. get: function() {
  118630. return Object.assign({}, this._mediaInfo);
  118631. },
  118632. enumerable: false,
  118633. configurable: true
  118634. });
  118635. Object.defineProperty(FlvPlayer2.prototype, "statisticsInfo", {
  118636. get: function() {
  118637. if (this._statisticsInfo == null) {
  118638. this._statisticsInfo = {};
  118639. }
  118640. this._statisticsInfo = this._fillStatisticsInfo(this._statisticsInfo);
  118641. return Object.assign({}, this._statisticsInfo);
  118642. },
  118643. enumerable: false,
  118644. configurable: true
  118645. });
  118646. FlvPlayer2.prototype._fillStatisticsInfo = function(statInfo) {
  118647. statInfo.playerType = this._type;
  118648. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  118649. return statInfo;
  118650. }
  118651. var hasQualityInfo = true;
  118652. var decoded = 0;
  118653. var dropped = 0;
  118654. if (this._mediaElement.getVideoPlaybackQuality) {
  118655. var quality = this._mediaElement.getVideoPlaybackQuality();
  118656. decoded = quality.totalVideoFrames;
  118657. dropped = quality.droppedVideoFrames;
  118658. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  118659. decoded = this._mediaElement.webkitDecodedFrameCount;
  118660. dropped = this._mediaElement.webkitDroppedFrameCount;
  118661. } else {
  118662. hasQualityInfo = false;
  118663. }
  118664. if (hasQualityInfo) {
  118665. statInfo.decodedFrames = decoded;
  118666. statInfo.droppedFrames = dropped;
  118667. }
  118668. return statInfo;
  118669. };
  118670. FlvPlayer2.prototype._onmseUpdateEnd = function() {
  118671. if (!this._config.lazyLoad || this._config.isLive) {
  118672. return;
  118673. }
  118674. var buffered = this._mediaElement.buffered;
  118675. var currentTime = this._mediaElement.currentTime;
  118676. var currentRangeEnd = 0;
  118677. for (var i2 = 0; i2 < buffered.length; i2++) {
  118678. var start2 = buffered.start(i2);
  118679. var end = buffered.end(i2);
  118680. if (start2 <= currentTime && currentTime < end) {
  118681. currentRangeEnd = end;
  118682. break;
  118683. }
  118684. }
  118685. if (currentRangeEnd >= currentTime + this._config.lazyLoadMaxDuration && this._progressChecker == null) {
  118686. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118687. this._suspendTransmuxer();
  118688. }
  118689. };
  118690. FlvPlayer2.prototype._onmseBufferFull = function() {
  118691. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MSE SourceBuffer is full, suspend transmuxing task");
  118692. if (this._progressChecker == null) {
  118693. this._suspendTransmuxer();
  118694. }
  118695. };
  118696. FlvPlayer2.prototype._suspendTransmuxer = function() {
  118697. if (this._transmuxer) {
  118698. this._transmuxer.pause();
  118699. if (this._progressChecker == null) {
  118700. this._progressChecker = window.setInterval(this._checkProgressAndResume.bind(this), 1e3);
  118701. }
  118702. }
  118703. };
  118704. FlvPlayer2.prototype._checkProgressAndResume = function() {
  118705. var currentTime = this._mediaElement.currentTime;
  118706. var buffered = this._mediaElement.buffered;
  118707. var needResume = false;
  118708. for (var i2 = 0; i2 < buffered.length; i2++) {
  118709. var from3 = buffered.start(i2);
  118710. var to = buffered.end(i2);
  118711. if (currentTime >= from3 && currentTime < to) {
  118712. if (currentTime >= to - this._config.lazyLoadRecoverDuration) {
  118713. needResume = true;
  118714. }
  118715. break;
  118716. }
  118717. }
  118718. if (needResume) {
  118719. window.clearInterval(this._progressChecker);
  118720. this._progressChecker = null;
  118721. if (needResume) {
  118722. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Continue loading from paused position");
  118723. this._transmuxer.resume();
  118724. }
  118725. }
  118726. };
  118727. FlvPlayer2.prototype._isTimepointBuffered = function(seconds) {
  118728. var buffered = this._mediaElement.buffered;
  118729. for (var i2 = 0; i2 < buffered.length; i2++) {
  118730. var from3 = buffered.start(i2);
  118731. var to = buffered.end(i2);
  118732. if (seconds >= from3 && seconds < to) {
  118733. return true;
  118734. }
  118735. }
  118736. return false;
  118737. };
  118738. FlvPlayer2.prototype._internalSeek = function(seconds) {
  118739. var directSeek = this._isTimepointBuffered(seconds);
  118740. var directSeekBegin = false;
  118741. var directSeekBeginTime = 0;
  118742. if (seconds < 1 && this._mediaElement.buffered.length > 0) {
  118743. var videoBeginTime = this._mediaElement.buffered.start(0);
  118744. if (videoBeginTime < 1 && seconds < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118745. directSeekBegin = true;
  118746. directSeekBeginTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118747. }
  118748. }
  118749. if (directSeekBegin) {
  118750. this._requestSetTime = true;
  118751. this._mediaElement.currentTime = directSeekBeginTime;
  118752. } else if (directSeek) {
  118753. if (!this._alwaysSeekKeyframe) {
  118754. this._requestSetTime = true;
  118755. this._mediaElement.currentTime = seconds;
  118756. } else {
  118757. var idr = this._msectl.getNearestKeyframe(Math.floor(seconds * 1e3));
  118758. this._requestSetTime = true;
  118759. if (idr != null) {
  118760. this._mediaElement.currentTime = idr.dts / 1e3;
  118761. } else {
  118762. this._mediaElement.currentTime = seconds;
  118763. }
  118764. }
  118765. if (this._progressChecker != null) {
  118766. this._checkProgressAndResume();
  118767. }
  118768. } else {
  118769. if (this._progressChecker != null) {
  118770. window.clearInterval(this._progressChecker);
  118771. this._progressChecker = null;
  118772. }
  118773. this._msectl.seek(seconds);
  118774. this._transmuxer.seek(Math.floor(seconds * 1e3));
  118775. if (this._config.accurateSeek) {
  118776. this._requestSetTime = true;
  118777. this._mediaElement.currentTime = seconds;
  118778. }
  118779. }
  118780. };
  118781. FlvPlayer2.prototype._checkAndApplyUnbufferedSeekpoint = function() {
  118782. if (this._seekpointRecord) {
  118783. if (this._seekpointRecord.recordTime <= this._now() - 100) {
  118784. var target = this._mediaElement.currentTime;
  118785. this._seekpointRecord = null;
  118786. if (!this._isTimepointBuffered(target)) {
  118787. if (this._progressChecker != null) {
  118788. window.clearTimeout(this._progressChecker);
  118789. this._progressChecker = null;
  118790. }
  118791. this._msectl.seek(target);
  118792. this._transmuxer.seek(Math.floor(target * 1e3));
  118793. if (this._config.accurateSeek) {
  118794. this._requestSetTime = true;
  118795. this._mediaElement.currentTime = target;
  118796. }
  118797. }
  118798. } else {
  118799. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118800. }
  118801. }
  118802. };
  118803. FlvPlayer2.prototype._checkAndResumeStuckPlayback = function(stalled) {
  118804. var media = this._mediaElement;
  118805. if (stalled || !this._receivedCanPlay || media.readyState < 2) {
  118806. var buffered = media.buffered;
  118807. if (buffered.length > 0 && media.currentTime < buffered.start(0)) {
  118808. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.w(this.TAG, "Playback seems stuck at " + media.currentTime + ", seek to " + buffered.start(0));
  118809. this._requestSetTime = true;
  118810. this._mediaElement.currentTime = buffered.start(0);
  118811. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118812. }
  118813. } else {
  118814. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118815. }
  118816. };
  118817. FlvPlayer2.prototype._onvLoadedMetadata = function(e) {
  118818. if (this._pendingSeekTime != null) {
  118819. this._mediaElement.currentTime = this._pendingSeekTime;
  118820. this._pendingSeekTime = null;
  118821. }
  118822. };
  118823. FlvPlayer2.prototype._onvSeeking = function(e) {
  118824. var target = this._mediaElement.currentTime;
  118825. var buffered = this._mediaElement.buffered;
  118826. if (this._requestSetTime) {
  118827. this._requestSetTime = false;
  118828. return;
  118829. }
  118830. if (target < 1 && buffered.length > 0) {
  118831. var videoBeginTime = buffered.start(0);
  118832. if (videoBeginTime < 1 && target < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118833. this._requestSetTime = true;
  118834. this._mediaElement.currentTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118835. return;
  118836. }
  118837. }
  118838. if (this._isTimepointBuffered(target)) {
  118839. if (this._alwaysSeekKeyframe) {
  118840. var idr = this._msectl.getNearestKeyframe(Math.floor(target * 1e3));
  118841. if (idr != null) {
  118842. this._requestSetTime = true;
  118843. this._mediaElement.currentTime = idr.dts / 1e3;
  118844. }
  118845. }
  118846. if (this._progressChecker != null) {
  118847. this._checkProgressAndResume();
  118848. }
  118849. return;
  118850. }
  118851. this._seekpointRecord = {
  118852. seekPoint: target,
  118853. recordTime: this._now()
  118854. };
  118855. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118856. };
  118857. FlvPlayer2.prototype._onvCanPlay = function(e) {
  118858. this._receivedCanPlay = true;
  118859. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118860. };
  118861. FlvPlayer2.prototype._onvStalled = function(e) {
  118862. this._checkAndResumeStuckPlayback(true);
  118863. };
  118864. FlvPlayer2.prototype._onvProgress = function(e) {
  118865. this._checkAndResumeStuckPlayback();
  118866. };
  118867. return FlvPlayer2;
  118868. }();
  118869. __webpack_exports__2["default"] = FlvPlayer;
  118870. },
  118871. "./src/player/native-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118872. __webpack_require__2.r(__webpack_exports__2);
  118873. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118874. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118875. var _player_events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/player/player-events.js");
  118876. var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/config.js");
  118877. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  118878. var NativePlayer = function() {
  118879. function NativePlayer2(mediaDataSource, config) {
  118880. this.TAG = "NativePlayer";
  118881. this._type = "NativePlayer";
  118882. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118883. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_2__.createDefaultConfig)();
  118884. if (typeof config === "object") {
  118885. Object.assign(this._config, config);
  118886. }
  118887. if (mediaDataSource.type.toLowerCase() === "flv") {
  118888. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");
  118889. }
  118890. if (mediaDataSource.hasOwnProperty("segments")) {
  118891. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer(" + mediaDataSource.type + ") doesn't support multipart playback!");
  118892. }
  118893. this.e = {
  118894. onvLoadedMetadata: this._onvLoadedMetadata.bind(this)
  118895. };
  118896. this._pendingSeekTime = null;
  118897. this._statisticsReporter = null;
  118898. this._mediaDataSource = mediaDataSource;
  118899. this._mediaElement = null;
  118900. }
  118901. NativePlayer2.prototype.destroy = function() {
  118902. if (this._mediaElement) {
  118903. this.unload();
  118904. this.detachMediaElement();
  118905. }
  118906. this.e = null;
  118907. this._mediaDataSource = null;
  118908. this._emitter.removeAllListeners();
  118909. this._emitter = null;
  118910. };
  118911. NativePlayer2.prototype.on = function(event2, listener) {
  118912. var _this = this;
  118913. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO) {
  118914. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118915. Promise.resolve().then(function() {
  118916. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, _this.mediaInfo);
  118917. });
  118918. }
  118919. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO) {
  118920. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118921. Promise.resolve().then(function() {
  118922. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, _this.statisticsInfo);
  118923. });
  118924. }
  118925. }
  118926. this._emitter.addListener(event2, listener);
  118927. };
  118928. NativePlayer2.prototype.off = function(event2, listener) {
  118929. this._emitter.removeListener(event2, listener);
  118930. };
  118931. NativePlayer2.prototype.attachMediaElement = function(mediaElement) {
  118932. this._mediaElement = mediaElement;
  118933. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118934. if (this._pendingSeekTime != null) {
  118935. try {
  118936. mediaElement.currentTime = this._pendingSeekTime;
  118937. this._pendingSeekTime = null;
  118938. } catch (e) {
  118939. }
  118940. }
  118941. };
  118942. NativePlayer2.prototype.detachMediaElement = function() {
  118943. if (this._mediaElement) {
  118944. this._mediaElement.src = "";
  118945. this._mediaElement.removeAttribute("src");
  118946. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118947. this._mediaElement = null;
  118948. }
  118949. if (this._statisticsReporter != null) {
  118950. window.clearInterval(this._statisticsReporter);
  118951. this._statisticsReporter = null;
  118952. }
  118953. };
  118954. NativePlayer2.prototype.load = function() {
  118955. if (!this._mediaElement) {
  118956. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118957. }
  118958. this._mediaElement.src = this._mediaDataSource.url;
  118959. if (this._mediaElement.readyState > 0) {
  118960. this._mediaElement.currentTime = 0;
  118961. }
  118962. this._mediaElement.preload = "auto";
  118963. this._mediaElement.load();
  118964. this._statisticsReporter = window.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  118965. };
  118966. NativePlayer2.prototype.unload = function() {
  118967. if (this._mediaElement) {
  118968. this._mediaElement.src = "";
  118969. this._mediaElement.removeAttribute("src");
  118970. }
  118971. if (this._statisticsReporter != null) {
  118972. window.clearInterval(this._statisticsReporter);
  118973. this._statisticsReporter = null;
  118974. }
  118975. };
  118976. NativePlayer2.prototype.play = function() {
  118977. return this._mediaElement.play();
  118978. };
  118979. NativePlayer2.prototype.pause = function() {
  118980. this._mediaElement.pause();
  118981. };
  118982. Object.defineProperty(NativePlayer2.prototype, "type", {
  118983. get: function() {
  118984. return this._type;
  118985. },
  118986. enumerable: false,
  118987. configurable: true
  118988. });
  118989. Object.defineProperty(NativePlayer2.prototype, "buffered", {
  118990. get: function() {
  118991. return this._mediaElement.buffered;
  118992. },
  118993. enumerable: false,
  118994. configurable: true
  118995. });
  118996. Object.defineProperty(NativePlayer2.prototype, "duration", {
  118997. get: function() {
  118998. return this._mediaElement.duration;
  118999. },
  119000. enumerable: false,
  119001. configurable: true
  119002. });
  119003. Object.defineProperty(NativePlayer2.prototype, "volume", {
  119004. get: function() {
  119005. return this._mediaElement.volume;
  119006. },
  119007. set: function(value) {
  119008. this._mediaElement.volume = value;
  119009. },
  119010. enumerable: false,
  119011. configurable: true
  119012. });
  119013. Object.defineProperty(NativePlayer2.prototype, "muted", {
  119014. get: function() {
  119015. return this._mediaElement.muted;
  119016. },
  119017. set: function(muted) {
  119018. this._mediaElement.muted = muted;
  119019. },
  119020. enumerable: false,
  119021. configurable: true
  119022. });
  119023. Object.defineProperty(NativePlayer2.prototype, "currentTime", {
  119024. get: function() {
  119025. if (this._mediaElement) {
  119026. return this._mediaElement.currentTime;
  119027. }
  119028. return 0;
  119029. },
  119030. set: function(seconds) {
  119031. if (this._mediaElement) {
  119032. this._mediaElement.currentTime = seconds;
  119033. } else {
  119034. this._pendingSeekTime = seconds;
  119035. }
  119036. },
  119037. enumerable: false,
  119038. configurable: true
  119039. });
  119040. Object.defineProperty(NativePlayer2.prototype, "mediaInfo", {
  119041. get: function() {
  119042. var mediaPrefix = this._mediaElement instanceof HTMLAudioElement ? "audio/" : "video/";
  119043. var info = {
  119044. mimeType: mediaPrefix + this._mediaDataSource.type
  119045. };
  119046. if (this._mediaElement) {
  119047. info.duration = Math.floor(this._mediaElement.duration * 1e3);
  119048. if (this._mediaElement instanceof HTMLVideoElement) {
  119049. info.width = this._mediaElement.videoWidth;
  119050. info.height = this._mediaElement.videoHeight;
  119051. }
  119052. }
  119053. return info;
  119054. },
  119055. enumerable: false,
  119056. configurable: true
  119057. });
  119058. Object.defineProperty(NativePlayer2.prototype, "statisticsInfo", {
  119059. get: function() {
  119060. var info = {
  119061. playerType: this._type,
  119062. url: this._mediaDataSource.url
  119063. };
  119064. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  119065. return info;
  119066. }
  119067. var hasQualityInfo = true;
  119068. var decoded = 0;
  119069. var dropped = 0;
  119070. if (this._mediaElement.getVideoPlaybackQuality) {
  119071. var quality = this._mediaElement.getVideoPlaybackQuality();
  119072. decoded = quality.totalVideoFrames;
  119073. dropped = quality.droppedVideoFrames;
  119074. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  119075. decoded = this._mediaElement.webkitDecodedFrameCount;
  119076. dropped = this._mediaElement.webkitDroppedFrameCount;
  119077. } else {
  119078. hasQualityInfo = false;
  119079. }
  119080. if (hasQualityInfo) {
  119081. info.decodedFrames = decoded;
  119082. info.droppedFrames = dropped;
  119083. }
  119084. return info;
  119085. },
  119086. enumerable: false,
  119087. configurable: true
  119088. });
  119089. NativePlayer2.prototype._onvLoadedMetadata = function(e) {
  119090. if (this._pendingSeekTime != null) {
  119091. this._mediaElement.currentTime = this._pendingSeekTime;
  119092. this._pendingSeekTime = null;
  119093. }
  119094. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, this.mediaInfo);
  119095. };
  119096. NativePlayer2.prototype._reportStatisticsInfo = function() {
  119097. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, this.statisticsInfo);
  119098. };
  119099. return NativePlayer2;
  119100. }();
  119101. __webpack_exports__2["default"] = NativePlayer;
  119102. },
  119103. "./src/player/player-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119104. __webpack_require__2.r(__webpack_exports__2);
  119105. __webpack_require__2.d(__webpack_exports__2, {
  119106. "ErrorTypes": function() {
  119107. return ErrorTypes;
  119108. },
  119109. "ErrorDetails": function() {
  119110. return ErrorDetails;
  119111. }
  119112. });
  119113. var _io_loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  119114. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/demux-errors.js");
  119115. var ErrorTypes = {
  119116. NETWORK_ERROR: "NetworkError",
  119117. MEDIA_ERROR: "MediaError",
  119118. OTHER_ERROR: "OtherError"
  119119. };
  119120. var ErrorDetails = {
  119121. NETWORK_EXCEPTION: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION,
  119122. NETWORK_STATUS_CODE_INVALID: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.HTTP_STATUS_CODE_INVALID,
  119123. NETWORK_TIMEOUT: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.CONNECTING_TIMEOUT,
  119124. NETWORK_UNRECOVERABLE_EARLY_EOF: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.UNRECOVERABLE_EARLY_EOF,
  119125. MEDIA_MSE_ERROR: "MediaMSEError",
  119126. MEDIA_FORMAT_ERROR: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_ERROR,
  119127. MEDIA_FORMAT_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_UNSUPPORTED,
  119128. MEDIA_CODEC_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.CODEC_UNSUPPORTED
  119129. };
  119130. },
  119131. "./src/player/player-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119132. __webpack_require__2.r(__webpack_exports__2);
  119133. var PlayerEvents = {
  119134. ERROR: "error",
  119135. LOADING_COMPLETE: "loading_complete",
  119136. RECOVERED_EARLY_EOF: "recovered_early_eof",
  119137. MEDIA_INFO: "media_info",
  119138. METADATA_ARRIVED: "metadata_arrived",
  119139. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  119140. STATISTICS_INFO: "statistics_info"
  119141. };
  119142. __webpack_exports__2["default"] = PlayerEvents;
  119143. },
  119144. "./src/remux/aac-silent.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119145. __webpack_require__2.r(__webpack_exports__2);
  119146. var AAC = function() {
  119147. function AAC2() {
  119148. }
  119149. AAC2.getSilentFrame = function(codec, channelCount) {
  119150. if (codec === "mp4a.40.2") {
  119151. if (channelCount === 1) {
  119152. return new Uint8Array([0, 200, 0, 128, 35, 128]);
  119153. } else if (channelCount === 2) {
  119154. return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
  119155. } else if (channelCount === 3) {
  119156. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
  119157. } else if (channelCount === 4) {
  119158. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
  119159. } else if (channelCount === 5) {
  119160. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
  119161. } else if (channelCount === 6) {
  119162. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 0, 178, 0, 32, 8, 224]);
  119163. }
  119164. } else {
  119165. if (channelCount === 1) {
  119166. return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119167. } else if (channelCount === 2) {
  119168. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119169. } else if (channelCount === 3) {
  119170. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119171. }
  119172. }
  119173. return null;
  119174. };
  119175. return AAC2;
  119176. }();
  119177. __webpack_exports__2["default"] = AAC;
  119178. },
  119179. "./src/remux/mp4-generator.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119180. __webpack_require__2.r(__webpack_exports__2);
  119181. var MP4 = function() {
  119182. function MP42() {
  119183. }
  119184. MP42.init = function() {
  119185. MP42.types = {
  119186. avc1: [],
  119187. avcC: [],
  119188. btrt: [],
  119189. dinf: [],
  119190. dref: [],
  119191. esds: [],
  119192. ftyp: [],
  119193. hdlr: [],
  119194. mdat: [],
  119195. mdhd: [],
  119196. mdia: [],
  119197. mfhd: [],
  119198. minf: [],
  119199. moof: [],
  119200. moov: [],
  119201. mp4a: [],
  119202. mvex: [],
  119203. mvhd: [],
  119204. sdtp: [],
  119205. stbl: [],
  119206. stco: [],
  119207. stsc: [],
  119208. stsd: [],
  119209. stsz: [],
  119210. stts: [],
  119211. tfdt: [],
  119212. tfhd: [],
  119213. traf: [],
  119214. trak: [],
  119215. trun: [],
  119216. trex: [],
  119217. tkhd: [],
  119218. vmhd: [],
  119219. smhd: [],
  119220. ".mp3": []
  119221. };
  119222. for (var name_1 in MP42.types) {
  119223. if (MP42.types.hasOwnProperty(name_1)) {
  119224. MP42.types[name_1] = [
  119225. name_1.charCodeAt(0),
  119226. name_1.charCodeAt(1),
  119227. name_1.charCodeAt(2),
  119228. name_1.charCodeAt(3)
  119229. ];
  119230. }
  119231. }
  119232. var constants = MP42.constants = {};
  119233. constants.FTYP = new Uint8Array([
  119234. 105,
  119235. 115,
  119236. 111,
  119237. 109,
  119238. 0,
  119239. 0,
  119240. 0,
  119241. 1,
  119242. 105,
  119243. 115,
  119244. 111,
  119245. 109,
  119246. 97,
  119247. 118,
  119248. 99,
  119249. 49
  119250. ]);
  119251. constants.STSD_PREFIX = new Uint8Array([
  119252. 0,
  119253. 0,
  119254. 0,
  119255. 0,
  119256. 0,
  119257. 0,
  119258. 0,
  119259. 1
  119260. ]);
  119261. constants.STTS = new Uint8Array([
  119262. 0,
  119263. 0,
  119264. 0,
  119265. 0,
  119266. 0,
  119267. 0,
  119268. 0,
  119269. 0
  119270. ]);
  119271. constants.STSC = constants.STCO = constants.STTS;
  119272. constants.STSZ = new Uint8Array([
  119273. 0,
  119274. 0,
  119275. 0,
  119276. 0,
  119277. 0,
  119278. 0,
  119279. 0,
  119280. 0,
  119281. 0,
  119282. 0,
  119283. 0,
  119284. 0
  119285. ]);
  119286. constants.HDLR_VIDEO = new Uint8Array([
  119287. 0,
  119288. 0,
  119289. 0,
  119290. 0,
  119291. 0,
  119292. 0,
  119293. 0,
  119294. 0,
  119295. 118,
  119296. 105,
  119297. 100,
  119298. 101,
  119299. 0,
  119300. 0,
  119301. 0,
  119302. 0,
  119303. 0,
  119304. 0,
  119305. 0,
  119306. 0,
  119307. 0,
  119308. 0,
  119309. 0,
  119310. 0,
  119311. 86,
  119312. 105,
  119313. 100,
  119314. 101,
  119315. 111,
  119316. 72,
  119317. 97,
  119318. 110,
  119319. 100,
  119320. 108,
  119321. 101,
  119322. 114,
  119323. 0
  119324. ]);
  119325. constants.HDLR_AUDIO = new Uint8Array([
  119326. 0,
  119327. 0,
  119328. 0,
  119329. 0,
  119330. 0,
  119331. 0,
  119332. 0,
  119333. 0,
  119334. 115,
  119335. 111,
  119336. 117,
  119337. 110,
  119338. 0,
  119339. 0,
  119340. 0,
  119341. 0,
  119342. 0,
  119343. 0,
  119344. 0,
  119345. 0,
  119346. 0,
  119347. 0,
  119348. 0,
  119349. 0,
  119350. 83,
  119351. 111,
  119352. 117,
  119353. 110,
  119354. 100,
  119355. 72,
  119356. 97,
  119357. 110,
  119358. 100,
  119359. 108,
  119360. 101,
  119361. 114,
  119362. 0
  119363. ]);
  119364. constants.DREF = new Uint8Array([
  119365. 0,
  119366. 0,
  119367. 0,
  119368. 0,
  119369. 0,
  119370. 0,
  119371. 0,
  119372. 1,
  119373. 0,
  119374. 0,
  119375. 0,
  119376. 12,
  119377. 117,
  119378. 114,
  119379. 108,
  119380. 32,
  119381. 0,
  119382. 0,
  119383. 0,
  119384. 1
  119385. ]);
  119386. constants.SMHD = new Uint8Array([
  119387. 0,
  119388. 0,
  119389. 0,
  119390. 0,
  119391. 0,
  119392. 0,
  119393. 0,
  119394. 0
  119395. ]);
  119396. constants.VMHD = new Uint8Array([
  119397. 0,
  119398. 0,
  119399. 0,
  119400. 1,
  119401. 0,
  119402. 0,
  119403. 0,
  119404. 0,
  119405. 0,
  119406. 0,
  119407. 0,
  119408. 0
  119409. ]);
  119410. };
  119411. MP42.box = function(type2) {
  119412. var size = 8;
  119413. var result = null;
  119414. var datas = Array.prototype.slice.call(arguments, 1);
  119415. var arrayCount = datas.length;
  119416. for (var i2 = 0; i2 < arrayCount; i2++) {
  119417. size += datas[i2].byteLength;
  119418. }
  119419. result = new Uint8Array(size);
  119420. result[0] = size >>> 24 & 255;
  119421. result[1] = size >>> 16 & 255;
  119422. result[2] = size >>> 8 & 255;
  119423. result[3] = size & 255;
  119424. result.set(type2, 4);
  119425. var offset = 8;
  119426. for (var i2 = 0; i2 < arrayCount; i2++) {
  119427. result.set(datas[i2], offset);
  119428. offset += datas[i2].byteLength;
  119429. }
  119430. return result;
  119431. };
  119432. MP42.generateInitSegment = function(meta2) {
  119433. var ftyp = MP42.box(MP42.types.ftyp, MP42.constants.FTYP);
  119434. var moov = MP42.moov(meta2);
  119435. var result = new Uint8Array(ftyp.byteLength + moov.byteLength);
  119436. result.set(ftyp, 0);
  119437. result.set(moov, ftyp.byteLength);
  119438. return result;
  119439. };
  119440. MP42.moov = function(meta2) {
  119441. var mvhd = MP42.mvhd(meta2.timescale, meta2.duration);
  119442. var trak = MP42.trak(meta2);
  119443. var mvex = MP42.mvex(meta2);
  119444. return MP42.box(MP42.types.moov, mvhd, trak, mvex);
  119445. };
  119446. MP42.mvhd = function(timescale2, duration5) {
  119447. return MP42.box(MP42.types.mvhd, new Uint8Array([
  119448. 0,
  119449. 0,
  119450. 0,
  119451. 0,
  119452. 0,
  119453. 0,
  119454. 0,
  119455. 0,
  119456. 0,
  119457. 0,
  119458. 0,
  119459. 0,
  119460. timescale2 >>> 24 & 255,
  119461. timescale2 >>> 16 & 255,
  119462. timescale2 >>> 8 & 255,
  119463. timescale2 & 255,
  119464. duration5 >>> 24 & 255,
  119465. duration5 >>> 16 & 255,
  119466. duration5 >>> 8 & 255,
  119467. duration5 & 255,
  119468. 0,
  119469. 1,
  119470. 0,
  119471. 0,
  119472. 1,
  119473. 0,
  119474. 0,
  119475. 0,
  119476. 0,
  119477. 0,
  119478. 0,
  119479. 0,
  119480. 0,
  119481. 0,
  119482. 0,
  119483. 0,
  119484. 0,
  119485. 1,
  119486. 0,
  119487. 0,
  119488. 0,
  119489. 0,
  119490. 0,
  119491. 0,
  119492. 0,
  119493. 0,
  119494. 0,
  119495. 0,
  119496. 0,
  119497. 0,
  119498. 0,
  119499. 0,
  119500. 0,
  119501. 1,
  119502. 0,
  119503. 0,
  119504. 0,
  119505. 0,
  119506. 0,
  119507. 0,
  119508. 0,
  119509. 0,
  119510. 0,
  119511. 0,
  119512. 0,
  119513. 0,
  119514. 0,
  119515. 0,
  119516. 64,
  119517. 0,
  119518. 0,
  119519. 0,
  119520. 0,
  119521. 0,
  119522. 0,
  119523. 0,
  119524. 0,
  119525. 0,
  119526. 0,
  119527. 0,
  119528. 0,
  119529. 0,
  119530. 0,
  119531. 0,
  119532. 0,
  119533. 0,
  119534. 0,
  119535. 0,
  119536. 0,
  119537. 0,
  119538. 0,
  119539. 0,
  119540. 0,
  119541. 0,
  119542. 0,
  119543. 0,
  119544. 255,
  119545. 255,
  119546. 255,
  119547. 255
  119548. ]));
  119549. };
  119550. MP42.trak = function(meta2) {
  119551. return MP42.box(MP42.types.trak, MP42.tkhd(meta2), MP42.mdia(meta2));
  119552. };
  119553. MP42.tkhd = function(meta2) {
  119554. var trackId = meta2.id, duration5 = meta2.duration;
  119555. var width2 = meta2.presentWidth, height2 = meta2.presentHeight;
  119556. return MP42.box(MP42.types.tkhd, new Uint8Array([
  119557. 0,
  119558. 0,
  119559. 0,
  119560. 7,
  119561. 0,
  119562. 0,
  119563. 0,
  119564. 0,
  119565. 0,
  119566. 0,
  119567. 0,
  119568. 0,
  119569. trackId >>> 24 & 255,
  119570. trackId >>> 16 & 255,
  119571. trackId >>> 8 & 255,
  119572. trackId & 255,
  119573. 0,
  119574. 0,
  119575. 0,
  119576. 0,
  119577. duration5 >>> 24 & 255,
  119578. duration5 >>> 16 & 255,
  119579. duration5 >>> 8 & 255,
  119580. duration5 & 255,
  119581. 0,
  119582. 0,
  119583. 0,
  119584. 0,
  119585. 0,
  119586. 0,
  119587. 0,
  119588. 0,
  119589. 0,
  119590. 0,
  119591. 0,
  119592. 0,
  119593. 0,
  119594. 0,
  119595. 0,
  119596. 0,
  119597. 0,
  119598. 1,
  119599. 0,
  119600. 0,
  119601. 0,
  119602. 0,
  119603. 0,
  119604. 0,
  119605. 0,
  119606. 0,
  119607. 0,
  119608. 0,
  119609. 0,
  119610. 0,
  119611. 0,
  119612. 0,
  119613. 0,
  119614. 1,
  119615. 0,
  119616. 0,
  119617. 0,
  119618. 0,
  119619. 0,
  119620. 0,
  119621. 0,
  119622. 0,
  119623. 0,
  119624. 0,
  119625. 0,
  119626. 0,
  119627. 0,
  119628. 0,
  119629. 64,
  119630. 0,
  119631. 0,
  119632. 0,
  119633. width2 >>> 8 & 255,
  119634. width2 & 255,
  119635. 0,
  119636. 0,
  119637. height2 >>> 8 & 255,
  119638. height2 & 255,
  119639. 0,
  119640. 0
  119641. ]));
  119642. };
  119643. MP42.mdia = function(meta2) {
  119644. return MP42.box(MP42.types.mdia, MP42.mdhd(meta2), MP42.hdlr(meta2), MP42.minf(meta2));
  119645. };
  119646. MP42.mdhd = function(meta2) {
  119647. var timescale2 = meta2.timescale;
  119648. var duration5 = meta2.duration;
  119649. return MP42.box(MP42.types.mdhd, new Uint8Array([
  119650. 0,
  119651. 0,
  119652. 0,
  119653. 0,
  119654. 0,
  119655. 0,
  119656. 0,
  119657. 0,
  119658. 0,
  119659. 0,
  119660. 0,
  119661. 0,
  119662. timescale2 >>> 24 & 255,
  119663. timescale2 >>> 16 & 255,
  119664. timescale2 >>> 8 & 255,
  119665. timescale2 & 255,
  119666. duration5 >>> 24 & 255,
  119667. duration5 >>> 16 & 255,
  119668. duration5 >>> 8 & 255,
  119669. duration5 & 255,
  119670. 85,
  119671. 196,
  119672. 0,
  119673. 0
  119674. ]));
  119675. };
  119676. MP42.hdlr = function(meta2) {
  119677. var data = null;
  119678. if (meta2.type === "audio") {
  119679. data = MP42.constants.HDLR_AUDIO;
  119680. } else {
  119681. data = MP42.constants.HDLR_VIDEO;
  119682. }
  119683. return MP42.box(MP42.types.hdlr, data);
  119684. };
  119685. MP42.minf = function(meta2) {
  119686. var xmhd = null;
  119687. if (meta2.type === "audio") {
  119688. xmhd = MP42.box(MP42.types.smhd, MP42.constants.SMHD);
  119689. } else {
  119690. xmhd = MP42.box(MP42.types.vmhd, MP42.constants.VMHD);
  119691. }
  119692. return MP42.box(MP42.types.minf, xmhd, MP42.dinf(), MP42.stbl(meta2));
  119693. };
  119694. MP42.dinf = function() {
  119695. var result = MP42.box(MP42.types.dinf, MP42.box(MP42.types.dref, MP42.constants.DREF));
  119696. return result;
  119697. };
  119698. MP42.stbl = function(meta2) {
  119699. var result = MP42.box(
  119700. MP42.types.stbl,
  119701. MP42.stsd(meta2),
  119702. MP42.box(MP42.types.stts, MP42.constants.STTS),
  119703. MP42.box(MP42.types.stsc, MP42.constants.STSC),
  119704. MP42.box(MP42.types.stsz, MP42.constants.STSZ),
  119705. MP42.box(MP42.types.stco, MP42.constants.STCO)
  119706. );
  119707. return result;
  119708. };
  119709. MP42.stsd = function(meta2) {
  119710. if (meta2.type === "audio") {
  119711. if (meta2.codec === "mp3") {
  119712. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp3(meta2));
  119713. }
  119714. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp4a(meta2));
  119715. } else {
  119716. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.avc1(meta2));
  119717. }
  119718. };
  119719. MP42.mp3 = function(meta2) {
  119720. var channelCount = meta2.channelCount;
  119721. var sampleRate = meta2.audioSampleRate;
  119722. var data = new Uint8Array([
  119723. 0,
  119724. 0,
  119725. 0,
  119726. 0,
  119727. 0,
  119728. 0,
  119729. 0,
  119730. 1,
  119731. 0,
  119732. 0,
  119733. 0,
  119734. 0,
  119735. 0,
  119736. 0,
  119737. 0,
  119738. 0,
  119739. 0,
  119740. channelCount,
  119741. 0,
  119742. 16,
  119743. 0,
  119744. 0,
  119745. 0,
  119746. 0,
  119747. sampleRate >>> 8 & 255,
  119748. sampleRate & 255,
  119749. 0,
  119750. 0
  119751. ]);
  119752. return MP42.box(MP42.types[".mp3"], data);
  119753. };
  119754. MP42.mp4a = function(meta2) {
  119755. var channelCount = meta2.channelCount;
  119756. var sampleRate = meta2.audioSampleRate;
  119757. var data = new Uint8Array([
  119758. 0,
  119759. 0,
  119760. 0,
  119761. 0,
  119762. 0,
  119763. 0,
  119764. 0,
  119765. 1,
  119766. 0,
  119767. 0,
  119768. 0,
  119769. 0,
  119770. 0,
  119771. 0,
  119772. 0,
  119773. 0,
  119774. 0,
  119775. channelCount,
  119776. 0,
  119777. 16,
  119778. 0,
  119779. 0,
  119780. 0,
  119781. 0,
  119782. sampleRate >>> 8 & 255,
  119783. sampleRate & 255,
  119784. 0,
  119785. 0
  119786. ]);
  119787. return MP42.box(MP42.types.mp4a, data, MP42.esds(meta2));
  119788. };
  119789. MP42.esds = function(meta2) {
  119790. var config = meta2.config || [];
  119791. var configSize = config.length;
  119792. var data = new Uint8Array([
  119793. 0,
  119794. 0,
  119795. 0,
  119796. 0,
  119797. 3,
  119798. 23 + configSize,
  119799. 0,
  119800. 1,
  119801. 0,
  119802. 4,
  119803. 15 + configSize,
  119804. 64,
  119805. 21,
  119806. 0,
  119807. 0,
  119808. 0,
  119809. 0,
  119810. 0,
  119811. 0,
  119812. 0,
  119813. 0,
  119814. 0,
  119815. 0,
  119816. 0,
  119817. 5
  119818. ].concat([
  119819. configSize
  119820. ]).concat(config).concat([
  119821. 6,
  119822. 1,
  119823. 2
  119824. ]));
  119825. return MP42.box(MP42.types.esds, data);
  119826. };
  119827. MP42.avc1 = function(meta2) {
  119828. var avcc = meta2.avcc;
  119829. var width2 = meta2.codecWidth, height2 = meta2.codecHeight;
  119830. var data = new Uint8Array([
  119831. 0,
  119832. 0,
  119833. 0,
  119834. 0,
  119835. 0,
  119836. 0,
  119837. 0,
  119838. 1,
  119839. 0,
  119840. 0,
  119841. 0,
  119842. 0,
  119843. 0,
  119844. 0,
  119845. 0,
  119846. 0,
  119847. 0,
  119848. 0,
  119849. 0,
  119850. 0,
  119851. 0,
  119852. 0,
  119853. 0,
  119854. 0,
  119855. width2 >>> 8 & 255,
  119856. width2 & 255,
  119857. height2 >>> 8 & 255,
  119858. height2 & 255,
  119859. 0,
  119860. 72,
  119861. 0,
  119862. 0,
  119863. 0,
  119864. 72,
  119865. 0,
  119866. 0,
  119867. 0,
  119868. 0,
  119869. 0,
  119870. 0,
  119871. 0,
  119872. 1,
  119873. 10,
  119874. 120,
  119875. 113,
  119876. 113,
  119877. 47,
  119878. 102,
  119879. 108,
  119880. 118,
  119881. 46,
  119882. 106,
  119883. 115,
  119884. 0,
  119885. 0,
  119886. 0,
  119887. 0,
  119888. 0,
  119889. 0,
  119890. 0,
  119891. 0,
  119892. 0,
  119893. 0,
  119894. 0,
  119895. 0,
  119896. 0,
  119897. 0,
  119898. 0,
  119899. 0,
  119900. 0,
  119901. 0,
  119902. 0,
  119903. 0,
  119904. 0,
  119905. 0,
  119906. 24,
  119907. 255,
  119908. 255
  119909. ]);
  119910. return MP42.box(MP42.types.avc1, data, MP42.box(MP42.types.avcC, avcc));
  119911. };
  119912. MP42.mvex = function(meta2) {
  119913. return MP42.box(MP42.types.mvex, MP42.trex(meta2));
  119914. };
  119915. MP42.trex = function(meta2) {
  119916. var trackId = meta2.id;
  119917. var data = new Uint8Array([
  119918. 0,
  119919. 0,
  119920. 0,
  119921. 0,
  119922. trackId >>> 24 & 255,
  119923. trackId >>> 16 & 255,
  119924. trackId >>> 8 & 255,
  119925. trackId & 255,
  119926. 0,
  119927. 0,
  119928. 0,
  119929. 1,
  119930. 0,
  119931. 0,
  119932. 0,
  119933. 0,
  119934. 0,
  119935. 0,
  119936. 0,
  119937. 0,
  119938. 0,
  119939. 1,
  119940. 0,
  119941. 1
  119942. ]);
  119943. return MP42.box(MP42.types.trex, data);
  119944. };
  119945. MP42.moof = function(track, baseMediaDecodeTime) {
  119946. return MP42.box(MP42.types.moof, MP42.mfhd(track.sequenceNumber), MP42.traf(track, baseMediaDecodeTime));
  119947. };
  119948. MP42.mfhd = function(sequenceNumber) {
  119949. var data = new Uint8Array([
  119950. 0,
  119951. 0,
  119952. 0,
  119953. 0,
  119954. sequenceNumber >>> 24 & 255,
  119955. sequenceNumber >>> 16 & 255,
  119956. sequenceNumber >>> 8 & 255,
  119957. sequenceNumber & 255
  119958. ]);
  119959. return MP42.box(MP42.types.mfhd, data);
  119960. };
  119961. MP42.traf = function(track, baseMediaDecodeTime) {
  119962. var trackId = track.id;
  119963. var tfhd = MP42.box(MP42.types.tfhd, new Uint8Array([
  119964. 0,
  119965. 0,
  119966. 0,
  119967. 0,
  119968. trackId >>> 24 & 255,
  119969. trackId >>> 16 & 255,
  119970. trackId >>> 8 & 255,
  119971. trackId & 255
  119972. ]));
  119973. var tfdt = MP42.box(MP42.types.tfdt, new Uint8Array([
  119974. 0,
  119975. 0,
  119976. 0,
  119977. 0,
  119978. baseMediaDecodeTime >>> 24 & 255,
  119979. baseMediaDecodeTime >>> 16 & 255,
  119980. baseMediaDecodeTime >>> 8 & 255,
  119981. baseMediaDecodeTime & 255
  119982. ]));
  119983. var sdtp = MP42.sdtp(track);
  119984. var trun = MP42.trun(track, sdtp.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
  119985. return MP42.box(MP42.types.traf, tfhd, tfdt, trun, sdtp);
  119986. };
  119987. MP42.sdtp = function(track) {
  119988. var samples = track.samples || [];
  119989. var sampleCount = samples.length;
  119990. var data = new Uint8Array(4 + sampleCount);
  119991. for (var i2 = 0; i2 < sampleCount; i2++) {
  119992. var flags = samples[i2].flags;
  119993. data[i2 + 4] = flags.isLeading << 6 | flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  119994. }
  119995. return MP42.box(MP42.types.sdtp, data);
  119996. };
  119997. MP42.trun = function(track, offset) {
  119998. var samples = track.samples || [];
  119999. var sampleCount = samples.length;
  120000. var dataSize = 12 + 16 * sampleCount;
  120001. var data = new Uint8Array(dataSize);
  120002. offset += 8 + dataSize;
  120003. data.set([
  120004. 0,
  120005. 0,
  120006. 15,
  120007. 1,
  120008. sampleCount >>> 24 & 255,
  120009. sampleCount >>> 16 & 255,
  120010. sampleCount >>> 8 & 255,
  120011. sampleCount & 255,
  120012. offset >>> 24 & 255,
  120013. offset >>> 16 & 255,
  120014. offset >>> 8 & 255,
  120015. offset & 255
  120016. ], 0);
  120017. for (var i2 = 0; i2 < sampleCount; i2++) {
  120018. var duration5 = samples[i2].duration;
  120019. var size = samples[i2].size;
  120020. var flags = samples[i2].flags;
  120021. var cts = samples[i2].cts;
  120022. data.set([
  120023. duration5 >>> 24 & 255,
  120024. duration5 >>> 16 & 255,
  120025. duration5 >>> 8 & 255,
  120026. duration5 & 255,
  120027. size >>> 24 & 255,
  120028. size >>> 16 & 255,
  120029. size >>> 8 & 255,
  120030. size & 255,
  120031. flags.isLeading << 2 | flags.dependsOn,
  120032. flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.isNonSync,
  120033. 0,
  120034. 0,
  120035. cts >>> 24 & 255,
  120036. cts >>> 16 & 255,
  120037. cts >>> 8 & 255,
  120038. cts & 255
  120039. ], 12 + 16 * i2);
  120040. }
  120041. return MP42.box(MP42.types.trun, data);
  120042. };
  120043. MP42.mdat = function(data) {
  120044. return MP42.box(MP42.types.mdat, data);
  120045. };
  120046. return MP42;
  120047. }();
  120048. MP4.init();
  120049. __webpack_exports__2["default"] = MP4;
  120050. },
  120051. "./src/remux/mp4-remuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120052. __webpack_require__2.r(__webpack_exports__2);
  120053. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  120054. var _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/remux/mp4-generator.js");
  120055. var _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/remux/aac-silent.js");
  120056. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/browser.js");
  120057. var _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  120058. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  120059. var MP4Remuxer = function() {
  120060. function MP4Remuxer2(config) {
  120061. this.TAG = "MP4Remuxer";
  120062. this._config = config;
  120063. this._isLive = config.isLive === true ? true : false;
  120064. this._dtsBase = -1;
  120065. this._dtsBaseInited = false;
  120066. this._audioDtsBase = Infinity;
  120067. this._videoDtsBase = Infinity;
  120068. this._audioNextDts = void 0;
  120069. this._videoNextDts = void 0;
  120070. this._audioStashedLastSample = null;
  120071. this._videoStashedLastSample = null;
  120072. this._audioMeta = null;
  120073. this._videoMeta = null;
  120074. this._audioSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("audio");
  120075. this._videoSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("video");
  120076. this._onInitSegment = null;
  120077. this._onMediaSegment = null;
  120078. this._forceFirstIDR = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.build < 2661) ? true : false;
  120079. this._fillSilentAfterSeek = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msie;
  120080. this._mp3UseMpegAudio = !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.firefox;
  120081. this._fillAudioTimestampGap = this._config.fixAudioTimestampGap;
  120082. }
  120083. MP4Remuxer2.prototype.destroy = function() {
  120084. this._dtsBase = -1;
  120085. this._dtsBaseInited = false;
  120086. this._audioMeta = null;
  120087. this._videoMeta = null;
  120088. this._audioSegmentInfoList.clear();
  120089. this._audioSegmentInfoList = null;
  120090. this._videoSegmentInfoList.clear();
  120091. this._videoSegmentInfoList = null;
  120092. this._onInitSegment = null;
  120093. this._onMediaSegment = null;
  120094. };
  120095. MP4Remuxer2.prototype.bindDataSource = function(producer) {
  120096. producer.onDataAvailable = this.remux.bind(this);
  120097. producer.onTrackMetadata = this._onTrackMetadataReceived.bind(this);
  120098. return this;
  120099. };
  120100. Object.defineProperty(MP4Remuxer2.prototype, "onInitSegment", {
  120101. get: function() {
  120102. return this._onInitSegment;
  120103. },
  120104. set: function(callback2) {
  120105. this._onInitSegment = callback2;
  120106. },
  120107. enumerable: false,
  120108. configurable: true
  120109. });
  120110. Object.defineProperty(MP4Remuxer2.prototype, "onMediaSegment", {
  120111. get: function() {
  120112. return this._onMediaSegment;
  120113. },
  120114. set: function(callback2) {
  120115. this._onMediaSegment = callback2;
  120116. },
  120117. enumerable: false,
  120118. configurable: true
  120119. });
  120120. MP4Remuxer2.prototype.insertDiscontinuity = function() {
  120121. this._audioNextDts = this._videoNextDts = void 0;
  120122. };
  120123. MP4Remuxer2.prototype.seek = function(originalDts) {
  120124. this._audioStashedLastSample = null;
  120125. this._videoStashedLastSample = null;
  120126. this._videoSegmentInfoList.clear();
  120127. this._audioSegmentInfoList.clear();
  120128. };
  120129. MP4Remuxer2.prototype.remux = function(audioTrack, videoTrack) {
  120130. if (!this._onMediaSegment) {
  120131. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");
  120132. }
  120133. if (!this._dtsBaseInited) {
  120134. this._calculateDtsBase(audioTrack, videoTrack);
  120135. }
  120136. this._remuxVideo(videoTrack);
  120137. this._remuxAudio(audioTrack);
  120138. };
  120139. MP4Remuxer2.prototype._onTrackMetadataReceived = function(type2, metadata) {
  120140. var metabox = null;
  120141. var container = "mp4";
  120142. var codec = metadata.codec;
  120143. if (type2 === "audio") {
  120144. this._audioMeta = metadata;
  120145. if (metadata.codec === "mp3" && this._mp3UseMpegAudio) {
  120146. container = "mpeg";
  120147. codec = "";
  120148. metabox = new Uint8Array();
  120149. } else {
  120150. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120151. }
  120152. } else if (type2 === "video") {
  120153. this._videoMeta = metadata;
  120154. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120155. } else {
  120156. return;
  120157. }
  120158. if (!this._onInitSegment) {
  120159. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");
  120160. }
  120161. this._onInitSegment(type2, {
  120162. type: type2,
  120163. data: metabox.buffer,
  120164. codec,
  120165. container: type2 + "/" + container,
  120166. mediaDuration: metadata.duration
  120167. });
  120168. };
  120169. MP4Remuxer2.prototype._calculateDtsBase = function(audioTrack, videoTrack) {
  120170. if (this._dtsBaseInited) {
  120171. return;
  120172. }
  120173. if (audioTrack.samples && audioTrack.samples.length) {
  120174. this._audioDtsBase = audioTrack.samples[0].dts;
  120175. }
  120176. if (videoTrack.samples && videoTrack.samples.length) {
  120177. this._videoDtsBase = videoTrack.samples[0].dts;
  120178. }
  120179. this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase);
  120180. this._dtsBaseInited = true;
  120181. };
  120182. MP4Remuxer2.prototype.flushStashedSamples = function() {
  120183. var videoSample = this._videoStashedLastSample;
  120184. var audioSample = this._audioStashedLastSample;
  120185. var videoTrack = {
  120186. type: "video",
  120187. id: 1,
  120188. sequenceNumber: 0,
  120189. samples: [],
  120190. length: 0
  120191. };
  120192. if (videoSample != null) {
  120193. videoTrack.samples.push(videoSample);
  120194. videoTrack.length = videoSample.length;
  120195. }
  120196. var audioTrack = {
  120197. type: "audio",
  120198. id: 2,
  120199. sequenceNumber: 0,
  120200. samples: [],
  120201. length: 0
  120202. };
  120203. if (audioSample != null) {
  120204. audioTrack.samples.push(audioSample);
  120205. audioTrack.length = audioSample.length;
  120206. }
  120207. this._videoStashedLastSample = null;
  120208. this._audioStashedLastSample = null;
  120209. this._remuxVideo(videoTrack, true);
  120210. this._remuxAudio(audioTrack, true);
  120211. };
  120212. MP4Remuxer2.prototype._remuxAudio = function(audioTrack, force) {
  120213. if (this._audioMeta == null) {
  120214. return;
  120215. }
  120216. var track = audioTrack;
  120217. var samples = track.samples;
  120218. var dtsCorrection = void 0;
  120219. var firstDts = -1, lastDts = -1;
  120220. var refSampleDuration = this._audioMeta.refSampleDuration;
  120221. var mpegRawTrack = this._audioMeta.codec === "mp3" && this._mp3UseMpegAudio;
  120222. var firstSegmentAfterSeek = this._dtsBaseInited && this._audioNextDts === void 0;
  120223. var insertPrefixSilentFrame = false;
  120224. if (!samples || samples.length === 0) {
  120225. return;
  120226. }
  120227. if (samples.length === 1 && !force) {
  120228. return;
  120229. }
  120230. var offset = 0;
  120231. var mdatbox = null;
  120232. var mdatBytes = 0;
  120233. if (mpegRawTrack) {
  120234. offset = 0;
  120235. mdatBytes = track.length;
  120236. } else {
  120237. offset = 8;
  120238. mdatBytes = 8 + track.length;
  120239. }
  120240. var lastSample = null;
  120241. if (samples.length > 1) {
  120242. lastSample = samples.pop();
  120243. mdatBytes -= lastSample.length;
  120244. }
  120245. if (this._audioStashedLastSample != null) {
  120246. var sample = this._audioStashedLastSample;
  120247. this._audioStashedLastSample = null;
  120248. samples.unshift(sample);
  120249. mdatBytes += sample.length;
  120250. }
  120251. if (lastSample != null) {
  120252. this._audioStashedLastSample = lastSample;
  120253. }
  120254. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120255. if (this._audioNextDts) {
  120256. dtsCorrection = firstSampleOriginalDts - this._audioNextDts;
  120257. } else {
  120258. if (this._audioSegmentInfoList.isEmpty()) {
  120259. dtsCorrection = 0;
  120260. if (this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty()) {
  120261. if (this._audioMeta.originalCodec !== "mp3") {
  120262. insertPrefixSilentFrame = true;
  120263. }
  120264. }
  120265. } else {
  120266. var lastSample_1 = this._audioSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120267. if (lastSample_1 != null) {
  120268. var distance2 = firstSampleOriginalDts - (lastSample_1.originalDts + lastSample_1.duration);
  120269. if (distance2 <= 3) {
  120270. distance2 = 0;
  120271. }
  120272. var expectedDts = lastSample_1.dts + lastSample_1.duration + distance2;
  120273. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120274. } else {
  120275. dtsCorrection = 0;
  120276. }
  120277. }
  120278. }
  120279. if (insertPrefixSilentFrame) {
  120280. var firstSampleDts = firstSampleOriginalDts - dtsCorrection;
  120281. var videoSegment = this._videoSegmentInfoList.getLastSegmentBefore(firstSampleOriginalDts);
  120282. if (videoSegment != null && videoSegment.beginDts < firstSampleDts) {
  120283. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120284. if (silentUnit) {
  120285. var dts = videoSegment.beginDts;
  120286. var silentFrameDuration = firstSampleDts - videoSegment.beginDts;
  120287. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "InsertPrefixSilentAudio: dts: " + dts + ", duration: " + silentFrameDuration);
  120288. samples.unshift({ unit: silentUnit, dts, pts: dts });
  120289. mdatBytes += silentUnit.byteLength;
  120290. }
  120291. } else {
  120292. insertPrefixSilentFrame = false;
  120293. }
  120294. }
  120295. var mp4Samples = [];
  120296. for (var i2 = 0; i2 < samples.length; i2++) {
  120297. var sample = samples[i2];
  120298. var unit = sample.unit;
  120299. var originalDts = sample.dts - this._dtsBase;
  120300. var dts = originalDts;
  120301. var needFillSilentFrames = false;
  120302. var silentFrames = null;
  120303. var sampleDuration = 0;
  120304. if (originalDts < -1e-3) {
  120305. continue;
  120306. }
  120307. if (this._audioMeta.codec !== "mp3") {
  120308. var curRefDts = originalDts;
  120309. var maxAudioFramesDrift = 3;
  120310. if (this._audioNextDts) {
  120311. curRefDts = this._audioNextDts;
  120312. }
  120313. dtsCorrection = originalDts - curRefDts;
  120314. if (dtsCorrection <= -maxAudioFramesDrift * refSampleDuration) {
  120315. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Dropping 1 audio frame (originalDts: " + originalDts + " ms ,curRefDts: " + curRefDts + " ms) due to dtsCorrection: " + dtsCorrection + " ms overlap.");
  120316. continue;
  120317. } else if (dtsCorrection >= maxAudioFramesDrift * refSampleDuration && this._fillAudioTimestampGap && !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.safari) {
  120318. needFillSilentFrames = true;
  120319. var frameCount = Math.floor(dtsCorrection / refSampleDuration);
  120320. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n" + ("originalDts: " + originalDts + " ms, curRefDts: " + curRefDts + " ms, ") + ("dtsCorrection: " + Math.round(dtsCorrection) + " ms, generate: " + frameCount + " frames"));
  120321. dts = Math.floor(curRefDts);
  120322. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120323. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120324. if (silentUnit == null) {
  120325. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unable to generate silent frame for " + (this._audioMeta.originalCodec + " with " + this._audioMeta.channelCount + " channels, repeat last frame"));
  120326. silentUnit = unit;
  120327. }
  120328. silentFrames = [];
  120329. for (var j = 0; j < frameCount; j++) {
  120330. curRefDts = curRefDts + refSampleDuration;
  120331. var intDts = Math.floor(curRefDts);
  120332. var intDuration = Math.floor(curRefDts + refSampleDuration) - intDts;
  120333. var frame = {
  120334. dts: intDts,
  120335. pts: intDts,
  120336. cts: 0,
  120337. unit: silentUnit,
  120338. size: silentUnit.byteLength,
  120339. duration: intDuration,
  120340. originalDts,
  120341. flags: {
  120342. isLeading: 0,
  120343. dependsOn: 1,
  120344. isDependedOn: 0,
  120345. hasRedundancy: 0
  120346. }
  120347. };
  120348. silentFrames.push(frame);
  120349. mdatBytes += frame.size;
  120350. }
  120351. this._audioNextDts = curRefDts + refSampleDuration;
  120352. } else {
  120353. dts = Math.floor(curRefDts);
  120354. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120355. this._audioNextDts = curRefDts + refSampleDuration;
  120356. }
  120357. } else {
  120358. dts = originalDts - dtsCorrection;
  120359. if (i2 !== samples.length - 1) {
  120360. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120361. sampleDuration = nextDts - dts;
  120362. } else {
  120363. if (lastSample != null) {
  120364. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120365. sampleDuration = nextDts - dts;
  120366. } else if (mp4Samples.length >= 1) {
  120367. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120368. } else {
  120369. sampleDuration = Math.floor(refSampleDuration);
  120370. }
  120371. }
  120372. this._audioNextDts = dts + sampleDuration;
  120373. }
  120374. if (firstDts === -1) {
  120375. firstDts = dts;
  120376. }
  120377. mp4Samples.push({
  120378. dts,
  120379. pts: dts,
  120380. cts: 0,
  120381. unit: sample.unit,
  120382. size: sample.unit.byteLength,
  120383. duration: sampleDuration,
  120384. originalDts,
  120385. flags: {
  120386. isLeading: 0,
  120387. dependsOn: 1,
  120388. isDependedOn: 0,
  120389. hasRedundancy: 0
  120390. }
  120391. });
  120392. if (needFillSilentFrames) {
  120393. mp4Samples.push.apply(mp4Samples, silentFrames);
  120394. }
  120395. }
  120396. if (mp4Samples.length === 0) {
  120397. track.samples = [];
  120398. track.length = 0;
  120399. return;
  120400. }
  120401. if (mpegRawTrack) {
  120402. mdatbox = new Uint8Array(mdatBytes);
  120403. } else {
  120404. mdatbox = new Uint8Array(mdatBytes);
  120405. mdatbox[0] = mdatBytes >>> 24 & 255;
  120406. mdatbox[1] = mdatBytes >>> 16 & 255;
  120407. mdatbox[2] = mdatBytes >>> 8 & 255;
  120408. mdatbox[3] = mdatBytes & 255;
  120409. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120410. }
  120411. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120412. var unit = mp4Samples[i2].unit;
  120413. mdatbox.set(unit, offset);
  120414. offset += unit.byteLength;
  120415. }
  120416. var latest = mp4Samples[mp4Samples.length - 1];
  120417. lastDts = latest.dts + latest.duration;
  120418. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120419. info.beginDts = firstDts;
  120420. info.endDts = lastDts;
  120421. info.beginPts = firstDts;
  120422. info.endPts = lastDts;
  120423. info.originalBeginDts = mp4Samples[0].originalDts;
  120424. info.originalEndDts = latest.originalDts + latest.duration;
  120425. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, false);
  120426. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, false);
  120427. if (!this._isLive) {
  120428. this._audioSegmentInfoList.append(info);
  120429. }
  120430. track.samples = mp4Samples;
  120431. track.sequenceNumber++;
  120432. var moofbox = null;
  120433. if (mpegRawTrack) {
  120434. moofbox = new Uint8Array();
  120435. } else {
  120436. moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120437. }
  120438. track.samples = [];
  120439. track.length = 0;
  120440. var segment = {
  120441. type: "audio",
  120442. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120443. sampleCount: mp4Samples.length,
  120444. info
  120445. };
  120446. if (mpegRawTrack && firstSegmentAfterSeek) {
  120447. segment.timestampOffset = firstDts;
  120448. }
  120449. this._onMediaSegment("audio", segment);
  120450. };
  120451. MP4Remuxer2.prototype._remuxVideo = function(videoTrack, force) {
  120452. if (this._videoMeta == null) {
  120453. return;
  120454. }
  120455. var track = videoTrack;
  120456. var samples = track.samples;
  120457. var dtsCorrection = void 0;
  120458. var firstDts = -1, lastDts = -1;
  120459. var firstPts = -1, lastPts = -1;
  120460. if (!samples || samples.length === 0) {
  120461. return;
  120462. }
  120463. if (samples.length === 1 && !force) {
  120464. return;
  120465. }
  120466. var offset = 8;
  120467. var mdatbox = null;
  120468. var mdatBytes = 8 + videoTrack.length;
  120469. var lastSample = null;
  120470. if (samples.length > 1) {
  120471. lastSample = samples.pop();
  120472. mdatBytes -= lastSample.length;
  120473. }
  120474. if (this._videoStashedLastSample != null) {
  120475. var sample = this._videoStashedLastSample;
  120476. this._videoStashedLastSample = null;
  120477. samples.unshift(sample);
  120478. mdatBytes += sample.length;
  120479. }
  120480. if (lastSample != null) {
  120481. this._videoStashedLastSample = lastSample;
  120482. }
  120483. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120484. if (this._videoNextDts) {
  120485. dtsCorrection = firstSampleOriginalDts - this._videoNextDts;
  120486. } else {
  120487. if (this._videoSegmentInfoList.isEmpty()) {
  120488. dtsCorrection = 0;
  120489. } else {
  120490. var lastSample_2 = this._videoSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120491. if (lastSample_2 != null) {
  120492. var distance2 = firstSampleOriginalDts - (lastSample_2.originalDts + lastSample_2.duration);
  120493. if (distance2 <= 3) {
  120494. distance2 = 0;
  120495. }
  120496. var expectedDts = lastSample_2.dts + lastSample_2.duration + distance2;
  120497. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120498. } else {
  120499. dtsCorrection = 0;
  120500. }
  120501. }
  120502. }
  120503. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120504. var mp4Samples = [];
  120505. for (var i2 = 0; i2 < samples.length; i2++) {
  120506. var sample = samples[i2];
  120507. var originalDts = sample.dts - this._dtsBase;
  120508. var isKeyframe = sample.isKeyframe;
  120509. var dts = originalDts - dtsCorrection;
  120510. var cts = sample.cts;
  120511. var pts = dts + cts;
  120512. if (firstDts === -1) {
  120513. firstDts = dts;
  120514. firstPts = pts;
  120515. }
  120516. var sampleDuration = 0;
  120517. if (i2 !== samples.length - 1) {
  120518. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120519. sampleDuration = nextDts - dts;
  120520. } else {
  120521. if (lastSample != null) {
  120522. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120523. sampleDuration = nextDts - dts;
  120524. } else if (mp4Samples.length >= 1) {
  120525. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120526. } else {
  120527. sampleDuration = Math.floor(this._videoMeta.refSampleDuration);
  120528. }
  120529. }
  120530. if (isKeyframe) {
  120531. var syncPoint = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(dts, pts, sampleDuration, sample.dts, true);
  120532. syncPoint.fileposition = sample.fileposition;
  120533. info.appendSyncPoint(syncPoint);
  120534. }
  120535. mp4Samples.push({
  120536. dts,
  120537. pts,
  120538. cts,
  120539. units: sample.units,
  120540. size: sample.length,
  120541. isKeyframe,
  120542. duration: sampleDuration,
  120543. originalDts,
  120544. flags: {
  120545. isLeading: 0,
  120546. dependsOn: isKeyframe ? 2 : 1,
  120547. isDependedOn: isKeyframe ? 1 : 0,
  120548. hasRedundancy: 0,
  120549. isNonSync: isKeyframe ? 0 : 1
  120550. }
  120551. });
  120552. }
  120553. mdatbox = new Uint8Array(mdatBytes);
  120554. mdatbox[0] = mdatBytes >>> 24 & 255;
  120555. mdatbox[1] = mdatBytes >>> 16 & 255;
  120556. mdatbox[2] = mdatBytes >>> 8 & 255;
  120557. mdatbox[3] = mdatBytes & 255;
  120558. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120559. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120560. var units = mp4Samples[i2].units;
  120561. while (units.length) {
  120562. var unit = units.shift();
  120563. var data = unit.data;
  120564. mdatbox.set(data, offset);
  120565. offset += data.byteLength;
  120566. }
  120567. }
  120568. var latest = mp4Samples[mp4Samples.length - 1];
  120569. lastDts = latest.dts + latest.duration;
  120570. lastPts = latest.pts + latest.duration;
  120571. this._videoNextDts = lastDts;
  120572. info.beginDts = firstDts;
  120573. info.endDts = lastDts;
  120574. info.beginPts = firstPts;
  120575. info.endPts = lastPts;
  120576. info.originalBeginDts = mp4Samples[0].originalDts;
  120577. info.originalEndDts = latest.originalDts + latest.duration;
  120578. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, mp4Samples[0].isKeyframe);
  120579. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, latest.isKeyframe);
  120580. if (!this._isLive) {
  120581. this._videoSegmentInfoList.append(info);
  120582. }
  120583. track.samples = mp4Samples;
  120584. track.sequenceNumber++;
  120585. if (this._forceFirstIDR) {
  120586. var flags = mp4Samples[0].flags;
  120587. flags.dependsOn = 2;
  120588. flags.isNonSync = 0;
  120589. }
  120590. var moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120591. track.samples = [];
  120592. track.length = 0;
  120593. this._onMediaSegment("video", {
  120594. type: "video",
  120595. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120596. sampleCount: mp4Samples.length,
  120597. info
  120598. });
  120599. };
  120600. MP4Remuxer2.prototype._mergeBoxes = function(moof, mdat) {
  120601. var result = new Uint8Array(moof.byteLength + mdat.byteLength);
  120602. result.set(moof, 0);
  120603. result.set(mdat, moof.byteLength);
  120604. return result;
  120605. };
  120606. return MP4Remuxer2;
  120607. }();
  120608. __webpack_exports__2["default"] = MP4Remuxer;
  120609. },
  120610. "./src/utils/browser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120611. __webpack_require__2.r(__webpack_exports__2);
  120612. var Browser = {};
  120613. function detect() {
  120614. var ua = self.navigator.userAgent.toLowerCase();
  120615. var match = /(edge)\/([\w.]+)/.exec(ua) || /(opr)[\/]([\w.]+)/.exec(ua) || /(chrome)[ \/]([\w.]+)/.exec(ua) || /(iemobile)[\/]([\w.]+)/.exec(ua) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(ua) || [];
  120616. var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua) || /(windows phone)/.exec(ua) || /(iphone)/.exec(ua) || /(kindle)/.exec(ua) || /(android)/.exec(ua) || /(windows)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua) || /(cros)/.exec(ua) || [];
  120617. var matched = {
  120618. browser: match[5] || match[3] || match[1] || "",
  120619. version: match[2] || match[4] || "0",
  120620. majorVersion: match[4] || match[2] || "0",
  120621. platform: platform_match[0] || ""
  120622. };
  120623. var browser2 = {};
  120624. if (matched.browser) {
  120625. browser2[matched.browser] = true;
  120626. var versionArray = matched.majorVersion.split(".");
  120627. browser2.version = {
  120628. major: parseInt(matched.majorVersion, 10),
  120629. string: matched.version
  120630. };
  120631. if (versionArray.length > 1) {
  120632. browser2.version.minor = parseInt(versionArray[1], 10);
  120633. }
  120634. if (versionArray.length > 2) {
  120635. browser2.version.build = parseInt(versionArray[2], 10);
  120636. }
  120637. }
  120638. if (matched.platform) {
  120639. browser2[matched.platform] = true;
  120640. }
  120641. if (browser2.chrome || browser2.opr || browser2.safari) {
  120642. browser2.webkit = true;
  120643. }
  120644. if (browser2.rv || browser2.iemobile) {
  120645. if (browser2.rv) {
  120646. delete browser2.rv;
  120647. }
  120648. var msie = "msie";
  120649. matched.browser = msie;
  120650. browser2[msie] = true;
  120651. }
  120652. if (browser2.edge) {
  120653. delete browser2.edge;
  120654. var msedge = "msedge";
  120655. matched.browser = msedge;
  120656. browser2[msedge] = true;
  120657. }
  120658. if (browser2.opr) {
  120659. var opera = "opera";
  120660. matched.browser = opera;
  120661. browser2[opera] = true;
  120662. }
  120663. if (browser2.safari && browser2.android) {
  120664. var android = "android";
  120665. matched.browser = android;
  120666. browser2[android] = true;
  120667. }
  120668. browser2.name = matched.browser;
  120669. browser2.platform = matched.platform;
  120670. for (var key in Browser) {
  120671. if (Browser.hasOwnProperty(key)) {
  120672. delete Browser[key];
  120673. }
  120674. }
  120675. Object.assign(Browser, browser2);
  120676. }
  120677. detect();
  120678. __webpack_exports__2["default"] = Browser;
  120679. },
  120680. "./src/utils/exception.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120681. __webpack_require__2.r(__webpack_exports__2);
  120682. __webpack_require__2.d(__webpack_exports__2, {
  120683. "RuntimeException": function() {
  120684. return RuntimeException;
  120685. },
  120686. "IllegalStateException": function() {
  120687. return IllegalStateException;
  120688. },
  120689. "InvalidArgumentException": function() {
  120690. return InvalidArgumentException;
  120691. },
  120692. "NotImplementedException": function() {
  120693. return NotImplementedException;
  120694. }
  120695. });
  120696. var __extends = function() {
  120697. var extendStatics = function(d2, b) {
  120698. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  120699. d3.__proto__ = b2;
  120700. } || function(d3, b2) {
  120701. for (var p in b2)
  120702. if (Object.prototype.hasOwnProperty.call(b2, p))
  120703. d3[p] = b2[p];
  120704. };
  120705. return extendStatics(d2, b);
  120706. };
  120707. return function(d2, b) {
  120708. if (typeof b !== "function" && b !== null)
  120709. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  120710. extendStatics(d2, b);
  120711. function __() {
  120712. this.constructor = d2;
  120713. }
  120714. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120715. };
  120716. }();
  120717. var RuntimeException = function() {
  120718. function RuntimeException2(message) {
  120719. this._message = message;
  120720. }
  120721. Object.defineProperty(RuntimeException2.prototype, "name", {
  120722. get: function() {
  120723. return "RuntimeException";
  120724. },
  120725. enumerable: false,
  120726. configurable: true
  120727. });
  120728. Object.defineProperty(RuntimeException2.prototype, "message", {
  120729. get: function() {
  120730. return this._message;
  120731. },
  120732. enumerable: false,
  120733. configurable: true
  120734. });
  120735. RuntimeException2.prototype.toString = function() {
  120736. return this.name + ": " + this.message;
  120737. };
  120738. return RuntimeException2;
  120739. }();
  120740. var IllegalStateException = function(_super) {
  120741. __extends(IllegalStateException2, _super);
  120742. function IllegalStateException2(message) {
  120743. return _super.call(this, message) || this;
  120744. }
  120745. Object.defineProperty(IllegalStateException2.prototype, "name", {
  120746. get: function() {
  120747. return "IllegalStateException";
  120748. },
  120749. enumerable: false,
  120750. configurable: true
  120751. });
  120752. return IllegalStateException2;
  120753. }(RuntimeException);
  120754. var InvalidArgumentException = function(_super) {
  120755. __extends(InvalidArgumentException2, _super);
  120756. function InvalidArgumentException2(message) {
  120757. return _super.call(this, message) || this;
  120758. }
  120759. Object.defineProperty(InvalidArgumentException2.prototype, "name", {
  120760. get: function() {
  120761. return "InvalidArgumentException";
  120762. },
  120763. enumerable: false,
  120764. configurable: true
  120765. });
  120766. return InvalidArgumentException2;
  120767. }(RuntimeException);
  120768. var NotImplementedException = function(_super) {
  120769. __extends(NotImplementedException2, _super);
  120770. function NotImplementedException2(message) {
  120771. return _super.call(this, message) || this;
  120772. }
  120773. Object.defineProperty(NotImplementedException2.prototype, "name", {
  120774. get: function() {
  120775. return "NotImplementedException";
  120776. },
  120777. enumerable: false,
  120778. configurable: true
  120779. });
  120780. return NotImplementedException2;
  120781. }(RuntimeException);
  120782. },
  120783. "./src/utils/logger.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120784. __webpack_require__2.r(__webpack_exports__2);
  120785. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120786. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120787. var Log = function() {
  120788. function Log2() {
  120789. }
  120790. Log2.e = function(tag, msg) {
  120791. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120792. tag = Log2.GLOBAL_TAG;
  120793. var str = "[" + tag + "] > " + msg;
  120794. if (Log2.ENABLE_CALLBACK) {
  120795. Log2.emitter.emit("log", "error", str);
  120796. }
  120797. if (!Log2.ENABLE_ERROR) {
  120798. return;
  120799. }
  120800. if (console.error) {
  120801. console.error(str);
  120802. } else if (console.warn) {
  120803. console.warn(str);
  120804. } else {
  120805. console.log(str);
  120806. }
  120807. };
  120808. Log2.i = function(tag, msg) {
  120809. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120810. tag = Log2.GLOBAL_TAG;
  120811. var str = "[" + tag + "] > " + msg;
  120812. if (Log2.ENABLE_CALLBACK) {
  120813. Log2.emitter.emit("log", "info", str);
  120814. }
  120815. if (!Log2.ENABLE_INFO) {
  120816. return;
  120817. }
  120818. if (console.info) {
  120819. console.info(str);
  120820. } else {
  120821. console.log(str);
  120822. }
  120823. };
  120824. Log2.w = function(tag, msg) {
  120825. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120826. tag = Log2.GLOBAL_TAG;
  120827. var str = "[" + tag + "] > " + msg;
  120828. if (Log2.ENABLE_CALLBACK) {
  120829. Log2.emitter.emit("log", "warn", str);
  120830. }
  120831. if (!Log2.ENABLE_WARN) {
  120832. return;
  120833. }
  120834. if (console.warn) {
  120835. console.warn(str);
  120836. } else {
  120837. console.log(str);
  120838. }
  120839. };
  120840. Log2.d = function(tag, msg) {
  120841. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120842. tag = Log2.GLOBAL_TAG;
  120843. var str = "[" + tag + "] > " + msg;
  120844. if (Log2.ENABLE_CALLBACK) {
  120845. Log2.emitter.emit("log", "debug", str);
  120846. }
  120847. if (!Log2.ENABLE_DEBUG) {
  120848. return;
  120849. }
  120850. if (console.debug) {
  120851. console.debug(str);
  120852. } else {
  120853. console.log(str);
  120854. }
  120855. };
  120856. Log2.v = function(tag, msg) {
  120857. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120858. tag = Log2.GLOBAL_TAG;
  120859. var str = "[" + tag + "] > " + msg;
  120860. if (Log2.ENABLE_CALLBACK) {
  120861. Log2.emitter.emit("log", "verbose", str);
  120862. }
  120863. if (!Log2.ENABLE_VERBOSE) {
  120864. return;
  120865. }
  120866. console.log(str);
  120867. };
  120868. return Log2;
  120869. }();
  120870. Log.GLOBAL_TAG = "flv.js";
  120871. Log.FORCE_GLOBAL_TAG = false;
  120872. Log.ENABLE_ERROR = true;
  120873. Log.ENABLE_INFO = true;
  120874. Log.ENABLE_WARN = true;
  120875. Log.ENABLE_DEBUG = true;
  120876. Log.ENABLE_VERBOSE = true;
  120877. Log.ENABLE_CALLBACK = false;
  120878. Log.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  120879. __webpack_exports__2["default"] = Log;
  120880. },
  120881. "./src/utils/logging-control.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120882. __webpack_require__2.r(__webpack_exports__2);
  120883. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120884. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120885. var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  120886. var LoggingControl = function() {
  120887. function LoggingControl2() {
  120888. }
  120889. Object.defineProperty(LoggingControl2, "forceGlobalTag", {
  120890. get: function() {
  120891. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG;
  120892. },
  120893. set: function(enable) {
  120894. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = enable;
  120895. LoggingControl2._notifyChange();
  120896. },
  120897. enumerable: false,
  120898. configurable: true
  120899. });
  120900. Object.defineProperty(LoggingControl2, "globalTag", {
  120901. get: function() {
  120902. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG;
  120903. },
  120904. set: function(tag) {
  120905. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = tag;
  120906. LoggingControl2._notifyChange();
  120907. },
  120908. enumerable: false,
  120909. configurable: true
  120910. });
  120911. Object.defineProperty(LoggingControl2, "enableAll", {
  120912. get: function() {
  120913. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120914. },
  120915. set: function(enable) {
  120916. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120917. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120918. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120919. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120920. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120921. LoggingControl2._notifyChange();
  120922. },
  120923. enumerable: false,
  120924. configurable: true
  120925. });
  120926. Object.defineProperty(LoggingControl2, "enableDebug", {
  120927. get: function() {
  120928. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG;
  120929. },
  120930. set: function(enable) {
  120931. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120932. LoggingControl2._notifyChange();
  120933. },
  120934. enumerable: false,
  120935. configurable: true
  120936. });
  120937. Object.defineProperty(LoggingControl2, "enableVerbose", {
  120938. get: function() {
  120939. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE;
  120940. },
  120941. set: function(enable) {
  120942. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120943. LoggingControl2._notifyChange();
  120944. },
  120945. enumerable: false,
  120946. configurable: true
  120947. });
  120948. Object.defineProperty(LoggingControl2, "enableInfo", {
  120949. get: function() {
  120950. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO;
  120951. },
  120952. set: function(enable) {
  120953. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120954. LoggingControl2._notifyChange();
  120955. },
  120956. enumerable: false,
  120957. configurable: true
  120958. });
  120959. Object.defineProperty(LoggingControl2, "enableWarn", {
  120960. get: function() {
  120961. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN;
  120962. },
  120963. set: function(enable) {
  120964. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120965. LoggingControl2._notifyChange();
  120966. },
  120967. enumerable: false,
  120968. configurable: true
  120969. });
  120970. Object.defineProperty(LoggingControl2, "enableError", {
  120971. get: function() {
  120972. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120973. },
  120974. set: function(enable) {
  120975. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120976. LoggingControl2._notifyChange();
  120977. },
  120978. enumerable: false,
  120979. configurable: true
  120980. });
  120981. LoggingControl2.getConfig = function() {
  120982. return {
  120983. globalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG,
  120984. forceGlobalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG,
  120985. enableVerbose: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE,
  120986. enableDebug: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG,
  120987. enableInfo: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO,
  120988. enableWarn: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN,
  120989. enableError: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR,
  120990. enableCallback: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK
  120991. };
  120992. };
  120993. LoggingControl2.applyConfig = function(config) {
  120994. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = config.globalTag;
  120995. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = config.forceGlobalTag;
  120996. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = config.enableVerbose;
  120997. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = config.enableDebug;
  120998. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = config.enableInfo;
  120999. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = config.enableWarn;
  121000. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = config.enableError;
  121001. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = config.enableCallback;
  121002. };
  121003. LoggingControl2._notifyChange = function() {
  121004. var emitter = LoggingControl2.emitter;
  121005. if (emitter.listenerCount("change") > 0) {
  121006. var config = LoggingControl2.getConfig();
  121007. emitter.emit("change", config);
  121008. }
  121009. };
  121010. LoggingControl2.registerListener = function(listener) {
  121011. LoggingControl2.emitter.addListener("change", listener);
  121012. };
  121013. LoggingControl2.removeListener = function(listener) {
  121014. LoggingControl2.emitter.removeListener("change", listener);
  121015. };
  121016. LoggingControl2.addLogListener = function(listener) {
  121017. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.addListener("log", listener);
  121018. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") > 0) {
  121019. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = true;
  121020. LoggingControl2._notifyChange();
  121021. }
  121022. };
  121023. LoggingControl2.removeLogListener = function(listener) {
  121024. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.removeListener("log", listener);
  121025. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") === 0) {
  121026. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = false;
  121027. LoggingControl2._notifyChange();
  121028. }
  121029. };
  121030. return LoggingControl2;
  121031. }();
  121032. LoggingControl.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  121033. __webpack_exports__2["default"] = LoggingControl;
  121034. },
  121035. "./src/utils/polyfill.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  121036. __webpack_require__2.r(__webpack_exports__2);
  121037. var Polyfill = function() {
  121038. function Polyfill2() {
  121039. }
  121040. Polyfill2.install = function() {
  121041. Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) {
  121042. obj.__proto__ = proto;
  121043. return obj;
  121044. };
  121045. Object.assign = Object.assign || function(target) {
  121046. if (target === void 0 || target === null) {
  121047. throw new TypeError("Cannot convert undefined or null to object");
  121048. }
  121049. var output = Object(target);
  121050. for (var i2 = 1; i2 < arguments.length; i2++) {
  121051. var source = arguments[i2];
  121052. if (source !== void 0 && source !== null) {
  121053. for (var key in source) {
  121054. if (source.hasOwnProperty(key)) {
  121055. output[key] = source[key];
  121056. }
  121057. }
  121058. }
  121059. }
  121060. return output;
  121061. };
  121062. if (typeof self.Promise !== "function") {
  121063. __webpack_require__2("./node_modules/es6-promise/dist/es6-promise.js").polyfill();
  121064. }
  121065. };
  121066. return Polyfill2;
  121067. }();
  121068. Polyfill.install();
  121069. __webpack_exports__2["default"] = Polyfill;
  121070. },
  121071. "./src/utils/utf8-conv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  121072. __webpack_require__2.r(__webpack_exports__2);
  121073. function checkContinuation(uint8array, start2, checkLength) {
  121074. var array = uint8array;
  121075. if (start2 + checkLength < array.length) {
  121076. while (checkLength--) {
  121077. if ((array[++start2] & 192) !== 128)
  121078. return false;
  121079. }
  121080. return true;
  121081. } else {
  121082. return false;
  121083. }
  121084. }
  121085. function decodeUTF8(uint8array) {
  121086. var out = [];
  121087. var input = uint8array;
  121088. var i2 = 0;
  121089. var length = uint8array.length;
  121090. while (i2 < length) {
  121091. if (input[i2] < 128) {
  121092. out.push(String.fromCharCode(input[i2]));
  121093. ++i2;
  121094. continue;
  121095. } else if (input[i2] < 192)
  121096. ;
  121097. else if (input[i2] < 224) {
  121098. if (checkContinuation(input, i2, 1)) {
  121099. var ucs4 = (input[i2] & 31) << 6 | input[i2 + 1] & 63;
  121100. if (ucs4 >= 128) {
  121101. out.push(String.fromCharCode(ucs4 & 65535));
  121102. i2 += 2;
  121103. continue;
  121104. }
  121105. }
  121106. } else if (input[i2] < 240) {
  121107. if (checkContinuation(input, i2, 2)) {
  121108. var ucs4 = (input[i2] & 15) << 12 | (input[i2 + 1] & 63) << 6 | input[i2 + 2] & 63;
  121109. if (ucs4 >= 2048 && (ucs4 & 63488) !== 55296) {
  121110. out.push(String.fromCharCode(ucs4 & 65535));
  121111. i2 += 3;
  121112. continue;
  121113. }
  121114. }
  121115. } else if (input[i2] < 248) {
  121116. if (checkContinuation(input, i2, 3)) {
  121117. var ucs4 = (input[i2] & 7) << 18 | (input[i2 + 1] & 63) << 12 | (input[i2 + 2] & 63) << 6 | input[i2 + 3] & 63;
  121118. if (ucs4 > 65536 && ucs4 < 1114112) {
  121119. ucs4 -= 65536;
  121120. out.push(String.fromCharCode(ucs4 >>> 10 | 55296));
  121121. out.push(String.fromCharCode(ucs4 & 1023 | 56320));
  121122. i2 += 4;
  121123. continue;
  121124. }
  121125. }
  121126. }
  121127. out.push(String.fromCharCode(65533));
  121128. ++i2;
  121129. }
  121130. return out.join("");
  121131. }
  121132. __webpack_exports__2["default"] = decodeUTF8;
  121133. }
  121134. };
  121135. var __webpack_module_cache__ = {};
  121136. function __webpack_require__(moduleId) {
  121137. var cachedModule = __webpack_module_cache__[moduleId];
  121138. if (cachedModule !== void 0) {
  121139. return cachedModule.exports;
  121140. }
  121141. var module3 = __webpack_module_cache__[moduleId] = {
  121142. exports: {}
  121143. };
  121144. __webpack_modules__[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
  121145. return module3.exports;
  121146. }
  121147. __webpack_require__.m = __webpack_modules__;
  121148. !function() {
  121149. __webpack_require__.n = function(module3) {
  121150. var getter = module3 && module3.__esModule ? function() {
  121151. return module3["default"];
  121152. } : function() {
  121153. return module3;
  121154. };
  121155. __webpack_require__.d(getter, { a: getter });
  121156. return getter;
  121157. };
  121158. }();
  121159. !function() {
  121160. __webpack_require__.d = function(exports3, definition) {
  121161. for (var key in definition) {
  121162. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports3, key)) {
  121163. Object.defineProperty(exports3, key, { enumerable: true, get: definition[key] });
  121164. }
  121165. }
  121166. };
  121167. }();
  121168. !function() {
  121169. __webpack_require__.g = function() {
  121170. if (typeof globalThis === "object")
  121171. return globalThis;
  121172. try {
  121173. return this || new Function("return this")();
  121174. } catch (e) {
  121175. if (typeof window === "object")
  121176. return window;
  121177. }
  121178. }();
  121179. }();
  121180. !function() {
  121181. __webpack_require__.o = function(obj, prop) {
  121182. return Object.prototype.hasOwnProperty.call(obj, prop);
  121183. };
  121184. }();
  121185. !function() {
  121186. __webpack_require__.r = function(exports3) {
  121187. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  121188. Object.defineProperty(exports3, Symbol.toStringTag, { value: "Module" });
  121189. }
  121190. Object.defineProperty(exports3, "__esModule", { value: true });
  121191. };
  121192. }();
  121193. var __webpack_exports__ = __webpack_require__("./src/index.js");
  121194. return __webpack_exports__;
  121195. }();
  121196. });
  121197. })(flv);
  121198. var flvjs = /* @__PURE__ */ getDefaultExportFromCjs(flv.exports);
  121199. const Html5 = videojs$2.getTech("Html5");
  121200. const mergeOptions = videojs$2.mergeOptions || videojs$2.util.mergeOptions;
  121201. const defaults = {
  121202. mediaDataSource: {},
  121203. config: {}
  121204. };
  121205. class Flvjs extends Html5 {
  121206. constructor(options2, ready) {
  121207. options2 = mergeOptions(defaults, options2);
  121208. super(options2, ready);
  121209. }
  121210. setSrc(src) {
  121211. if (this.flvPlayer) {
  121212. this.flvPlayer.detachMediaElement();
  121213. this.flvPlayer.destroy();
  121214. }
  121215. const mediaDataSource = this.options_.mediaDataSource;
  121216. const config = this.options_.config;
  121217. mediaDataSource.type = mediaDataSource.type === void 0 ? "flv" : mediaDataSource.type;
  121218. mediaDataSource.url = src;
  121219. this.flvPlayer = flvjs.createPlayer(mediaDataSource, config);
  121220. this.flvPlayer.attachMediaElement(this.el_);
  121221. this.flvPlayer.load();
  121222. }
  121223. dispose() {
  121224. if (this.flvPlayer) {
  121225. this.flvPlayer.detachMediaElement();
  121226. this.flvPlayer.destroy();
  121227. }
  121228. super.dispose();
  121229. }
  121230. }
  121231. Flvjs.isSupported = function() {
  121232. return flvjs && flvjs.isSupported();
  121233. };
  121234. Flvjs.formats = {
  121235. "video/flv": "FLV",
  121236. "video/x-flv": "FLV"
  121237. };
  121238. Flvjs.canPlayType = function(type2) {
  121239. if (Flvjs.isSupported() && type2 in Flvjs.formats) {
  121240. return "maybe";
  121241. }
  121242. return "";
  121243. };
  121244. Flvjs.canPlaySource = function(srcObj, options2) {
  121245. return Flvjs.canPlayType(srcObj.type);
  121246. };
  121247. Flvjs.VERSION = "__VERSION__";
  121248. videojs$2.registerTech("Flvjs", Flvjs);
  121249. var VideoWindow$1 = "";
  121250. class VideoWindow {
  121251. constructor(viewer2, position2, videoInfo, offsetHeight) {
  121252. if (!viewer2)
  121253. throw new Cesium.DeveloperError("no viewer object!");
  121254. if (!position2)
  121255. throw new Cesium.DeveloperError("no position object!");
  121256. this.viewer = viewer2;
  121257. this.position = position2;
  121258. this.offsetHeight = offsetHeight;
  121259. if (position2 instanceof Cesium.Cartesian3) {
  121260. this.position = position2;
  121261. } else {
  121262. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121263. }
  121264. if (document.getElementsByClassName("popup-video").length > 0) {
  121265. document.getElementsByClassName("popup-video")[0].remove();
  121266. viewer2.entities.remove(viewer2.entities.getById("videoPopupPoint"));
  121267. }
  121268. this.id = "popup_video_" + getGuid();
  121269. this.popupDiv = document.createElement("div");
  121270. this.popupDiv.classList.add("popup-video");
  121271. this.popupDiv.id = this.id;
  121272. this.viewer.container.append(this.popupDiv);
  121273. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121274. switch (videoInfo.type) {
  121275. case "hls":
  121276. this.videotype = "application/x-mpegURL";
  121277. break;
  121278. case "rtmp":
  121279. this.videotype = "rtmp/flv";
  121280. break;
  121281. case "flv":
  121282. this.videotype = "video/x-flv";
  121283. break;
  121284. case "mp4":
  121285. this.videotype = "video/mp4";
  121286. break;
  121287. }
  121288. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121289. controls: true,
  121290. autoplay: "muted",
  121291. loop: true,
  121292. muted: false,
  121293. fluid: true,
  121294. aspectRatio: "16:9",
  121295. reload: "auto",
  121296. fullscreen: {
  121297. options: {
  121298. navigationUI: "hide"
  121299. }
  121300. },
  121301. sources: [{
  121302. src: videoInfo.url,
  121303. type: this.videotype
  121304. }]
  121305. }, function onPlayerReady() {
  121306. console.log("onPlayerReady", this);
  121307. });
  121308. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121309. this.initPoint();
  121310. document.getElementsByClassName("popup-video1-close-button")[0].onclick = () => {
  121311. this.close();
  121312. };
  121313. }
  121314. postRender() {
  121315. this.viewer.scene.canvas.height;
  121316. const windowPosition = new Cesium.Cartesian2();
  121317. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121318. this.viewer.scene,
  121319. this.position,
  121320. windowPosition
  121321. );
  121322. let elWidth = this.popupDiv.offsetWidth;
  121323. let elHeight = this.popupDiv.offsetHeight;
  121324. if (!!this.offsetHeight) {
  121325. elHeight += this.offsetHeight;
  121326. }
  121327. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121328. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121329. const camerPosition = this.viewer.camera.position;
  121330. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121331. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121332. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121333. this.popupDiv.style.display = "block";
  121334. } else {
  121335. this.popupDiv.style.display = "none";
  121336. }
  121337. }
  121338. _createHtml(videoInfo) {
  121339. let html = `
  121340. <div class="popup-video-header">
  121341. ${videoInfo.name}
  121342. <span class="popup-video1-close-button">\xD7</span>
  121343. </div>
  121344. <div class="popup-video-content">
  121345. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121346. </div>
  121347. <div class="popup-video-tip">
  121348. </div>
  121349. `;
  121350. return html;
  121351. }
  121352. initPoint() {
  121353. this.billboard = new Cesium.Entity({
  121354. id: "videoPopupPoint",
  121355. name: "popupPoint",
  121356. position: this.position,
  121357. billboard: {
  121358. image: "jt3dSDK/imgs/point/point.png",
  121359. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121360. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121361. scale: 1,
  121362. pixelOffset: new Cesium.Cartesian2(0, 0),
  121363. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121364. }
  121365. });
  121366. this.viewer.entities.add(this.billboard);
  121367. }
  121368. }
  121369. Object.assign(VideoWindow.prototype, {
  121370. close() {
  121371. this.popupDiv.remove();
  121372. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121373. this.viewer.entities.remove(this.billboard);
  121374. videojs$2("myvideo").dispose();
  121375. this.videoPlayer.dispose();
  121376. }
  121377. });
  121378. var VideoWindow2$1 = "";
  121379. class VideoWindow2 {
  121380. constructor(viewer2, position2, videoInfo) {
  121381. if (!viewer2)
  121382. throw new Cesium.DeveloperError("no viewer object!");
  121383. if (!position2)
  121384. throw new Cesium.DeveloperError("no position object!");
  121385. this.viewer = viewer2;
  121386. this.position = position2;
  121387. if (position2 instanceof Cesium.Cartesian3) {
  121388. this.position = position2;
  121389. } else {
  121390. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121391. }
  121392. if (document.getElementsByClassName("popup-video2").length > 0) {
  121393. document.getElementsByClassName("popup-video2")[0].remove();
  121394. }
  121395. this.id = "popup_video_" + getGuid();
  121396. this.popupDiv = document.createElement("div");
  121397. this.popupDiv.classList.add("popup-video2");
  121398. this.popupDiv.id = this.id;
  121399. this.viewer.container.append(this.popupDiv);
  121400. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121401. switch (videoInfo.type) {
  121402. case "hls":
  121403. this.videotype = "application/x-mpegURL";
  121404. break;
  121405. case "rtmp":
  121406. this.videotype = "rtmp/flv";
  121407. break;
  121408. case "flv":
  121409. this.videotype = "video/x-flv";
  121410. break;
  121411. case "mp4":
  121412. this.videotype = "video/mp4";
  121413. break;
  121414. }
  121415. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121416. controls: true,
  121417. autoplay: "muted",
  121418. loop: true,
  121419. muted: false,
  121420. fluid: true,
  121421. aspectRatio: "16:9",
  121422. reload: "auto",
  121423. fullscreen: {
  121424. options: {
  121425. navigationUI: "hide"
  121426. }
  121427. },
  121428. sources: [{
  121429. src: videoInfo.url,
  121430. type: this.videotype
  121431. }]
  121432. }, function onPlayerReady() {
  121433. console.log("onPlayerReady", this);
  121434. });
  121435. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121436. document.getElementsByClassName("popup-video2-close-button")[0].onclick = () => {
  121437. this.close();
  121438. };
  121439. }
  121440. postRender() {
  121441. this.viewer.scene.canvas.height;
  121442. const windowPosition = new Cesium.Cartesian2();
  121443. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121444. this.viewer.scene,
  121445. this.position,
  121446. windowPosition
  121447. );
  121448. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121449. this.popupDiv.style.top = windowPosition.y + "px";
  121450. const camerPosition = this.viewer.camera.position;
  121451. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121452. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121453. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121454. this.popupDiv.style.display = "block";
  121455. } else {
  121456. this.popupDiv.style.display = "none";
  121457. }
  121458. }
  121459. _createHtml(videoInfo) {
  121460. let html = `
  121461. <div class="rightLine-1"></div>
  121462. <div class="rightLine-2"></div>
  121463. <div class="rightLine-3"></div>
  121464. <div class="popup-header">
  121465. <span class="popup-title" >${videoInfo.name}</span>
  121466. <span class="popup-video2-close-button" title="\u5173\u95ED" >\xD7</span>
  121467. </div>
  121468. <div class="popup-content">
  121469. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121470. </div>
  121471. `;
  121472. return html;
  121473. }
  121474. }
  121475. Object.assign(VideoWindow2.prototype, {
  121476. close() {
  121477. this.popupDiv.remove();
  121478. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121479. }
  121480. });
  121481. var VideoWindow3$1 = "";
  121482. class VideoWindow3 {
  121483. constructor(viewer2, position2, videoInfo) {
  121484. if (!viewer2)
  121485. throw new Cesium.DeveloperError("no viewer object!");
  121486. if (!position2)
  121487. throw new Cesium.DeveloperError("no position object!");
  121488. this.viewer = viewer2;
  121489. this.position = position2;
  121490. if (position2 instanceof Cesium.Cartesian3) {
  121491. this.position = position2;
  121492. } else {
  121493. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121494. }
  121495. if (document.getElementsByClassName("popup-video3").length > 0) {
  121496. document.getElementsByClassName("popup-video3")[0].remove();
  121497. }
  121498. this.id = "popup_video_" + getGuid();
  121499. this.popupDiv = document.createElement("div");
  121500. this.popupDiv.classList.add("popup-video3");
  121501. this.popupDiv.id = this.id;
  121502. this.viewer.container.append(this.popupDiv);
  121503. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121504. switch (videoInfo.type) {
  121505. case "hls":
  121506. this.videotype = "application/x-mpegURL";
  121507. break;
  121508. case "rtmp":
  121509. this.videotype = "rtmp/flv";
  121510. break;
  121511. case "flv":
  121512. this.videotype = "video/x-flv";
  121513. break;
  121514. case "mp4":
  121515. this.videotype = "video/mp4";
  121516. break;
  121517. }
  121518. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121519. controls: true,
  121520. autoplay: "muted",
  121521. loop: true,
  121522. muted: false,
  121523. fluid: true,
  121524. aspectRatio: "16:9",
  121525. reload: "auto",
  121526. fullscreen: {
  121527. options: {
  121528. navigationUI: "hide"
  121529. }
  121530. },
  121531. sources: [{
  121532. src: videoInfo.url,
  121533. type: this.videotype
  121534. }]
  121535. }, function onPlayerReady() {
  121536. console.log("onPlayerReady", this);
  121537. });
  121538. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121539. document.getElementsByClassName("popup-video3-close-button")[0].onclick = () => {
  121540. this.close();
  121541. };
  121542. }
  121543. postRender() {
  121544. this.viewer.scene.canvas.height;
  121545. const windowPosition = new Cesium.Cartesian2();
  121546. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121547. this.viewer.scene,
  121548. this.position,
  121549. windowPosition
  121550. );
  121551. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121552. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121553. const camerPosition = this.viewer.camera.position;
  121554. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121555. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121556. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121557. this.popupDiv.style.display = "block";
  121558. } else {
  121559. this.popupDiv.style.display = "none";
  121560. }
  121561. }
  121562. _createHtml(videoInfo) {
  121563. let html = `
  121564. <div class="leftLine-1"></div>
  121565. <div class="leftLine-2"></div>
  121566. <div class="popup-header">
  121567. <span class="popup-title" >${videoInfo.name}</span>
  121568. <span class="popup-video3-close-button" title="\u5173\u95ED" >\xD7</span>
  121569. </div>
  121570. <div class="popup-content">
  121571. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121572. </div>
  121573. `;
  121574. return html;
  121575. }
  121576. }
  121577. Object.assign(VideoWindow3.prototype, {
  121578. close() {
  121579. this.popupDiv.remove();
  121580. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121581. }
  121582. });
  121583. var HtmlWindow1 = "";
  121584. class HtmlWindow {
  121585. constructor(viewer2, position2, title, html, offsetHeight) {
  121586. if (!viewer2)
  121587. throw new Cesium.DeveloperError("no viewer object!");
  121588. if (!position2)
  121589. throw new Cesium.DeveloperError("no position object!");
  121590. this.viewer = viewer2;
  121591. this.offsetHeight = offsetHeight;
  121592. if (position2 instanceof Cesium.Cartesian3) {
  121593. this.position = position2;
  121594. } else {
  121595. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121596. }
  121597. if (document.getElementsByClassName("popup1").length > 0) {
  121598. document.getElementsByClassName("popup1")[0].remove();
  121599. viewer2.entities.remove(viewer2.entities.getById("popupPoint"));
  121600. }
  121601. this.id = "popup_" + getGuid();
  121602. this.popupDiv = document.createElement("div");
  121603. this.popupDiv.classList.add("popup1");
  121604. this.popupDiv.id = this.id;
  121605. this.viewer.container.append(this.popupDiv);
  121606. this.popupDiv.innerHTML = this._createHtml(title, html);
  121607. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121608. this.initPoint();
  121609. document.getElementsByClassName("popup1-close-button")[0].onclick = () => {
  121610. this.close();
  121611. };
  121612. }
  121613. postRender() {
  121614. this.viewer.scene.canvas.height;
  121615. const windowPosition = new Cesium.Cartesian2();
  121616. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121617. this.viewer.scene,
  121618. this.position,
  121619. windowPosition
  121620. );
  121621. let elWidth = this.popupDiv.offsetWidth;
  121622. let elHeight = this.popupDiv.offsetHeight;
  121623. if (!!this.offsetHeight) {
  121624. elHeight += this.offsetHeight;
  121625. }
  121626. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121627. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121628. const camerPosition = this.viewer.camera.position;
  121629. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121630. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121631. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121632. this.popupDiv.style.display = "block";
  121633. } else {
  121634. this.popupDiv.style.display = "none";
  121635. }
  121636. }
  121637. _createHtml(header, content) {
  121638. let html = `
  121639. <div class="popup-header">
  121640. ${header}
  121641. <span class="popup1-close-button">\xD7</span>
  121642. </div>
  121643. <div class="popup-content">
  121644. ${content}
  121645. </div>
  121646. <div class="popup-tip">
  121647. </div>
  121648. `;
  121649. return html;
  121650. }
  121651. initPoint() {
  121652. this.billboard = this.viewer.entities.add({
  121653. id: "popupPoint",
  121654. name: "popupPoint",
  121655. position: this.position,
  121656. billboard: {
  121657. image: "jt3dSDK/imgs/point/point.png",
  121658. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121659. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121660. scale: 1,
  121661. pixelOffset: new Cesium.Cartesian2(0, 0),
  121662. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121663. }
  121664. });
  121665. }
  121666. }
  121667. Object.assign(HtmlWindow.prototype, {
  121668. close() {
  121669. this.popupDiv.remove();
  121670. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121671. this.viewer.entities.remove(this.billboard);
  121672. }
  121673. });
  121674. var HtmlWindow2$1 = "";
  121675. class HtmlWindow2 {
  121676. constructor(viewer2, position2, title, html) {
  121677. if (!viewer2)
  121678. throw new Cesium.DeveloperError("no viewer object!");
  121679. if (!position2)
  121680. throw new Cesium.DeveloperError("no position object!");
  121681. this.viewer = viewer2;
  121682. this.position = position2;
  121683. if (position2 instanceof Cesium.Cartesian3) {
  121684. this.position = position2;
  121685. } else {
  121686. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121687. }
  121688. if (document.getElementsByClassName("popup2").length > 0) {
  121689. document.getElementsByClassName("popup2")[0].remove();
  121690. }
  121691. this.id = "popup_" + getGuid();
  121692. this.popupDiv = document.createElement("div");
  121693. this.popupDiv.classList.add("popup2");
  121694. this.popupDiv.id = this.id;
  121695. this.viewer.container.append(this.popupDiv);
  121696. this.popupDiv.innerHTML = this._createHtml(title, html);
  121697. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121698. document.getElementsByClassName("popup2-close-button")[0].onclick = () => {
  121699. this.close();
  121700. };
  121701. }
  121702. postRender() {
  121703. this.viewer.scene.canvas.height;
  121704. const windowPosition = new Cesium.Cartesian2();
  121705. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121706. this.viewer.scene,
  121707. this.position,
  121708. windowPosition
  121709. );
  121710. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121711. this.popupDiv.style.top = windowPosition.y + "px";
  121712. const camerPosition = this.viewer.camera.position;
  121713. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121714. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121715. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121716. this.popupDiv.style.display = "block";
  121717. } else {
  121718. this.popupDiv.style.display = "none";
  121719. }
  121720. }
  121721. _createHtml(title, content) {
  121722. let html = `
  121723. <div class="rightLine-1"></div>
  121724. <div class="rightLine-2"></div>
  121725. <div class="rightLine-3"></div>
  121726. <div class="popup-header">
  121727. <span class="popup-title" >${title}</span>
  121728. <span class="popup2-close-button" title="\u5173\u95ED" >\xD7</span>
  121729. </div>
  121730. <div class="popup-content">
  121731. ${content}
  121732. </div>
  121733. `;
  121734. return html;
  121735. }
  121736. }
  121737. Object.assign(HtmlWindow2.prototype, {
  121738. close() {
  121739. this.popupDiv.remove();
  121740. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121741. }
  121742. });
  121743. var HtmlWindow3$1 = "";
  121744. class HtmlWindow3 {
  121745. constructor(viewer2, position2, title, html) {
  121746. if (!viewer2)
  121747. throw new Cesium.DeveloperError("no viewer object!");
  121748. if (!position2)
  121749. throw new Cesium.DeveloperError("no position object!");
  121750. this.viewer = viewer2;
  121751. this.position = position2;
  121752. if (position2 instanceof Cesium.Cartesian3) {
  121753. this.position = position2;
  121754. } else {
  121755. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121756. }
  121757. if (document.getElementsByClassName("popup3").length > 0) {
  121758. document.getElementsByClassName("popup3")[0].remove();
  121759. }
  121760. this.id = "popup_" + getGuid();
  121761. this.popupDiv = document.createElement("div");
  121762. this.popupDiv.classList.add("popup3");
  121763. this.popupDiv.id = this.id;
  121764. this.viewer.container.append(this.popupDiv);
  121765. this.popupDiv.innerHTML = this._createHtml(title, html);
  121766. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121767. document.getElementsByClassName("popup3-close-button")[0].onclick = () => {
  121768. this.close();
  121769. };
  121770. }
  121771. postRender() {
  121772. this.viewer.scene.canvas.height;
  121773. const windowPosition = new Cesium.Cartesian2();
  121774. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121775. this.viewer.scene,
  121776. this.position,
  121777. windowPosition
  121778. );
  121779. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121780. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121781. const camerPosition = this.viewer.camera.position;
  121782. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121783. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121784. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121785. this.popupDiv.style.display = "block";
  121786. } else {
  121787. this.popupDiv.style.display = "none";
  121788. }
  121789. }
  121790. _createHtml(title, content) {
  121791. let html = `
  121792. <div class="leftLine-1"></div>
  121793. <div class="leftLine-2"></div>
  121794. <div class="popup-header">
  121795. <span class="popup-title" >${title}</span>
  121796. <span class="popup3-close-button" title="\u5173\u95ED" >\xD7</span>
  121797. </div>
  121798. <div class="popup-content">
  121799. ${content}
  121800. </div>
  121801. `;
  121802. return html;
  121803. }
  121804. }
  121805. Object.assign(HtmlWindow3.prototype, {
  121806. close() {
  121807. this.popupDiv.remove();
  121808. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121809. }
  121810. });
  121811. let PopupWindow = {
  121812. MultiFieldAdaptWindow,
  121813. VideoWindow,
  121814. VideoWindow2,
  121815. VideoWindow3,
  121816. HtmlWindow,
  121817. HtmlWindow2,
  121818. HtmlWindow3
  121819. };
  121820. class AroundPoint {
  121821. constructor(viewer2, amount, position2) {
  121822. this._viewer = viewer2;
  121823. this._amount = amount;
  121824. this._position = position2;
  121825. this._range = this._viewer.camera.positionCartographic.height;
  121826. }
  121827. _bindEvent() {
  121828. let _self = this;
  121829. this._viewer.clock.onTick.addEventListener(this._aroundPoint, this);
  121830. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121831. handler.setInputAction(function(click) {
  121832. _self.stop();
  121833. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121834. }
  121835. _unbindEvent() {
  121836. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121837. this._viewer.clock.onTick.removeEventListener(this._aroundPoint, this);
  121838. }
  121839. start() {
  121840. this._viewer.clock.shouldAnimate = true;
  121841. this._unbindEvent();
  121842. this._bindEvent();
  121843. return this;
  121844. }
  121845. stop() {
  121846. this._unbindEvent();
  121847. return this;
  121848. }
  121849. _aroundPoint() {
  121850. let heading = this._viewer.camera.heading;
  121851. let pitch = this._viewer.camera.pitch;
  121852. let range3 = this._range;
  121853. heading += Cesium.Math.toRadians(this._amount);
  121854. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121855. heading = 0;
  121856. }
  121857. this._viewer.camera.lookAt(
  121858. this._position,
  121859. new Cesium.HeadingPitchRange(
  121860. heading,
  121861. pitch,
  121862. range3
  121863. )
  121864. );
  121865. }
  121866. }
  121867. class AroundView {
  121868. constructor(viewer2, amount) {
  121869. this._viewer = viewer2;
  121870. this._amount = amount;
  121871. }
  121872. _bindEvent() {
  121873. let _self = this;
  121874. this._viewer.clock.onTick.addEventListener(this._aroundView, this);
  121875. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121876. handler.setInputAction(function(click) {
  121877. _self.stop();
  121878. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121879. }
  121880. _unbindEvent() {
  121881. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121882. this._viewer.clock.onTick.removeEventListener(this._aroundView, this);
  121883. }
  121884. start() {
  121885. this._viewer.clock.shouldAnimate = true;
  121886. this._unbindEvent();
  121887. this._bindEvent();
  121888. return this;
  121889. }
  121890. stop() {
  121891. this._unbindEvent();
  121892. return this;
  121893. }
  121894. _aroundView() {
  121895. let heading = this._viewer.camera.heading;
  121896. let pitch = this._viewer.camera.pitch;
  121897. let roll = this._viewer.camera.roll;
  121898. heading += Cesium.Math.toRadians(this._amount);
  121899. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121900. heading = 0;
  121901. }
  121902. this._viewer.camera.setView({
  121903. orientation: {
  121904. heading,
  121905. pitch,
  121906. roll
  121907. }
  121908. });
  121909. }
  121910. }
  121911. export { AroundPoint, AroundView, CircleObject, CommonTools, CoordTransform, CrImageServerLayer, DrawMilitaryPlot, DrawPoint, DrawTools, LocateUtil, PointObject, PolygonObject, PolylineObject, PopupWindow, CreateRemindertip as ReminderTip, Roaming, RuntimeEnvironment, SceneControl, SceneEffects, SketchViewModel, SpatialAnalysis, StatusBar, TerrainAnalysis, TrackRoam, WallObject, common, jtMap3d, LoadMapData as layer };